diff --git a/.eslintrc.json b/.eslintrc.json index 466925362f4a9654c2b34c6cd7c9747c42d3d463..72b581a6b21ed1f5a368bbe32606c5f240645e56 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -38,7 +38,12 @@ "camelcase": "warn", "comma-spacing": "error", "comma-style": "error", - "object-curly-newline": "off", + "object-curly-newline": ["warn", + { + "minProperties": 4, + "consistent": true + } + ], "object-curly-spacing": "error", "no-var": "error", "spaced-comment": "warn", diff --git a/devNotes/legacy files/artWidgets-legacy b/devNotes/legacy files/artWidgets-legacy index 2ab0c78478d5410310311d6a8f7604469c17435d..a07b0a3534be7299b4a637d150498285848ae644 100644 --- a/devNotes/legacy files/artWidgets-legacy +++ b/devNotes/legacy files/artWidgets-legacy @@ -82,9 +82,9 @@ $args[2]: icon UI Display for vector art, 1 for on. <<print "<img class='paperdoll' src=" + _folderLoc + "/test ui.svg'" + "/>">> <</if>> -/% Set skin colour %/ +/% Set skin color %/ <<set _skinFilter = "filter: url(#skin-" + _.kebabCase($args[0].skin) + ");">> -/% Set hair colour %/ +/% Set hair color %/ <<set _hairFilter = "filter: url(#hair-" + _.kebabCase($args[0].hColor) + ");">> <<set _pubesFilter = "filter: url(#hair-" + _.kebabCase($args[0].pubicHColor) + ");">> <<set _axillaryFilter = "filter: url(#hair-" + _.kebabCase($args[0].underArmHColor) + ");">> diff --git a/src/001-lib/Jquery/Jquery.js b/src/001-lib/Jquery/Jquery.js index cb826d7932b6309c249b2eb3a86ace3037f90065..cc817707cf93a2f0a8d78be7175b2351a6b24247 100644 --- a/src/001-lib/Jquery/Jquery.js +++ b/src/001-lib/Jquery/Jquery.js @@ -1,15 +1,15 @@ (function (window, define, exports) { -/*! jQuery UI - v1.12.1 - 2016-09-14 -* http://jqueryui.com -* Includes: widget.js, position.js, data.js, disable-selection.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js, focusable.js, form-reset-mixin.js, jquery-1-7.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/draggable.js, widgets/droppable.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/resizable.js, widgets/selectable.js, widgets/selectmenu.js, widgets/slider.js, widgets/sortable.js, widgets/spinner.js, widgets/tabs.js, widgets/tooltip.js -* Copyright jQuery Foundation and other contributors; Licensed MIT */ - -(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)})(function(t){function e(t){for(var e=t.css("visibility");"inherit"===e;)t=t.parent(),e=t.css("visibility");return"hidden"!==e}function i(t){for(var e,i;t.length&&t[0]!==document;){if(e=t.css("position"),("absolute"===e||"relative"===e||"fixed"===e)&&(i=parseInt(t.css("zIndex"),10),!isNaN(i)&&0!==i))return i;t=t.parent()}return 0}function s(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[""]),this.regional.en=t.extend(!0,{},this.regional[""]),this.regional["en-US"]=t.extend(!0,{},this.regional.en),this.dpDiv=n(t("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function n(e){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.on("mouseout",i,function(){t(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).removeClass("ui-datepicker-next-hover")}).on("mouseover",i,o)}function o(){t.datepicker._isDisabledDatepicker(m.inline?m.dpDiv.parent()[0]:m.input[0])||(t(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),t(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).addClass("ui-datepicker-next-hover"))}function a(e,i){t.extend(e,i);for(var s in i)null==i[s]&&(e[s]=i[s]);return e}function r(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger("change")}}t.ui=t.ui||{},t.ui.version="1.12.1";var h=0,l=Array.prototype.slice;t.cleanData=function(e){return function(i){var s,n,o;for(o=0;null!=(n=i[o]);o++)try{s=t._data(n,"events"),s&&s.remove&&t(n).triggerHandler("remove")}catch(a){}e(i)}}(t.cleanData),t.widget=function(e,i,s){var n,o,a,r={},h=e.split(".")[0];e=e.split(".")[1];var l=h+"-"+e;return s||(s=i,i=t.Widget),t.isArray(s)&&(s=t.extend.apply(null,[{}].concat(s))),t.expr[":"][l.toLowerCase()]=function(e){return!!t.data(e,l)},t[h]=t[h]||{},n=t[h][e],o=t[h][e]=function(t,e){return this._createWidget?(arguments.length&&this._createWidget(t,e),void 0):new o(t,e)},t.extend(o,n,{version:s.version,_proto:t.extend({},s),_childConstructors:[]}),a=new i,a.options=t.widget.extend({},a.options),t.each(s,function(e,s){return t.isFunction(s)?(r[e]=function(){function t(){return i.prototype[e].apply(this,arguments)}function n(t){return i.prototype[e].apply(this,t)}return function(){var e,i=this._super,o=this._superApply;return this._super=t,this._superApply=n,e=s.apply(this,arguments),this._super=i,this._superApply=o,e}}(),void 0):(r[e]=s,void 0)}),o.prototype=t.widget.extend(a,{widgetEventPrefix:n?a.widgetEventPrefix||e:e},r,{constructor:o,namespace:h,widgetName:e,widgetFullName:l}),n?(t.each(n._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete n._childConstructors):i._childConstructors.push(o),t.widget.bridge(e,o),o},t.widget.extend=function(e){for(var i,s,n=l.call(arguments,1),o=0,a=n.length;a>o;o++)for(i in n[o])s=n[o][i],n[o].hasOwnProperty(i)&&void 0!==s&&(e[i]=t.isPlainObject(s)?t.isPlainObject(e[i])?t.widget.extend({},e[i],s):t.widget.extend({},s):s);return e},t.widget.bridge=function(e,i){var s=i.prototype.widgetFullName||e;t.fn[e]=function(n){var o="string"==typeof n,a=l.call(arguments,1),r=this;return o?this.length||"instance"!==n?this.each(function(){var i,o=t.data(this,s);return"instance"===n?(r=o,!1):o?t.isFunction(o[n])&&"_"!==n.charAt(0)?(i=o[n].apply(o,a),i!==o&&void 0!==i?(r=i&&i.jquery?r.pushStack(i.get()):i,!1):void 0):t.error("no such method '"+n+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; "+"attempted to call method '"+n+"'")}):r=void 0:(a.length&&(n=t.widget.extend.apply(null,[n].concat(a))),this.each(function(){var e=t.data(this,s);e?(e.option(n||{}),e._init&&e._init()):t.data(this,s,new i(n,this))})),r}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,i){i=t(i||this.defaultElement||this)[0],this.element=t(i),this.uuid=h++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},i!==this&&(t.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===i&&this.destroy()}}),this.document=t(i.style?i.ownerDocument:i.document||i),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var s,n,o,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},s=e.split("."),e=s.shift(),s.length){for(n=a[e]=t.widget.extend({},this.options[e]),o=0;s.length-1>o;o++)n[s[o]]=n[s[o]]||{},n=n[s[o]];if(e=s.pop(),1===arguments.length)return void 0===n[e]?null:n[e];n[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];a[e]=i}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var i,s,n;for(i in e)n=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&n&&n.length&&(s=t(n.get()),this._removeClass(n,i),s.addClass(this._classes({element:s,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){function i(i,o){var a,r;for(r=0;i.length>r;r++)a=n.classesElementLookup[i[r]]||t(),a=e.add?t(t.unique(a.get().concat(e.element.get()))):t(a.not(e.element).get()),n.classesElementLookup[i[r]]=a,s.push(i[r]),o&&e.classes[i[r]]&&s.push(e.classes[i[r]])}var s=[],n=this;return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&i(e.keys.match(/\S+/g)||[],!0),e.extra&&i(e.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,function(s,n){-1!==t.inArray(e.target,n)&&(i.classesElementLookup[s]=t(n.not(e.target).get()))})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof s?s:i;var n="string"==typeof t||null===t,o={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s};return o.element.toggleClass(this._classes(o),s),this},_on:function(e,i,s){var n,o=this;"boolean"!=typeof e&&(s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),t.each(s,function(s,a){function r(){return e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||t.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+o.eventNamespace,c=h[2];c?n.on(l,c,r):i.on(l,r)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(i).off(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}}),t.widget,function(){function e(t,e,i){return[parseFloat(t[0])*(u.test(t[0])?e/100:1),parseFloat(t[1])*(u.test(t[1])?i/100:1)]}function i(e,i){return parseInt(t.css(e,i),10)||0}function s(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}var n,o=Math.max,a=Math.abs,r=/left|center|right/,h=/top|center|bottom/,l=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,u=/%$/,d=t.fn.position;t.position={scrollbarWidth:function(){if(void 0!==n)return n;var e,i,s=t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=s.children()[0];return t("body").append(s),e=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,e===i&&(i=s[0].clientWidth),s.remove(),n=e-i},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,o="scroll"===s||"auto"===s&&e.height<e.element[0].scrollHeight;return{width:o?t.position.scrollbarWidth():0,height:n?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),s=t.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType,o=!s&&!n;return{element:i,isWindow:s,isDocument:n,offset:o?t(e).offset():{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:i.outerWidth(),height:i.outerHeight()}}},t.fn.position=function(n){if(!n||!n.of)return d.apply(this,arguments);n=t.extend({},n);var u,p,f,g,m,_,v=t(n.of),b=t.position.getWithinInfo(n.within),y=t.position.getScrollInfo(b),w=(n.collision||"flip").split(" "),k={};return _=s(v),v[0].preventDefault&&(n.at="left top"),p=_.width,f=_.height,g=_.offset,m=t.extend({},g),t.each(["my","at"],function(){var t,e,i=(n[this]||"").split(" ");1===i.length&&(i=r.test(i[0])?i.concat(["center"]):h.test(i[0])?["center"].concat(i):["center","center"]),i[0]=r.test(i[0])?i[0]:"center",i[1]=h.test(i[1])?i[1]:"center",t=l.exec(i[0]),e=l.exec(i[1]),k[this]=[t?t[0]:0,e?e[0]:0],n[this]=[c.exec(i[0])[0],c.exec(i[1])[0]]}),1===w.length&&(w[1]=w[0]),"right"===n.at[0]?m.left+=p:"center"===n.at[0]&&(m.left+=p/2),"bottom"===n.at[1]?m.top+=f:"center"===n.at[1]&&(m.top+=f/2),u=e(k.at,p,f),m.left+=u[0],m.top+=u[1],this.each(function(){var s,r,h=t(this),l=h.outerWidth(),c=h.outerHeight(),d=i(this,"marginLeft"),_=i(this,"marginTop"),x=l+d+i(this,"marginRight")+y.width,C=c+_+i(this,"marginBottom")+y.height,D=t.extend({},m),I=e(k.my,h.outerWidth(),h.outerHeight());"right"===n.my[0]?D.left-=l:"center"===n.my[0]&&(D.left-=l/2),"bottom"===n.my[1]?D.top-=c:"center"===n.my[1]&&(D.top-=c/2),D.left+=I[0],D.top+=I[1],s={marginLeft:d,marginTop:_},t.each(["left","top"],function(e,i){t.ui.position[w[e]]&&t.ui.position[w[e]][i](D,{targetWidth:p,targetHeight:f,elemWidth:l,elemHeight:c,collisionPosition:s,collisionWidth:x,collisionHeight:C,offset:[u[0]+I[0],u[1]+I[1]],my:n.my,at:n.at,within:b,elem:h})}),n.using&&(r=function(t){var e=g.left-D.left,i=e+p-l,s=g.top-D.top,r=s+f-c,u={target:{element:v,left:g.left,top:g.top,width:p,height:f},element:{element:h,left:D.left,top:D.top,width:l,height:c},horizontal:0>i?"left":e>0?"right":"center",vertical:0>r?"top":s>0?"bottom":"middle"};l>p&&p>a(e+i)&&(u.horizontal="center"),c>f&&f>a(s+r)&&(u.vertical="middle"),u.important=o(a(e),a(i))>o(a(s),a(r))?"horizontal":"vertical",n.using.call(this,t,u)}),h.offset(t.extend(D,{using:r}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,h=n-r,l=r+e.collisionWidth-a-n;e.collisionWidth>a?h>0&&0>=l?(i=t.left+h+e.collisionWidth-a-n,t.left+=h-i):t.left=l>0&&0>=h?n:h>l?n+a-e.collisionWidth:n:h>0?t.left+=h:l>0?t.left-=l:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,h=n-r,l=r+e.collisionHeight-a-n;e.collisionHeight>a?h>0&&0>=l?(i=t.top+h+e.collisionHeight-a-n,t.top+=h-i):t.top=l>0&&0>=h?n:h>l?n+a-e.collisionHeight:n:h>0?t.top+=h:l>0?t.top-=l:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,o=n.offset.left+n.scrollLeft,r=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=t.left-e.collisionPosition.marginLeft,c=l-h,u=l+e.collisionWidth-r-h,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-r-o,(0>i||a(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-h,(s>0||u>a(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,o=n.offset.top+n.scrollTop,r=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=t.top-e.collisionPosition.marginTop,c=l-h,u=l+e.collisionHeight-r-h,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,g=-2*e.offset[1];0>c?(s=t.top+p+f+g+e.collisionHeight-r-o,(0>s||a(c)>s)&&(t.top+=p+f+g)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+g-h,(i>0||u>a(i))&&(t.top+=p+f+g))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}}}(),t.ui.position,t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])}}),t.fn.extend({disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}});var c="ui-effects-",u="ui-effects-style",d="ui-effects-animated",p=t;t.effects={effect:{}},function(t,e){function i(t,e,i){var s=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:t>s.max?s.max:t)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(t,o){var a,r=o.re.exec(i),h=r&&o.parse(r),l=o.space||"rgba";return h?(a=s[l](h),s[c[l].cache]=a[c[l].cache],n=s._rgba=a._rgba,!1):e}),n.length?("0,0,0,0"===n.join()&&t.extend(n,o.transparent),s):o[i]}function n(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var o,a="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],l=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},c={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=l.support={},p=t("<p>")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),l.fn=t.extend(l.prototype,{parse:function(n,a,r,h){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(a),a=e);var u=this,d=t.type(n),p=this._rgba=[];return a!==e&&(n=[n,a,r,h],d="array"),"string"===d?this.parse(s(n)||o._default):"array"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(n[e.idx],e)}),this):"object"===d?(n instanceof l?f(c,function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}):f(c,function(e,s){var o=s.cache;f(s.props,function(t,e){if(!u[o]&&s.to){if("alpha"===t||null==n[t])return;u[o]=s.to(u._rgba)}u[o][e.idx]=i(n[t],e,!0)}),u[o]&&0>t.inArray(null,u[o].slice(0,3))&&(u[o][3]=1,s.from&&(u._rgba=s.from(u[o])))}),this):e},is:function(t){var i=l(t),s=!0,n=this;return f(c,function(t,o){var a,r=i[o.cache];return r&&(a=n[o.cache]||o.to&&o.to(n._rgba)||[],f(o.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===a[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return f(c,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=l(t),n=s._space(),o=c[n],a=0===this.alpha()?l("transparent"):this,r=a[o.cache]||o.to(a._rgba),h=r.slice();return s=s[o.cache],f(o.props,function(t,n){var o=n.idx,a=r[o],l=s[o],c=u[n.type]||{};null!==l&&(null===a?h[o]=l:(c.mod&&(l-a>c.mod/2?a+=c.mod:a-l>c.mod/2&&(a-=c.mod)),h[o]=i((l-a)*e+a,n)))}),this[n](h)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(e)._rgba;return l(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,o=t[2]/255,a=t[3],r=Math.max(s,n,o),h=Math.min(s,n,o),l=r-h,c=r+h,u=.5*c;return e=h===r?0:s===r?60*(n-o)/l+360:n===r?60*(o-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=u?l/c:l/(2-c),[Math.round(e)%360,i,u,null==a?1:a]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],o=t[3],a=.5>=s?s*(1+i):s+i-s*i,r=2*s-a;return[Math.round(255*n(r,a,e+1/3)),Math.round(255*n(r,a,e)),Math.round(255*n(r,a,e-1/3)),o]},f(c,function(s,n){var o=n.props,a=n.cache,h=n.to,c=n.from;l.fn[s]=function(s){if(h&&!this[a]&&(this[a]=h(this._rgba)),s===e)return this[a].slice();var n,r=t.type(s),u="array"===r||"object"===r?s:arguments,d=this[a].slice();return f(o,function(t,e){var s=u["object"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?(n=l(c(d)),n[a]=d,n):l(d)},f(o,function(e,i){l.fn[e]||(l.fn[e]=function(n){var o,a=t.type(n),h="alpha"===e?this._hsla?"hsla":"rgba":s,l=this[h](),c=l[i.idx];return"undefined"===a?c:("function"===a&&(n=n.call(this,c),a=t.type(n)),null==n&&i.empty?this:("string"===a&&(o=r.exec(n),o&&(n=c+parseFloat(o[2])*("+"===o[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,n){var o,a,r="";if("transparent"!==n&&("string"!==t.type(n)||(o=s(n)))){if(n=l(o||n),!d.rgba&&1!==n._rgba[3]){for(a="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&a&&a.style;)try{r=t.css(a,"backgroundColor"),a=a.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(h){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=l(e.elem,i),e.end=l(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},l.hook(a),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},o=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(p),function(){function e(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,o={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(o[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(o[i]=n[i]);return o}function i(e,i){var s,o,a={};for(s in i)o=i[s],e[s]!==o&&(n[s]||(t.fx.step[s]||!isNaN(parseFloat(o)))&&(a[s]=o));return a}var s=["add","remove","toggle"],n={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(p.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(n,o,a,r){var h=t.speed(o,a,r);return this.queue(function(){var o,a=t(this),r=a.attr("class")||"",l=h.children?a.find("*").addBack():a;l=l.map(function(){var i=t(this);return{el:i,start:e(this)}}),o=function(){t.each(s,function(t,e){n[e]&&a[e+"Class"](n[e])})},o(),l=l.map(function(){return this.end=e(this.el[0]),this.diff=i(this.start,this.end),this}),a.attr("class",r),l=l.map(function(){var e=this,i=t.Deferred(),s=t.extend({},h,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,l.get()).done(function(){o(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),h.complete.call(a[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,o){return s?t.effects.animateClass.call(this,{add:i},s,n,o):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,o){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,o):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(e){return function(i,s,n,o,a){return"boolean"==typeof s||void 0===s?n?t.effects.animateClass.call(this,s?{add:i}:{remove:i},n,o,a):e.apply(this,arguments):t.effects.animateClass.call(this,{toggle:i},s,n,o)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,o){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,o)}})}(),function(){function e(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function i(e){return!e||"number"==typeof e||t.fx.speeds[e]?!0:"string"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:"object"!=typeof e||e.effect?!1:!0:!0}function s(t,e){var i=e.outerWidth(),s=e.outerHeight(),n=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/,o=n.exec(t)||["",0,i,s,0];return{top:parseFloat(o[1])||0,right:"auto"===o[2]?i:parseFloat(o[2]),bottom:"auto"===o[3]?s:parseFloat(o[3]),left:parseFloat(o[4])||0}}t.expr&&t.expr.filters&&t.expr.filters.animated&&(t.expr.filters.animated=function(e){return function(i){return!!t(i).data(d)||e(i)}}(t.expr.filters.animated)),t.uiBackCompat!==!1&&t.extend(t.effects,{save:function(t,e){for(var i=0,s=e.length;s>i;i++)null!==e[i]&&t.data(c+e[i],t[0].style[e[i]])},restore:function(t,e){for(var i,s=0,n=e.length;n>s;s++)null!==e[s]&&(i=t.data(c+e[s]),t.css(e[s],i))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},s=t("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},o=document.activeElement;try{o.id}catch(a){o=document.body}return e.wrap(s),(e[0]===o||t.contains(e[0],o))&&t(o).trigger("focus"),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).trigger("focus")),e}}),t.extend(t.effects,{version:"1.12.1",define:function(e,i,s){return s||(s=i,i="effect"),t.effects.effect[e]=s,t.effects.effect[e].mode=i,s},scaledDimensions:function(t,e,i){if(0===e)return{height:0,width:0,outerHeight:0,outerWidth:0};var s="horizontal"!==i?(e||100)/100:1,n="vertical"!==i?(e||100)/100:1;return{height:t.height()*n,width:t.width()*s,outerHeight:t.outerHeight()*n,outerWidth:t.outerWidth()*s}},clipToBox:function(t){return{width:t.clip.right-t.clip.left,height:t.clip.bottom-t.clip.top,left:t.clip.left,top:t.clip.top}},unshift:function(t,e,i){var s=t.queue();e>1&&s.splice.apply(s,[1,0].concat(s.splice(e,i))),t.dequeue()},saveStyle:function(t){t.data(u,t[0].style.cssText)},restoreStyle:function(t){t[0].style.cssText=t.data(u)||"",t.removeData(u)},mode:function(t,e){var i=t.is(":hidden");return"toggle"===e&&(e=i?"show":"hide"),(i?"hide"===e:"show"===e)&&(e="none"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createPlaceholder:function(e){var i,s=e.css("position"),n=e.position();return e.css({marginTop:e.css("marginTop"),marginBottom:e.css("marginBottom"),marginLeft:e.css("marginLeft"),marginRight:e.css("marginRight")}).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()),/^(static|relative)/.test(s)&&(s="absolute",i=t("<"+e[0].nodeName+">").insertAfter(e).css({display:/^(inline|ruby)/.test(e.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:e.css("marginTop"),marginBottom:e.css("marginBottom"),marginLeft:e.css("marginLeft"),marginRight:e.css("marginRight"),"float":e.css("float")}).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).addClass("ui-effects-placeholder"),e.data(c+"placeholder",i)),e.css({position:s,left:n.left,top:n.top}),i},removePlaceholder:function(t){var e=c+"placeholder",i=t.data(e);i&&(i.remove(),t.removeData(e))},cleanUp:function(e){t.effects.restoreStyle(e),t.effects.removePlaceholder(e)},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var o=e.cssUnit(i);o[0]>0&&(n[i]=o[0]*s+o[1])}),n}}),t.fn.extend({effect:function(){function i(e){function i(){r.removeData(d),t.effects.cleanUp(r),"hide"===s.mode&&r.hide(),a()}function a(){t.isFunction(h)&&h.call(r[0]),t.isFunction(e)&&e()}var r=t(this);s.mode=c.shift(),t.uiBackCompat===!1||o?"none"===s.mode?(r[l](),a()):n.call(r[0],s,i):(r.is(":hidden")?"hide"===l:"show"===l)?(r[l](),a()):n.call(r[0],s,a)}var s=e.apply(this,arguments),n=t.effects.effect[s.effect],o=n.mode,a=s.queue,r=a||"fx",h=s.complete,l=s.mode,c=[],u=function(e){var i=t(this),s=t.effects.mode(i,l)||o;i.data(d,!0),c.push(s),o&&("show"===s||s===o&&"hide"===s)&&i.show(),o&&"none"===s||t.effects.saveStyle(i),t.isFunction(e)&&e()};return t.fx.off||!n?l?this[l](s.duration,h):this.each(function(){h&&h.call(this)}):a===!1?this.each(u).each(i):this.queue(r,u).queue(r,i)},show:function(t){return function(s){if(i(s))return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="show",this.effect.call(this,n) -}}(t.fn.show),hide:function(t){return function(s){if(i(s))return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="hide",this.effect.call(this,n)}}(t.fn.hide),toggle:function(t){return function(s){if(i(s)||"boolean"==typeof s)return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s},cssClip:function(t){return t?this.css("clip","rect("+t.top+"px "+t.right+"px "+t.bottom+"px "+t.left+"px)"):s(this.css("clip"),this)},transfer:function(e,i){var s=t(this),n=t(e.to),o="fixed"===n.css("position"),a=t("body"),r=o?a.scrollTop():0,h=o?a.scrollLeft():0,l=n.offset(),c={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},u=s.offset(),d=t("<div class='ui-effects-transfer'></div>").appendTo("body").addClass(e.className).css({top:u.top-r,left:u.left-h,height:s.innerHeight(),width:s.innerWidth(),position:o?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){d.remove(),t.isFunction(i)&&i()})}}),t.fx.step.clip=function(e){e.clipInit||(e.start=t(e.elem).cssClip(),"string"==typeof e.end&&(e.end=s(e.end,e.elem)),e.clipInit=!0),t(e.elem).cssClip({top:e.pos*(e.end.top-e.start.top)+e.start.top,right:e.pos*(e.end.right-e.start.right)+e.start.right,bottom:e.pos*(e.end.bottom-e.start.bottom)+e.start.bottom,left:e.pos*(e.end.left-e.start.left)+e.start.left})}}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}();var f=t.effects;t.effects.define("blind","hide",function(e,i){var s={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},n=t(this),o=e.direction||"up",a=n.cssClip(),r={clip:t.extend({},a)},h=t.effects.createPlaceholder(n);r.clip[s[o][0]]=r.clip[s[o][1]],"show"===e.mode&&(n.cssClip(r.clip),h&&h.css(t.effects.clipToBox(r)),r.clip=a),h&&h.animate(t.effects.clipToBox(r),e.duration,e.easing),n.animate(r,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("bounce",function(e,i){var s,n,o,a=t(this),r=e.mode,h="hide"===r,l="show"===r,c=e.direction||"up",u=e.distance,d=e.times||5,p=2*d+(l||h?1:0),f=e.duration/p,g=e.easing,m="up"===c||"down"===c?"top":"left",_="up"===c||"left"===c,v=0,b=a.queue().length;for(t.effects.createPlaceholder(a),o=a.css(m),u||(u=a["top"===m?"outerHeight":"outerWidth"]()/3),l&&(n={opacity:1},n[m]=o,a.css("opacity",0).css(m,_?2*-u:2*u).animate(n,f,g)),h&&(u/=Math.pow(2,d-1)),n={},n[m]=o;d>v;v++)s={},s[m]=(_?"-=":"+=")+u,a.animate(s,f,g).animate(n,f,g),u=h?2*u:u/2;h&&(s={opacity:0},s[m]=(_?"-=":"+=")+u,a.animate(s,f,g)),a.queue(i),t.effects.unshift(a,b,p+1)}),t.effects.define("clip","hide",function(e,i){var s,n={},o=t(this),a=e.direction||"vertical",r="both"===a,h=r||"horizontal"===a,l=r||"vertical"===a;s=o.cssClip(),n.clip={top:l?(s.bottom-s.top)/2:s.top,right:h?(s.right-s.left)/2:s.right,bottom:l?(s.bottom-s.top)/2:s.bottom,left:h?(s.right-s.left)/2:s.left},t.effects.createPlaceholder(o),"show"===e.mode&&(o.cssClip(n.clip),n.clip=s),o.animate(n,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("drop","hide",function(e,i){var s,n=t(this),o=e.mode,a="show"===o,r=e.direction||"left",h="up"===r||"down"===r?"top":"left",l="up"===r||"left"===r?"-=":"+=",c="+="===l?"-=":"+=",u={opacity:0};t.effects.createPlaceholder(n),s=e.distance||n["top"===h?"outerHeight":"outerWidth"](!0)/2,u[h]=l+s,a&&(n.css(u),u[h]=c+s,u.opacity=1),n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("explode","hide",function(e,i){function s(){b.push(this),b.length===u*d&&n()}function n(){p.css({visibility:"visible"}),t(b).remove(),i()}var o,a,r,h,l,c,u=e.pieces?Math.round(Math.sqrt(e.pieces)):3,d=u,p=t(this),f=e.mode,g="show"===f,m=p.show().css("visibility","hidden").offset(),_=Math.ceil(p.outerWidth()/d),v=Math.ceil(p.outerHeight()/u),b=[];for(o=0;u>o;o++)for(h=m.top+o*v,c=o-(u-1)/2,a=0;d>a;a++)r=m.left+a*_,l=a-(d-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-a*_,top:-o*v}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:_,height:v,left:r+(g?l*_:0),top:h+(g?c*v:0),opacity:g?0:1}).animate({left:r+(g?0:l*_),top:h+(g?0:c*v),opacity:g?1:0},e.duration||500,e.easing,s)}),t.effects.define("fade","toggle",function(e,i){var s="show"===e.mode;t(this).css("opacity",s?0:1).animate({opacity:s?1:0},{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("fold","hide",function(e,i){var s=t(this),n=e.mode,o="show"===n,a="hide"===n,r=e.size||15,h=/([0-9]+)%/.exec(r),l=!!e.horizFirst,c=l?["right","bottom"]:["bottom","right"],u=e.duration/2,d=t.effects.createPlaceholder(s),p=s.cssClip(),f={clip:t.extend({},p)},g={clip:t.extend({},p)},m=[p[c[0]],p[c[1]]],_=s.queue().length;h&&(r=parseInt(h[1],10)/100*m[a?0:1]),f.clip[c[0]]=r,g.clip[c[0]]=r,g.clip[c[1]]=0,o&&(s.cssClip(g.clip),d&&d.css(t.effects.clipToBox(g)),g.clip=p),s.queue(function(i){d&&d.animate(t.effects.clipToBox(f),u,e.easing).animate(t.effects.clipToBox(g),u,e.easing),i()}).animate(f,u,e.easing).animate(g,u,e.easing).queue(i),t.effects.unshift(s,_,4)}),t.effects.define("highlight","show",function(e,i){var s=t(this),n={backgroundColor:s.css("backgroundColor")};"hide"===e.mode&&(n.opacity=0),t.effects.saveStyle(s),s.css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(n,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("size",function(e,i){var s,n,o,a=t(this),r=["fontSize"],h=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],l=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],c=e.mode,u="effect"!==c,d=e.scale||"both",p=e.origin||["middle","center"],f=a.css("position"),g=a.position(),m=t.effects.scaledDimensions(a),_=e.from||m,v=e.to||t.effects.scaledDimensions(a,0);t.effects.createPlaceholder(a),"show"===c&&(o=_,_=v,v=o),n={from:{y:_.height/m.height,x:_.width/m.width},to:{y:v.height/m.height,x:v.width/m.width}},("box"===d||"both"===d)&&(n.from.y!==n.to.y&&(_=t.effects.setTransition(a,h,n.from.y,_),v=t.effects.setTransition(a,h,n.to.y,v)),n.from.x!==n.to.x&&(_=t.effects.setTransition(a,l,n.from.x,_),v=t.effects.setTransition(a,l,n.to.x,v))),("content"===d||"both"===d)&&n.from.y!==n.to.y&&(_=t.effects.setTransition(a,r,n.from.y,_),v=t.effects.setTransition(a,r,n.to.y,v)),p&&(s=t.effects.getBaseline(p,m),_.top=(m.outerHeight-_.outerHeight)*s.y+g.top,_.left=(m.outerWidth-_.outerWidth)*s.x+g.left,v.top=(m.outerHeight-v.outerHeight)*s.y+g.top,v.left=(m.outerWidth-v.outerWidth)*s.x+g.left),a.css(_),("content"===d||"both"===d)&&(h=h.concat(["marginTop","marginBottom"]).concat(r),l=l.concat(["marginLeft","marginRight"]),a.find("*[width]").each(function(){var i=t(this),s=t.effects.scaledDimensions(i),o={height:s.height*n.from.y,width:s.width*n.from.x,outerHeight:s.outerHeight*n.from.y,outerWidth:s.outerWidth*n.from.x},a={height:s.height*n.to.y,width:s.width*n.to.x,outerHeight:s.height*n.to.y,outerWidth:s.width*n.to.x};n.from.y!==n.to.y&&(o=t.effects.setTransition(i,h,n.from.y,o),a=t.effects.setTransition(i,h,n.to.y,a)),n.from.x!==n.to.x&&(o=t.effects.setTransition(i,l,n.from.x,o),a=t.effects.setTransition(i,l,n.to.x,a)),u&&t.effects.saveStyle(i),i.css(o),i.animate(a,e.duration,e.easing,function(){u&&t.effects.restoreStyle(i)})})),a.animate(v,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){var e=a.offset();0===v.opacity&&a.css("opacity",_.opacity),u||(a.css("position","static"===f?"relative":f).offset(e),t.effects.saveStyle(a)),i()}})}),t.effects.define("scale",function(e,i){var s=t(this),n=e.mode,o=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"effect"!==n?0:100),a=t.extend(!0,{from:t.effects.scaledDimensions(s),to:t.effects.scaledDimensions(s,o,e.direction||"both"),origin:e.origin||["middle","center"]},e);e.fade&&(a.from.opacity=1,a.to.opacity=0),t.effects.effect.size.call(this,a,i)}),t.effects.define("puff","hide",function(e,i){var s=t.extend(!0,{},e,{fade:!0,percent:parseInt(e.percent,10)||150});t.effects.effect.scale.call(this,s,i)}),t.effects.define("pulsate","show",function(e,i){var s=t(this),n=e.mode,o="show"===n,a="hide"===n,r=o||a,h=2*(e.times||5)+(r?1:0),l=e.duration/h,c=0,u=1,d=s.queue().length;for((o||!s.is(":visible"))&&(s.css("opacity",0).show(),c=1);h>u;u++)s.animate({opacity:c},l,e.easing),c=1-c;s.animate({opacity:c},l,e.easing),s.queue(i),t.effects.unshift(s,d,h+1)}),t.effects.define("shake",function(e,i){var s=1,n=t(this),o=e.direction||"left",a=e.distance||20,r=e.times||3,h=2*r+1,l=Math.round(e.duration/h),c="up"===o||"down"===o?"top":"left",u="up"===o||"left"===o,d={},p={},f={},g=n.queue().length;for(t.effects.createPlaceholder(n),d[c]=(u?"-=":"+=")+a,p[c]=(u?"+=":"-=")+2*a,f[c]=(u?"-=":"+=")+2*a,n.animate(d,l,e.easing);r>s;s++)n.animate(p,l,e.easing).animate(f,l,e.easing);n.animate(p,l,e.easing).animate(d,l/2,e.easing).queue(i),t.effects.unshift(n,g,h+1)}),t.effects.define("slide","show",function(e,i){var s,n,o=t(this),a={up:["bottom","top"],down:["top","bottom"],left:["right","left"],right:["left","right"]},r=e.mode,h=e.direction||"left",l="up"===h||"down"===h?"top":"left",c="up"===h||"left"===h,u=e.distance||o["top"===l?"outerHeight":"outerWidth"](!0),d={};t.effects.createPlaceholder(o),s=o.cssClip(),n=o.position()[l],d[l]=(c?-1:1)*u+n,d.clip=o.cssClip(),d.clip[a[h][1]]=d.clip[a[h][0]],"show"===r&&(o.cssClip(d.clip),o.css(l,d[l]),d.clip=s,d[l]=n),o.animate(d,{queue:!1,duration:e.duration,easing:e.easing,complete:i})});var f;t.uiBackCompat!==!1&&(f=t.effects.define("transfer",function(e,i){t(this).transfer(e,i)})),t.ui.focusable=function(i,s){var n,o,a,r,h,l=i.nodeName.toLowerCase();return"area"===l?(n=i.parentNode,o=n.name,i.href&&o&&"map"===n.nodeName.toLowerCase()?(a=t("img[usemap='#"+o+"']"),a.length>0&&a.is(":visible")):!1):(/^(input|select|textarea|button|object)$/.test(l)?(r=!i.disabled,r&&(h=t(i).closest("fieldset")[0],h&&(r=!h.disabled))):r="a"===l?i.href||s:s,r&&t(i).is(":visible")&&e(t(i)))},t.extend(t.expr[":"],{focusable:function(e){return t.ui.focusable(e,null!=t.attr(e,"tabindex"))}}),t.ui.focusable,t.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):t(this[0].form)},t.ui.formResetMixin={_formResetHandler:function(){var e=t(this);setTimeout(function(){var i=e.data("ui-form-reset-instances");t.each(i,function(){this.refresh()})})},_bindFormResetHandler:function(){if(this.form=this.element.form(),this.form.length){var t=this.form.data("ui-form-reset-instances")||[];t.length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t)}},_unbindFormResetHandler:function(){if(this.form.length){var e=this.form.data("ui-form-reset-instances");e.splice(t.inArray(this,e),1),e.length?this.form.data("ui-form-reset-instances",e):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}},"1.7"===t.fn.jquery.substring(0,3)&&(t.each(["Width","Height"],function(e,i){function s(e,i,s,o){return t.each(n,function(){i-=parseFloat(t.css(e,"padding"+this))||0,s&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),o&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],o=i.toLowerCase(),a={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+i]=function(e){return void 0===e?a["inner"+i].call(this):this.each(function(){t(this).css(o,s(this,e)+"px")})},t.fn["outer"+i]=function(e,n){return"number"!=typeof e?a["outer"+i].call(this,e):this.each(function(){t(this).css(o,s(this,e,!0,n)+"px")})}}),t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},t.ui.escapeSelector=function(){var t=/([!"#$%&'()*+,.\/:;<=>?@[\]^`{|}~])/g;return function(e){return e.replace(t,"\\$1")}}(),t.fn.labels=function(){var e,i,s,n,o;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(n=this.eq(0).parents("label"),s=this.attr("id"),s&&(e=this.eq(0).parents().last(),o=e.add(e.length?e.siblings():this.siblings()),i="label[for='"+t.ui.escapeSelector(s)+"']",n=n.add(o.find(i).addBack(i))),this.pushStack(n))},t.fn.scrollParent=function(e){var i=this.css("position"),s="absolute"===i,n=e?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var e=t(this);return s&&"static"===e.css("position")?!1:n.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==i&&o.length?o:t(this[0].ownerDocument||document)},t.extend(t.expr[":"],{tabbable:function(e){var i=t.attr(e,"tabindex"),s=null!=i;return(!s||i>=0)&&t.ui.focusable(e,s)}}),t.fn.extend({uniqueId:function(){var t=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++t)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}}),t.widget("ui.accordion",{version:"1.12.1",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:!1,event:"click",header:"> li > :first-child, > :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var e=this.options;this.prevShow=this.prevHide=t(),this._addClass("ui-accordion","ui-widget ui-helper-reset"),this.element.attr("role","tablist"),e.collapsible||e.active!==!1&&null!=e.active||(e.active=0),this._processPanels(),0>e.active&&(e.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():t()}},_createIcons:function(){var e,i,s=this.options.icons;s&&(e=t("<span>"),this._addClass(e,"ui-accordion-header-icon","ui-icon "+s.header),e.prependTo(this.headers),i=this.active.children(".ui-accordion-header-icon"),this._removeClass(i,s.header)._addClass(i,null,s.activeHeader)._addClass(this.headers,"ui-accordion-icons"))},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons"),this.headers.children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeAttr("role"),this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId(),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){return"active"===t?(this._activate(e),void 0):("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||this.options.active!==!1||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons()),void 0)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t),this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!t)},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var i=t.ui.keyCode,s=this.headers.length,n=this.headers.index(e.target),o=!1;switch(e.keyCode){case i.RIGHT:case i.DOWN:o=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:o=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(e);break;case i.HOME:o=this.headers[0];break;case i.END:o=this.headers[s-1]}o&&(t(e.target).attr("tabIndex",-1),t(o).attr("tabIndex",0),t(o).trigger("focus"),e.preventDefault())}},_panelKeyDown:function(e){e.keyCode===t.ui.keyCode.UP&&e.ctrlKey&&t(e.currentTarget).prev().trigger("focus")},refresh:function(){var e=this.options;this._processPanels(),e.active===!1&&e.collapsible===!0||!this.headers.length?(e.active=!1,this.active=t()):e.active===!1?this._activate(0):this.active.length&&!t.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(e.active=!1,this.active=t()):this._activate(Math.max(0,e.active-1)):e.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var t=this.headers,e=this.panels;this.headers=this.element.find(this.options.header),this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default"),this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide(),this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content"),e&&(this._off(t.not(this.headers)),this._off(e.not(this.panels)))},_refresh:function(){var e,i=this.options,s=i.heightStyle,n=this.element.parent();this.active=this._findActive(i.active),this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed"),this._addClass(this.active.next(),"ui-accordion-content-active"),this.active.next().show(),this.headers.attr("role","tab").each(function(){var e=t(this),i=e.uniqueId().attr("id"),s=e.next(),n=s.uniqueId().attr("id");e.attr("aria-controls",n),s.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(i.event),"fill"===s?(e=n.height(),this.element.siblings(":visible").each(function(){var i=t(this),s=i.css("position");"absolute"!==s&&"fixed"!==s&&(e-=i.outerHeight(!0))}),this.headers.each(function(){e-=t(this).outerHeight(!0)}),this.headers.next().each(function(){t(this).height(Math.max(0,e-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===s&&(e=0,this.headers.next().each(function(){var i=t(this).is(":visible");i||t(this).show(),e=Math.max(e,t(this).css("height","").height()),i||t(this).hide()}).height(e))},_activate:function(e){var i=this._findActive(e)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):t()},_setupEvents:function(e){var i={keydown:"_keydown"};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(e){var i,s,n=this.options,o=this.active,a=t(e.currentTarget),r=a[0]===o[0],h=r&&n.collapsible,l=h?t():a.next(),c=o.next(),u={oldHeader:o,oldPanel:c,newHeader:h?t():a,newPanel:l};e.preventDefault(),r&&!n.collapsible||this._trigger("beforeActivate",e,u)===!1||(n.active=h?!1:this.headers.index(a),this.active=r?t():a,this._toggle(u),this._removeClass(o,"ui-accordion-header-active","ui-state-active"),n.icons&&(i=o.children(".ui-accordion-header-icon"),this._removeClass(i,null,n.icons.activeHeader)._addClass(i,null,n.icons.header)),r||(this._removeClass(a,"ui-accordion-header-collapsed")._addClass(a,"ui-accordion-header-active","ui-state-active"),n.icons&&(s=a.children(".ui-accordion-header-icon"),this._removeClass(s,null,n.icons.header)._addClass(s,null,n.icons.activeHeader)),this._addClass(a.next(),"ui-accordion-content-active")))},_toggle:function(e){var i=e.newPanel,s=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,e):(s.hide(),i.show(),this._toggleComplete(e)),s.attr({"aria-hidden":"true"}),s.prev().attr({"aria-selected":"false","aria-expanded":"false"}),i.length&&s.length?s.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===parseInt(t(this).attr("tabIndex"),10)}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(t,e,i){var s,n,o,a=this,r=0,h=t.css("box-sizing"),l=t.length&&(!e.length||t.index()<e.index()),c=this.options.animate||{},u=l&&c.down||c,d=function(){a._toggleComplete(i)};return"number"==typeof u&&(o=u),"string"==typeof u&&(n=u),n=n||u.easing||c.easing,o=o||u.duration||c.duration,e.length?t.length?(s=t.show().outerHeight(),e.animate(this.hideProps,{duration:o,easing:n,step:function(t,e){e.now=Math.round(t)}}),t.hide().animate(this.showProps,{duration:o,easing:n,complete:d,step:function(t,i){i.now=Math.round(t),"height"!==i.prop?"content-box"===h&&(r+=i.now):"content"!==a.options.heightStyle&&(i.now=Math.round(s-e.outerHeight()-r),r=0)}}),void 0):e.animate(this.hideProps,o,n,d):t.animate(this.showProps,o,n,d)},_toggleComplete:function(t){var e=t.oldPanel,i=e.prev();this._removeClass(e,"ui-accordion-content-active"),this._removeClass(i,"ui-accordion-header-active")._addClass(i,"ui-accordion-header-collapsed"),e.length&&(e.parent()[0].className=e.parent()[0].className),this._trigger("activate",null,t)}}),t.ui.safeActiveElement=function(t){var e;try{e=t.activeElement}catch(i){e=t.body}return e||(e=t.body),e.nodeName||(e=t.body),e},t.widget("ui.menu",{version:"1.12.1",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(t){t.preventDefault()},"click .ui-menu-item":function(e){var i=t(e.target),s=t(t.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(e),e.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(e):!this.element.is(":focus")&&s.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){if(!this.previousFilter){var i=t(e.target).closest(".ui-menu-item"),s=t(e.currentTarget);i[0]===s[0]&&(this._removeClass(s.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(e,s))}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.find(this.options.items).eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){var i=!t.contains(this.element[0],t.ui.safeActiveElement(this.document[0]));i&&this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){this._closeOnDocumentClick(t)&&this.collapseAll(t),this.mouseHandled=!1}})},_destroy:function(){var e=this.element.find(".ui-menu-item").removeAttr("role aria-disabled"),i=e.children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),i.children().each(function(){var e=t(this);e.data("ui-menu-submenu-caret")&&e.remove()})},_keydown:function(e){var i,s,n,o,a=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:a=!1,s=this.previousFilter||"",o=!1,n=e.keyCode>=96&&105>=e.keyCode?""+(e.keyCode-96):String.fromCharCode(e.keyCode),clearTimeout(this.filterTimer),n===s?o=!0:n=s+n,i=this._filterMenuItems(n),i=o&&-1!==i.index(this.active.next())?this.active.nextAll(".ui-menu-item"):i,i.length||(n=String.fromCharCode(e.keyCode),i=this._filterMenuItems(n)),i.length?(this.focus(e,i),this.previousFilter=n,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}a&&e.preventDefault()},_activate:function(t){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,i,s,n,o,a=this,r=this.options.icons.submenu,h=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),s=h.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),i=e.prev(),s=t("<span>").data("ui-menu-submenu-caret",!0);a._addClass(s,"ui-menu-icon","ui-icon "+r),i.attr("aria-haspopup","true").prepend(s),e.attr("aria-labelledby",i.attr("id"))}),this._addClass(s,"ui-menu","ui-widget ui-widget-content ui-front"),e=h.add(this.element),i=e.find(this.options.items),i.not(".ui-menu-item").each(function(){var e=t(this);a._isDivider(e)&&a._addClass(e,"ui-menu-divider","ui-widget-content")}),n=i.not(".ui-menu-item, .ui-menu-divider"),o=n.children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(n,"ui-menu-item")._addClass(o,"ui-menu-item-wrapper"),i.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){if("icons"===t){var i=this.element.find(".ui-menu-icon");this._removeClass(i,null,this.options.icons.submenu)._addClass(i,null,e.submenu)}this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t+""),this._toggleClass(null,"ui-state-disabled",!!t)},focus:function(t,e){var i,s,n;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children(".ui-menu-item-wrapper"),this._addClass(s,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),n=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(n,null,"ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=e.children(".ui-menu"),i.length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,s,n,o,a,r;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,n=e.offset().top-this.activeMenu.offset().top-i-s,o=this.activeMenu.scrollTop(),a=this.activeMenu.height(),r=e.outerHeight(),0>n?this.activeMenu.scrollTop(o+n):n+r>a&&this.activeMenu.scrollTop(o+n-a+r))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",t,{item:this.active}),this.active=null)},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var i=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(e),this._removeClass(s.find(".ui-state-active"),null,"ui-state-active"),this.activeMenu=s},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false")},_closeOnDocumentClick:function(e){return!t(e.target).closest(".ui-menu").length},_isDivider:function(t){return!/[^\-\u2014\u2013\s]/.test(t.text())},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.find(this.options.items)[e]()),this.focus(i,s)},nextPage:function(e){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=t(this),0>i.offset().top-s-n}),this.focus(e,i)):this.focus(e,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())),void 0):(this.next(e),void 0)},previousPage:function(e){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=t(this),i.offset().top-s+n>0}),this.focus(e,i)):this.focus(e,this.activeMenu.find(this.options.items).first())),void 0):(this.next(e),void 0)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||t(e.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,i)},_filterMenuItems:function(e){var i=e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),s=RegExp("^"+i,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return s.test(t.trim(t(this).children(".ui-menu-item-wrapper").text()))})}}),t.widget("ui.autocomplete",{version:"1.12.1",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var e,i,s,n=this.element[0].nodeName.toLowerCase(),o="textarea"===n,a="input"===n; -this.isMultiLine=o||!a&&this._isContentEditable(this.element),this.valueMethod=this.element[o||a?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return e=!0,s=!0,i=!0,void 0;e=!1,s=!1,i=!1;var o=t.ui.keyCode;switch(n.keyCode){case o.PAGE_UP:e=!0,this._move("previousPage",n);break;case o.PAGE_DOWN:e=!0,this._move("nextPage",n);break;case o.UP:e=!0,this._keyEvent("previous",n);break;case o.DOWN:e=!0,this._keyEvent("next",n);break;case o.ENTER:this.menu.active&&(e=!0,n.preventDefault(),this.menu.select(n));break;case o.TAB:this.menu.active&&this.menu.select(n);break;case o.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(e)return e=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),void 0;if(!i){var n=t.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(t){return s?(s=!1,t.preventDefault(),void 0):(this._searchTimeout(t),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(t),this._change(t),void 0)}}),this._initSource(),this.menu=t("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(e){e.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,this.element[0]!==t.ui.safeActiveElement(this.document[0])&&this.element.trigger("focus")})},menufocus:function(e,i){var s,n;return this.isNewMenu&&(this.isNewMenu=!1,e.originalEvent&&/^mouse/.test(e.originalEvent.type))?(this.menu.blur(),this.document.one("mousemove",function(){t(e.target).trigger(e.originalEvent)}),void 0):(n=i.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",e,{item:n})&&e.originalEvent&&/^key/.test(e.originalEvent.type)&&this._value(n.value),s=i.item.attr("aria-label")||n.value,s&&t.trim(s).length&&(this.liveRegion.children().hide(),t("<div>").text(s).appendTo(this.liveRegion)),void 0)},menuselect:function(e,i){var s=i.item.data("ui-autocomplete-item"),n=this.previous;this.element[0]!==t.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=n,this._delay(function(){this.previous=n,this.selectedItem=s})),!1!==this._trigger("select",e,{item:s})&&this._value(s.value),this.term=this._value(),this.close(e),this.selectedItem=s}}),this.liveRegion=t("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(e){var i=this.menu.element[0];return e.target===this.element[0]||e.target===i||t.contains(i,e.target)},_closeOnClickOutside:function(t){this._isEventTargetInWidget(t)||this.close()},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?t(e):this.document.find(e).eq(0)),e&&e[0]||(e=this.element.closest(".ui-front, dialog")),e.length||(e=this.document[0].body),e},_initSource:function(){var e,i,s=this;t.isArray(this.options.source)?(e=this.options.source,this.source=function(i,s){s(t.ui.autocomplete.filter(e,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(e,n){s.xhr&&s.xhr.abort(),s.xhr=t.ajax({url:i,data:e,dataType:"json",success:function(t){n(t)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(t){clearTimeout(this.searching),this.searching=this._delay(function(){var e=this.term===this._value(),i=this.menu.element.is(":visible"),s=t.altKey||t.ctrlKey||t.metaKey||t.shiftKey;(!e||e&&!i&&!s)&&(this.selectedItem=null,this.search(null,t))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length<this.options.minLength?this.close(e):this._trigger("search",e)!==!1?this._search(t):void 0},_search:function(t){this.pending++,this._addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:t},this._response())},_response:function(){var e=++this.requestIndex;return t.proxy(function(t){e===this.requestIndex&&this.__response(t),this.pending--,this.pending||this._removeClass("ui-autocomplete-loading")},this)},__response:function(t){t&&(t=this._normalize(t)),this._trigger("response",null,{content:t}),!this.options.disabled&&t&&t.length&&!this.cancelSearch?(this._suggest(t),this._trigger("open")):this._close()},close:function(t){this.cancelSearch=!0,this._close(t)},_close:function(t){this._off(this.document,"mousedown"),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",t))},_change:function(t){this.previous!==this._value()&&this._trigger("change",t,{item:this.selectedItem})},_normalize:function(e){return e.length&&e[0].label&&e[0].value?e:t.map(e,function(e){return"string"==typeof e?{label:e,value:e}:t.extend({},e,{label:e.label||e.value,value:e.value||e.label})})},_suggest:function(e){var i=this.menu.element.empty();this._renderMenu(i,e),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(t.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(),this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var t=this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(e,i){var s=this;t.each(i,function(t,i){s._renderItemData(e,i)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-autocomplete-item",e)},_renderItem:function(e,i){return t("<li>").append(t("<div>").text(i.label)).appendTo(e)},_move:function(t,e){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this.isMultiLine||this._value(this.term),this.menu.blur(),void 0):(this.menu[t](e),void 0):(this.search(null,e),void 0)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(t,e),e.preventDefault())},_isContentEditable:function(t){if(!t.length)return!1;var e=t.prop("contentEditable");return"inherit"===e?this._isContentEditable(t.parent()):"true"===e}}),t.extend(t.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(e,i){var s=RegExp(t.ui.autocomplete.escapeRegex(i),"i");return t.grep(e,function(t){return s.test(t.label||t.value||t)})}}),t.widget("ui.autocomplete",t.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(t>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var i;this._superApply(arguments),this.options.disabled||this.cancelSearch||(i=e&&e.length?this.options.messages.results(e.length):this.options.messages.noResults,this.liveRegion.children().hide(),t("<div>").text(i).appendTo(this.liveRegion))}}),t.ui.autocomplete;var g=/ui-corner-([a-z]){2,6}/g;t.widget("ui.controlgroup",{version:"1.12.1",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var e=this,i=[];t.each(this.options.items,function(s,n){var o,a={};return n?"controlgroupLabel"===s?(o=e.element.find(n),o.each(function(){var e=t(this);e.children(".ui-controlgroup-label-contents").length||e.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")}),e._addClass(o,null,"ui-widget ui-widget-content ui-state-default"),i=i.concat(o.get()),void 0):(t.fn[s]&&(a=e["_"+s+"Options"]?e["_"+s+"Options"]("middle"):{classes:{}},e.element.find(n).each(function(){var n=t(this),o=n[s]("instance"),r=t.widget.extend({},a);if("button"!==s||!n.parent(".ui-spinner").length){o||(o=n[s]()[s]("instance")),o&&(r.classes=e._resolveClassesValues(r.classes,o)),n[s](r);var h=n[s]("widget");t.data(h[0],"ui-controlgroup-data",o?o:n[s]("instance")),i.push(h[0])}})),void 0):void 0}),this.childWidgets=t(t.unique(i)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(e){this.childWidgets.each(function(){var i=t(this),s=i.data("ui-controlgroup-data");s&&s[e]&&s[e]()})},_updateCornerClass:function(t,e){var i="ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all",s=this._buildSimpleOptions(e,"label").classes.label;this._removeClass(t,null,i),this._addClass(t,null,s)},_buildSimpleOptions:function(t,e){var i="vertical"===this.options.direction,s={classes:{}};return s.classes[e]={middle:"",first:"ui-corner-"+(i?"top":"left"),last:"ui-corner-"+(i?"bottom":"right"),only:"ui-corner-all"}[t],s},_spinnerOptions:function(t){var e=this._buildSimpleOptions(t,"ui-spinner");return e.classes["ui-spinner-up"]="",e.classes["ui-spinner-down"]="",e},_buttonOptions:function(t){return this._buildSimpleOptions(t,"ui-button")},_checkboxradioOptions:function(t){return this._buildSimpleOptions(t,"ui-checkboxradio-label")},_selectmenuOptions:function(t){var e="vertical"===this.options.direction;return{width:e?"auto":!1,classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(e?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(e?"top":"left")},last:{"ui-selectmenu-button-open":e?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(e?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[t]}},_resolveClassesValues:function(e,i){var s={};return t.each(e,function(n){var o=i.options.classes[n]||"";o=t.trim(o.replace(g,"")),s[n]=(o+" "+e[n]).replace(/\s+/g," ")}),s},_setOption:function(t,e){return"direction"===t&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(t,e),"disabled"===t?(this._callChildMethod(e?"disable":"enable"),void 0):(this.refresh(),void 0)},refresh:function(){var e,i=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),e=this.childWidgets,this.options.onlyVisible&&(e=e.filter(":visible")),e.length&&(t.each(["first","last"],function(t,s){var n=e[s]().data("ui-controlgroup-data");if(n&&i["_"+n.widgetName+"Options"]){var o=i["_"+n.widgetName+"Options"](1===e.length?"only":s);o.classes=i._resolveClassesValues(o.classes,n),n.element[n.widgetName](o)}else i._updateCornerClass(e[s](),s)}),this._callChildMethod("refresh"))}}),t.widget("ui.checkboxradio",[t.ui.formResetMixin,{version:"1.12.1",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var e,i,s=this,n=this._super()||{};return this._readType(),i=this.element.labels(),this.label=t(i[i.length-1]),this.label.length||t.error("No label found for checkboxradio widget"),this.originalLabel="",this.label.contents().not(this.element[0]).each(function(){s.originalLabel+=3===this.nodeType?t(this).text():this.outerHTML}),this.originalLabel&&(n.label=this.originalLabel),e=this.element[0].disabled,null!=e&&(n.disabled=e),n},_create:function(){var t=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),t&&(this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this.icon&&this._addClass(this.icon,null,"ui-state-hover")),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var e=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===e&&/radio|checkbox/.test(this.type)||t.error("Can't create checkboxradio on element.nodeName="+e+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var e,i=this.element[0].name,s="input[name='"+t.ui.escapeSelector(i)+"']";return i?(e=this.form.length?t(this.form[0].elements).filter(s):t(s).filter(function(){return 0===t(this).form().length}),e.not(this.element)):t([])},_toggleClasses:function(){var e=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",e),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",e)._toggleClass(this.icon,null,"ui-icon-blank",!e),"radio"===this.type&&this._getRadioGroup().each(function(){var e=t(this).checkboxradio("instance");e&&e._removeClass(e.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(t,e){return"label"!==t||e?(this._super(t,e),"disabled"===t?(this._toggleClass(this.label,null,"ui-state-disabled",e),this.element[0].disabled=e,void 0):(this.refresh(),void 0)):void 0},_updateIcon:function(e){var i="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=t("<span>"),this.iconSpace=t("<span> </span>"),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(i+=e?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,e?"ui-icon-blank":"ui-icon-check")):i+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",i),e||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var t=this.label.contents().not(this.element[0]);this.icon&&(t=t.not(this.icon[0])),this.iconSpace&&(t=t.not(this.iconSpace[0])),t.remove(),this.label.append(this.options.label)},refresh:function(){var t=this.element[0].checked,e=this.element[0].disabled;this._updateIcon(t),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),null!==this.options.label&&this._updateLabel(),e!==this.options.disabled&&this._setOptions({disabled:e})}}]),t.ui.checkboxradio,t.widget("ui.button",{version:"1.12.1",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var t,e=this._super()||{};return this.isInput=this.element.is("input"),t=this.element[0].disabled,null!=t&&(e.disabled=t),this.originalLabel=this.isInput?this.element.val():this.element.html(),this.originalLabel&&(e.label=this.originalLabel),e},_create:function(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1),this.hasTitle=!!this.element.attr("title"),this.options.label&&this.options.label!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this.element.html(this.options.label)),this._addClass("ui-button","ui-widget"),this._setOption("disabled",this.options.disabled),this._enhance(),this.element.is("a")&&this._on({keyup:function(e){e.keyCode===t.ui.keyCode.SPACE&&(e.preventDefault(),this.element[0].click?this.element[0].click():this.element.trigger("click"))}})},_enhance:function(){this.element.is("button")||this.element.attr("role","button"),this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updateTooltip())},_updateTooltip:function(){this.title=this.element.attr("title"),this.options.showLabel||this.title||this.element.attr("title",this.options.label)},_updateIcon:function(e,i){var s="iconPosition"!==e,n=s?this.options.iconPosition:i,o="top"===n||"bottom"===n;this.icon?s&&this._removeClass(this.icon,null,this.options.icon):(this.icon=t("<span>"),this._addClass(this.icon,"ui-button-icon","ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only")),s&&this._addClass(this.icon,null,i),this._attachIcon(n),o?(this._addClass(this.icon,null,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconSpace||(this.iconSpace=t("<span> </span>"),this._addClass(this.iconSpace,"ui-button-icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._attachIconSpace(n))},_destroy:function(){this.element.removeAttr("role"),this.icon&&this.icon.remove(),this.iconSpace&&this.iconSpace.remove(),this.hasTitle||this.element.removeAttr("title")},_attachIconSpace:function(t){this.icon[/^(?:end|bottom)/.test(t)?"before":"after"](this.iconSpace)},_attachIcon:function(t){this.element[/^(?:end|bottom)/.test(t)?"append":"prepend"](this.icon)},_setOptions:function(t){var e=void 0===t.showLabel?this.options.showLabel:t.showLabel,i=void 0===t.icon?this.options.icon:t.icon;e||i||(t.showLabel=!0),this._super(t)},_setOption:function(t,e){"icon"===t&&(e?this._updateIcon(t,e):this.icon&&(this.icon.remove(),this.iconSpace&&this.iconSpace.remove())),"iconPosition"===t&&this._updateIcon(t,e),"showLabel"===t&&(this._toggleClass("ui-button-icon-only",null,!e),this._updateTooltip()),"label"===t&&(this.isInput?this.element.val(e):(this.element.html(e),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIconSpace(this.options.iconPosition)))),this._super(t,e),"disabled"===t&&(this._toggleClass(null,"ui-state-disabled",e),this.element[0].disabled=e,e&&this.element.blur())},refresh:function(){var t=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOptions({disabled:t}),this._updateTooltip()}}),t.uiBackCompat!==!1&&(t.widget("ui.button",t.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.options.showLabel=this.options.text),!this.options.showLabel&&this.options.text&&(this.options.text=this.options.showLabel),this.options.icon||!this.options.icons.primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.primary=this.options.icon):this.options.icons.primary?this.options.icon=this.options.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.iconPosition="end"),this._super()},_setOption:function(t,e){return"text"===t?(this._super("showLabel",e),void 0):("showLabel"===t&&(this.options.text=e),"icon"===t&&(this.options.icons.primary=e),"icons"===t&&(e.primary?(this._super("icon",e.primary),this._super("iconPosition","beginning")):e.secondary&&(this._super("icon",e.secondary),this._super("iconPosition","end"))),this._superApply(arguments),void 0)}}),t.fn.button=function(e){return function(){return!this.length||this.length&&"INPUT"!==this[0].tagName||this.length&&"INPUT"===this[0].tagName&&"checkbox"!==this.attr("type")&&"radio"!==this.attr("type")?e.apply(this,arguments):(t.ui.checkboxradio||t.error("Checkboxradio widget missing"),0===arguments.length?this.checkboxradio({icon:!1}):this.checkboxradio.apply(this,arguments))}}(t.fn.button),t.fn.buttonset=function(){return t.ui.controlgroup||t.error("Controlgroup widget missing"),"option"===arguments[0]&&"items"===arguments[1]&&arguments[2]?this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]):"option"===arguments[0]&&"items"===arguments[1]?this.controlgroup.apply(this,[arguments[0],"items.button"]):("object"==typeof arguments[0]&&arguments[0].items&&(arguments[0].items={button:arguments[0].items}),this.controlgroup.apply(this,arguments))}),t.ui.button,t.extend(t.ui,{datepicker:{version:"1.12.1"}});var m;t.extend(s.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return a(this._defaults,t||{}),this},_attachDatepicker:function(e,i){var s,n,o;s=e.nodeName.toLowerCase(),n="div"===s||"span"===s,e.id||(this.uuid+=1,e.id="dp"+this.uuid),o=this._newInst(t(e),n),o.settings=t.extend({},i||{}),"input"===s?this._connectDatepicker(e,o):n&&this._inlineDatepicker(e,o)},_newInst:function(e,i){var s=e[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?n(t("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(e,i){var s=t(e);i.append=t([]),i.trigger=t([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp),this._autoSize(i),t.data(e,"datepicker",i),i.settings.disabled&&this._disableDatepicker(e))},_attachments:function(e,i){var s,n,o,a=this._get(i,"appendText"),r=this._get(i,"isRTL");i.append&&i.append.remove(),a&&(i.append=t("<span class='"+this._appendClass+"'>"+a+"</span>"),e[r?"before":"after"](i.append)),e.off("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&e.on("focus",this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),o=this._get(i,"buttonImage"),i.trigger=t(this._get(i,"buttonImageOnly")?t("<img/>").addClass(this._triggerClass).attr({src:o,alt:n,title:n}):t("<button type='button'></button>").addClass(this._triggerClass).html(o?t("<img/>").attr({src:o,alt:n,title:n}):n)),e[r?"before":"after"](i.trigger),i.trigger.on("click",function(){return t.datepicker._datepickerShowing&&t.datepicker._lastInput===e[0]?t.datepicker._hideDatepicker():t.datepicker._datepickerShowing&&t.datepicker._lastInput!==e[0]?(t.datepicker._hideDatepicker(),t.datepicker._showDatepicker(e[0])):t.datepicker._showDatepicker(e[0]),!1}))},_autoSize:function(t){if(this._get(t,"autoSize")&&!t.inline){var e,i,s,n,o=new Date(2009,11,20),a=this._get(t,"dateFormat");a.match(/[DM]/)&&(e=function(t){for(i=0,s=0,n=0;t.length>n;n++)t[n].length>i&&(i=t[n].length,s=n);return s},o.setMonth(e(this._get(t,a.match(/MM/)?"monthNames":"monthNamesShort"))),o.setDate(e(this._get(t,a.match(/DD/)?"dayNames":"dayNamesShort"))+20-o.getDay())),t.input.attr("size",this._formatDate(t,o).length)}},_inlineDatepicker:function(e,i){var s=t(e);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),t.data(e,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(e),i.dpDiv.css("display","block"))},_dialogDatepicker:function(e,i,s,n,o){var r,h,l,c,u,d=this._dialogInst;return d||(this.uuid+=1,r="dp"+this.uuid,this._dialogInput=t("<input type='text' id='"+r+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.on("keydown",this._doKeyDown),t("body").append(this._dialogInput),d=this._dialogInst=this._newInst(this._dialogInput,!1),d.settings={},t.data(this._dialogInput[0],"datepicker",d)),a(d.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(d,i):i,this._dialogInput.val(i),this._pos=o?o.length?o:[o.pageX,o.pageY]:null,this._pos||(h=document.documentElement.clientWidth,l=document.documentElement.clientHeight,c=document.documentElement.scrollLeft||document.body.scrollLeft,u=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[h/2-100+c,l/2-150+u]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),d.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),t.blockUI&&t.blockUI(this.dpDiv),t.data(this._dialogInput[0],"datepicker",d),this},_destroyDatepicker:function(e){var i,s=t(e),n=t.data(e,"datepicker");s.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),t.removeData(e,"datepicker"),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty(),m===n&&(m=null))},_enableDatepicker:function(e){var i,s,n=t(e),o=t.data(e,"datepicker");n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!1,o.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}))},_disableDatepicker:function(e){var i,s,n=t(e),o=t.data(e,"datepicker");n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!0,o.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;this._disabledInputs.length>e;e++)if(this._disabledInputs[e]===t)return!0;return!1},_getInst:function(e){try{return t.data(e,"datepicker")}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(e,i,s){var n,o,r,h,l=this._getInst(e);return 2===arguments.length&&"string"==typeof i?"defaults"===i?t.extend({},t.datepicker._defaults):l?"all"===i?t.extend({},l.settings):this._get(l,i):null:(n=i||{},"string"==typeof i&&(n={},n[i]=s),l&&(this._curInst===l&&this._hideDatepicker(),o=this._getDateDatepicker(e,!0),r=this._getMinMaxDate(l,"min"),h=this._getMinMaxDate(l,"max"),a(l.settings,n),null!==r&&void 0!==n.dateFormat&&void 0===n.minDate&&(l.settings.minDate=this._formatDate(l,r)),null!==h&&void 0!==n.dateFormat&&void 0===n.maxDate&&(l.settings.maxDate=this._formatDate(l,h)),"disabled"in n&&(n.disabled?this._disableDatepicker(e):this._enableDatepicker(e)),this._attachments(t(e),l),this._autoSize(l),this._setDate(l,o),this._updateAlternate(l),this._updateDatepicker(l)),void 0)},_changeDatepicker:function(t,e,i){this._optionDatepicker(t,e,i)},_refreshDatepicker:function(t){var e=this._getInst(t);e&&this._updateDatepicker(e)},_setDateDatepicker:function(t,e){var i=this._getInst(t);i&&(this._setDate(i,e),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(t,e){var i=this._getInst(t);return i&&!i.inline&&this._setDateFromField(i,e),i?this._getDate(i):null},_doKeyDown:function(e){var i,s,n,o=t.datepicker._getInst(e.target),a=!0,r=o.dpDiv.is(".ui-datepicker-rtl");if(o._keyEvent=!0,t.datepicker._datepickerShowing)switch(e.keyCode){case 9:t.datepicker._hideDatepicker(),a=!1;break;case 13:return n=t("td."+t.datepicker._dayOverClass+":not(."+t.datepicker._currentClass+")",o.dpDiv),n[0]&&t.datepicker._selectDay(e.target,o.selectedMonth,o.selectedYear,n[0]),i=t.datepicker._get(o,"onSelect"),i?(s=t.datepicker._formatDate(o),i.apply(o.input?o.input[0]:null,[s,o])):t.datepicker._hideDatepicker(),!1;case 27:t.datepicker._hideDatepicker();break;case 33:t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 34:t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&t.datepicker._clearDate(e.target),a=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&t.datepicker._gotoToday(e.target),a=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,r?1:-1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,-7,"D"),a=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,r?-1:1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,7,"D"),a=e.ctrlKey||e.metaKey;break;default:a=!1}else 36===e.keyCode&&e.ctrlKey?t.datepicker._showDatepicker(this):a=!1;a&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(e){var i,s,n=t.datepicker._getInst(e.target);return t.datepicker._get(n,"constrainInput")?(i=t.datepicker._possibleChars(t.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),e.ctrlKey||e.metaKey||" ">s||!i||i.indexOf(s)>-1):void 0},_doKeyUp:function(e){var i,s=t.datepicker._getInst(e.target);if(s.input.val()!==s.lastVal)try{i=t.datepicker.parseDate(t.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,t.datepicker._getFormatConfig(s)),i&&(t.datepicker._setDateFromField(s),t.datepicker._updateAlternate(s),t.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(e){if(e=e.target||e,"input"!==e.nodeName.toLowerCase()&&(e=t("input",e.parentNode)[0]),!t.datepicker._isDisabledDatepicker(e)&&t.datepicker._lastInput!==e){var s,n,o,r,h,l,c;s=t.datepicker._getInst(e),t.datepicker._curInst&&t.datepicker._curInst!==s&&(t.datepicker._curInst.dpDiv.stop(!0,!0),s&&t.datepicker._datepickerShowing&&t.datepicker._hideDatepicker(t.datepicker._curInst.input[0])),n=t.datepicker._get(s,"beforeShow"),o=n?n.apply(e,[e,s]):{},o!==!1&&(a(s.settings,o),s.lastVal=null,t.datepicker._lastInput=e,t.datepicker._setDateFromField(s),t.datepicker._inDialog&&(e.value=""),t.datepicker._pos||(t.datepicker._pos=t.datepicker._findPos(e),t.datepicker._pos[1]+=e.offsetHeight),r=!1,t(e).parents().each(function(){return r|="fixed"===t(this).css("position"),!r}),h={left:t.datepicker._pos[0],top:t.datepicker._pos[1]},t.datepicker._pos=null,s.dpDiv.empty(),s.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),t.datepicker._updateDatepicker(s),h=t.datepicker._checkOffset(s,h,r),s.dpDiv.css({position:t.datepicker._inDialog&&t.blockUI?"static":r?"fixed":"absolute",display:"none",left:h.left+"px",top:h.top+"px"}),s.inline||(l=t.datepicker._get(s,"showAnim"),c=t.datepicker._get(s,"duration"),s.dpDiv.css("z-index",i(t(e))+1),t.datepicker._datepickerShowing=!0,t.effects&&t.effects.effect[l]?s.dpDiv.show(l,t.datepicker._get(s,"showOptions"),c):s.dpDiv[l||"show"](l?c:null),t.datepicker._shouldFocusInput(s)&&s.input.trigger("focus"),t.datepicker._curInst=s)) -}},_updateDatepicker:function(e){this.maxRows=4,m=e,e.dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e);var i,s=this._getNumberOfMonths(e),n=s[1],a=17,r=e.dpDiv.find("."+this._dayOverClass+" a");r.length>0&&o.apply(r.get(0)),e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&e.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",a*n+"em"),e.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e===t.datepicker._curInst&&t.datepicker._datepickerShowing&&t.datepicker._shouldFocusInput(e)&&e.input.trigger("focus"),e.yearshtml&&(i=e.yearshtml,setTimeout(function(){i===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),i=e.yearshtml=null},0))},_shouldFocusInput:function(t){return t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&!t.input.is(":focus")},_checkOffset:function(e,i,s){var n=e.dpDiv.outerWidth(),o=e.dpDiv.outerHeight(),a=e.input?e.input.outerWidth():0,r=e.input?e.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:t(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:t(document).scrollTop());return i.left-=this._get(e,"isRTL")?n-a:0,i.left-=s&&i.left===e.input.offset().left?t(document).scrollLeft():0,i.top-=s&&i.top===e.input.offset().top+r?t(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+o>l&&l>o?Math.abs(o+r):0),i},_findPos:function(e){for(var i,s=this._getInst(e),n=this._get(s,"isRTL");e&&("hidden"===e.type||1!==e.nodeType||t.expr.filters.hidden(e));)e=e[n?"previousSibling":"nextSibling"];return i=t(e).offset(),[i.left,i.top]},_hideDatepicker:function(e){var i,s,n,o,a=this._curInst;!a||e&&a!==t.data(e,"datepicker")||this._datepickerShowing&&(i=this._get(a,"showAnim"),s=this._get(a,"duration"),n=function(){t.datepicker._tidyDialog(a)},t.effects&&(t.effects.effect[i]||t.effects[i])?a.dpDiv.hide(i,t.datepicker._get(a,"showOptions"),s,n):a.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,o=this._get(a,"onClose"),o&&o.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),t.blockUI&&(t.unblockUI(),t("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(t.datepicker._curInst){var i=t(e.target),s=t.datepicker._getInst(i[0]);(i[0].id!==t.datepicker._mainDivId&&0===i.parents("#"+t.datepicker._mainDivId).length&&!i.hasClass(t.datepicker.markerClassName)&&!i.closest("."+t.datepicker._triggerClass).length&&t.datepicker._datepickerShowing&&(!t.datepicker._inDialog||!t.blockUI)||i.hasClass(t.datepicker.markerClassName)&&t.datepicker._curInst!==s)&&t.datepicker._hideDatepicker()}},_adjustDate:function(e,i,s){var n=t(e),o=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(o,i+("M"===s?this._get(o,"showCurrentAtPos"):0),s),this._updateDatepicker(o))},_gotoToday:function(e){var i,s=t(e),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(e,i,s){var n=t(e),o=this._getInst(n[0]);o["selected"+("M"===s?"Month":"Year")]=o["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(o),this._adjustDate(n)},_selectDay:function(e,i,s,n){var o,a=t(e);t(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(a[0])||(o=this._getInst(a[0]),o.selectedDay=o.currentDay=t("a",n).html(),o.selectedMonth=o.currentMonth=i,o.selectedYear=o.currentYear=s,this._selectDate(e,this._formatDate(o,o.currentDay,o.currentMonth,o.currentYear)))},_clearDate:function(e){var i=t(e);this._selectDate(i,"")},_selectDate:function(e,i){var s,n=t(e),o=this._getInst(n[0]);i=null!=i?i:this._formatDate(o),o.input&&o.input.val(i),this._updateAlternate(o),s=this._get(o,"onSelect"),s?s.apply(o.input?o.input[0]:null,[i,o]):o.input&&o.input.trigger("change"),o.inline?this._updateDatepicker(o):(this._hideDatepicker(),this._lastInput=o.input[0],"object"!=typeof o.input[0]&&o.input.trigger("focus"),this._lastInput=null)},_updateAlternate:function(e){var i,s,n,o=this._get(e,"altField");o&&(i=this._get(e,"altFormat")||this._get(e,"dateFormat"),s=this._getDate(e),n=this.formatDate(i,s,this._getFormatConfig(e)),t(o).val(n))},noWeekends:function(t){var e=t.getDay();return[e>0&&6>e,""]},iso8601Week:function(t){var e,i=new Date(t.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),e=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((e-i)/864e5)/7)+1},parseDate:function(e,i,s){if(null==e||null==i)throw"Invalid arguments";if(i="object"==typeof i?""+i:i+"",""===i)return null;var n,o,a,r,h=0,l=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,c="string"!=typeof l?l:(new Date).getFullYear()%100+parseInt(l,10),u=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,d=(s?s.dayNames:null)||this._defaults.dayNames,p=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,f=(s?s.monthNames:null)||this._defaults.monthNames,g=-1,m=-1,_=-1,v=-1,b=!1,y=function(t){var i=e.length>n+1&&e.charAt(n+1)===t;return i&&n++,i},w=function(t){var e=y(t),s="@"===t?14:"!"===t?20:"y"===t&&e?4:"o"===t?3:2,n="y"===t?s:1,o=RegExp("^\\d{"+n+","+s+"}"),a=i.substring(h).match(o);if(!a)throw"Missing number at position "+h;return h+=a[0].length,parseInt(a[0],10)},k=function(e,s,n){var o=-1,a=t.map(y(e)?n:s,function(t,e){return[[e,t]]}).sort(function(t,e){return-(t[1].length-e[1].length)});if(t.each(a,function(t,e){var s=e[1];return i.substr(h,s.length).toLowerCase()===s.toLowerCase()?(o=e[0],h+=s.length,!1):void 0}),-1!==o)return o+1;throw"Unknown name at position "+h},x=function(){if(i.charAt(h)!==e.charAt(n))throw"Unexpected literal at position "+h;h++};for(n=0;e.length>n;n++)if(b)"'"!==e.charAt(n)||y("'")?x():b=!1;else switch(e.charAt(n)){case"d":_=w("d");break;case"D":k("D",u,d);break;case"o":v=w("o");break;case"m":m=w("m");break;case"M":m=k("M",p,f);break;case"y":g=w("y");break;case"@":r=new Date(w("@")),g=r.getFullYear(),m=r.getMonth()+1,_=r.getDate();break;case"!":r=new Date((w("!")-this._ticksTo1970)/1e4),g=r.getFullYear(),m=r.getMonth()+1,_=r.getDate();break;case"'":y("'")?x():b=!0;break;default:x()}if(i.length>h&&(a=i.substr(h),!/^\s+/.test(a)))throw"Extra/unparsed characters found in date: "+a;if(-1===g?g=(new Date).getFullYear():100>g&&(g+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c>=g?0:-100)),v>-1)for(m=1,_=v;;){if(o=this._getDaysInMonth(g,m-1),o>=_)break;m++,_-=o}if(r=this._daylightSavingAdjust(new Date(g,m-1,_)),r.getFullYear()!==g||r.getMonth()+1!==m||r.getDate()!==_)throw"Invalid date";return r},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(t,e,i){if(!e)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,o=(i?i.dayNames:null)||this._defaults.dayNames,a=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,h=function(e){var i=t.length>s+1&&t.charAt(s+1)===e;return i&&s++,i},l=function(t,e,i){var s=""+e;if(h(t))for(;i>s.length;)s="0"+s;return s},c=function(t,e,i,s){return h(t)?s[e]:i[e]},u="",d=!1;if(e)for(s=0;t.length>s;s++)if(d)"'"!==t.charAt(s)||h("'")?u+=t.charAt(s):d=!1;else switch(t.charAt(s)){case"d":u+=l("d",e.getDate(),2);break;case"D":u+=c("D",e.getDay(),n,o);break;case"o":u+=l("o",Math.round((new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-new Date(e.getFullYear(),0,0).getTime())/864e5),3);break;case"m":u+=l("m",e.getMonth()+1,2);break;case"M":u+=c("M",e.getMonth(),a,r);break;case"y":u+=h("y")?e.getFullYear():(10>e.getFullYear()%100?"0":"")+e.getFullYear()%100;break;case"@":u+=e.getTime();break;case"!":u+=1e4*e.getTime()+this._ticksTo1970;break;case"'":h("'")?u+="'":d=!0;break;default:u+=t.charAt(s)}return u},_possibleChars:function(t){var e,i="",s=!1,n=function(i){var s=t.length>e+1&&t.charAt(e+1)===i;return s&&e++,s};for(e=0;t.length>e;e++)if(s)"'"!==t.charAt(e)||n("'")?i+=t.charAt(e):s=!1;else switch(t.charAt(e)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=t.charAt(e)}return i},_get:function(t,e){return void 0!==t.settings[e]?t.settings[e]:this._defaults[e]},_setDateFromField:function(t,e){if(t.input.val()!==t.lastVal){var i=this._get(t,"dateFormat"),s=t.lastVal=t.input?t.input.val():null,n=this._getDefaultDate(t),o=n,a=this._getFormatConfig(t);try{o=this.parseDate(i,s,a)||n}catch(r){s=e?"":s}t.selectedDay=o.getDate(),t.drawMonth=t.selectedMonth=o.getMonth(),t.drawYear=t.selectedYear=o.getFullYear(),t.currentDay=s?o.getDate():0,t.currentMonth=s?o.getMonth():0,t.currentYear=s?o.getFullYear():0,this._adjustInstDate(t)}},_getDefaultDate:function(t){return this._restrictMinMax(t,this._determineDate(t,this._get(t,"defaultDate"),new Date))},_determineDate:function(e,i,s){var n=function(t){var e=new Date;return e.setDate(e.getDate()+t),e},o=function(i){try{return t.datepicker.parseDate(t.datepicker._get(e,"dateFormat"),i,t.datepicker._getFormatConfig(e))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?t.datepicker._getDate(e):null)||new Date,o=n.getFullYear(),a=n.getMonth(),r=n.getDate(),h=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=h.exec(i);l;){switch(l[2]||"d"){case"d":case"D":r+=parseInt(l[1],10);break;case"w":case"W":r+=7*parseInt(l[1],10);break;case"m":case"M":a+=parseInt(l[1],10),r=Math.min(r,t.datepicker._getDaysInMonth(o,a));break;case"y":case"Y":o+=parseInt(l[1],10),r=Math.min(r,t.datepicker._getDaysInMonth(o,a))}l=h.exec(i)}return new Date(o,a,r)},a=null==i||""===i?s:"string"==typeof i?o(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return a=a&&"Invalid Date"==""+a?s:a,a&&(a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)),this._daylightSavingAdjust(a)},_daylightSavingAdjust:function(t){return t?(t.setHours(t.getHours()>12?t.getHours()+2:0),t):null},_setDate:function(t,e,i){var s=!e,n=t.selectedMonth,o=t.selectedYear,a=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=a.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=a.getMonth(),t.drawYear=t.selectedYear=t.currentYear=a.getFullYear(),n===t.selectedMonth&&o===t.selectedYear||i||this._notifyChange(t),this._adjustInstDate(t),t.input&&t.input.val(s?"":this._formatDate(t))},_getDate:function(t){var e=!t.currentYear||t.input&&""===t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return e},_attachHandlers:function(e){var i=this._get(e,"stepMonths"),s="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){t.datepicker._adjustDate(s,-i,"M")},next:function(){t.datepicker._adjustDate(s,+i,"M")},hide:function(){t.datepicker._hideDatepicker()},today:function(){t.datepicker._gotoToday(s)},selectDay:function(){return t.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return t.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return t.datepicker._selectMonthYear(s,this,"Y"),!1}};t(this).on(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(t){var e,i,s,n,o,a,r,h,l,c,u,d,p,f,g,m,_,v,b,y,w,k,x,C,D,I,T,P,M,S,H,z,O,A,N,W,E,F,L,R=new Date,B=this._daylightSavingAdjust(new Date(R.getFullYear(),R.getMonth(),R.getDate())),Y=this._get(t,"isRTL"),j=this._get(t,"showButtonPanel"),q=this._get(t,"hideIfNoPrevNext"),K=this._get(t,"navigationAsDateFormat"),U=this._getNumberOfMonths(t),V=this._get(t,"showCurrentAtPos"),$=this._get(t,"stepMonths"),X=1!==U[0]||1!==U[1],G=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),Q=this._getMinMaxDate(t,"min"),J=this._getMinMaxDate(t,"max"),Z=t.drawMonth-V,te=t.drawYear;if(0>Z&&(Z+=12,te--),J)for(e=this._daylightSavingAdjust(new Date(J.getFullYear(),J.getMonth()-U[0]*U[1]+1,J.getDate())),e=Q&&Q>e?Q:e;this._daylightSavingAdjust(new Date(te,Z,1))>e;)Z--,0>Z&&(Z=11,te--);for(t.drawMonth=Z,t.drawYear=te,i=this._get(t,"prevText"),i=K?this.formatDate(i,this._daylightSavingAdjust(new Date(te,Z-$,1)),this._getFormatConfig(t)):i,s=this._canAdjustMonth(t,-1,te,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>":q?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>",n=this._get(t,"nextText"),n=K?this.formatDate(n,this._daylightSavingAdjust(new Date(te,Z+$,1)),this._getFormatConfig(t)):n,o=this._canAdjustMonth(t,1,te,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>":q?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>",a=this._get(t,"currentText"),r=this._get(t,"gotoCurrent")&&t.currentDay?G:B,a=K?this.formatDate(a,r,this._getFormatConfig(t)):a,h=t.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(t,"closeText")+"</button>",l=j?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(Y?h:"")+(this._isInRange(t,r)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+a+"</button>":"")+(Y?"":h)+"</div>":"",c=parseInt(this._get(t,"firstDay"),10),c=isNaN(c)?0:c,u=this._get(t,"showWeek"),d=this._get(t,"dayNames"),p=this._get(t,"dayNamesMin"),f=this._get(t,"monthNames"),g=this._get(t,"monthNamesShort"),m=this._get(t,"beforeShowDay"),_=this._get(t,"showOtherMonths"),v=this._get(t,"selectOtherMonths"),b=this._getDefaultDate(t),y="",k=0;U[0]>k;k++){for(x="",this.maxRows=4,C=0;U[1]>C;C++){if(D=this._daylightSavingAdjust(new Date(te,Z,t.selectedDay)),I=" ui-corner-all",T="",X){if(T+="<div class='ui-datepicker-group",U[1]>1)switch(C){case 0:T+=" ui-datepicker-group-first",I=" ui-corner-"+(Y?"right":"left");break;case U[1]-1:T+=" ui-datepicker-group-last",I=" ui-corner-"+(Y?"left":"right");break;default:T+=" ui-datepicker-group-middle",I=""}T+="'>"}for(T+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+I+"'>"+(/all|left/.test(I)&&0===k?Y?o:s:"")+(/all|right/.test(I)&&0===k?Y?s:o:"")+this._generateMonthYearHeader(t,Z,te,Q,J,k>0||C>0,f,g)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",P=u?"<th class='ui-datepicker-week-col'>"+this._get(t,"weekHeader")+"</th>":"",w=0;7>w;w++)M=(w+c)%7,P+="<th scope='col'"+((w+c+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+d[M]+"'>"+p[M]+"</span></th>";for(T+=P+"</tr></thead><tbody>",S=this._getDaysInMonth(te,Z),te===t.selectedYear&&Z===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,S)),H=(this._getFirstDayOfMonth(te,Z)-c+7)%7,z=Math.ceil((H+S)/7),O=X?this.maxRows>z?this.maxRows:z:z,this.maxRows=O,A=this._daylightSavingAdjust(new Date(te,Z,1-H)),N=0;O>N;N++){for(T+="<tr>",W=u?"<td class='ui-datepicker-week-col'>"+this._get(t,"calculateWeek")(A)+"</td>":"",w=0;7>w;w++)E=m?m.apply(t.input?t.input[0]:null,[A]):[!0,""],F=A.getMonth()!==Z,L=F&&!v||!E[0]||Q&&Q>A||J&&A>J,W+="<td class='"+((w+c+6)%7>=5?" ui-datepicker-week-end":"")+(F?" ui-datepicker-other-month":"")+(A.getTime()===D.getTime()&&Z===t.selectedMonth&&t._keyEvent||b.getTime()===A.getTime()&&b.getTime()===D.getTime()?" "+this._dayOverClass:"")+(L?" "+this._unselectableClass+" ui-state-disabled":"")+(F&&!_?"":" "+E[1]+(A.getTime()===G.getTime()?" "+this._currentClass:"")+(A.getTime()===B.getTime()?" ui-datepicker-today":""))+"'"+(F&&!_||!E[2]?"":" title='"+E[2].replace(/'/g,"'")+"'")+(L?"":" data-handler='selectDay' data-event='click' data-month='"+A.getMonth()+"' data-year='"+A.getFullYear()+"'")+">"+(F&&!_?" ":L?"<span class='ui-state-default'>"+A.getDate()+"</span>":"<a class='ui-state-default"+(A.getTime()===B.getTime()?" ui-state-highlight":"")+(A.getTime()===G.getTime()?" ui-state-active":"")+(F?" ui-priority-secondary":"")+"' href='#'>"+A.getDate()+"</a>")+"</td>",A.setDate(A.getDate()+1),A=this._daylightSavingAdjust(A);T+=W+"</tr>"}Z++,Z>11&&(Z=0,te++),T+="</tbody></table>"+(X?"</div>"+(U[0]>0&&C===U[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),x+=T}y+=x}return y+=l,t._keyEvent=!1,y},_generateMonthYearHeader:function(t,e,i,s,n,o,a,r){var h,l,c,u,d,p,f,g,m=this._get(t,"changeMonth"),_=this._get(t,"changeYear"),v=this._get(t,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",y="";if(o||!m)y+="<span class='ui-datepicker-month'>"+a[e]+"</span>";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,y+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",c=0;12>c;c++)(!h||c>=s.getMonth())&&(!l||n.getMonth()>=c)&&(y+="<option value='"+c+"'"+(c===e?" selected='selected'":"")+">"+r[c]+"</option>");y+="</select>"}if(v||(b+=y+(!o&&m&&_?"":" ")),!t.yearshtml)if(t.yearshtml="",o||!_)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(u=this._get(t,"yearRange").split(":"),d=(new Date).getFullYear(),p=function(t){var e=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?d+parseInt(t,10):parseInt(t,10);return isNaN(e)?d:e},f=p(u[0]),g=Math.max(f,p(u[1]||"")),f=s?Math.max(f,s.getFullYear()):f,g=n?Math.min(g,n.getFullYear()):g,t.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";g>=f;f++)t.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";t.yearshtml+="</select>",b+=t.yearshtml,t.yearshtml=null}return b+=this._get(t,"yearSuffix"),v&&(b+=(!o&&m&&_?"":" ")+y),b+="</div>"},_adjustInstDate:function(t,e,i){var s=t.selectedYear+("Y"===i?e:0),n=t.selectedMonth+("M"===i?e:0),o=Math.min(t.selectedDay,this._getDaysInMonth(s,n))+("D"===i?e:0),a=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(s,n,o)));t.selectedDay=a.getDate(),t.drawMonth=t.selectedMonth=a.getMonth(),t.drawYear=t.selectedYear=a.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),s=this._getMinMaxDate(t,"max"),n=i&&i>e?i:e;return s&&n>s?s:n},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){var e=this._get(t,"numberOfMonths");return null==e?[1,1]:"number"==typeof e?[1,e]:e},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,i,s){var n=this._getNumberOfMonths(t),o=this._daylightSavingAdjust(new Date(i,s+(0>e?e:n[0]*n[1]),1));return 0>e&&o.setDate(this._getDaysInMonth(o.getFullYear(),o.getMonth())),this._isInRange(t,o)},_isInRange:function(t,e){var i,s,n=this._getMinMaxDate(t,"min"),o=this._getMinMaxDate(t,"max"),a=null,r=null,h=this._get(t,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),a=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(a+=s),i[1].match(/[+\-].*/)&&(r+=s)),(!n||e.getTime()>=n.getTime())&&(!o||e.getTime()<=o.getTime())&&(!a||e.getFullYear()>=a)&&(!r||r>=e.getFullYear())},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),{shortYearCutoff:e,dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,s){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);var n=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(s,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),n,this._getFormatConfig(t))}}),t.fn.datepicker=function(e){if(!this.length)return this;t.datepicker.initialized||(t(document).on("mousedown",t.datepicker._checkExternalClick),t.datepicker.initialized=!0),0===t("#"+t.datepicker._mainDivId).length&&t("body").append(t.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof e||"isDisabled"!==e&&"getDate"!==e&&"widget"!==e?"option"===e&&2===arguments.length&&"string"==typeof arguments[1]?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof e?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this].concat(i)):t.datepicker._attachDatepicker(this,e)}):t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i))},t.datepicker=new s,t.datepicker.initialized=!1,t.datepicker.uuid=(new Date).getTime(),t.datepicker.version="1.12.1",t.datepicker,t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var _=!1;t(document).on("mouseup",function(){_=!1}),t.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){if(!_){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e;var i=this,s=1===e.which,n="string"==typeof this.options.cancel&&e.target.nodeName?t(e.target).closest(this.options.cancel).length:!1;return s&&!n&&this._mouseCapture(e)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(e)!==!1,!this._mouseStarted)?(e.preventDefault(),!0):(!0===t.data(e.target,this.widgetName+".preventClickEvent")&&t.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return i._mouseMove(t)},this._mouseUpDelegate=function(t){return i._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),_=!0,!0)):!0}},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button)return this._mouseUp(e);if(!e.which)if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,_=!1,e.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),t.ui.plugin={add:function(e,i,s){var n,o=t.ui[e].prototype;for(n in s)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([i,s[n]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;o.length>n;n++)t.options[o[n][0]]&&o[n][1].apply(t.element,i)}},t.ui.safeBlur=function(e){e&&"body"!==e.nodeName.toLowerCase()&&t(e).trigger("blur")},t.widget("ui.draggable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(t,e){this._super(t,e),"handle"===t&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(e){var i=this.options;return this.helper||i.disabled||t(e.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(e),this.handle?(this._blurActiveElement(e),this._blockFrames(i.iframeFix===!0?"iframe":i.iframeFix),!0):!1)},_blockFrames:function(e){this.iframeBlocks=this.document.find(e).map(function(){var e=t(this);return t("<div>").css("position","absolute").appendTo(e.parent()).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(e){var i=t.ui.safeActiveElement(this.document[0]),s=t(e.target);s.closest(i).length||t.ui.safeBlur(i)},_mouseStart:function(e){var i=this.options;return this.helper=this._createHelper(e),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===t(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(e),this.originalPosition=this.position=this._generatePosition(e,!1),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",e)===!1?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(e,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",e,s)===!1)return this._mouseUp(new t.Event("mouseup",e)),!1;this.position=s.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var i=this,s=!1;return t.ui.ddmanager&&!this.options.dropBehaviour&&(s=t.ui.ddmanager.drop(this,e)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",e)!==!1&&i._clear()}):this._trigger("stop",e)!==!1&&this._clear(),!1},_mouseUp:function(e){return this._unblockFrames(),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),this.handleElement.is(e.target)&&this.element.trigger("focus"),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new t.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(e){return this.options.handle?!!t(e.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper),n=s?t(i.helper.apply(this.element[0],[e])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s&&n[0]===this.element[0]&&this._setPositionRelative(),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var e=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(e?0:this.scrollParent.scrollTop()),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(e?0:this.scrollParent.scrollLeft())} -},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options,o=this.document[0];return this.relativeContainer=null,n.containment?"window"===n.containment?(this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===n.containment?(this.containment=[0,0,t(o).width()-this.helperProportions.width-this.margins.left,(t(o).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):n.containment.constructor===Array?(this.containment=n.containment,void 0):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=t(n.containment),s=i[0],s&&(e=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(e?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i),void 0):(this.containment=null,void 0)},_convertPositionTo:function(t,e){e||(e=this.position);var i="absolute"===t?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(t,e){var i,s,n,o,a=this.options,r=this._isRootNode(this.scrollParent[0]),h=t.pageX,l=t.pageY;return r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),e&&(this.containment&&(this.relativeContainer?(s=this.relativeContainer.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,t.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),t.pageY-this.offset.click.top<i[1]&&(l=i[1]+this.offset.click.top),t.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),a.grid&&(n=a.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/a.grid[1])*a.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-a.grid[1]:n+a.grid[1]:n,o=a.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/a.grid[0])*a.grid[0]:this.originalPageX,h=i?o-this.offset.click.left>=i[0]||o-this.offset.click.left>i[2]?o:o-this.offset.click.left>=i[0]?o-a.grid[0]:o+a.grid[0]:o),"y"===a.axis&&(h=this.originalPageX),"x"===a.axis&&(l=this.originalPageY)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(e,i,s){return s=s||this._uiHash(),t.ui.plugin.call(this,e,[i,s,this],!0),/^(drag|start|stop)/.test(e)&&(this.positionAbs=this._convertPositionTo("absolute"),s.offset=this.positionAbs),t.Widget.prototype._trigger.call(this,e,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i,s){var n=t.extend({},i,{item:s.element});s.sortables=[],t(s.options.connectToSortable).each(function(){var i=t(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push(i),i.refreshPositions(),i._trigger("activate",e,n))})},stop:function(e,i,s){var n=t.extend({},i,{item:s.element});s.cancelHelperRemoval=!1,t.each(s.sortables,function(){var t=this;t.isOver?(t.isOver=0,s.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,n))})},drag:function(e,i,s){t.each(s.sortables,function(){var n=!1,o=this;o.positionAbs=s.positionAbs,o.helperProportions=s.helperProportions,o.offset.click=s.offset.click,o._intersectsWith(o.containerCache)&&(n=!0,t.each(s.sortables,function(){return this.positionAbs=s.positionAbs,this.helperProportions=s.helperProportions,this.offset.click=s.offset.click,this!==o&&this._intersectsWith(this.containerCache)&&t.contains(o.element[0],this.element[0])&&(n=!1),n})),n?(o.isOver||(o.isOver=1,s._parent=i.helper.parent(),o.currentItem=i.helper.appendTo(o.element).data("ui-sortable-item",!0),o.options._helper=o.options.helper,o.options.helper=function(){return i.helper[0]},e.target=o.currentItem[0],o._mouseCapture(e,!0),o._mouseStart(e,!0,!0),o.offset.click.top=s.offset.click.top,o.offset.click.left=s.offset.click.left,o.offset.parent.left-=s.offset.parent.left-o.offset.parent.left,o.offset.parent.top-=s.offset.parent.top-o.offset.parent.top,s._trigger("toSortable",e),s.dropped=o.element,t.each(s.sortables,function(){this.refreshPositions()}),s.currentItem=s.element,o.fromOutside=s),o.currentItem&&(o._mouseDrag(e),i.position=o.position)):o.isOver&&(o.isOver=0,o.cancelHelperRemoval=!0,o.options._revert=o.options.revert,o.options.revert=!1,o._trigger("out",e,o._uiHash(o)),o._mouseStop(e,!0),o.options.revert=o.options._revert,o.options.helper=o.options._helper,o.placeholder&&o.placeholder.remove(),i.helper.appendTo(s._parent),s._refreshOffsets(e),i.position=s._generatePosition(e,!0),s._trigger("fromSortable",e),s.dropped=!1,t.each(s.sortables,function(){this.refreshPositions()}))})}}),t.ui.plugin.add("draggable","cursor",{start:function(e,i,s){var n=t("body"),o=s.options;n.css("cursor")&&(o._cursor=n.css("cursor")),n.css("cursor",o.cursor)},stop:function(e,i,s){var n=s.options;n._cursor&&t("body").css("cursor",n._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,i,s){var n=t(i.helper),o=s.options;n.css("opacity")&&(o._opacity=n.css("opacity")),n.css("opacity",o.opacity)},stop:function(e,i,s){var n=s.options;n._opacity&&t(i.helper).css("opacity",n._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(t,e,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(e,i,s){var n=s.options,o=!1,a=s.scrollParentNotHidden[0],r=s.document[0];a!==r&&"HTML"!==a.tagName?(n.axis&&"x"===n.axis||(s.overflowOffset.top+a.offsetHeight-e.pageY<n.scrollSensitivity?a.scrollTop=o=a.scrollTop+n.scrollSpeed:e.pageY-s.overflowOffset.top<n.scrollSensitivity&&(a.scrollTop=o=a.scrollTop-n.scrollSpeed)),n.axis&&"y"===n.axis||(s.overflowOffset.left+a.offsetWidth-e.pageX<n.scrollSensitivity?a.scrollLeft=o=a.scrollLeft+n.scrollSpeed:e.pageX-s.overflowOffset.left<n.scrollSensitivity&&(a.scrollLeft=o=a.scrollLeft-n.scrollSpeed))):(n.axis&&"x"===n.axis||(e.pageY-t(r).scrollTop()<n.scrollSensitivity?o=t(r).scrollTop(t(r).scrollTop()-n.scrollSpeed):t(window).height()-(e.pageY-t(r).scrollTop())<n.scrollSensitivity&&(o=t(r).scrollTop(t(r).scrollTop()+n.scrollSpeed))),n.axis&&"y"===n.axis||(e.pageX-t(r).scrollLeft()<n.scrollSensitivity?o=t(r).scrollLeft(t(r).scrollLeft()-n.scrollSpeed):t(window).width()-(e.pageX-t(r).scrollLeft())<n.scrollSensitivity&&(o=t(r).scrollLeft(t(r).scrollLeft()+n.scrollSpeed)))),o!==!1&&t.ui.ddmanager&&!n.dropBehaviour&&t.ui.ddmanager.prepareOffsets(s,e)}}),t.ui.plugin.add("draggable","snap",{start:function(e,i,s){var n=s.options;s.snapElements=[],t(n.snap.constructor!==String?n.snap.items||":data(ui-draggable)":n.snap).each(function(){var e=t(this),i=e.offset();this!==s.element[0]&&s.snapElements.push({item:this,width:e.outerWidth(),height:e.outerHeight(),top:i.top,left:i.left})})},drag:function(e,i,s){var n,o,a,r,h,l,c,u,d,p,f=s.options,g=f.snapTolerance,m=i.offset.left,_=m+s.helperProportions.width,v=i.offset.top,b=v+s.helperProportions.height;for(d=s.snapElements.length-1;d>=0;d--)h=s.snapElements[d].left-s.margins.left,l=h+s.snapElements[d].width,c=s.snapElements[d].top-s.margins.top,u=c+s.snapElements[d].height,h-g>_||m>l+g||c-g>b||v>u+g||!t.contains(s.snapElements[d].item.ownerDocument,s.snapElements[d].item)?(s.snapElements[d].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[d].item})),s.snapElements[d].snapping=!1):("inner"!==f.snapMode&&(n=g>=Math.abs(c-b),o=g>=Math.abs(u-v),a=g>=Math.abs(h-_),r=g>=Math.abs(l-m),n&&(i.position.top=s._convertPositionTo("relative",{top:c-s.helperProportions.height,left:0}).top),o&&(i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top),a&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h-s.helperProportions.width}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l}).left)),p=n||o||a||r,"outer"!==f.snapMode&&(n=g>=Math.abs(c-v),o=g>=Math.abs(u-b),a=g>=Math.abs(h-m),r=g>=Math.abs(l-_),n&&(i.position.top=s._convertPositionTo("relative",{top:c,left:0}).top),o&&(i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top),a&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left)),!s.snapElements[d].snapping&&(n||o||a||r||p)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[d].item})),s.snapElements[d].snapping=n||o||a||r||p)}}),t.ui.plugin.add("draggable","stack",{start:function(e,i,s){var n,o=s.options,a=t.makeArray(t(o.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});a.length&&(n=parseInt(t(a[0]).css("zIndex"),10)||0,t(a).each(function(e){t(this).css("zIndex",n+e)}),this.css("zIndex",n+a.length))}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,i,s){var n=t(i.helper),o=s.options;n.css("zIndex")&&(o._zIndex=n.css("zIndex")),n.css("zIndex",o.zIndex)},stop:function(e,i,s){var n=s.options;n._zIndex&&t(i.helper).css("zIndex",n._zIndex)}}),t.ui.draggable,t.widget("ui.resizable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return e[s]>0?!0:(e[s]=1,n=e[s]>0,e[s]=0,n)},_create:function(){var e,i=this.options,s=this;this._addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!i.aspectRatio,aspectRatio:i.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:i.helper||i.ghost||i.animate?i.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(t("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,e={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(e),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(e),this._proportionallyResize()),this._setupHandles(),i.autoHide&&t(this.element).on("mouseenter",function(){i.disabled||(s._removeClass("ui-resizable-autohide"),s._handles.show())}).on("mouseleave",function(){i.disabled||s.resizing||(s._addClass("ui-resizable-autohide"),s._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,i=function(e){t(e).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;default:}},_setupHandles:function(){var e,i,s,n,o,a=this.options,r=this;if(this.handles=a.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=t(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),s=this.handles.split(","),this.handles={},i=0;s.length>i;i++)e=t.trim(s[i]),n="ui-resizable-"+e,o=t("<div>"),this._addClass(o,"ui-resizable-handle "+n),o.css({zIndex:a.zIndex}),this.handles[e]=".ui-resizable-"+e,this.element.append(o);this._renderAxis=function(e){var i,s,n,o;e=e||this.element;for(i in this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=t(this.handles[i]),this._on(this.handles[i],{mousedown:r._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(s=t(this.handles[i],this.element),o=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(n,o),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){r.resizing||(this.className&&(o=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),r.axis=o&&o[1]?o[1]:"se")}),a.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(e){var i,s,n=!1;for(i in this.handles)s=t(this.handles[i])[0],(s===e.target||t.contains(s,e.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(e){var i,s,n,o=this.options,a=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),s=this._num(this.helper.css("top")),o.containment&&(i+=t(o.containment).scrollLeft()||0,s+=t(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:s},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:a.width(),height:a.height()},this.originalSize=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()},this.sizeDiff={width:a.outerWidth()-a.width(),height:a.outerHeight()-a.height()},this.originalPosition={left:i,top:s},this.originalMousePosition={left:e.pageX,top:e.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===n?this.axis+"-resize":n),this._addClass("ui-resizable-resizing"),this._propagate("start",e),!0},_mouseDrag:function(e){var i,s,n=this.originalMousePosition,o=this.axis,a=e.pageX-n.left||0,r=e.pageY-n.top||0,h=this._change[o];return this._updatePrevProperties(),h?(i=h.apply(this,[e,a,r]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",e,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(e){this.resizing=!1;var i,s,n,o,a,r,h,l=this.options,c=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&this._hasScroll(i[0],"left")?0:c.sizeDiff.height,o=s?0:c.sizeDiff.width,a={width:c.helper.width()-o,height:c.helper.height()-n},r=parseFloat(c.element.css("left"))+(c.position.left-c.originalPosition.left)||null,h=parseFloat(c.element.css("top"))+(c.position.top-c.originalPosition.top)||null,l.animate||this.element.css(t.extend(a,{top:h,left:r})),c.helper.height(c.size.height),c.helper.width(c.size.width),this._helper&&!l.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s,n,o,a=this.options;o={minWidth:this._isNumber(a.minWidth)?a.minWidth:0,maxWidth:this._isNumber(a.maxWidth)?a.maxWidth:1/0,minHeight:this._isNumber(a.minHeight)?a.minHeight:0,maxHeight:this._isNumber(a.maxHeight)?a.maxHeight:1/0},(this._aspectRatio||t)&&(e=o.minHeight*this.aspectRatio,s=o.minWidth/this.aspectRatio,i=o.maxHeight*this.aspectRatio,n=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),s>o.minHeight&&(o.minHeight=s),o.maxWidth>i&&(o.maxWidth=i),o.maxHeight>n&&(o.maxHeight=n)),this._vBoundaries=o},_updateCache:function(t){this.offset=this.helper.offset(),this._isNumber(t.left)&&(this.position.left=t.left),this._isNumber(t.top)&&(this.position.top=t.top),this._isNumber(t.height)&&(this.size.height=t.height),this._isNumber(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,i=this.size,s=this.axis;return this._isNumber(t.height)?t.width=t.height*this.aspectRatio:this._isNumber(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===s&&(t.left=e.left+(i.width-t.width),t.top=null),"nw"===s&&(t.top=e.top+(i.height-t.height),t.left=e.left+(i.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,s=this._isNumber(t.width)&&e.maxWidth&&e.maxWidth<t.width,n=this._isNumber(t.height)&&e.maxHeight&&e.maxHeight<t.height,o=this._isNumber(t.width)&&e.minWidth&&e.minWidth>t.width,a=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,r=this.originalPosition.left+this.originalSize.width,h=this.originalPosition.top+this.originalSize.height,l=/sw|nw|w/.test(i),c=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),a&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&l&&(t.left=r-e.minWidth),s&&l&&(t.left=r-e.maxWidth),a&&c&&(t.top=h-e.minHeight),n&&c&&(t.top=h-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];4>e;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;this._proportionallyResizeElements.length>e;e++)t=this._proportionallyResizeElements[e],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(t)),t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t("<div style='overflow:hidden;'></div>"),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize,s=this.originalPosition;return{left:s.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},sw:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,s]))},ne:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},nw:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,s]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var i=t(this).resizable("instance"),s=i.options,n=i._proportionallyResizeElements,o=n.length&&/textarea/i.test(n[0].nodeName),a=o&&i._hasScroll(n[0],"left")?0:i.sizeDiff.height,r=o?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-a},l=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,c=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(h,c&&l?{top:c,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};n&&n.length&&t(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var e,i,s,n,o,a,r,h=t(this).resizable("instance"),l=h.options,c=h.element,u=l.containment,d=u instanceof t?u.get(0):/parent/.test(u)?c.parent().get(0):u;d&&(h.containerElement=t(d),/document/.test(u)||u===document?(h.containerOffset={left:0,top:0},h.containerPosition={left:0,top:0},h.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(e=t(d),i=[],t(["Top","Right","Left","Bottom"]).each(function(t,s){i[t]=h._num(e.css("padding"+s))}),h.containerOffset=e.offset(),h.containerPosition=e.position(),h.containerSize={height:e.innerHeight()-i[3],width:e.innerWidth()-i[1]},s=h.containerOffset,n=h.containerSize.height,o=h.containerSize.width,a=h._hasScroll(d,"left")?d.scrollWidth:o,r=h._hasScroll(d)?d.scrollHeight:n,h.parentData={element:d,left:s.left,top:s.top,width:a,height:r}))},resize:function(e){var i,s,n,o,a=t(this).resizable("instance"),r=a.options,h=a.containerOffset,l=a.position,c=a._aspectRatio||e.shiftKey,u={top:0,left:0},d=a.containerElement,p=!0;d[0]!==document&&/static/.test(d.css("position"))&&(u=h),l.left<(a._helper?h.left:0)&&(a.size.width=a.size.width+(a._helper?a.position.left-h.left:a.position.left-u.left),c&&(a.size.height=a.size.width/a.aspectRatio,p=!1),a.position.left=r.helper?h.left:0),l.top<(a._helper?h.top:0)&&(a.size.height=a.size.height+(a._helper?a.position.top-h.top:a.position.top),c&&(a.size.width=a.size.height*a.aspectRatio,p=!1),a.position.top=a._helper?h.top:0),n=a.containerElement.get(0)===a.element.parent().get(0),o=/relative|absolute/.test(a.containerElement.css("position")),n&&o?(a.offset.left=a.parentData.left+a.position.left,a.offset.top=a.parentData.top+a.position.top):(a.offset.left=a.element.offset().left,a.offset.top=a.element.offset().top),i=Math.abs(a.sizeDiff.width+(a._helper?a.offset.left-u.left:a.offset.left-h.left)),s=Math.abs(a.sizeDiff.height+(a._helper?a.offset.top-u.top:a.offset.top-h.top)),i+a.size.width>=a.parentData.width&&(a.size.width=a.parentData.width-i,c&&(a.size.height=a.size.width/a.aspectRatio,p=!1)),s+a.size.height>=a.parentData.height&&(a.size.height=a.parentData.height-s,c&&(a.size.width=a.size.height*a.aspectRatio,p=!1)),p||(a.position.left=a.prevPosition.left,a.position.top=a.prevPosition.top,a.size.width=a.prevSize.width,a.size.height=a.prevSize.height)},stop:function(){var e=t(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.containerPosition,o=e.containerElement,a=t(e.helper),r=a.offset(),h=a.outerWidth()-e.sizeDiff.width,l=a.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l}),e._helper&&!i.animate&&/static/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).resizable("instance"),i=e.options;t(i.alsoResize).each(function(){var e=t(this);e.data("ui-resizable-alsoresize",{width:parseFloat(e.width()),height:parseFloat(e.height()),left:parseFloat(e.css("left")),top:parseFloat(e.css("top"))})})},resize:function(e,i){var s=t(this).resizable("instance"),n=s.options,o=s.originalSize,a=s.originalPosition,r={height:s.size.height-o.height||0,width:s.size.width-o.width||0,top:s.position.top-a.top||0,left:s.position.left-a.left||0};t(n.alsoResize).each(function(){var e=t(this),s=t(this).data("ui-resizable-alsoresize"),n={},o=e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(o,function(t,e){var i=(s[e]||0)+(r[e]||0);i&&i>=0&&(n[e]=i||null)}),e.css(n)})},stop:function(){t(this).removeData("ui-resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).resizable("instance"),i=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:i.height,width:i.width,margin:0,left:0,top:0}),e._addClass(e.ghost,"ui-resizable-ghost"),t.uiBackCompat!==!1&&"string"==typeof e.options.ghost&&e.ghost.addClass(this.options.ghost),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).resizable("instance");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).resizable("instance");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e,i=t(this).resizable("instance"),s=i.options,n=i.size,o=i.originalSize,a=i.originalPosition,r=i.axis,h="number"==typeof s.grid?[s.grid,s.grid]:s.grid,l=h[0]||1,c=h[1]||1,u=Math.round((n.width-o.width)/l)*l,d=Math.round((n.height-o.height)/c)*c,p=o.width+u,f=o.height+d,g=s.maxWidth&&p>s.maxWidth,m=s.maxHeight&&f>s.maxHeight,_=s.minWidth&&s.minWidth>p,v=s.minHeight&&s.minHeight>f;s.grid=h,_&&(p+=l),v&&(f+=c),g&&(p-=l),m&&(f-=c),/^(se|s|e)$/.test(r)?(i.size.width=p,i.size.height=f):/^(ne)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.top=a.top-d):/^(sw)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.left=a.left-u):((0>=f-c||0>=p-l)&&(e=i._getPaddingPlusBorderDimensions(this)),f-c>0?(i.size.height=f,i.position.top=a.top-d):(f=c-e.height,i.size.height=f,i.position.top=a.top+o.height-f),p-l>0?(i.size.width=p,i.position.left=a.left-u):(p=l-e.width,i.size.width=p,i.position.left=a.left+o.width-p))}}),t.ui.resizable,t.widget("ui.dialog",{version:"1.12.1",options:{appendTo:"body",autoOpen:!0,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:!0,closeText:"Close",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(e){var i=t(this).css(e).offset().top;0>i&&t(this).css("top",e.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),null==this.options.title&&null!=this.originalTitle&&(this.options.title=this.originalTitle),this.options.disabled&&(this.options.disabled=!1),this._createWrapper(),this.element.show().removeAttr("title").appendTo(this.uiDialog),this._addClass("ui-dialog-content","ui-widget-content"),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&t.fn.draggable&&this._makeDraggable(),this.options.resizable&&t.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var e=this.options.appendTo;return e&&(e.jquery||e.nodeType)?t(e):this.document.find(e||"body").eq(0)},_destroy:function(){var t,e=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().css(this.originalCss).detach(),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),t=e.parent.children().eq(e.index),t.length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog -},disable:t.noop,enable:t.noop,close:function(e){var i=this;this._isOpen&&this._trigger("beforeClose",e)!==!1&&(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),this.opener.filter(":focusable").trigger("focus").length||t.ui.safeBlur(t.ui.safeActiveElement(this.document[0])),this._hide(this.uiDialog,this.options.hide,function(){i._trigger("close",e)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(e,i){var s=!1,n=this.uiDialog.siblings(".ui-front:visible").map(function(){return+t(this).css("z-index")}).get(),o=Math.max.apply(null,n);return o>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",o+1),s=!0),s&&!i&&this._trigger("focus",e),s},open:function(){var e=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),void 0):(this._isOpen=!0,this.opener=t(t.ui.safeActiveElement(this.document[0])),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){e._focusTabbable(),e._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"),void 0)},_focusTabbable:function(){var t=this._focusedElement;t||(t=this.element.find("[autofocus]")),t.length||(t=this.element.find(":tabbable")),t.length||(t=this.uiDialogButtonPane.find(":tabbable")),t.length||(t=this.uiDialogTitlebarClose.filter(":tabbable")),t.length||(t=this.uiDialog),t.eq(0).trigger("focus")},_keepFocus:function(e){function i(){var e=t.ui.safeActiveElement(this.document[0]),i=this.uiDialog[0]===e||t.contains(this.uiDialog[0],e);i||this._focusTabbable()}e.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=t("<div>").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front"),this._on(this.uiDialog,{keydown:function(e){if(this.options.closeOnEscape&&!e.isDefaultPrevented()&&e.keyCode&&e.keyCode===t.ui.keyCode.ESCAPE)return e.preventDefault(),this.close(e),void 0;if(e.keyCode===t.ui.keyCode.TAB&&!e.isDefaultPrevented()){var i=this.uiDialog.find(":tabbable"),s=i.filter(":first"),n=i.filter(":last");e.target!==n[0]&&e.target!==this.uiDialog[0]||e.shiftKey?e.target!==s[0]&&e.target!==this.uiDialog[0]||!e.shiftKey||(this._delay(function(){n.trigger("focus")}),e.preventDefault()):(this._delay(function(){s.trigger("focus")}),e.preventDefault())}},mousedown:function(t){this._moveToTop(t)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var e;this.uiDialogTitlebar=t("<div>"),this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix"),this._on(this.uiDialogTitlebar,{mousedown:function(e){t(e.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.trigger("focus")}}),this.uiDialogTitlebarClose=t("<button type='button'></button>").button({label:t("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar),this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close"),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}}),e=t("<span>").uniqueId().prependTo(this.uiDialogTitlebar),this._addClass(e,"ui-dialog-title"),this._title(e),this.uiDialogTitlebar.prependTo(this.uiDialog),this.uiDialog.attr({"aria-labelledby":e.attr("id")})},_title:function(t){this.options.title?t.text(this.options.title):t.html(" ")},_createButtonPane:function(){this.uiDialogButtonPane=t("<div>"),this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix"),this.uiButtonSet=t("<div>").appendTo(this.uiDialogButtonPane),this._addClass(this.uiButtonSet,"ui-dialog-buttonset"),this._createButtons()},_createButtons:function(){var e=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),t.isEmptyObject(i)||t.isArray(i)&&!i.length?(this._removeClass(this.uiDialog,"ui-dialog-buttons"),void 0):(t.each(i,function(i,s){var n,o;s=t.isFunction(s)?{click:s,text:i}:s,s=t.extend({type:"button"},s),n=s.click,o={icon:s.icon,iconPosition:s.iconPosition,showLabel:s.showLabel,icons:s.icons,text:s.text},delete s.click,delete s.icon,delete s.iconPosition,delete s.showLabel,delete s.icons,"boolean"==typeof s.text&&delete s.text,t("<button></button>",s).button(o).appendTo(e.uiButtonSet).on("click",function(){n.apply(e.element[0],arguments)})}),this._addClass(this.uiDialog,"ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),void 0)},_makeDraggable:function(){function e(t){return{position:t.position,offset:t.offset}}var i=this,s=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,n){i._addClass(t(this),"ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",s,e(n))},drag:function(t,s){i._trigger("drag",t,e(s))},stop:function(n,o){var a=o.offset.left-i.document.scrollLeft(),r=o.offset.top-i.document.scrollTop();s.position={my:"left top",at:"left"+(a>=0?"+":"")+a+" "+"top"+(r>=0?"+":"")+r,of:i.window},i._removeClass(t(this),"ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",n,e(o))}})},_makeResizable:function(){function e(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}var i=this,s=this.options,n=s.resizable,o=this.uiDialog.css("position"),a="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:s.maxWidth,maxHeight:s.maxHeight,minWidth:s.minWidth,minHeight:this._minHeight(),handles:a,start:function(s,n){i._addClass(t(this),"ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",s,e(n))},resize:function(t,s){i._trigger("resize",t,e(s))},stop:function(n,o){var a=i.uiDialog.offset(),r=a.left-i.document.scrollLeft(),h=a.top-i.document.scrollTop();s.height=i.uiDialog.height(),s.width=i.uiDialog.width(),s.position={my:"left top",at:"left"+(r>=0?"+":"")+r+" "+"top"+(h>=0?"+":"")+h,of:i.window},i._removeClass(t(this),"ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",n,e(o))}}).css("position",o)},_trackFocus:function(){this._on(this.widget(),{focusin:function(e){this._makeFocusTarget(),this._focusedElement=t(e.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var e=this._trackingInstances(),i=t.inArray(this,e);-1!==i&&e.splice(i,1)},_trackingInstances:function(){var t=this.document.data("ui-dialog-instances");return t||(t=[],this.document.data("ui-dialog-instances",t)),t},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(e){var i=this,s=!1,n={};t.each(e,function(t,e){i._setOption(t,e),t in i.sizeRelatedOptions&&(s=!0),t in i.resizableRelatedOptions&&(n[t]=e)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",n)},_setOption:function(e,i){var s,n,o=this.uiDialog;"disabled"!==e&&(this._super(e,i),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:t("<a>").text(""+this.options.closeText).html()}),"draggable"===e&&(s=o.is(":data(ui-draggable)"),s&&!i&&o.draggable("destroy"),!s&&i&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&(n=o.is(":data(ui-resizable)"),n&&!i&&o.resizable("destroy"),n&&"string"==typeof i&&o.resizable("option","handles",i),n||i===!1||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var t,e,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),t=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),e=Math.max(0,s.minHeight-t),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-t):"none","auto"===s.height?this.element.css({minHeight:e,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var e=t(this);return t("<div>").css({position:"absolute",width:e.outerWidth(),height:e.outerHeight()}).appendTo(e.parent()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(e){return t(e.target).closest(".ui-dialog").length?!0:!!t(e.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var e=!0;this._delay(function(){e=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(t){e||this._allowInteraction(t)||(t.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=t("<div>").appendTo(this._appendTo()),this._addClass(this.overlay,null,"ui-widget-overlay ui-front"),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var t=this.document.data("ui-dialog-overlays")-1;t?this.document.data("ui-dialog-overlays",t):(this._off(this.document,"focusin"),this.document.removeData("ui-dialog-overlays")),this.overlay.remove(),this.overlay=null}}}),t.uiBackCompat!==!1&&t.widget("ui.dialog",t.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super(),this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(t,e){"dialogClass"===t&&this.uiDialog.removeClass(this.options.dialogClass).addClass(e),this._superApply(arguments)}}),t.ui.dialog,t.widget("ui.droppable",{version:"1.12.1",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var e,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=t.isFunction(s)?s:function(t){return t.is(s)},this.proportions=function(){return arguments.length?(e=arguments[0],void 0):e?e:e={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},this._addToManager(i.scope),i.addClasses&&this._addClass("ui-droppable")},_addToManager:function(e){t.ui.ddmanager.droppables[e]=t.ui.ddmanager.droppables[e]||[],t.ui.ddmanager.droppables[e].push(this)},_splice:function(t){for(var e=0;t.length>e;e++)t[e]===this&&t.splice(e,1)},_destroy:function(){var e=t.ui.ddmanager.droppables[this.options.scope];this._splice(e)},_setOption:function(e,i){if("accept"===e)this.accept=t.isFunction(i)?i:function(t){return t.is(i)};else if("scope"===e){var s=t.ui.ddmanager.droppables[this.options.scope];this._splice(s),this._addToManager(i)}this._super(e,i)},_activate:function(e){var i=t.ui.ddmanager.current;this._addActiveClass(),i&&this._trigger("activate",e,this.ui(i))},_deactivate:function(e){var i=t.ui.ddmanager.current;this._removeActiveClass(),i&&this._trigger("deactivate",e,this.ui(i))},_over:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this._addHoverClass(),this._trigger("over",e,this.ui(i)))},_out:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this._removeHoverClass(),this._trigger("out",e,this.ui(i)))},_drop:function(e,i){var s=i||t.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var i=t(this).droppable("instance");return i.options.greedy&&!i.options.disabled&&i.options.scope===s.options.scope&&i.accept.call(i.element[0],s.currentItem||s.element)&&v(s,t.extend(i,{offset:i.element.offset()}),i.options.tolerance,e)?(n=!0,!1):void 0}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this._removeActiveClass(),this._removeHoverClass(),this._trigger("drop",e,this.ui(s)),this.element):!1):!1},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}});var v=t.ui.intersect=function(){function t(t,e,i){return t>=e&&e+i>t}return function(e,i,s,n){if(!i.offset)return!1;var o=(e.positionAbs||e.position.absolute).left+e.margins.left,a=(e.positionAbs||e.position.absolute).top+e.margins.top,r=o+e.helperProportions.width,h=a+e.helperProportions.height,l=i.offset.left,c=i.offset.top,u=l+i.proportions().width,d=c+i.proportions().height;switch(s){case"fit":return o>=l&&u>=r&&a>=c&&d>=h;case"intersect":return o+e.helperProportions.width/2>l&&u>r-e.helperProportions.width/2&&a+e.helperProportions.height/2>c&&d>h-e.helperProportions.height/2;case"pointer":return t(n.pageY,c,i.proportions().height)&&t(n.pageX,l,i.proportions().width);case"touch":return(a>=c&&d>=a||h>=c&&d>=h||c>a&&h>d)&&(o>=l&&u>=o||r>=l&&u>=r||l>o&&r>u);default:return!1}}}();t.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,i){var s,n,o=t.ui.ddmanager.droppables[e.options.scope]||[],a=i?i.type:null,r=(e.currentItem||e.element).find(":data(ui-droppable)").addBack();t:for(s=0;o.length>s;s++)if(!(o[s].options.disabled||e&&!o[s].accept.call(o[s].element[0],e.currentItem||e.element))){for(n=0;r.length>n;n++)if(r[n]===o[s].element[0]){o[s].proportions().height=0;continue t}o[s].visible="none"!==o[s].element.css("display"),o[s].visible&&("mousedown"===a&&o[s]._activate.call(o[s],i),o[s].offset=o[s].element.offset(),o[s].proportions({width:o[s].element[0].offsetWidth,height:o[s].element[0].offsetHeight}))}},drop:function(e,i){var s=!1;return t.each((t.ui.ddmanager.droppables[e.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&v(e,this,this.options.tolerance,i)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(e,i){e.element.parentsUntil("body").on("scroll.droppable",function(){e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)})},drag:function(e,i){e.options.refreshPositions&&t.ui.ddmanager.prepareOffsets(e,i),t.each(t.ui.ddmanager.droppables[e.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,o,a=v(e,this,this.options.tolerance,i),r=!a&&this.isover?"isout":a&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,o=this.element.parents(":data(ui-droppable)").filter(function(){return t(this).droppable("instance").options.scope===n}),o.length&&(s=t(o[0]).droppable("instance"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(e,i){e.element.parentsUntil("body").off("scroll.droppable"),e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)}},t.uiBackCompat!==!1&&t.widget("ui.droppable",t.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super(),this.options.activeClass&&this.element.addClass(this.options.activeClass)},_removeActiveClass:function(){this._super(),this.options.activeClass&&this.element.removeClass(this.options.activeClass)},_addHoverClass:function(){this._super(),this.options.hoverClass&&this.element.addClass(this.options.hoverClass)},_removeHoverClass:function(){this._super(),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass)}}),t.ui.droppable,t.widget("ui.progressbar",{version:"1.12.1",options:{classes:{"ui-progressbar":"ui-corner-all","ui-progressbar-value":"ui-corner-left","ui-progressbar-complete":"ui-corner-right"},max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.attr({role:"progressbar","aria-valuemin":this.min}),this._addClass("ui-progressbar","ui-widget ui-widget-content"),this.valueDiv=t("<div>").appendTo(this.element),this._addClass(this.valueDiv,"ui-progressbar-value","ui-widget-header"),this._refreshValue()},_destroy:function(){this.element.removeAttr("role aria-valuemin aria-valuemax aria-valuenow"),this.valueDiv.remove()},value:function(t){return void 0===t?this.options.value:(this.options.value=this._constrainedValue(t),this._refreshValue(),void 0)},_constrainedValue:function(t){return void 0===t&&(t=this.options.value),this.indeterminate=t===!1,"number"!=typeof t&&(t=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var e=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||e>this.min).width(i.toFixed(0)+"%"),this._toggleClass(this.valueDiv,"ui-progressbar-complete",null,e===this.options.max)._toggleClass("ui-progressbar-indeterminate",null,this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=t("<div>").appendTo(this.valueDiv),this._addClass(this.overlayDiv,"ui-progressbar-overlay"))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":e}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),e===this.options.max&&this._trigger("complete")}}),t.widget("ui.selectable",t.ui.mouse,{version:"1.12.1",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var e=this;this._addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){e.elementPos=t(e.element[0]).offset(),e.selectees=t(e.options.filter,e.element[0]),e._addClass(e.selectees,"ui-selectee"),e.selectees.each(function(){var i=t(this),s=i.offset(),n={left:s.left-e.elementPos.left,top:s.top-e.elementPos.top};t.data(this,"selectable-item",{element:this,$element:i,left:n.left,top:n.top,right:n.left+i.outerWidth(),bottom:n.top+i.outerHeight(),startselected:!1,selected:i.hasClass("ui-selected"),selecting:i.hasClass("ui-selecting"),unselecting:i.hasClass("ui-unselecting")})})},this.refresh(),this._mouseInit(),this.helper=t("<div>"),this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){this.selectees.removeData("selectable-item"),this._mouseDestroy()},_mouseStart:function(e){var i=this,s=this.options;this.opos=[e.pageX,e.pageY],this.elementPos=t(this.element[0]).offset(),this.options.disabled||(this.selectees=t(s.filter,this.element[0]),this._trigger("start",e),t(s.appendTo).append(this.helper),this.helper.css({left:e.pageX,top:e.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=t.data(this,"selectable-item");s.startselected=!0,e.metaKey||e.ctrlKey||(i._removeClass(s.$element,"ui-selected"),s.selected=!1,i._addClass(s.$element,"ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",e,{unselecting:s.element}))}),t(e.target).parents().addBack().each(function(){var s,n=t.data(this,"selectable-item");return n?(s=!e.metaKey&&!e.ctrlKey||!n.$element.hasClass("ui-selected"),i._removeClass(n.$element,s?"ui-unselecting":"ui-selected")._addClass(n.$element,s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",e,{selecting:n.element}):i._trigger("unselecting",e,{unselecting:n.element}),!1):void 0}))},_mouseDrag:function(e){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,o=this.opos[0],a=this.opos[1],r=e.pageX,h=e.pageY;return o>r&&(i=r,r=o,o=i),a>h&&(i=h,h=a,a=i),this.helper.css({left:o,top:a,width:r-o,height:h-a}),this.selectees.each(function(){var i=t.data(this,"selectable-item"),l=!1,c={};i&&i.element!==s.element[0]&&(c.left=i.left+s.elementPos.left,c.right=i.right+s.elementPos.left,c.top=i.top+s.elementPos.top,c.bottom=i.bottom+s.elementPos.top,"touch"===n.tolerance?l=!(c.left>r||o>c.right||c.top>h||a>c.bottom):"fit"===n.tolerance&&(l=c.left>o&&r>c.right&&c.top>a&&h>c.bottom),l?(i.selected&&(s._removeClass(i.$element,"ui-selected"),i.selected=!1),i.unselecting&&(s._removeClass(i.$element,"ui-unselecting"),i.unselecting=!1),i.selecting||(s._addClass(i.$element,"ui-selecting"),i.selecting=!0,s._trigger("selecting",e,{selecting:i.element}))):(i.selecting&&((e.metaKey||e.ctrlKey)&&i.startselected?(s._removeClass(i.$element,"ui-selecting"),i.selecting=!1,s._addClass(i.$element,"ui-selected"),i.selected=!0):(s._removeClass(i.$element,"ui-selecting"),i.selecting=!1,i.startselected&&(s._addClass(i.$element,"ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",e,{unselecting:i.element}))),i.selected&&(e.metaKey||e.ctrlKey||i.startselected||(s._removeClass(i.$element,"ui-selected"),i.selected=!1,s._addClass(i.$element,"ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",e,{unselecting:i.element})))))}),!1}},_mouseStop:function(e){var i=this;return this.dragged=!1,t(".ui-unselecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");i._removeClass(s.$element,"ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",e,{unselected:s.element})}),t(".ui-selecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");i._removeClass(s.$element,"ui-selecting")._addClass(s.$element,"ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",e,{selected:s.element})}),this._trigger("stop",e),this.helper.remove(),!1}}),t.widget("ui.selectmenu",[t.ui.formResetMixin,{version:"1.12.1",defaultElement:"<select>",options:{appendTo:null,classes:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"},disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:!1,change:null,close:null,focus:null,open:null,select:null},_create:function(){var e=this.element.uniqueId().attr("id");this.ids={element:e,button:e+"-button",menu:e+"-menu"},this._drawButton(),this._drawMenu(),this._bindFormResetHandler(),this._rendered=!1,this.menuItems=t()},_drawButton:function(){var e,i=this,s=this._parseOption(this.element.find("option:selected"),this.element[0].selectedIndex);this.labels=this.element.labels().attr("for",this.ids.button),this._on(this.labels,{click:function(t){this.button.focus(),t.preventDefault()}}),this.element.hide(),this.button=t("<span>",{tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true",title:this.element.attr("title")}).insertAfter(this.element),this._addClass(this.button,"ui-selectmenu-button ui-selectmenu-button-closed","ui-button ui-widget"),e=t("<span>").appendTo(this.button),this._addClass(e,"ui-selectmenu-icon","ui-icon "+this.options.icons.button),this.buttonItem=this._renderButtonItem(s).appendTo(this.button),this.options.width!==!1&&this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){i._rendered||i._refreshMenu()})},_drawMenu:function(){var e=this;this.menu=t("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=t("<div>").append(this.menu),this._addClass(this.menuWrap,"ui-selectmenu-menu","ui-front"),this.menuWrap.appendTo(this._appendTo()),this.menuInstance=this.menu.menu({classes:{"ui-menu":"ui-corner-bottom"},role:"listbox",select:function(t,i){t.preventDefault(),e._setSelection(),e._select(i.item.data("ui-selectmenu-item"),t)},focus:function(t,i){var s=i.item.data("ui-selectmenu-item");null!=e.focusIndex&&s.index!==e.focusIndex&&(e._trigger("focus",t,{item:s}),e.isOpen||e._select(s,t)),e.focusIndex=s.index,e.button.attr("aria-activedescendant",e.menuItems.eq(s.index).attr("id"))}}).menu("instance"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(this._getSelectedItem().data("ui-selectmenu-item")||{})),null===this.options.width&&this._resizeButton()},_refreshMenu:function(){var t,e=this.element.find("option");this.menu.empty(),this._parseOptions(e),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup").find(".ui-menu-item-wrapper"),this._rendered=!0,e.length&&(t=this._getSelectedItem(),this.menuInstance.focus(null,t),this._setAria(t.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(t){this.options.disabled||(this._rendered?(this._removeClass(this.menu.find(".ui-state-active"),null,"ui-state-active"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.menuItems.length&&(this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",t)))},_position:function(){this.menuWrap.position(t.extend({of:this.button},this.options.position))},close:function(t){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",t))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderButtonItem:function(e){var i=t("<span>");return this._setText(i,e.label),this._addClass(i,"ui-selectmenu-text"),i},_renderMenu:function(e,i){var s=this,n="";t.each(i,function(i,o){var a;o.optgroup!==n&&(a=t("<li>",{text:o.optgroup}),s._addClass(a,"ui-selectmenu-optgroup","ui-menu-divider"+(o.element.parent("optgroup").prop("disabled")?" ui-state-disabled":"")),a.appendTo(e),n=o.optgroup),s._renderItemData(e,o)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-selectmenu-item",e)},_renderItem:function(e,i){var s=t("<li>"),n=t("<div>",{title:i.element.attr("title")});return i.disabled&&this._addClass(s,null,"ui-state-disabled"),this._setText(n,i.label),s.append(n).appendTo(e)},_setText:function(t,e){e?t.text(e):t.html(" ")},_move:function(t,e){var i,s,n=".ui-menu-item";this.isOpen?i=this.menuItems.eq(this.focusIndex).parent("li"):(i=this.menuItems.eq(this.element[0].selectedIndex).parent("li"),n+=":not(.ui-state-disabled)"),s="first"===t||"last"===t?i["first"===t?"prevAll":"nextAll"](n).eq(-1):i[t+"All"](n).eq(0),s.length&&this.menuInstance.focus(e,s)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex).parent("li")},_toggle:function(t){this[this.isOpen?"close":"open"](t)},_setSelection:function(){var t;this.range&&(window.getSelection?(t=window.getSelection(),t.removeAllRanges(),t.addRange(this.range)):this.range.select(),this.button.focus())},_documentClick:{mousedown:function(e){this.isOpen&&(t(e.target).closest(".ui-selectmenu-menu, #"+t.ui.escapeSelector(this.ids.button)).length||this.close(e))}},_buttonEvents:{mousedown:function(){var t;window.getSelection?(t=window.getSelection(),t.rangeCount&&(this.range=t.getRangeAt(0))):this.range=document.selection.createRange()},click:function(t){this._setSelection(),this._toggle(t)},keydown:function(e){var i=!0;switch(e.keyCode){case t.ui.keyCode.TAB:case t.ui.keyCode.ESCAPE:this.close(e),i=!1;break;case t.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(e);break;case t.ui.keyCode.UP:e.altKey?this._toggle(e):this._move("prev",e);break;case t.ui.keyCode.DOWN:e.altKey?this._toggle(e):this._move("next",e);break;case t.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(e):this._toggle(e);break;case t.ui.keyCode.LEFT:this._move("prev",e);break;case t.ui.keyCode.RIGHT:this._move("next",e);break;case t.ui.keyCode.HOME:case t.ui.keyCode.PAGE_UP:this._move("first",e);break;case t.ui.keyCode.END:case t.ui.keyCode.PAGE_DOWN:this._move("last",e);break;default:this.menu.trigger(e),i=!1}i&&e.preventDefault()}},_selectFocusedItem:function(t){var e=this.menuItems.eq(this.focusIndex).parent("li");e.hasClass("ui-state-disabled")||this._select(e.data("ui-selectmenu-item"),t)},_select:function(t,e){var i=this.element[0].selectedIndex;this.element[0].selectedIndex=t.index,this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(t)),this._setAria(t),this._trigger("select",e,{item:t}),t.index!==i&&this._trigger("change",e,{item:t}),this.close(e)},_setAria:function(t){var e=this.menuItems.eq(t.index).attr("id");this.button.attr({"aria-labelledby":e,"aria-activedescendant":e}),this.menu.attr("aria-activedescendant",e)},_setOption:function(t,e){if("icons"===t){var i=this.button.find("span.ui-icon");this._removeClass(i,null,this.options.icons.button)._addClass(i,null,e.button)}this._super(t,e),"appendTo"===t&&this.menuWrap.appendTo(this._appendTo()),"width"===t&&this._resizeButton()},_setOptionDisabled:function(t){this._super(t),this.menuInstance.option("disabled",t),this.button.attr("aria-disabled",t),this._toggleClass(this.button,null,"ui-state-disabled",t),this.element.prop("disabled",t),t?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?t(e):this.document.find(e).eq(0)),e&&e[0]||(e=this.element.closest(".ui-front, dialog")),e.length||(e=this.document[0].body),e},_toggleAttr:function(){this.button.attr("aria-expanded",this.isOpen),this._removeClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"closed":"open"))._addClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"open":"closed"))._toggleClass(this.menuWrap,"ui-selectmenu-open",null,this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var t=this.options.width;return t===!1?(this.button.css("width",""),void 0):(null===t&&(t=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(t),void 0)},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){var t=this._super();return t.disabled=this.element.prop("disabled"),t},_parseOptions:function(e){var i=this,s=[];e.each(function(e,n){s.push(i._parseOption(t(n),e))}),this.items=s},_parseOption:function(t,e){var i=t.parent("optgroup");return{element:t,index:e,value:t.val(),label:t.text(),optgroup:i.attr("label")||"",disabled:i.prop("disabled")||t.prop("disabled")}},_destroy:function(){this._unbindFormResetHandler(),this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.labels.attr("for",this.ids.element)}}]),t.widget("ui.slider",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"slide",options:{animate:!1,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all","ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this._addClass("ui-slider ui-slider-"+this.orientation,"ui-widget ui-widget-content"),this._refresh(),this._animateOff=!1 -},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,i,s=this.options,n=this.element.find(".ui-slider-handle"),o="<span tabindex='0'></span>",a=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),e=n.length;i>e;e++)a.push(o);this.handles=n.add(t(a.join("")).appendTo(this.element)),this._addClass(this.handles,"ui-slider-handle","ui-state-default"),this.handle=this.handles.eq(0),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e).attr("tabIndex",0)})},_createRange:function(){var e=this.options;e.range?(e.range===!0&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:t.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?(this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max"),this.range.css({left:"",bottom:""})):(this.range=t("<div>").appendTo(this.element),this._addClass(this.range,"ui-slider-range")),("min"===e.range||"max"===e.range)&&this._addClass(this.range,"ui-slider-range-"+e.range)):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this._mouseDestroy()},_mouseCapture:function(e){var i,s,n,o,a,r,h,l,c=this,u=this.options;return u.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var i=Math.abs(s-c.values(e));(n>i||n===i&&(e===c._lastChangedValue||c.values(e)===u.min))&&(n=i,o=t(this),a=e)}),r=this._start(e,a),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=a,this._addClass(o,null,"ui-state-active"),o.trigger("focus"),h=o.offset(),l=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:e.pageX-h.left-o.width()/2,top:e.pageY-h.top-o.height()/2-(parseInt(o.css("borderTopWidth"),10)||0)-(parseInt(o.css("borderBottomWidth"),10)||0)+(parseInt(o.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,a,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this._removeClass(this.handles,null,"ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,s,n,o;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/e,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),o=this._valueMin()+s*n,this._trimAlignValue(o)},_uiHash:function(t,e,i){var s={handle:this.handles[t],handleIndex:t,value:void 0!==e?e:this.value()};return this._hasMultipleValues()&&(s.value=void 0!==e?e:this.values(t),s.values=i||this.values()),s},_hasMultipleValues:function(){return this.options.values&&this.options.values.length},_start:function(t,e){return this._trigger("start",t,this._uiHash(e))},_slide:function(t,e,i){var s,n,o=this.value(),a=this.values();this._hasMultipleValues()&&(n=this.values(e?0:1),o=this.values(e),2===this.options.values.length&&this.options.range===!0&&(i=0===e?Math.min(n,i):Math.max(n,i)),a[e]=i),i!==o&&(s=this._trigger("slide",t,this._uiHash(e,i,a)),s!==!1&&(this._hasMultipleValues()?this.values(e,i):this.value(i)))},_stop:function(t,e){this._trigger("stop",t,this._uiHash(e))},_change:function(t,e){this._keySliding||this._mouseSliding||(this._lastChangedValue=e,this._trigger("change",t,this._uiHash(e)))},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),this._change(null,0),void 0):this._value()},values:function(e,i){var s,n,o;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),this._change(null,e),void 0;if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this._hasMultipleValues()?this._values(e):this.value();for(s=this.options.values,n=arguments[0],o=0;s.length>o;o+=1)s[o]=this._trimAlignValue(n[o]),this._change(null,o);this._refreshValue()},_setOption:function(e,i){var s,n=0;switch("range"===e&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),t.isArray(this.options.values)&&(n=this.options.values.length),this._super(e,i),e){case"orientation":this._detectOrientation(),this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-"+this.orientation),this._refreshValue(),this.options.range&&this._refreshRange(i),this.handles.css("horizontal"===i?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=n-1;s>=0;s--)this._change(null,s);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_setOptionDisabled:function(t){this._super(t),this._toggleClass(null,"ui-state-disabled",!!t)},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);if(this._hasMultipleValues()){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(t){if(this._valueMin()>=t)return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,s=t-i;return 2*Math.abs(i)>=e&&(s+=i>0?e:-e),parseFloat(s.toFixed(5))},_calculateNewMax:function(){var t=this.options.max,e=this._valueMin(),i=this.options.step,s=Math.round((t-e)/i)*i;t=s+e,t>this.options.max&&(t-=i),this.max=parseFloat(t.toFixed(this._precision()))},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(t){"vertical"===t&&this.range.css({width:"",left:""}),"horizontal"===t&&this.range.css({height:"",bottom:""})},_refreshValue:function(){var e,i,s,n,o,a=this.options.range,r=this.options,h=this,l=this._animateOff?!1:r.animate,c={};this._hasMultipleValues()?this.handles.each(function(s){i=100*((h.values(s)-h._valueMin())/(h._valueMax()-h._valueMin())),c["horizontal"===h.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[l?"animate":"css"](c,r.animate),h.options.range===!0&&("horizontal"===h.orientation?(0===s&&h.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:r.animate})):(0===s&&h.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:r.animate}))),e=i}):(s=this.value(),n=this._valueMin(),o=this._valueMax(),i=o!==n?100*((s-n)/(o-n)):0,c["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](c,r.animate),"min"===a&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},r.animate),"max"===a&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:100-i+"%"},r.animate),"min"===a&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},r.animate),"max"===a&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:100-i+"%"},r.animate))},_handleEvents:{keydown:function(e){var i,s,n,o,a=t(e.target).data("ui-slider-handle-index");switch(e.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(e.preventDefault(),!this._keySliding&&(this._keySliding=!0,this._addClass(t(e.target),null,"ui-state-active"),i=this._start(e,a),i===!1))return}switch(o=this.options.step,s=n=this._hasMultipleValues()?this.values(a):this.value(),e.keyCode){case t.ui.keyCode.HOME:n=this._valueMin();break;case t.ui.keyCode.END:n=this._valueMax();break;case t.ui.keyCode.PAGE_UP:n=this._trimAlignValue(s+(this._valueMax()-this._valueMin())/this.numPages);break;case t.ui.keyCode.PAGE_DOWN:n=this._trimAlignValue(s-(this._valueMax()-this._valueMin())/this.numPages);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(s===this._valueMax())return;n=this._trimAlignValue(s+o);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(s===this._valueMin())return;n=this._trimAlignValue(s-o)}this._slide(e,a,n)},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),this._removeClass(t(e.target),null,"ui-state-active"))}}}),t.widget("ui.sortable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,i){return t>=e&&e+i>t},_isFloating:function(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(t,e){this._super(t,e),"handle"===t&&this._setHandleClassName()},_setHandleClassName:function(){var e=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),t.each(this.items,function(){e._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(e,i){var s=null,n=!1,o=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(e),t(e.target).parents().each(function(){return t.data(this,o.widgetName+"-item")===o?(s=t(this),!1):void 0}),t.data(e.target,o.widgetName+"-item")===o&&(s=t(e.target)),s?!this.options.handle||i||(t(this.options.handle,s).find("*").addBack().each(function(){this===e.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(e,i,s){var n,o,a=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),a.containment&&this._setContainment(),a.cursor&&"auto"!==a.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",a.cursor),this.storedStylesheet=t("<style>*{ cursor: "+a.cursor+" !important; }</style>").appendTo(o)),a.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",a.opacity)),a.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",a.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,n,o,a=this.options,r=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<a.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+a.scrollSpeed:e.pageY-this.overflowOffset.top<a.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-a.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<a.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+a.scrollSpeed:e.pageX-this.overflowOffset.left<a.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-a.scrollSpeed)):(e.pageY-this.document.scrollTop()<a.scrollSensitivity?r=this.document.scrollTop(this.document.scrollTop()-a.scrollSpeed):this.window.height()-(e.pageY-this.document.scrollTop())<a.scrollSensitivity&&(r=this.document.scrollTop(this.document.scrollTop()+a.scrollSpeed)),e.pageX-this.document.scrollLeft()<a.scrollSensitivity?r=this.document.scrollLeft(this.document.scrollLeft()-a.scrollSpeed):this.window.width()-(e.pageX-this.document.scrollLeft())<a.scrollSensitivity&&(r=this.document.scrollLeft(this.document.scrollLeft()+a.scrollSpeed))),r!==!1&&t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],o=this._intersectsWithPointer(s),o&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===o?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],n):!0)){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset(),o=this.options.axis,a={};o&&"x"!==o||(a.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(a.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(a,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp(new t.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,o=t.left,a=o+t.width,r=t.top,h=r+t.height,l=this.offset.click.top,c=this.offset.click.left,u="x"===this.options.axis||s+l>r&&h>s+l,d="y"===this.options.axis||e+c>o&&a>e+c,p=u&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?p:e+this.helperProportions.width/2>o&&a>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(t){var e,i,s="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),n="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width),o=s&&n;return o?(e=this._getDragVerticalDirection(),i=this._getDragHorizontalDirection(),this.floating?"right"===i||"down"===e?2:1:e&&("down"===e?2:1)):!1},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),s=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&i||"left"===n&&!i:s&&("down"===s&&e||"up"===s&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){function i(){r.push(this)}var s,n,o,a,r=[],h=[],l=this._connectWith();if(l&&e)for(s=l.length-1;s>=0;s--)for(o=t(l[s],this.document[0]),n=o.length-1;n>=0;n--)a=t.data(o[n],this.widgetFullName),a&&a!==this&&!a.options.disabled&&h.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);for(h.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=h.length-1;s>=0;s--)h[s][0].each(i);return t(r)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,n,o,a,r,h,l,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(n=t(d[i],this.document[0]),s=n.length-1;s>=0;s--)o=t.data(n[s],this.widgetFullName),o&&o!==this&&!o.options.disabled&&(u.push([t.isFunction(o.options.items)?o.options.items.call(o.element[0],e,{item:this.currentItem}):t(o.options.items,o.element),o]),this.containers.push(o));for(i=u.length-1;i>=0;i--)for(a=u[i][1],r=u[i][0],s=0,l=r.length;l>s;s++)h=t(r[s]),h.data(this.widgetName+"-item",a),c.push({item:h,instance:a,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.floating=this.items.length?"x"===this.options.axis||this._isFloating(this.items[0].item):!1,this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,o;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item,e||(s.width=n.outerWidth(),s.height=n.outerHeight()),o=n.offset(),s.left=o.left,s.top=o.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)o=this.containers[i].element.offset(),this.containers[i].containerCache.left=o.left,this.containers[i].containerCache.top=o.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var i,s=e.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),n=t("<"+s+">",e.document[0]);return e._addClass(n,"ui-sortable-placeholder",i||e.currentItem[0].className)._removeClass(n,"ui-sortable-helper"),"tbody"===s?e._createTrPlaceholder(e.currentItem.find("tr").eq(0),t("<tr>",e.document[0]).appendTo(n)):"tr"===s?e._createTrPlaceholder(e.currentItem,n):"img"===s&&n.attr("src",e.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(t,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_createTrPlaceholder:function(e,i){var s=this;e.children().each(function(){t("<td> </td>",s.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(i)})},_contactContainers:function(e){var i,s,n,o,a,r,h,l,c,u,d=null,p=null;for(i=this.containers.length-1;i>=0;i--)if(!t.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(d&&t.contains(this.containers[i].element[0],d.element[0]))continue;d=this.containers[i],p=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",e,this._uiHash(this)),this.containers[i].containerCache.over=0);if(d)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",e,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(n=1e4,o=null,c=d.floating||this._isFloating(this.currentItem),a=c?"left":"top",r=c?"width":"height",u=c?"pageX":"pageY",s=this.items.length-1;s>=0;s--)t.contains(this.containers[p].element[0],this.items[s].item[0])&&this.items[s].item[0]!==this.currentItem[0]&&(h=this.items[s].item.offset()[a],l=!1,e[u]-h>this.items[s][r]/2&&(l=!0),n>Math.abs(e[u]-h)&&(n=Math.abs(e[u]-h),o=this.items[s],this.direction=l?"up":"down"));if(!o&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",e,this._uiHash()),this.currentContainer.containerCache.over=1),void 0;o?this._rearrange(e,o,null,!0):this._rearrange(e,null,this.containers[p].element,!0),this._trigger("change",e,this._uiHash()),this.containers[p]._trigger("change",e,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",e,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===n.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===n.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(e=t(n.containment)[0],i=t(n.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())*s}},_generatePosition:function(e){var i,s,n=this.options,o=e.pageX,a=e.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(o=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(a=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(o=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((a-this.originalPageY)/n.grid[1])*n.grid[1],a=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((o-this.originalPageX)/n.grid[0])*n.grid[0],o=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter; -this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){function i(t,e,i){return function(s){i._trigger(t,s,e._uiHash(e))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&n.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||n.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(n.push(function(t){this._trigger("remove",t,this._uiHash())}),n.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)e||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}}),t.widget("ui.spinner",{version:"1.12.1",defaultElement:"<input>",widgetEventPrefix:"spin",options:{classes:{"ui-spinner":"ui-corner-all","ui-spinner-down":"ui-corner-br","ui-spinner-up":"ui-corner-tr"},culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var e=this._super(),i=this.element;return t.each(["min","max","step"],function(t,s){var n=i.attr(s);null!=n&&n.length&&(e[s]=n)}),e},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t),void 0)},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((e>0?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(e){function i(){var e=this.element[0]===t.ui.safeActiveElement(this.document[0]);e||(this.element.trigger("focus"),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===t.ui.safeActiveElement(this.document[0])?this.previous:this.element.val(),e.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(e)!==!1&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){return t(e.currentTarget).hasClass("ui-state-active")?this._start(e)===!1?!1:(this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap("<span>").parent().append("<a></a><a></a>")},_draw:function(){this._enhance(),this._addClass(this.uiSpinner,"ui-spinner","ui-widget ui-widget-content"),this._addClass("ui-spinner-input"),this.element.attr("role","spinbutton"),this.buttons=this.uiSpinner.children("a").attr("tabIndex",-1).attr("aria-hidden",!0).button({classes:{"ui-button":""}}),this._removeClass(this.buttons,"ui-corner-all"),this._addClass(this.buttons.first(),"ui-spinner-button ui-spinner-up"),this._addClass(this.buttons.last(),"ui-spinner-button ui-spinner-down"),this.buttons.first().button({icon:this.options.icons.up,showLabel:!1}),this.buttons.last().button({icon:this.options.icons.down,showLabel:!1}),this.buttons.height()>Math.ceil(.5*this.uiSpinner.height())&&this.uiSpinner.height()>0&&this.uiSpinner.height(this.uiSpinner.height())},_keydown:function(e){var i=this.options,s=t.ui.keyCode;switch(e.keyCode){case s.UP:return this._repeat(null,1,e),!0;case s.DOWN:return this._repeat(null,-1,e),!0;case s.PAGE_UP:return this._repeat(null,i.page,e),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,e),!0}return!1},_start:function(t){return this.spinning||this._trigger("start",t)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,i)},t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&this._trigger("spin",e,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(e){var i=this.options.incremental;return i?t.isFunction(i)?i(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_adjustValue:function(t){var e,i,s=this.options;return e=null!==s.min?s.min:0,i=t-e,i=Math.round(i/s.step)*s.step,t=e+i,t=parseFloat(t.toFixed(this._precision())),null!==s.max&&t>s.max?s.max:null!==s.min&&s.min>t?s.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){var i,s,n;return"culture"===t||"numberFormat"===t?(i=this._parse(this.element.val()),this.options[t]=e,this.element.val(this._format(i)),void 0):(("max"===t||"min"===t||"step"===t)&&"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(s=this.buttons.first().find(".ui-icon"),this._removeClass(s,null,this.options.icons.up),this._addClass(s,null,e.up),n=this.buttons.last().find(".ui-icon"),this._removeClass(n,null,this.options.icons.down),this._addClass(n,null,e.down)),this._super(t,e),void 0)},_setOptionDisabled:function(t){this._super(t),this._toggleClass(this.uiSpinner,null,"ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable")},_setOptions:r(function(t){this._super(t)}),_parse:function(t){return"string"==typeof t&&""!==t&&(t=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t),""===t||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var t=this.value();return null===t?!1:t===this._adjustValue(t)},_value:function(t,e){var i;""!==t&&(i=this._parse(t),null!==i&&(e||(i=this._adjustValue(i)),t=this._format(i))),this.element.val(t),this._refresh()},_destroy:function(){this.element.prop("disabled",!1).removeAttr("autocomplete role aria-valuemin aria-valuemax aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:r(function(t){this._stepUp(t)}),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:r(function(t){this._stepDown(t)}),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:r(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:r(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){return arguments.length?(r(this._value).call(this,t),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}}),t.uiBackCompat!==!1&&t.widget("ui.spinner",t.ui.spinner,{_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml())},_uiSpinnerHtml:function(){return"<span>"},_buttonHtml:function(){return"<a></a><a></a>"}}),t.ui.spinner,t.widget("ui.tabs",{version:"1.12.1",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var t=/#.*$/;return function(e){var i,s;i=e.href.replace(t,""),s=location.href.replace(t,"");try{i=decodeURIComponent(i)}catch(n){}try{s=decodeURIComponent(s)}catch(n){}return e.hash.length>1&&i===s}}(),_create:function(){var e=this,i=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-widget-content"),this._toggleClass("ui-tabs-collapsible",null,i.collapsible),this._processTabs(),i.active=this._initialActive(),t.isArray(i.disabled)&&(i.disabled=t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):t(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var e=this.options.active,i=this.options.collapsible,s=location.hash.substring(1);return null===e&&(s&&this.tabs.each(function(i,n){return t(n).attr("aria-controls")===s?(e=i,!1):void 0}),null===e&&(e=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===e||-1===e)&&(e=this.tabs.length?0:!1)),e!==!1&&(e=this.tabs.index(this.tabs.eq(e)),-1===e&&(e=i?!1:0)),!i&&e===!1&&this.anchors.length&&(e=0),e},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(e){var i=t(t.ui.safeActiveElement(this.document[0])).closest("li"),s=this.tabs.index(i),n=!0;if(!this._handlePageNav(e)){switch(e.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:s++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:n=!1,s--;break;case t.ui.keyCode.END:s=this.anchors.length-1;break;case t.ui.keyCode.HOME:s=0;break;case t.ui.keyCode.SPACE:return e.preventDefault(),clearTimeout(this.activating),this._activate(s),void 0;case t.ui.keyCode.ENTER:return e.preventDefault(),clearTimeout(this.activating),this._activate(s===this.options.active?!1:s),void 0;default:return}e.preventDefault(),clearTimeout(this.activating),s=this._focusNextTab(s,n),e.ctrlKey||e.metaKey||(i.attr("aria-selected","false"),this.tabs.eq(s).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",s)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.trigger("focus"))},_handlePageNav:function(e){return e.altKey&&e.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):e.altKey&&e.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(e,i){function s(){return e>n&&(e=0),0>e&&(e=n),e}for(var n=this.tabs.length-1;-1!==t.inArray(s(),this.options.disabled);)e=i?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).trigger("focus"),t},_setOption:function(t,e){return"active"===t?(this._activate(e),void 0):(this._super(t,e),"collapsible"===t&&(this._toggleClass("ui-tabs-collapsible",null,e),e||this.options.active!==!1||this._activate(0)),"event"===t&&this._setupEvents(e),"heightStyle"===t&&this._setupHeightStyle(e),void 0)},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,i=this.tablist.children(":has(a[href])");e.disabled=t.map(i.filter(".ui-state-disabled"),function(t){return i.index(t)}),this._processTabs(),e.active!==!1&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t()),this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass(this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this,i=this.tabs,s=this.anchors,n=this.panels;this.tablist=this._getList().attr("role","tablist"),this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("mousedown"+this.eventNamespace,"> li",function(e){t(this).is(".ui-state-disabled")&&e.preventDefault()}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass(this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map(function(){return t("a",this)[0]}).attr({role:"presentation",tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=t(),this.anchors.each(function(i,s){var n,o,a,r=t(s).uniqueId().attr("id"),h=t(s).closest("li"),l=h.attr("aria-controls");e._isLocal(s)?(n=s.hash,a=n.substring(1),o=e.element.find(e._sanitizeSelector(n))):(a=h.attr("aria-controls")||t({}).uniqueId()[0].id,n="#"+a,o=e.element.find(n),o.length||(o=e._createPanel(a),o.insertAfter(e.panels[i-1]||e.tablist)),o.attr("aria-live","polite")),o.length&&(e.panels=e.panels.add(o)),l&&h.data("ui-tabs-aria-controls",l),h.attr({"aria-controls":a,"aria-labelledby":r}),o.attr("aria-labelledby",r)}),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),i&&(this._off(i.not(this.tabs)),this._off(s.not(this.anchors)),this._off(n.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(e){return t("<div>").attr("id",e).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(e){var i,s,n;for(t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1),n=0;s=this.tabs[n];n++)i=t(s),e===!0||-1!==t.inArray(n,e)?(i.attr("aria-disabled","true"),this._addClass(i,null,"ui-state-disabled")):(i.removeAttr("aria-disabled"),this._removeClass(i,null,"ui-state-disabled"));this.options.disabled=e,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,e===!0)},_setupEvents:function(e){var i={};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(t){t.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var i,s=this.element.parent();"fill"===e?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.panels.each(function(){i=Math.max(i,t(this).height("").height())}).height(i))},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),o=n.closest("li"),a=o[0]===s[0],r=a&&i.collapsible,h=r?t():this._getPanelForTab(o),l=s.length?this._getPanelForTab(s):t(),c={oldTab:s,oldPanel:l,newTab:r?t():o,newPanel:h};e.preventDefault(),o.hasClass("ui-state-disabled")||o.hasClass("ui-tabs-loading")||this.running||a&&!i.collapsible||this._trigger("beforeActivate",e,c)===!1||(i.active=r?!1:this.tabs.index(o),this.active=a?t():o,this.xhr&&this.xhr.abort(),l.length||h.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(o),e),this._toggle(e,c))},_toggle:function(e,i){function s(){o.running=!1,o._trigger("activate",e,i)}function n(){o._addClass(i.newTab.closest("li"),"ui-tabs-active","ui-state-active"),a.length&&o.options.show?o._show(a,o.options.show,s):(a.show(),s())}var o=this,a=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){o._removeClass(i.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),n()}):(this._removeClass(i.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),r.hide(),n()),r.attr("aria-hidden","true"),i.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),a.length&&r.length?i.oldTab.attr("tabIndex",-1):a.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),a.attr("aria-hidden","false"),i.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(e){var i,s=this._findActive(e);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return e===!1?t():this.tabs.eq(e)},_getIndex:function(e){return"string"==typeof e&&(e=this.anchors.index(this.anchors.filter("[href$='"+t.ui.escapeSelector(e)+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}),this.tabs.each(function(){var e=t(this),i=e.data("ui-tabs-aria-controls");i?e.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(e){var i=this.options.disabled;i!==!1&&(void 0===e?i=!1:(e=this._getIndex(e),i=t.isArray(i)?t.map(i,function(t){return t!==e?t:null}):t.map(this.tabs,function(t,i){return i!==e?i:null})),this._setOptionDisabled(i))},disable:function(e){var i=this.options.disabled;if(i!==!0){if(void 0===e)i=!0;else{if(e=this._getIndex(e),-1!==t.inArray(e,i))return;i=t.isArray(i)?t.merge([e],i).sort():[e]}this._setOptionDisabled(i)}},load:function(e,i){e=this._getIndex(e);var s=this,n=this.tabs.eq(e),o=n.find(".ui-tabs-anchor"),a=this._getPanelForTab(n),r={tab:n,panel:a},h=function(t,e){"abort"===e&&s.panels.stop(!1,!0),s._removeClass(n,"ui-tabs-loading"),a.removeAttr("aria-busy"),t===s.xhr&&delete s.xhr};this._isLocal(o[0])||(this.xhr=t.ajax(this._ajaxSettings(o,i,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(this._addClass(n,"ui-tabs-loading"),a.attr("aria-busy","true"),this.xhr.done(function(t,e,n){setTimeout(function(){a.html(t),s._trigger("load",i,r),h(n,e)},1)}).fail(function(t,e){setTimeout(function(){h(t,e)},1)})))},_ajaxSettings:function(e,i,s){var n=this;return{url:e.attr("href").replace(/#.*$/,""),beforeSend:function(e,o){return n._trigger("beforeLoad",i,t.extend({jqXHR:e,ajaxSettings:o},s))}}},_getPanelForTab:function(e){var i=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}}),t.uiBackCompat!==!1&&t.widget("ui.tabs",t.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}}),t.ui.tabs,t.widget("ui.tooltip",{version:"1.12.1",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var e=t(this).attr("title")||"";return t("<a>").text(e).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,track:!1,close:null,open:null},_addDescribedBy:function(e,i){var s=(e.attr("aria-describedby")||"").split(/\s+/);s.push(i),e.data("ui-tooltip-id",i).attr("aria-describedby",t.trim(s.join(" ")))},_removeDescribedBy:function(e){var i=e.data("ui-tooltip-id"),s=(e.attr("aria-describedby")||"").split(/\s+/),n=t.inArray(i,s);-1!==n&&s.splice(n,1),e.removeData("ui-tooltip-id"),s=t.trim(s.join(" ")),s?e.attr("aria-describedby",s):e.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.liveRegion=t("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this.disabledTitles=t([])},_setOption:function(e,i){var s=this;this._super(e,i),"content"===e&&t.each(this.tooltips,function(t,e){s._updateContent(e.element)})},_setOptionDisabled:function(t){this[t?"_disable":"_enable"]()},_disable:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s.element[0],e.close(n,!0)}),this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var e=t(this);return e.is("[title]")?e.data("ui-tooltip-title",e.attr("title")).removeAttr("title"):void 0}))},_enable:function(){this.disabledTitles.each(function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))}),this.disabledTitles=t([])},open:function(e){var i=this,s=t(e?e.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&s.parents().each(function(){var e,s=t(this);s.data("ui-tooltip-open")&&(e=t.Event("blur"),e.target=e.currentTarget=this,i.close(e,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._registerCloseHandlers(e,s),this._updateContent(s,e))},_updateContent:function(t,e){var i,s=this.options.content,n=this,o=e?e.type:null;return"string"==typeof s||s.nodeType||s.jquery?this._open(e,t,s):(i=s.call(t[0],function(i){n._delay(function(){t.data("ui-tooltip-open")&&(e&&(e.type=o),this._open(e,t,i))})}),i&&this._open(e,t,i),void 0)},_open:function(e,i,s){function n(t){l.of=t,a.is(":hidden")||a.position(l)}var o,a,r,h,l=t.extend({},this.options.position);if(s){if(o=this._find(i))return o.tooltip.find(".ui-tooltip-content").html(s),void 0;i.is("[title]")&&(e&&"mouseover"===e.type?i.attr("title",""):i.removeAttr("title")),o=this._tooltip(i),a=o.tooltip,this._addDescribedBy(i,a.attr("id")),a.find(".ui-tooltip-content").html(s),this.liveRegion.children().hide(),h=t("<div>").html(a.find(".ui-tooltip-content").html()),h.removeAttr("name").find("[name]").removeAttr("name"),h.removeAttr("id").find("[id]").removeAttr("id"),h.appendTo(this.liveRegion),this.options.track&&e&&/^mouse/.test(e.type)?(this._on(this.document,{mousemove:n}),n(e)):a.position(t.extend({of:i},this.options.position)),a.hide(),this._show(a,this.options.show),this.options.track&&this.options.show&&this.options.show.delay&&(r=this.delayedShow=setInterval(function(){a.is(":visible")&&(n(l.of),clearInterval(r))},t.fx.interval)),this._trigger("open",e,{tooltip:a})}},_registerCloseHandlers:function(e,i){var s={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var s=t.Event(e);s.currentTarget=i[0],this.close(s,!0)}}};i[0]!==this.element[0]&&(s.remove=function(){this._removeTooltip(this._find(i).tooltip)}),e&&"mouseover"!==e.type||(s.mouseleave="close"),e&&"focusin"!==e.type||(s.focusout="close"),this._on(!0,i,s)},close:function(e){var i,s=this,n=t(e?e.currentTarget:this.element),o=this._find(n);return o?(i=o.tooltip,o.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&!n.attr("title")&&n.attr("title",n.data("ui-tooltip-title")),this._removeDescribedBy(n),o.hiding=!0,i.stop(!0),this._hide(i,this.options.hide,function(){s._removeTooltip(t(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,i){t(i.element).attr("title",i.title),delete s.parents[e]}),o.closing=!0,this._trigger("close",e,{tooltip:i}),o.hiding||(o.closing=!1)),void 0):(n.removeData("ui-tooltip-open"),void 0)},_tooltip:function(e){var i=t("<div>").attr("role","tooltip"),s=t("<div>").appendTo(i),n=i.uniqueId().attr("id");return this._addClass(s,"ui-tooltip-content"),this._addClass(i,"ui-tooltip","ui-widget ui-widget-content"),i.appendTo(this._appendTo(e)),this.tooltips[n]={element:e,tooltip:i}},_find:function(t){var e=t.data("ui-tooltip-id");return e?this.tooltips[e]:null},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_appendTo:function(t){var e=t.closest(".ui-front, dialog");return e.length||(e=this.document[0].body),e},_destroy:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur"),o=s.element;n.target=n.currentTarget=o[0],e.close(n,!0),t("#"+i).remove(),o.data("ui-tooltip-title")&&(o.attr("title")||o.attr("title",o.data("ui-tooltip-title")),o.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}}),t.uiBackCompat!==!1&&t.widget("ui.tooltip",t.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var t=this._superApply(arguments);return this.options.tooltipClass&&t.tooltip.addClass(this.options.tooltipClass),t}}),t.ui.tooltip}); -}).call(window, window); \ No newline at end of file + /*! jQuery UI - v1.12.1 - 2016-09-14 + * http://jqueryui.com + * Includes: widget.js, position.js, data.js, disable-selection.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js, focusable.js, form-reset-mixin.js, jquery-1-7.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/draggable.js, widgets/droppable.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/resizable.js, widgets/selectable.js, widgets/selectmenu.js, widgets/slider.js, widgets/sortable.js, widgets/spinner.js, widgets/tabs.js, widgets/tooltip.js + * Copyright jQuery Foundation and other contributors; Licensed MIT */ + + (function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)})(function(t){function e(t){for(var e=t.css("visibility");"inherit"===e;)t=t.parent(),e=t.css("visibility");return"hidden"!==e}function i(t){for(var e,i;t.length&&t[0]!==document;){if(e=t.css("position"),("absolute"===e||"relative"===e||"fixed"===e)&&(i=parseInt(t.css("zIndex"),10),!isNaN(i)&&0!==i))return i;t=t.parent()}return 0}function s(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[""]),this.regional.en=t.extend(!0,{},this.regional[""]),this.regional["en-US"]=t.extend(!0,{},this.regional.en),this.dpDiv=n(t("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function n(e){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.on("mouseout",i,function(){t(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).removeClass("ui-datepicker-next-hover")}).on("mouseover",i,o)}function o(){t.datepicker._isDisabledDatepicker(m.inline?m.dpDiv.parent()[0]:m.input[0])||(t(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),t(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).addClass("ui-datepicker-next-hover"))}function a(e,i){t.extend(e,i);for(var s in i)null==i[s]&&(e[s]=i[s]);return e}function r(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger("change")}}t.ui=t.ui||{},t.ui.version="1.12.1";var h=0,l=Array.prototype.slice;t.cleanData=function(e){return function(i){var s,n,o;for(o=0;null!=(n=i[o]);o++)try{s=t._data(n,"events"),s&&s.remove&&t(n).triggerHandler("remove")}catch(a){}e(i)}}(t.cleanData),t.widget=function(e,i,s){var n,o,a,r={},h=e.split(".")[0];e=e.split(".")[1];var l=h+"-"+e;return s||(s=i,i=t.Widget),t.isArray(s)&&(s=t.extend.apply(null,[{}].concat(s))),t.expr[":"][l.toLowerCase()]=function(e){return!!t.data(e,l)},t[h]=t[h]||{},n=t[h][e],o=t[h][e]=function(t,e){return this._createWidget?(arguments.length&&this._createWidget(t,e),void 0):new o(t,e)},t.extend(o,n,{version:s.version,_proto:t.extend({},s),_childConstructors:[]}),a=new i,a.options=t.widget.extend({},a.options),t.each(s,function(e,s){return t.isFunction(s)?(r[e]=function(){function t(){return i.prototype[e].apply(this,arguments)}function n(t){return i.prototype[e].apply(this,t)}return function(){var e,i=this._super,o=this._superApply;return this._super=t,this._superApply=n,e=s.apply(this,arguments),this._super=i,this._superApply=o,e}}(),void 0):(r[e]=s,void 0)}),o.prototype=t.widget.extend(a,{widgetEventPrefix:n?a.widgetEventPrefix||e:e},r,{constructor:o,namespace:h,widgetName:e,widgetFullName:l}),n?(t.each(n._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete n._childConstructors):i._childConstructors.push(o),t.widget.bridge(e,o),o},t.widget.extend=function(e){for(var i,s,n=l.call(arguments,1),o=0,a=n.length;a>o;o++)for(i in n[o])s=n[o][i],n[o].hasOwnProperty(i)&&void 0!==s&&(e[i]=t.isPlainObject(s)?t.isPlainObject(e[i])?t.widget.extend({},e[i],s):t.widget.extend({},s):s);return e},t.widget.bridge=function(e,i){var s=i.prototype.widgetFullName||e;t.fn[e]=function(n){var o="string"==typeof n,a=l.call(arguments,1),r=this;return o?this.length||"instance"!==n?this.each(function(){var i,o=t.data(this,s);return"instance"===n?(r=o,!1):o?t.isFunction(o[n])&&"_"!==n.charAt(0)?(i=o[n].apply(o,a),i!==o&&void 0!==i?(r=i&&i.jquery?r.pushStack(i.get()):i,!1):void 0):t.error("no such method '"+n+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; "+"attempted to call method '"+n+"'")}):r=void 0:(a.length&&(n=t.widget.extend.apply(null,[n].concat(a))),this.each(function(){var e=t.data(this,s);e?(e.option(n||{}),e._init&&e._init()):t.data(this,s,new i(n,this))})),r}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,i){i=t(i||this.defaultElement||this)[0],this.element=t(i),this.uuid=h++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},i!==this&&(t.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===i&&this.destroy()}}),this.document=t(i.style?i.ownerDocument:i.document||i),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var s,n,o,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},s=e.split("."),e=s.shift(),s.length){for(n=a[e]=t.widget.extend({},this.options[e]),o=0;s.length-1>o;o++)n[s[o]]=n[s[o]]||{},n=n[s[o]];if(e=s.pop(),1===arguments.length)return void 0===n[e]?null:n[e];n[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];a[e]=i}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var i,s,n;for(i in e)n=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&n&&n.length&&(s=t(n.get()),this._removeClass(n,i),s.addClass(this._classes({element:s,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){function i(i,o){var a,r;for(r=0;i.length>r;r++)a=n.classesElementLookup[i[r]]||t(),a=e.add?t(t.unique(a.get().concat(e.element.get()))):t(a.not(e.element).get()),n.classesElementLookup[i[r]]=a,s.push(i[r]),o&&e.classes[i[r]]&&s.push(e.classes[i[r]])}var s=[],n=this;return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&i(e.keys.match(/\S+/g)||[],!0),e.extra&&i(e.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,function(s,n){-1!==t.inArray(e.target,n)&&(i.classesElementLookup[s]=t(n.not(e.target).get()))})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof s?s:i;var n="string"==typeof t||null===t,o={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s};return o.element.toggleClass(this._classes(o),s),this},_on:function(e,i,s){var n,o=this;"boolean"!=typeof e&&(s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),t.each(s,function(s,a){function r(){return e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||t.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+o.eventNamespace,c=h[2];c?n.on(l,c,r):i.on(l,r)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(i).off(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}}),t.widget,function(){function e(t,e,i){return[parseFloat(t[0])*(u.test(t[0])?e/100:1),parseFloat(t[1])*(u.test(t[1])?i/100:1)]}function i(e,i){return parseInt(t.css(e,i),10)||0}function s(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}var n,o=Math.max,a=Math.abs,r=/left|center|right/,h=/top|center|bottom/,l=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,u=/%$/,d=t.fn.position;t.position={scrollbarWidth:function(){if(void 0!==n)return n;var e,i,s=t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=s.children()[0];return t("body").append(s),e=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,e===i&&(i=s[0].clientWidth),s.remove(),n=e-i},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,o="scroll"===s||"auto"===s&&e.height<e.element[0].scrollHeight;return{width:o?t.position.scrollbarWidth():0,height:n?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),s=t.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType,o=!s&&!n;return{element:i,isWindow:s,isDocument:n,offset:o?t(e).offset():{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:i.outerWidth(),height:i.outerHeight()}}},t.fn.position=function(n){if(!n||!n.of)return d.apply(this,arguments);n=t.extend({},n);var u,p,f,g,m,_,v=t(n.of),b=t.position.getWithinInfo(n.within),y=t.position.getScrollInfo(b),w=(n.collision||"flip").split(" "),k={};return _=s(v),v[0].preventDefault&&(n.at="left top"),p=_.width,f=_.height,g=_.offset,m=t.extend({},g),t.each(["my","at"],function(){var t,e,i=(n[this]||"").split(" ");1===i.length&&(i=r.test(i[0])?i.concat(["center"]):h.test(i[0])?["center"].concat(i):["center","center"]),i[0]=r.test(i[0])?i[0]:"center",i[1]=h.test(i[1])?i[1]:"center",t=l.exec(i[0]),e=l.exec(i[1]),k[this]=[t?t[0]:0,e?e[0]:0],n[this]=[c.exec(i[0])[0],c.exec(i[1])[0]]}),1===w.length&&(w[1]=w[0]),"right"===n.at[0]?m.left+=p:"center"===n.at[0]&&(m.left+=p/2),"bottom"===n.at[1]?m.top+=f:"center"===n.at[1]&&(m.top+=f/2),u=e(k.at,p,f),m.left+=u[0],m.top+=u[1],this.each(function(){var s,r,h=t(this),l=h.outerWidth(),c=h.outerHeight(),d=i(this,"marginLeft"),_=i(this,"marginTop"),x=l+d+i(this,"marginRight")+y.width,C=c+_+i(this,"marginBottom")+y.height,D=t.extend({},m),I=e(k.my,h.outerWidth(),h.outerHeight());"right"===n.my[0]?D.left-=l:"center"===n.my[0]&&(D.left-=l/2),"bottom"===n.my[1]?D.top-=c:"center"===n.my[1]&&(D.top-=c/2),D.left+=I[0],D.top+=I[1],s={marginLeft:d,marginTop:_},t.each(["left","top"],function(e,i){t.ui.position[w[e]]&&t.ui.position[w[e]][i](D,{targetWidth:p,targetHeight:f,elemWidth:l,elemHeight:c,collisionPosition:s,collisionWidth:x,collisionHeight:C,offset:[u[0]+I[0],u[1]+I[1]],my:n.my,at:n.at,within:b,elem:h})}),n.using&&(r=function(t){var e=g.left-D.left,i=e+p-l,s=g.top-D.top,r=s+f-c,u={target:{element:v,left:g.left,top:g.top,width:p,height:f},element:{element:h,left:D.left,top:D.top,width:l,height:c},horizontal:0>i?"left":e>0?"right":"center",vertical:0>r?"top":s>0?"bottom":"middle"};l>p&&p>a(e+i)&&(u.horizontal="center"),c>f&&f>a(s+r)&&(u.vertical="middle"),u.important=o(a(e),a(i))>o(a(s),a(r))?"horizontal":"vertical",n.using.call(this,t,u)}),h.offset(t.extend(D,{using:r}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,h=n-r,l=r+e.collisionWidth-a-n;e.collisionWidth>a?h>0&&0>=l?(i=t.left+h+e.collisionWidth-a-n,t.left+=h-i):t.left=l>0&&0>=h?n:h>l?n+a-e.collisionWidth:n:h>0?t.left+=h:l>0?t.left-=l:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,h=n-r,l=r+e.collisionHeight-a-n;e.collisionHeight>a?h>0&&0>=l?(i=t.top+h+e.collisionHeight-a-n,t.top+=h-i):t.top=l>0&&0>=h?n:h>l?n+a-e.collisionHeight:n:h>0?t.top+=h:l>0?t.top-=l:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,o=n.offset.left+n.scrollLeft,r=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=t.left-e.collisionPosition.marginLeft,c=l-h,u=l+e.collisionWidth-r-h,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-r-o,(0>i||a(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-h,(s>0||u>a(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,o=n.offset.top+n.scrollTop,r=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=t.top-e.collisionPosition.marginTop,c=l-h,u=l+e.collisionHeight-r-h,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,g=-2*e.offset[1];0>c?(s=t.top+p+f+g+e.collisionHeight-r-o,(0>s||a(c)>s)&&(t.top+=p+f+g)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+g-h,(i>0||u>a(i))&&(t.top+=p+f+g))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}}}(),t.ui.position,t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])}}),t.fn.extend({disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}});var c="ui-effects-",u="ui-effects-style",d="ui-effects-animated",p=t;t.effects={effect:{}},function(t,e){function i(t,e,i){var s=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:t>s.max?s.max:t)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(t,o){var a,r=o.re.exec(i),h=r&&o.parse(r),l=o.space||"rgba";return h?(a=s[l](h),s[c[l].cache]=a[c[l].cache],n=s._rgba=a._rgba,!1):e}),n.length?("0,0,0,0"===n.join()&&t.extend(n,o.transparent),s):o[i]}function n(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var o,a="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],l=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},c={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=l.support={},p=t("<p>")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),l.fn=t.extend(l.prototype,{parse:function(n,a,r,h){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(a),a=e);var u=this,d=t.type(n),p=this._rgba=[];return a!==e&&(n=[n,a,r,h],d="array"),"string"===d?this.parse(s(n)||o._default):"array"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(n[e.idx],e)}),this):"object"===d?(n instanceof l?f(c,function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}):f(c,function(e,s){var o=s.cache;f(s.props,function(t,e){if(!u[o]&&s.to){if("alpha"===t||null==n[t])return;u[o]=s.to(u._rgba)}u[o][e.idx]=i(n[t],e,!0)}),u[o]&&0>t.inArray(null,u[o].slice(0,3))&&(u[o][3]=1,s.from&&(u._rgba=s.from(u[o])))}),this):e},is:function(t){var i=l(t),s=!0,n=this;return f(c,function(t,o){var a,r=i[o.cache];return r&&(a=n[o.cache]||o.to&&o.to(n._rgba)||[],f(o.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===a[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return f(c,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=l(t),n=s._space(),o=c[n],a=0===this.alpha()?l("transparent"):this,r=a[o.cache]||o.to(a._rgba),h=r.slice();return s=s[o.cache],f(o.props,function(t,n){var o=n.idx,a=r[o],l=s[o],c=u[n.type]||{};null!==l&&(null===a?h[o]=l:(c.mod&&(l-a>c.mod/2?a+=c.mod:a-l>c.mod/2&&(a-=c.mod)),h[o]=i((l-a)*e+a,n)))}),this[n](h)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(e)._rgba;return l(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,o=t[2]/255,a=t[3],r=Math.max(s,n,o),h=Math.min(s,n,o),l=r-h,c=r+h,u=.5*c;return e=h===r?0:s===r?60*(n-o)/l+360:n===r?60*(o-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=u?l/c:l/(2-c),[Math.round(e)%360,i,u,null==a?1:a]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],o=t[3],a=.5>=s?s*(1+i):s+i-s*i,r=2*s-a;return[Math.round(255*n(r,a,e+1/3)),Math.round(255*n(r,a,e)),Math.round(255*n(r,a,e-1/3)),o]},f(c,function(s,n){var o=n.props,a=n.cache,h=n.to,c=n.from;l.fn[s]=function(s){if(h&&!this[a]&&(this[a]=h(this._rgba)),s===e)return this[a].slice();var n,r=t.type(s),u="array"===r||"object"===r?s:arguments,d=this[a].slice();return f(o,function(t,e){var s=u["object"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?(n=l(c(d)),n[a]=d,n):l(d)},f(o,function(e,i){l.fn[e]||(l.fn[e]=function(n){var o,a=t.type(n),h="alpha"===e?this._hsla?"hsla":"rgba":s,l=this[h](),c=l[i.idx];return"undefined"===a?c:("function"===a&&(n=n.call(this,c),a=t.type(n)),null==n&&i.empty?this:("string"===a&&(o=r.exec(n),o&&(n=c+parseFloat(o[2])*("+"===o[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,n){var o,a,r="";if("transparent"!==n&&("string"!==t.type(n)||(o=s(n)))){if(n=l(o||n),!d.rgba&&1!==n._rgba[3]){for(a="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&a&&a.style;)try{r=t.css(a,"backgroundColor"),a=a.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(h){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=l(e.elem,i),e.end=l(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},l.hook(a),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},o=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(p),function(){function e(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,o={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(o[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(o[i]=n[i]);return o}function i(e,i){var s,o,a={};for(s in i)o=i[s],e[s]!==o&&(n[s]||(t.fx.step[s]||!isNaN(parseFloat(o)))&&(a[s]=o));return a}var s=["add","remove","toggle"],n={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(p.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(n,o,a,r){var h=t.speed(o,a,r);return this.queue(function(){var o,a=t(this),r=a.attr("class")||"",l=h.children?a.find("*").addBack():a;l=l.map(function(){var i=t(this);return{el:i,start:e(this)}}),o=function(){t.each(s,function(t,e){n[e]&&a[e+"Class"](n[e])})},o(),l=l.map(function(){return this.end=e(this.el[0]),this.diff=i(this.start,this.end),this}),a.attr("class",r),l=l.map(function(){var e=this,i=t.Deferred(),s=t.extend({},h,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,l.get()).done(function(){o(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),h.complete.call(a[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,o){return s?t.effects.animateClass.call(this,{add:i},s,n,o):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,o){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,o):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(e){return function(i,s,n,o,a){return"boolean"==typeof s||void 0===s?n?t.effects.animateClass.call(this,s?{add:i}:{remove:i},n,o,a):e.apply(this,arguments):t.effects.animateClass.call(this,{toggle:i},s,n,o)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,o){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,o)}})}(),function(){function e(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function i(e){return!e||"number"==typeof e||t.fx.speeds[e]?!0:"string"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:"object"!=typeof e||e.effect?!1:!0:!0}function s(t,e){var i=e.outerWidth(),s=e.outerHeight(),n=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/,o=n.exec(t)||["",0,i,s,0];return{top:parseFloat(o[1])||0,right:"auto"===o[2]?i:parseFloat(o[2]),bottom:"auto"===o[3]?s:parseFloat(o[3]),left:parseFloat(o[4])||0}}t.expr&&t.expr.filters&&t.expr.filters.animated&&(t.expr.filters.animated=function(e){return function(i){return!!t(i).data(d)||e(i)}}(t.expr.filters.animated)),t.uiBackCompat!==!1&&t.extend(t.effects,{save:function(t,e){for(var i=0,s=e.length;s>i;i++)null!==e[i]&&t.data(c+e[i],t[0].style[e[i]])},restore:function(t,e){for(var i,s=0,n=e.length;n>s;s++)null!==e[s]&&(i=t.data(c+e[s]),t.css(e[s],i))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},s=t("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},o=document.activeElement;try{o.id}catch(a){o=document.body}return e.wrap(s),(e[0]===o||t.contains(e[0],o))&&t(o).trigger("focus"),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).trigger("focus")),e}}),t.extend(t.effects,{version:"1.12.1",define:function(e,i,s){return s||(s=i,i="effect"),t.effects.effect[e]=s,t.effects.effect[e].mode=i,s},scaledDimensions:function(t,e,i){if(0===e)return{height:0,width:0,outerHeight:0,outerWidth:0};var s="horizontal"!==i?(e||100)/100:1,n="vertical"!==i?(e||100)/100:1;return{height:t.height()*n,width:t.width()*s,outerHeight:t.outerHeight()*n,outerWidth:t.outerWidth()*s}},clipToBox:function(t){return{width:t.clip.right-t.clip.left,height:t.clip.bottom-t.clip.top,left:t.clip.left,top:t.clip.top}},unshift:function(t,e,i){var s=t.queue();e>1&&s.splice.apply(s,[1,0].concat(s.splice(e,i))),t.dequeue()},saveStyle:function(t){t.data(u,t[0].style.cssText)},restoreStyle:function(t){t[0].style.cssText=t.data(u)||"",t.removeData(u)},mode:function(t,e){var i=t.is(":hidden");return"toggle"===e&&(e=i?"show":"hide"),(i?"hide"===e:"show"===e)&&(e="none"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createPlaceholder:function(e){var i,s=e.css("position"),n=e.position();return e.css({marginTop:e.css("marginTop"),marginBottom:e.css("marginBottom"),marginLeft:e.css("marginLeft"),marginRight:e.css("marginRight")}).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()),/^(static|relative)/.test(s)&&(s="absolute",i=t("<"+e[0].nodeName+">").insertAfter(e).css({display:/^(inline|ruby)/.test(e.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:e.css("marginTop"),marginBottom:e.css("marginBottom"),marginLeft:e.css("marginLeft"),marginRight:e.css("marginRight"),"float":e.css("float")}).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).addClass("ui-effects-placeholder"),e.data(c+"placeholder",i)),e.css({position:s,left:n.left,top:n.top}),i},removePlaceholder:function(t){var e=c+"placeholder",i=t.data(e);i&&(i.remove(),t.removeData(e))},cleanUp:function(e){t.effects.restoreStyle(e),t.effects.removePlaceholder(e)},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var o=e.cssUnit(i);o[0]>0&&(n[i]=o[0]*s+o[1])}),n}}),t.fn.extend({effect:function(){function i(e){function i(){r.removeData(d),t.effects.cleanUp(r),"hide"===s.mode&&r.hide(),a()}function a(){t.isFunction(h)&&h.call(r[0]),t.isFunction(e)&&e()}var r=t(this);s.mode=c.shift(),t.uiBackCompat===!1||o?"none"===s.mode?(r[l](),a()):n.call(r[0],s,i):(r.is(":hidden")?"hide"===l:"show"===l)?(r[l](),a()):n.call(r[0],s,a)}var s=e.apply(this,arguments),n=t.effects.effect[s.effect],o=n.mode,a=s.queue,r=a||"fx",h=s.complete,l=s.mode,c=[],u=function(e){var i=t(this),s=t.effects.mode(i,l)||o;i.data(d,!0),c.push(s),o&&("show"===s||s===o&&"hide"===s)&&i.show(),o&&"none"===s||t.effects.saveStyle(i),t.isFunction(e)&&e()};return t.fx.off||!n?l?this[l](s.duration,h):this.each(function(){h&&h.call(this)}):a===!1?this.each(u).each(i):this.queue(r,u).queue(r,i)},show:function(t){return function(s){if(i(s))return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="show",this.effect.call(this,n) + }}(t.fn.show),hide:function(t){return function(s){if(i(s))return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="hide",this.effect.call(this,n)}}(t.fn.hide),toggle:function(t){return function(s){if(i(s)||"boolean"==typeof s)return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s},cssClip:function(t){return t?this.css("clip","rect("+t.top+"px "+t.right+"px "+t.bottom+"px "+t.left+"px)"):s(this.css("clip"),this)},transfer:function(e,i){var s=t(this),n=t(e.to),o="fixed"===n.css("position"),a=t("body"),r=o?a.scrollTop():0,h=o?a.scrollLeft():0,l=n.offset(),c={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},u=s.offset(),d=t("<div class='ui-effects-transfer'></div>").appendTo("body").addClass(e.className).css({top:u.top-r,left:u.left-h,height:s.innerHeight(),width:s.innerWidth(),position:o?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){d.remove(),t.isFunction(i)&&i()})}}),t.fx.step.clip=function(e){e.clipInit||(e.start=t(e.elem).cssClip(),"string"==typeof e.end&&(e.end=s(e.end,e.elem)),e.clipInit=!0),t(e.elem).cssClip({top:e.pos*(e.end.top-e.start.top)+e.start.top,right:e.pos*(e.end.right-e.start.right)+e.start.right,bottom:e.pos*(e.end.bottom-e.start.bottom)+e.start.bottom,left:e.pos*(e.end.left-e.start.left)+e.start.left})}}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}();var f=t.effects;t.effects.define("blind","hide",function(e,i){var s={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},n=t(this),o=e.direction||"up",a=n.cssClip(),r={clip:t.extend({},a)},h=t.effects.createPlaceholder(n);r.clip[s[o][0]]=r.clip[s[o][1]],"show"===e.mode&&(n.cssClip(r.clip),h&&h.css(t.effects.clipToBox(r)),r.clip=a),h&&h.animate(t.effects.clipToBox(r),e.duration,e.easing),n.animate(r,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("bounce",function(e,i){var s,n,o,a=t(this),r=e.mode,h="hide"===r,l="show"===r,c=e.direction||"up",u=e.distance,d=e.times||5,p=2*d+(l||h?1:0),f=e.duration/p,g=e.easing,m="up"===c||"down"===c?"top":"left",_="up"===c||"left"===c,v=0,b=a.queue().length;for(t.effects.createPlaceholder(a),o=a.css(m),u||(u=a["top"===m?"outerHeight":"outerWidth"]()/3),l&&(n={opacity:1},n[m]=o,a.css("opacity",0).css(m,_?2*-u:2*u).animate(n,f,g)),h&&(u/=Math.pow(2,d-1)),n={},n[m]=o;d>v;v++)s={},s[m]=(_?"-=":"+=")+u,a.animate(s,f,g).animate(n,f,g),u=h?2*u:u/2;h&&(s={opacity:0},s[m]=(_?"-=":"+=")+u,a.animate(s,f,g)),a.queue(i),t.effects.unshift(a,b,p+1)}),t.effects.define("clip","hide",function(e,i){var s,n={},o=t(this),a=e.direction||"vertical",r="both"===a,h=r||"horizontal"===a,l=r||"vertical"===a;s=o.cssClip(),n.clip={top:l?(s.bottom-s.top)/2:s.top,right:h?(s.right-s.left)/2:s.right,bottom:l?(s.bottom-s.top)/2:s.bottom,left:h?(s.right-s.left)/2:s.left},t.effects.createPlaceholder(o),"show"===e.mode&&(o.cssClip(n.clip),n.clip=s),o.animate(n,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("drop","hide",function(e,i){var s,n=t(this),o=e.mode,a="show"===o,r=e.direction||"left",h="up"===r||"down"===r?"top":"left",l="up"===r||"left"===r?"-=":"+=",c="+="===l?"-=":"+=",u={opacity:0};t.effects.createPlaceholder(n),s=e.distance||n["top"===h?"outerHeight":"outerWidth"](!0)/2,u[h]=l+s,a&&(n.css(u),u[h]=c+s,u.opacity=1),n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("explode","hide",function(e,i){function s(){b.push(this),b.length===u*d&&n()}function n(){p.css({visibility:"visible"}),t(b).remove(),i()}var o,a,r,h,l,c,u=e.pieces?Math.round(Math.sqrt(e.pieces)):3,d=u,p=t(this),f=e.mode,g="show"===f,m=p.show().css("visibility","hidden").offset(),_=Math.ceil(p.outerWidth()/d),v=Math.ceil(p.outerHeight()/u),b=[];for(o=0;u>o;o++)for(h=m.top+o*v,c=o-(u-1)/2,a=0;d>a;a++)r=m.left+a*_,l=a-(d-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-a*_,top:-o*v}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:_,height:v,left:r+(g?l*_:0),top:h+(g?c*v:0),opacity:g?0:1}).animate({left:r+(g?0:l*_),top:h+(g?0:c*v),opacity:g?1:0},e.duration||500,e.easing,s)}),t.effects.define("fade","toggle",function(e,i){var s="show"===e.mode;t(this).css("opacity",s?0:1).animate({opacity:s?1:0},{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("fold","hide",function(e,i){var s=t(this),n=e.mode,o="show"===n,a="hide"===n,r=e.size||15,h=/([0-9]+)%/.exec(r),l=!!e.horizFirst,c=l?["right","bottom"]:["bottom","right"],u=e.duration/2,d=t.effects.createPlaceholder(s),p=s.cssClip(),f={clip:t.extend({},p)},g={clip:t.extend({},p)},m=[p[c[0]],p[c[1]]],_=s.queue().length;h&&(r=parseInt(h[1],10)/100*m[a?0:1]),f.clip[c[0]]=r,g.clip[c[0]]=r,g.clip[c[1]]=0,o&&(s.cssClip(g.clip),d&&d.css(t.effects.clipToBox(g)),g.clip=p),s.queue(function(i){d&&d.animate(t.effects.clipToBox(f),u,e.easing).animate(t.effects.clipToBox(g),u,e.easing),i()}).animate(f,u,e.easing).animate(g,u,e.easing).queue(i),t.effects.unshift(s,_,4)}),t.effects.define("highlight","show",function(e,i){var s=t(this),n={backgroundColor:s.css("backgroundColor")};"hide"===e.mode&&(n.opacity=0),t.effects.saveStyle(s),s.css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(n,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("size",function(e,i){var s,n,o,a=t(this),r=["fontSize"],h=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],l=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],c=e.mode,u="effect"!==c,d=e.scale||"both",p=e.origin||["middle","center"],f=a.css("position"),g=a.position(),m=t.effects.scaledDimensions(a),_=e.from||m,v=e.to||t.effects.scaledDimensions(a,0);t.effects.createPlaceholder(a),"show"===c&&(o=_,_=v,v=o),n={from:{y:_.height/m.height,x:_.width/m.width},to:{y:v.height/m.height,x:v.width/m.width}},("box"===d||"both"===d)&&(n.from.y!==n.to.y&&(_=t.effects.setTransition(a,h,n.from.y,_),v=t.effects.setTransition(a,h,n.to.y,v)),n.from.x!==n.to.x&&(_=t.effects.setTransition(a,l,n.from.x,_),v=t.effects.setTransition(a,l,n.to.x,v))),("content"===d||"both"===d)&&n.from.y!==n.to.y&&(_=t.effects.setTransition(a,r,n.from.y,_),v=t.effects.setTransition(a,r,n.to.y,v)),p&&(s=t.effects.getBaseline(p,m),_.top=(m.outerHeight-_.outerHeight)*s.y+g.top,_.left=(m.outerWidth-_.outerWidth)*s.x+g.left,v.top=(m.outerHeight-v.outerHeight)*s.y+g.top,v.left=(m.outerWidth-v.outerWidth)*s.x+g.left),a.css(_),("content"===d||"both"===d)&&(h=h.concat(["marginTop","marginBottom"]).concat(r),l=l.concat(["marginLeft","marginRight"]),a.find("*[width]").each(function(){var i=t(this),s=t.effects.scaledDimensions(i),o={height:s.height*n.from.y,width:s.width*n.from.x,outerHeight:s.outerHeight*n.from.y,outerWidth:s.outerWidth*n.from.x},a={height:s.height*n.to.y,width:s.width*n.to.x,outerHeight:s.height*n.to.y,outerWidth:s.width*n.to.x};n.from.y!==n.to.y&&(o=t.effects.setTransition(i,h,n.from.y,o),a=t.effects.setTransition(i,h,n.to.y,a)),n.from.x!==n.to.x&&(o=t.effects.setTransition(i,l,n.from.x,o),a=t.effects.setTransition(i,l,n.to.x,a)),u&&t.effects.saveStyle(i),i.css(o),i.animate(a,e.duration,e.easing,function(){u&&t.effects.restoreStyle(i)})})),a.animate(v,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){var e=a.offset();0===v.opacity&&a.css("opacity",_.opacity),u||(a.css("position","static"===f?"relative":f).offset(e),t.effects.saveStyle(a)),i()}})}),t.effects.define("scale",function(e,i){var s=t(this),n=e.mode,o=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"effect"!==n?0:100),a=t.extend(!0,{from:t.effects.scaledDimensions(s),to:t.effects.scaledDimensions(s,o,e.direction||"both"),origin:e.origin||["middle","center"]},e);e.fade&&(a.from.opacity=1,a.to.opacity=0),t.effects.effect.size.call(this,a,i)}),t.effects.define("puff","hide",function(e,i){var s=t.extend(!0,{},e,{fade:!0,percent:parseInt(e.percent,10)||150});t.effects.effect.scale.call(this,s,i)}),t.effects.define("pulsate","show",function(e,i){var s=t(this),n=e.mode,o="show"===n,a="hide"===n,r=o||a,h=2*(e.times||5)+(r?1:0),l=e.duration/h,c=0,u=1,d=s.queue().length;for((o||!s.is(":visible"))&&(s.css("opacity",0).show(),c=1);h>u;u++)s.animate({opacity:c},l,e.easing),c=1-c;s.animate({opacity:c},l,e.easing),s.queue(i),t.effects.unshift(s,d,h+1)}),t.effects.define("shake",function(e,i){var s=1,n=t(this),o=e.direction||"left",a=e.distance||20,r=e.times||3,h=2*r+1,l=Math.round(e.duration/h),c="up"===o||"down"===o?"top":"left",u="up"===o||"left"===o,d={},p={},f={},g=n.queue().length;for(t.effects.createPlaceholder(n),d[c]=(u?"-=":"+=")+a,p[c]=(u?"+=":"-=")+2*a,f[c]=(u?"-=":"+=")+2*a,n.animate(d,l,e.easing);r>s;s++)n.animate(p,l,e.easing).animate(f,l,e.easing);n.animate(p,l,e.easing).animate(d,l/2,e.easing).queue(i),t.effects.unshift(n,g,h+1)}),t.effects.define("slide","show",function(e,i){var s,n,o=t(this),a={up:["bottom","top"],down:["top","bottom"],left:["right","left"],right:["left","right"]},r=e.mode,h=e.direction||"left",l="up"===h||"down"===h?"top":"left",c="up"===h||"left"===h,u=e.distance||o["top"===l?"outerHeight":"outerWidth"](!0),d={};t.effects.createPlaceholder(o),s=o.cssClip(),n=o.position()[l],d[l]=(c?-1:1)*u+n,d.clip=o.cssClip(),d.clip[a[h][1]]=d.clip[a[h][0]],"show"===r&&(o.cssClip(d.clip),o.css(l,d[l]),d.clip=s,d[l]=n),o.animate(d,{queue:!1,duration:e.duration,easing:e.easing,complete:i})});var f;t.uiBackCompat!==!1&&(f=t.effects.define("transfer",function(e,i){t(this).transfer(e,i)})),t.ui.focusable=function(i,s){var n,o,a,r,h,l=i.nodeName.toLowerCase();return"area"===l?(n=i.parentNode,o=n.name,i.href&&o&&"map"===n.nodeName.toLowerCase()?(a=t("img[usemap='#"+o+"']"),a.length>0&&a.is(":visible")):!1):(/^(input|select|textarea|button|object)$/.test(l)?(r=!i.disabled,r&&(h=t(i).closest("fieldset")[0],h&&(r=!h.disabled))):r="a"===l?i.href||s:s,r&&t(i).is(":visible")&&e(t(i)))},t.extend(t.expr[":"],{focusable:function(e){return t.ui.focusable(e,null!=t.attr(e,"tabindex"))}}),t.ui.focusable,t.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):t(this[0].form)},t.ui.formResetMixin={_formResetHandler:function(){var e=t(this);setTimeout(function(){var i=e.data("ui-form-reset-instances");t.each(i,function(){this.refresh()})})},_bindFormResetHandler:function(){if(this.form=this.element.form(),this.form.length){var t=this.form.data("ui-form-reset-instances")||[];t.length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t)}},_unbindFormResetHandler:function(){if(this.form.length){var e=this.form.data("ui-form-reset-instances");e.splice(t.inArray(this,e),1),e.length?this.form.data("ui-form-reset-instances",e):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}},"1.7"===t.fn.jquery.substring(0,3)&&(t.each(["Width","Height"],function(e,i){function s(e,i,s,o){return t.each(n,function(){i-=parseFloat(t.css(e,"padding"+this))||0,s&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),o&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],o=i.toLowerCase(),a={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+i]=function(e){return void 0===e?a["inner"+i].call(this):this.each(function(){t(this).css(o,s(this,e)+"px")})},t.fn["outer"+i]=function(e,n){return"number"!=typeof e?a["outer"+i].call(this,e):this.each(function(){t(this).css(o,s(this,e,!0,n)+"px")})}}),t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},t.ui.escapeSelector=function(){var t=/([!"#$%&'()*+,.\/:;<=>?@[\]^`{|}~])/g;return function(e){return e.replace(t,"\\$1")}}(),t.fn.labels=function(){var e,i,s,n,o;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(n=this.eq(0).parents("label"),s=this.attr("id"),s&&(e=this.eq(0).parents().last(),o=e.add(e.length?e.siblings():this.siblings()),i="label[for='"+t.ui.escapeSelector(s)+"']",n=n.add(o.find(i).addBack(i))),this.pushStack(n))},t.fn.scrollParent=function(e){var i=this.css("position"),s="absolute"===i,n=e?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var e=t(this);return s&&"static"===e.css("position")?!1:n.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==i&&o.length?o:t(this[0].ownerDocument||document)},t.extend(t.expr[":"],{tabbable:function(e){var i=t.attr(e,"tabindex"),s=null!=i;return(!s||i>=0)&&t.ui.focusable(e,s)}}),t.fn.extend({uniqueId:function(){var t=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++t)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}}),t.widget("ui.accordion",{version:"1.12.1",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:!1,event:"click",header:"> li > :first-child, > :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var e=this.options;this.prevShow=this.prevHide=t(),this._addClass("ui-accordion","ui-widget ui-helper-reset"),this.element.attr("role","tablist"),e.collapsible||e.active!==!1&&null!=e.active||(e.active=0),this._processPanels(),0>e.active&&(e.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():t()}},_createIcons:function(){var e,i,s=this.options.icons;s&&(e=t("<span>"),this._addClass(e,"ui-accordion-header-icon","ui-icon "+s.header),e.prependTo(this.headers),i=this.active.children(".ui-accordion-header-icon"),this._removeClass(i,s.header)._addClass(i,null,s.activeHeader)._addClass(this.headers,"ui-accordion-icons"))},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons"),this.headers.children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeAttr("role"),this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId(),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){return"active"===t?(this._activate(e),void 0):("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||this.options.active!==!1||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons()),void 0)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t),this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!t)},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var i=t.ui.keyCode,s=this.headers.length,n=this.headers.index(e.target),o=!1;switch(e.keyCode){case i.RIGHT:case i.DOWN:o=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:o=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(e);break;case i.HOME:o=this.headers[0];break;case i.END:o=this.headers[s-1]}o&&(t(e.target).attr("tabIndex",-1),t(o).attr("tabIndex",0),t(o).trigger("focus"),e.preventDefault())}},_panelKeyDown:function(e){e.keyCode===t.ui.keyCode.UP&&e.ctrlKey&&t(e.currentTarget).prev().trigger("focus")},refresh:function(){var e=this.options;this._processPanels(),e.active===!1&&e.collapsible===!0||!this.headers.length?(e.active=!1,this.active=t()):e.active===!1?this._activate(0):this.active.length&&!t.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(e.active=!1,this.active=t()):this._activate(Math.max(0,e.active-1)):e.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var t=this.headers,e=this.panels;this.headers=this.element.find(this.options.header),this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default"),this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide(),this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content"),e&&(this._off(t.not(this.headers)),this._off(e.not(this.panels)))},_refresh:function(){var e,i=this.options,s=i.heightStyle,n=this.element.parent();this.active=this._findActive(i.active),this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed"),this._addClass(this.active.next(),"ui-accordion-content-active"),this.active.next().show(),this.headers.attr("role","tab").each(function(){var e=t(this),i=e.uniqueId().attr("id"),s=e.next(),n=s.uniqueId().attr("id");e.attr("aria-controls",n),s.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(i.event),"fill"===s?(e=n.height(),this.element.siblings(":visible").each(function(){var i=t(this),s=i.css("position");"absolute"!==s&&"fixed"!==s&&(e-=i.outerHeight(!0))}),this.headers.each(function(){e-=t(this).outerHeight(!0)}),this.headers.next().each(function(){t(this).height(Math.max(0,e-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===s&&(e=0,this.headers.next().each(function(){var i=t(this).is(":visible");i||t(this).show(),e=Math.max(e,t(this).css("height","").height()),i||t(this).hide()}).height(e))},_activate:function(e){var i=this._findActive(e)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):t()},_setupEvents:function(e){var i={keydown:"_keydown"};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(e){var i,s,n=this.options,o=this.active,a=t(e.currentTarget),r=a[0]===o[0],h=r&&n.collapsible,l=h?t():a.next(),c=o.next(),u={oldHeader:o,oldPanel:c,newHeader:h?t():a,newPanel:l};e.preventDefault(),r&&!n.collapsible||this._trigger("beforeActivate",e,u)===!1||(n.active=h?!1:this.headers.index(a),this.active=r?t():a,this._toggle(u),this._removeClass(o,"ui-accordion-header-active","ui-state-active"),n.icons&&(i=o.children(".ui-accordion-header-icon"),this._removeClass(i,null,n.icons.activeHeader)._addClass(i,null,n.icons.header)),r||(this._removeClass(a,"ui-accordion-header-collapsed")._addClass(a,"ui-accordion-header-active","ui-state-active"),n.icons&&(s=a.children(".ui-accordion-header-icon"),this._removeClass(s,null,n.icons.header)._addClass(s,null,n.icons.activeHeader)),this._addClass(a.next(),"ui-accordion-content-active")))},_toggle:function(e){var i=e.newPanel,s=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,e):(s.hide(),i.show(),this._toggleComplete(e)),s.attr({"aria-hidden":"true"}),s.prev().attr({"aria-selected":"false","aria-expanded":"false"}),i.length&&s.length?s.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===parseInt(t(this).attr("tabIndex"),10)}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(t,e,i){var s,n,o,a=this,r=0,h=t.css("box-sizing"),l=t.length&&(!e.length||t.index()<e.index()),c=this.options.animate||{},u=l&&c.down||c,d=function(){a._toggleComplete(i)};return"number"==typeof u&&(o=u),"string"==typeof u&&(n=u),n=n||u.easing||c.easing,o=o||u.duration||c.duration,e.length?t.length?(s=t.show().outerHeight(),e.animate(this.hideProps,{duration:o,easing:n,step:function(t,e){e.now=Math.round(t)}}),t.hide().animate(this.showProps,{duration:o,easing:n,complete:d,step:function(t,i){i.now=Math.round(t),"height"!==i.prop?"content-box"===h&&(r+=i.now):"content"!==a.options.heightStyle&&(i.now=Math.round(s-e.outerHeight()-r),r=0)}}),void 0):e.animate(this.hideProps,o,n,d):t.animate(this.showProps,o,n,d)},_toggleComplete:function(t){var e=t.oldPanel,i=e.prev();this._removeClass(e,"ui-accordion-content-active"),this._removeClass(i,"ui-accordion-header-active")._addClass(i,"ui-accordion-header-collapsed"),e.length&&(e.parent()[0].className=e.parent()[0].className),this._trigger("activate",null,t)}}),t.ui.safeActiveElement=function(t){var e;try{e=t.activeElement}catch(i){e=t.body}return e||(e=t.body),e.nodeName||(e=t.body),e},t.widget("ui.menu",{version:"1.12.1",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(t){t.preventDefault()},"click .ui-menu-item":function(e){var i=t(e.target),s=t(t.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(e),e.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(e):!this.element.is(":focus")&&s.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){if(!this.previousFilter){var i=t(e.target).closest(".ui-menu-item"),s=t(e.currentTarget);i[0]===s[0]&&(this._removeClass(s.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(e,s))}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.find(this.options.items).eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){var i=!t.contains(this.element[0],t.ui.safeActiveElement(this.document[0]));i&&this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){this._closeOnDocumentClick(t)&&this.collapseAll(t),this.mouseHandled=!1}})},_destroy:function(){var e=this.element.find(".ui-menu-item").removeAttr("role aria-disabled"),i=e.children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),i.children().each(function(){var e=t(this);e.data("ui-menu-submenu-caret")&&e.remove()})},_keydown:function(e){var i,s,n,o,a=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:a=!1,s=this.previousFilter||"",o=!1,n=e.keyCode>=96&&105>=e.keyCode?""+(e.keyCode-96):String.fromCharCode(e.keyCode),clearTimeout(this.filterTimer),n===s?o=!0:n=s+n,i=this._filterMenuItems(n),i=o&&-1!==i.index(this.active.next())?this.active.nextAll(".ui-menu-item"):i,i.length||(n=String.fromCharCode(e.keyCode),i=this._filterMenuItems(n)),i.length?(this.focus(e,i),this.previousFilter=n,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}a&&e.preventDefault()},_activate:function(t){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,i,s,n,o,a=this,r=this.options.icons.submenu,h=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),s=h.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),i=e.prev(),s=t("<span>").data("ui-menu-submenu-caret",!0);a._addClass(s,"ui-menu-icon","ui-icon "+r),i.attr("aria-haspopup","true").prepend(s),e.attr("aria-labelledby",i.attr("id"))}),this._addClass(s,"ui-menu","ui-widget ui-widget-content ui-front"),e=h.add(this.element),i=e.find(this.options.items),i.not(".ui-menu-item").each(function(){var e=t(this);a._isDivider(e)&&a._addClass(e,"ui-menu-divider","ui-widget-content")}),n=i.not(".ui-menu-item, .ui-menu-divider"),o=n.children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(n,"ui-menu-item")._addClass(o,"ui-menu-item-wrapper"),i.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){if("icons"===t){var i=this.element.find(".ui-menu-icon");this._removeClass(i,null,this.options.icons.submenu)._addClass(i,null,e.submenu)}this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t+""),this._toggleClass(null,"ui-state-disabled",!!t)},focus:function(t,e){var i,s,n;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children(".ui-menu-item-wrapper"),this._addClass(s,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),n=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(n,null,"ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=e.children(".ui-menu"),i.length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,s,n,o,a,r;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,n=e.offset().top-this.activeMenu.offset().top-i-s,o=this.activeMenu.scrollTop(),a=this.activeMenu.height(),r=e.outerHeight(),0>n?this.activeMenu.scrollTop(o+n):n+r>a&&this.activeMenu.scrollTop(o+n-a+r))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",t,{item:this.active}),this.active=null)},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var i=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(e),this._removeClass(s.find(".ui-state-active"),null,"ui-state-active"),this.activeMenu=s},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false")},_closeOnDocumentClick:function(e){return!t(e.target).closest(".ui-menu").length},_isDivider:function(t){return!/[^\-\u2014\u2013\s]/.test(t.text())},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.find(this.options.items)[e]()),this.focus(i,s)},nextPage:function(e){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=t(this),0>i.offset().top-s-n}),this.focus(e,i)):this.focus(e,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())),void 0):(this.next(e),void 0)},previousPage:function(e){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=t(this),i.offset().top-s+n>0}),this.focus(e,i)):this.focus(e,this.activeMenu.find(this.options.items).first())),void 0):(this.next(e),void 0)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||t(e.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,i)},_filterMenuItems:function(e){var i=e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),s=RegExp("^"+i,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return s.test(t.trim(t(this).children(".ui-menu-item-wrapper").text()))})}}),t.widget("ui.autocomplete",{version:"1.12.1",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var e,i,s,n=this.element[0].nodeName.toLowerCase(),o="textarea"===n,a="input"===n; + this.isMultiLine=o||!a&&this._isContentEditable(this.element),this.valueMethod=this.element[o||a?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return e=!0,s=!0,i=!0,void 0;e=!1,s=!1,i=!1;var o=t.ui.keyCode;switch(n.keyCode){case o.PAGE_UP:e=!0,this._move("previousPage",n);break;case o.PAGE_DOWN:e=!0,this._move("nextPage",n);break;case o.UP:e=!0,this._keyEvent("previous",n);break;case o.DOWN:e=!0,this._keyEvent("next",n);break;case o.ENTER:this.menu.active&&(e=!0,n.preventDefault(),this.menu.select(n));break;case o.TAB:this.menu.active&&this.menu.select(n);break;case o.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(e)return e=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),void 0;if(!i){var n=t.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(t){return s?(s=!1,t.preventDefault(),void 0):(this._searchTimeout(t),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(t),this._change(t),void 0)}}),this._initSource(),this.menu=t("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(e){e.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,this.element[0]!==t.ui.safeActiveElement(this.document[0])&&this.element.trigger("focus")})},menufocus:function(e,i){var s,n;return this.isNewMenu&&(this.isNewMenu=!1,e.originalEvent&&/^mouse/.test(e.originalEvent.type))?(this.menu.blur(),this.document.one("mousemove",function(){t(e.target).trigger(e.originalEvent)}),void 0):(n=i.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",e,{item:n})&&e.originalEvent&&/^key/.test(e.originalEvent.type)&&this._value(n.value),s=i.item.attr("aria-label")||n.value,s&&t.trim(s).length&&(this.liveRegion.children().hide(),t("<div>").text(s).appendTo(this.liveRegion)),void 0)},menuselect:function(e,i){var s=i.item.data("ui-autocomplete-item"),n=this.previous;this.element[0]!==t.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=n,this._delay(function(){this.previous=n,this.selectedItem=s})),!1!==this._trigger("select",e,{item:s})&&this._value(s.value),this.term=this._value(),this.close(e),this.selectedItem=s}}),this.liveRegion=t("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(e){var i=this.menu.element[0];return e.target===this.element[0]||e.target===i||t.contains(i,e.target)},_closeOnClickOutside:function(t){this._isEventTargetInWidget(t)||this.close()},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?t(e):this.document.find(e).eq(0)),e&&e[0]||(e=this.element.closest(".ui-front, dialog")),e.length||(e=this.document[0].body),e},_initSource:function(){var e,i,s=this;t.isArray(this.options.source)?(e=this.options.source,this.source=function(i,s){s(t.ui.autocomplete.filter(e,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(e,n){s.xhr&&s.xhr.abort(),s.xhr=t.ajax({url:i,data:e,dataType:"json",success:function(t){n(t)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(t){clearTimeout(this.searching),this.searching=this._delay(function(){var e=this.term===this._value(),i=this.menu.element.is(":visible"),s=t.altKey||t.ctrlKey||t.metaKey||t.shiftKey;(!e||e&&!i&&!s)&&(this.selectedItem=null,this.search(null,t))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length<this.options.minLength?this.close(e):this._trigger("search",e)!==!1?this._search(t):void 0},_search:function(t){this.pending++,this._addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:t},this._response())},_response:function(){var e=++this.requestIndex;return t.proxy(function(t){e===this.requestIndex&&this.__response(t),this.pending--,this.pending||this._removeClass("ui-autocomplete-loading")},this)},__response:function(t){t&&(t=this._normalize(t)),this._trigger("response",null,{content:t}),!this.options.disabled&&t&&t.length&&!this.cancelSearch?(this._suggest(t),this._trigger("open")):this._close()},close:function(t){this.cancelSearch=!0,this._close(t)},_close:function(t){this._off(this.document,"mousedown"),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",t))},_change:function(t){this.previous!==this._value()&&this._trigger("change",t,{item:this.selectedItem})},_normalize:function(e){return e.length&&e[0].label&&e[0].value?e:t.map(e,function(e){return"string"==typeof e?{label:e,value:e}:t.extend({},e,{label:e.label||e.value,value:e.value||e.label})})},_suggest:function(e){var i=this.menu.element.empty();this._renderMenu(i,e),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(t.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(),this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var t=this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(e,i){var s=this;t.each(i,function(t,i){s._renderItemData(e,i)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-autocomplete-item",e)},_renderItem:function(e,i){return t("<li>").append(t("<div>").text(i.label)).appendTo(e)},_move:function(t,e){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this.isMultiLine||this._value(this.term),this.menu.blur(),void 0):(this.menu[t](e),void 0):(this.search(null,e),void 0)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(t,e),e.preventDefault())},_isContentEditable:function(t){if(!t.length)return!1;var e=t.prop("contentEditable");return"inherit"===e?this._isContentEditable(t.parent()):"true"===e}}),t.extend(t.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(e,i){var s=RegExp(t.ui.autocomplete.escapeRegex(i),"i");return t.grep(e,function(t){return s.test(t.label||t.value||t)})}}),t.widget("ui.autocomplete",t.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(t>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var i;this._superApply(arguments),this.options.disabled||this.cancelSearch||(i=e&&e.length?this.options.messages.results(e.length):this.options.messages.noResults,this.liveRegion.children().hide(),t("<div>").text(i).appendTo(this.liveRegion))}}),t.ui.autocomplete;var g=/ui-corner-([a-z]){2,6}/g;t.widget("ui.controlgroup",{version:"1.12.1",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var e=this,i=[];t.each(this.options.items,function(s,n){var o,a={};return n?"controlgroupLabel"===s?(o=e.element.find(n),o.each(function(){var e=t(this);e.children(".ui-controlgroup-label-contents").length||e.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")}),e._addClass(o,null,"ui-widget ui-widget-content ui-state-default"),i=i.concat(o.get()),void 0):(t.fn[s]&&(a=e["_"+s+"Options"]?e["_"+s+"Options"]("middle"):{classes:{}},e.element.find(n).each(function(){var n=t(this),o=n[s]("instance"),r=t.widget.extend({},a);if("button"!==s||!n.parent(".ui-spinner").length){o||(o=n[s]()[s]("instance")),o&&(r.classes=e._resolveClassesValues(r.classes,o)),n[s](r);var h=n[s]("widget");t.data(h[0],"ui-controlgroup-data",o?o:n[s]("instance")),i.push(h[0])}})),void 0):void 0}),this.childWidgets=t(t.unique(i)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(e){this.childWidgets.each(function(){var i=t(this),s=i.data("ui-controlgroup-data");s&&s[e]&&s[e]()})},_updateCornerClass:function(t,e){var i="ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all",s=this._buildSimpleOptions(e,"label").classes.label;this._removeClass(t,null,i),this._addClass(t,null,s)},_buildSimpleOptions:function(t,e){var i="vertical"===this.options.direction,s={classes:{}};return s.classes[e]={middle:"",first:"ui-corner-"+(i?"top":"left"),last:"ui-corner-"+(i?"bottom":"right"),only:"ui-corner-all"}[t],s},_spinnerOptions:function(t){var e=this._buildSimpleOptions(t,"ui-spinner");return e.classes["ui-spinner-up"]="",e.classes["ui-spinner-down"]="",e},_buttonOptions:function(t){return this._buildSimpleOptions(t,"ui-button")},_checkboxradioOptions:function(t){return this._buildSimpleOptions(t,"ui-checkboxradio-label")},_selectmenuOptions:function(t){var e="vertical"===this.options.direction;return{width:e?"auto":!1,classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(e?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(e?"top":"left")},last:{"ui-selectmenu-button-open":e?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(e?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[t]}},_resolveClassesValues:function(e,i){var s={};return t.each(e,function(n){var o=i.options.classes[n]||"";o=t.trim(o.replace(g,"")),s[n]=(o+" "+e[n]).replace(/\s+/g," ")}),s},_setOption:function(t,e){return"direction"===t&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(t,e),"disabled"===t?(this._callChildMethod(e?"disable":"enable"),void 0):(this.refresh(),void 0)},refresh:function(){var e,i=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),e=this.childWidgets,this.options.onlyVisible&&(e=e.filter(":visible")),e.length&&(t.each(["first","last"],function(t,s){var n=e[s]().data("ui-controlgroup-data");if(n&&i["_"+n.widgetName+"Options"]){var o=i["_"+n.widgetName+"Options"](1===e.length?"only":s);o.classes=i._resolveClassesValues(o.classes,n),n.element[n.widgetName](o)}else i._updateCornerClass(e[s](),s)}),this._callChildMethod("refresh"))}}),t.widget("ui.checkboxradio",[t.ui.formResetMixin,{version:"1.12.1",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var e,i,s=this,n=this._super()||{};return this._readType(),i=this.element.labels(),this.label=t(i[i.length-1]),this.label.length||t.error("No label found for checkboxradio widget"),this.originalLabel="",this.label.contents().not(this.element[0]).each(function(){s.originalLabel+=3===this.nodeType?t(this).text():this.outerHTML}),this.originalLabel&&(n.label=this.originalLabel),e=this.element[0].disabled,null!=e&&(n.disabled=e),n},_create:function(){var t=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),t&&(this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this.icon&&this._addClass(this.icon,null,"ui-state-hover")),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var e=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===e&&/radio|checkbox/.test(this.type)||t.error("Can't create checkboxradio on element.nodeName="+e+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var e,i=this.element[0].name,s="input[name='"+t.ui.escapeSelector(i)+"']";return i?(e=this.form.length?t(this.form[0].elements).filter(s):t(s).filter(function(){return 0===t(this).form().length}),e.not(this.element)):t([])},_toggleClasses:function(){var e=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",e),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",e)._toggleClass(this.icon,null,"ui-icon-blank",!e),"radio"===this.type&&this._getRadioGroup().each(function(){var e=t(this).checkboxradio("instance");e&&e._removeClass(e.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(t,e){return"label"!==t||e?(this._super(t,e),"disabled"===t?(this._toggleClass(this.label,null,"ui-state-disabled",e),this.element[0].disabled=e,void 0):(this.refresh(),void 0)):void 0},_updateIcon:function(e){var i="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=t("<span>"),this.iconSpace=t("<span> </span>"),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(i+=e?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,e?"ui-icon-blank":"ui-icon-check")):i+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",i),e||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var t=this.label.contents().not(this.element[0]);this.icon&&(t=t.not(this.icon[0])),this.iconSpace&&(t=t.not(this.iconSpace[0])),t.remove(),this.label.append(this.options.label)},refresh:function(){var t=this.element[0].checked,e=this.element[0].disabled;this._updateIcon(t),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),null!==this.options.label&&this._updateLabel(),e!==this.options.disabled&&this._setOptions({disabled:e})}}]),t.ui.checkboxradio,t.widget("ui.button",{version:"1.12.1",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var t,e=this._super()||{};return this.isInput=this.element.is("input"),t=this.element[0].disabled,null!=t&&(e.disabled=t),this.originalLabel=this.isInput?this.element.val():this.element.html(),this.originalLabel&&(e.label=this.originalLabel),e},_create:function(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1),this.hasTitle=!!this.element.attr("title"),this.options.label&&this.options.label!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this.element.html(this.options.label)),this._addClass("ui-button","ui-widget"),this._setOption("disabled",this.options.disabled),this._enhance(),this.element.is("a")&&this._on({keyup:function(e){e.keyCode===t.ui.keyCode.SPACE&&(e.preventDefault(),this.element[0].click?this.element[0].click():this.element.trigger("click"))}})},_enhance:function(){this.element.is("button")||this.element.attr("role","button"),this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updateTooltip())},_updateTooltip:function(){this.title=this.element.attr("title"),this.options.showLabel||this.title||this.element.attr("title",this.options.label)},_updateIcon:function(e,i){var s="iconPosition"!==e,n=s?this.options.iconPosition:i,o="top"===n||"bottom"===n;this.icon?s&&this._removeClass(this.icon,null,this.options.icon):(this.icon=t("<span>"),this._addClass(this.icon,"ui-button-icon","ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only")),s&&this._addClass(this.icon,null,i),this._attachIcon(n),o?(this._addClass(this.icon,null,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconSpace||(this.iconSpace=t("<span> </span>"),this._addClass(this.iconSpace,"ui-button-icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._attachIconSpace(n))},_destroy:function(){this.element.removeAttr("role"),this.icon&&this.icon.remove(),this.iconSpace&&this.iconSpace.remove(),this.hasTitle||this.element.removeAttr("title")},_attachIconSpace:function(t){this.icon[/^(?:end|bottom)/.test(t)?"before":"after"](this.iconSpace)},_attachIcon:function(t){this.element[/^(?:end|bottom)/.test(t)?"append":"prepend"](this.icon)},_setOptions:function(t){var e=void 0===t.showLabel?this.options.showLabel:t.showLabel,i=void 0===t.icon?this.options.icon:t.icon;e||i||(t.showLabel=!0),this._super(t)},_setOption:function(t,e){"icon"===t&&(e?this._updateIcon(t,e):this.icon&&(this.icon.remove(),this.iconSpace&&this.iconSpace.remove())),"iconPosition"===t&&this._updateIcon(t,e),"showLabel"===t&&(this._toggleClass("ui-button-icon-only",null,!e),this._updateTooltip()),"label"===t&&(this.isInput?this.element.val(e):(this.element.html(e),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIconSpace(this.options.iconPosition)))),this._super(t,e),"disabled"===t&&(this._toggleClass(null,"ui-state-disabled",e),this.element[0].disabled=e,e&&this.element.blur())},refresh:function(){var t=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOptions({disabled:t}),this._updateTooltip()}}),t.uiBackCompat!==!1&&(t.widget("ui.button",t.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.options.showLabel=this.options.text),!this.options.showLabel&&this.options.text&&(this.options.text=this.options.showLabel),this.options.icon||!this.options.icons.primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.primary=this.options.icon):this.options.icons.primary?this.options.icon=this.options.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.iconPosition="end"),this._super()},_setOption:function(t,e){return"text"===t?(this._super("showLabel",e),void 0):("showLabel"===t&&(this.options.text=e),"icon"===t&&(this.options.icons.primary=e),"icons"===t&&(e.primary?(this._super("icon",e.primary),this._super("iconPosition","beginning")):e.secondary&&(this._super("icon",e.secondary),this._super("iconPosition","end"))),this._superApply(arguments),void 0)}}),t.fn.button=function(e){return function(){return!this.length||this.length&&"INPUT"!==this[0].tagName||this.length&&"INPUT"===this[0].tagName&&"checkbox"!==this.attr("type")&&"radio"!==this.attr("type")?e.apply(this,arguments):(t.ui.checkboxradio||t.error("Checkboxradio widget missing"),0===arguments.length?this.checkboxradio({icon:!1}):this.checkboxradio.apply(this,arguments))}}(t.fn.button),t.fn.buttonset=function(){return t.ui.controlgroup||t.error("Controlgroup widget missing"),"option"===arguments[0]&&"items"===arguments[1]&&arguments[2]?this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]):"option"===arguments[0]&&"items"===arguments[1]?this.controlgroup.apply(this,[arguments[0],"items.button"]):("object"==typeof arguments[0]&&arguments[0].items&&(arguments[0].items={button:arguments[0].items}),this.controlgroup.apply(this,arguments))}),t.ui.button,t.extend(t.ui,{datepicker:{version:"1.12.1"}});var m;t.extend(s.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return a(this._defaults,t||{}),this},_attachDatepicker:function(e,i){var s,n,o;s=e.nodeName.toLowerCase(),n="div"===s||"span"===s,e.id||(this.uuid+=1,e.id="dp"+this.uuid),o=this._newInst(t(e),n),o.settings=t.extend({},i||{}),"input"===s?this._connectDatepicker(e,o):n&&this._inlineDatepicker(e,o)},_newInst:function(e,i){var s=e[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?n(t("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(e,i){var s=t(e);i.append=t([]),i.trigger=t([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp),this._autoSize(i),t.data(e,"datepicker",i),i.settings.disabled&&this._disableDatepicker(e))},_attachments:function(e,i){var s,n,o,a=this._get(i,"appendText"),r=this._get(i,"isRTL");i.append&&i.append.remove(),a&&(i.append=t("<span class='"+this._appendClass+"'>"+a+"</span>"),e[r?"before":"after"](i.append)),e.off("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&e.on("focus",this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),o=this._get(i,"buttonImage"),i.trigger=t(this._get(i,"buttonImageOnly")?t("<img/>").addClass(this._triggerClass).attr({src:o,alt:n,title:n}):t("<button type='button'></button>").addClass(this._triggerClass).html(o?t("<img/>").attr({src:o,alt:n,title:n}):n)),e[r?"before":"after"](i.trigger),i.trigger.on("click",function(){return t.datepicker._datepickerShowing&&t.datepicker._lastInput===e[0]?t.datepicker._hideDatepicker():t.datepicker._datepickerShowing&&t.datepicker._lastInput!==e[0]?(t.datepicker._hideDatepicker(),t.datepicker._showDatepicker(e[0])):t.datepicker._showDatepicker(e[0]),!1}))},_autoSize:function(t){if(this._get(t,"autoSize")&&!t.inline){var e,i,s,n,o=new Date(2009,11,20),a=this._get(t,"dateFormat");a.match(/[DM]/)&&(e=function(t){for(i=0,s=0,n=0;t.length>n;n++)t[n].length>i&&(i=t[n].length,s=n);return s},o.setMonth(e(this._get(t,a.match(/MM/)?"monthNames":"monthNamesShort"))),o.setDate(e(this._get(t,a.match(/DD/)?"dayNames":"dayNamesShort"))+20-o.getDay())),t.input.attr("size",this._formatDate(t,o).length)}},_inlineDatepicker:function(e,i){var s=t(e);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),t.data(e,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(e),i.dpDiv.css("display","block"))},_dialogDatepicker:function(e,i,s,n,o){var r,h,l,c,u,d=this._dialogInst;return d||(this.uuid+=1,r="dp"+this.uuid,this._dialogInput=t("<input type='text' id='"+r+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.on("keydown",this._doKeyDown),t("body").append(this._dialogInput),d=this._dialogInst=this._newInst(this._dialogInput,!1),d.settings={},t.data(this._dialogInput[0],"datepicker",d)),a(d.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(d,i):i,this._dialogInput.val(i),this._pos=o?o.length?o:[o.pageX,o.pageY]:null,this._pos||(h=document.documentElement.clientWidth,l=document.documentElement.clientHeight,c=document.documentElement.scrollLeft||document.body.scrollLeft,u=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[h/2-100+c,l/2-150+u]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),d.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),t.blockUI&&t.blockUI(this.dpDiv),t.data(this._dialogInput[0],"datepicker",d),this},_destroyDatepicker:function(e){var i,s=t(e),n=t.data(e,"datepicker");s.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),t.removeData(e,"datepicker"),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty(),m===n&&(m=null))},_enableDatepicker:function(e){var i,s,n=t(e),o=t.data(e,"datepicker");n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!1,o.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}))},_disableDatepicker:function(e){var i,s,n=t(e),o=t.data(e,"datepicker");n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!0,o.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;this._disabledInputs.length>e;e++)if(this._disabledInputs[e]===t)return!0;return!1},_getInst:function(e){try{return t.data(e,"datepicker")}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(e,i,s){var n,o,r,h,l=this._getInst(e);return 2===arguments.length&&"string"==typeof i?"defaults"===i?t.extend({},t.datepicker._defaults):l?"all"===i?t.extend({},l.settings):this._get(l,i):null:(n=i||{},"string"==typeof i&&(n={},n[i]=s),l&&(this._curInst===l&&this._hideDatepicker(),o=this._getDateDatepicker(e,!0),r=this._getMinMaxDate(l,"min"),h=this._getMinMaxDate(l,"max"),a(l.settings,n),null!==r&&void 0!==n.dateFormat&&void 0===n.minDate&&(l.settings.minDate=this._formatDate(l,r)),null!==h&&void 0!==n.dateFormat&&void 0===n.maxDate&&(l.settings.maxDate=this._formatDate(l,h)),"disabled"in n&&(n.disabled?this._disableDatepicker(e):this._enableDatepicker(e)),this._attachments(t(e),l),this._autoSize(l),this._setDate(l,o),this._updateAlternate(l),this._updateDatepicker(l)),void 0)},_changeDatepicker:function(t,e,i){this._optionDatepicker(t,e,i)},_refreshDatepicker:function(t){var e=this._getInst(t);e&&this._updateDatepicker(e)},_setDateDatepicker:function(t,e){var i=this._getInst(t);i&&(this._setDate(i,e),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(t,e){var i=this._getInst(t);return i&&!i.inline&&this._setDateFromField(i,e),i?this._getDate(i):null},_doKeyDown:function(e){var i,s,n,o=t.datepicker._getInst(e.target),a=!0,r=o.dpDiv.is(".ui-datepicker-rtl");if(o._keyEvent=!0,t.datepicker._datepickerShowing)switch(e.keyCode){case 9:t.datepicker._hideDatepicker(),a=!1;break;case 13:return n=t("td."+t.datepicker._dayOverClass+":not(."+t.datepicker._currentClass+")",o.dpDiv),n[0]&&t.datepicker._selectDay(e.target,o.selectedMonth,o.selectedYear,n[0]),i=t.datepicker._get(o,"onSelect"),i?(s=t.datepicker._formatDate(o),i.apply(o.input?o.input[0]:null,[s,o])):t.datepicker._hideDatepicker(),!1;case 27:t.datepicker._hideDatepicker();break;case 33:t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 34:t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&t.datepicker._clearDate(e.target),a=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&t.datepicker._gotoToday(e.target),a=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,r?1:-1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,-7,"D"),a=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,r?-1:1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,7,"D"),a=e.ctrlKey||e.metaKey;break;default:a=!1}else 36===e.keyCode&&e.ctrlKey?t.datepicker._showDatepicker(this):a=!1;a&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(e){var i,s,n=t.datepicker._getInst(e.target);return t.datepicker._get(n,"constrainInput")?(i=t.datepicker._possibleChars(t.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),e.ctrlKey||e.metaKey||" ">s||!i||i.indexOf(s)>-1):void 0},_doKeyUp:function(e){var i,s=t.datepicker._getInst(e.target);if(s.input.val()!==s.lastVal)try{i=t.datepicker.parseDate(t.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,t.datepicker._getFormatConfig(s)),i&&(t.datepicker._setDateFromField(s),t.datepicker._updateAlternate(s),t.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(e){if(e=e.target||e,"input"!==e.nodeName.toLowerCase()&&(e=t("input",e.parentNode)[0]),!t.datepicker._isDisabledDatepicker(e)&&t.datepicker._lastInput!==e){var s,n,o,r,h,l,c;s=t.datepicker._getInst(e),t.datepicker._curInst&&t.datepicker._curInst!==s&&(t.datepicker._curInst.dpDiv.stop(!0,!0),s&&t.datepicker._datepickerShowing&&t.datepicker._hideDatepicker(t.datepicker._curInst.input[0])),n=t.datepicker._get(s,"beforeShow"),o=n?n.apply(e,[e,s]):{},o!==!1&&(a(s.settings,o),s.lastVal=null,t.datepicker._lastInput=e,t.datepicker._setDateFromField(s),t.datepicker._inDialog&&(e.value=""),t.datepicker._pos||(t.datepicker._pos=t.datepicker._findPos(e),t.datepicker._pos[1]+=e.offsetHeight),r=!1,t(e).parents().each(function(){return r|="fixed"===t(this).css("position"),!r}),h={left:t.datepicker._pos[0],top:t.datepicker._pos[1]},t.datepicker._pos=null,s.dpDiv.empty(),s.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),t.datepicker._updateDatepicker(s),h=t.datepicker._checkOffset(s,h,r),s.dpDiv.css({position:t.datepicker._inDialog&&t.blockUI?"static":r?"fixed":"absolute",display:"none",left:h.left+"px",top:h.top+"px"}),s.inline||(l=t.datepicker._get(s,"showAnim"),c=t.datepicker._get(s,"duration"),s.dpDiv.css("z-index",i(t(e))+1),t.datepicker._datepickerShowing=!0,t.effects&&t.effects.effect[l]?s.dpDiv.show(l,t.datepicker._get(s,"showOptions"),c):s.dpDiv[l||"show"](l?c:null),t.datepicker._shouldFocusInput(s)&&s.input.trigger("focus"),t.datepicker._curInst=s)) + }},_updateDatepicker:function(e){this.maxRows=4,m=e,e.dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e);var i,s=this._getNumberOfMonths(e),n=s[1],a=17,r=e.dpDiv.find("."+this._dayOverClass+" a");r.length>0&&o.apply(r.get(0)),e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&e.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",a*n+"em"),e.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e===t.datepicker._curInst&&t.datepicker._datepickerShowing&&t.datepicker._shouldFocusInput(e)&&e.input.trigger("focus"),e.yearshtml&&(i=e.yearshtml,setTimeout(function(){i===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),i=e.yearshtml=null},0))},_shouldFocusInput:function(t){return t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&!t.input.is(":focus")},_checkOffset:function(e,i,s){var n=e.dpDiv.outerWidth(),o=e.dpDiv.outerHeight(),a=e.input?e.input.outerWidth():0,r=e.input?e.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:t(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:t(document).scrollTop());return i.left-=this._get(e,"isRTL")?n-a:0,i.left-=s&&i.left===e.input.offset().left?t(document).scrollLeft():0,i.top-=s&&i.top===e.input.offset().top+r?t(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+o>l&&l>o?Math.abs(o+r):0),i},_findPos:function(e){for(var i,s=this._getInst(e),n=this._get(s,"isRTL");e&&("hidden"===e.type||1!==e.nodeType||t.expr.filters.hidden(e));)e=e[n?"previousSibling":"nextSibling"];return i=t(e).offset(),[i.left,i.top]},_hideDatepicker:function(e){var i,s,n,o,a=this._curInst;!a||e&&a!==t.data(e,"datepicker")||this._datepickerShowing&&(i=this._get(a,"showAnim"),s=this._get(a,"duration"),n=function(){t.datepicker._tidyDialog(a)},t.effects&&(t.effects.effect[i]||t.effects[i])?a.dpDiv.hide(i,t.datepicker._get(a,"showOptions"),s,n):a.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,o=this._get(a,"onClose"),o&&o.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),t.blockUI&&(t.unblockUI(),t("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(t.datepicker._curInst){var i=t(e.target),s=t.datepicker._getInst(i[0]);(i[0].id!==t.datepicker._mainDivId&&0===i.parents("#"+t.datepicker._mainDivId).length&&!i.hasClass(t.datepicker.markerClassName)&&!i.closest("."+t.datepicker._triggerClass).length&&t.datepicker._datepickerShowing&&(!t.datepicker._inDialog||!t.blockUI)||i.hasClass(t.datepicker.markerClassName)&&t.datepicker._curInst!==s)&&t.datepicker._hideDatepicker()}},_adjustDate:function(e,i,s){var n=t(e),o=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(o,i+("M"===s?this._get(o,"showCurrentAtPos"):0),s),this._updateDatepicker(o))},_gotoToday:function(e){var i,s=t(e),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(e,i,s){var n=t(e),o=this._getInst(n[0]);o["selected"+("M"===s?"Month":"Year")]=o["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(o),this._adjustDate(n)},_selectDay:function(e,i,s,n){var o,a=t(e);t(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(a[0])||(o=this._getInst(a[0]),o.selectedDay=o.currentDay=t("a",n).html(),o.selectedMonth=o.currentMonth=i,o.selectedYear=o.currentYear=s,this._selectDate(e,this._formatDate(o,o.currentDay,o.currentMonth,o.currentYear)))},_clearDate:function(e){var i=t(e);this._selectDate(i,"")},_selectDate:function(e,i){var s,n=t(e),o=this._getInst(n[0]);i=null!=i?i:this._formatDate(o),o.input&&o.input.val(i),this._updateAlternate(o),s=this._get(o,"onSelect"),s?s.apply(o.input?o.input[0]:null,[i,o]):o.input&&o.input.trigger("change"),o.inline?this._updateDatepicker(o):(this._hideDatepicker(),this._lastInput=o.input[0],"object"!=typeof o.input[0]&&o.input.trigger("focus"),this._lastInput=null)},_updateAlternate:function(e){var i,s,n,o=this._get(e,"altField");o&&(i=this._get(e,"altFormat")||this._get(e,"dateFormat"),s=this._getDate(e),n=this.formatDate(i,s,this._getFormatConfig(e)),t(o).val(n))},noWeekends:function(t){var e=t.getDay();return[e>0&&6>e,""]},iso8601Week:function(t){var e,i=new Date(t.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),e=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((e-i)/864e5)/7)+1},parseDate:function(e,i,s){if(null==e||null==i)throw"Invalid arguments";if(i="object"==typeof i?""+i:i+"",""===i)return null;var n,o,a,r,h=0,l=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,c="string"!=typeof l?l:(new Date).getFullYear()%100+parseInt(l,10),u=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,d=(s?s.dayNames:null)||this._defaults.dayNames,p=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,f=(s?s.monthNames:null)||this._defaults.monthNames,g=-1,m=-1,_=-1,v=-1,b=!1,y=function(t){var i=e.length>n+1&&e.charAt(n+1)===t;return i&&n++,i},w=function(t){var e=y(t),s="@"===t?14:"!"===t?20:"y"===t&&e?4:"o"===t?3:2,n="y"===t?s:1,o=RegExp("^\\d{"+n+","+s+"}"),a=i.substring(h).match(o);if(!a)throw"Missing number at position "+h;return h+=a[0].length,parseInt(a[0],10)},k=function(e,s,n){var o=-1,a=t.map(y(e)?n:s,function(t,e){return[[e,t]]}).sort(function(t,e){return-(t[1].length-e[1].length)});if(t.each(a,function(t,e){var s=e[1];return i.substr(h,s.length).toLowerCase()===s.toLowerCase()?(o=e[0],h+=s.length,!1):void 0}),-1!==o)return o+1;throw"Unknown name at position "+h},x=function(){if(i.charAt(h)!==e.charAt(n))throw"Unexpected literal at position "+h;h++};for(n=0;e.length>n;n++)if(b)"'"!==e.charAt(n)||y("'")?x():b=!1;else switch(e.charAt(n)){case"d":_=w("d");break;case"D":k("D",u,d);break;case"o":v=w("o");break;case"m":m=w("m");break;case"M":m=k("M",p,f);break;case"y":g=w("y");break;case"@":r=new Date(w("@")),g=r.getFullYear(),m=r.getMonth()+1,_=r.getDate();break;case"!":r=new Date((w("!")-this._ticksTo1970)/1e4),g=r.getFullYear(),m=r.getMonth()+1,_=r.getDate();break;case"'":y("'")?x():b=!0;break;default:x()}if(i.length>h&&(a=i.substr(h),!/^\s+/.test(a)))throw"Extra/unparsed characters found in date: "+a;if(-1===g?g=(new Date).getFullYear():100>g&&(g+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c>=g?0:-100)),v>-1)for(m=1,_=v;;){if(o=this._getDaysInMonth(g,m-1),o>=_)break;m++,_-=o}if(r=this._daylightSavingAdjust(new Date(g,m-1,_)),r.getFullYear()!==g||r.getMonth()+1!==m||r.getDate()!==_)throw"Invalid date";return r},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(t,e,i){if(!e)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,o=(i?i.dayNames:null)||this._defaults.dayNames,a=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,h=function(e){var i=t.length>s+1&&t.charAt(s+1)===e;return i&&s++,i},l=function(t,e,i){var s=""+e;if(h(t))for(;i>s.length;)s="0"+s;return s},c=function(t,e,i,s){return h(t)?s[e]:i[e]},u="",d=!1;if(e)for(s=0;t.length>s;s++)if(d)"'"!==t.charAt(s)||h("'")?u+=t.charAt(s):d=!1;else switch(t.charAt(s)){case"d":u+=l("d",e.getDate(),2);break;case"D":u+=c("D",e.getDay(),n,o);break;case"o":u+=l("o",Math.round((new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-new Date(e.getFullYear(),0,0).getTime())/864e5),3);break;case"m":u+=l("m",e.getMonth()+1,2);break;case"M":u+=c("M",e.getMonth(),a,r);break;case"y":u+=h("y")?e.getFullYear():(10>e.getFullYear()%100?"0":"")+e.getFullYear()%100;break;case"@":u+=e.getTime();break;case"!":u+=1e4*e.getTime()+this._ticksTo1970;break;case"'":h("'")?u+="'":d=!0;break;default:u+=t.charAt(s)}return u},_possibleChars:function(t){var e,i="",s=!1,n=function(i){var s=t.length>e+1&&t.charAt(e+1)===i;return s&&e++,s};for(e=0;t.length>e;e++)if(s)"'"!==t.charAt(e)||n("'")?i+=t.charAt(e):s=!1;else switch(t.charAt(e)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=t.charAt(e)}return i},_get:function(t,e){return void 0!==t.settings[e]?t.settings[e]:this._defaults[e]},_setDateFromField:function(t,e){if(t.input.val()!==t.lastVal){var i=this._get(t,"dateFormat"),s=t.lastVal=t.input?t.input.val():null,n=this._getDefaultDate(t),o=n,a=this._getFormatConfig(t);try{o=this.parseDate(i,s,a)||n}catch(r){s=e?"":s}t.selectedDay=o.getDate(),t.drawMonth=t.selectedMonth=o.getMonth(),t.drawYear=t.selectedYear=o.getFullYear(),t.currentDay=s?o.getDate():0,t.currentMonth=s?o.getMonth():0,t.currentYear=s?o.getFullYear():0,this._adjustInstDate(t)}},_getDefaultDate:function(t){return this._restrictMinMax(t,this._determineDate(t,this._get(t,"defaultDate"),new Date))},_determineDate:function(e,i,s){var n=function(t){var e=new Date;return e.setDate(e.getDate()+t),e},o=function(i){try{return t.datepicker.parseDate(t.datepicker._get(e,"dateFormat"),i,t.datepicker._getFormatConfig(e))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?t.datepicker._getDate(e):null)||new Date,o=n.getFullYear(),a=n.getMonth(),r=n.getDate(),h=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=h.exec(i);l;){switch(l[2]||"d"){case"d":case"D":r+=parseInt(l[1],10);break;case"w":case"W":r+=7*parseInt(l[1],10);break;case"m":case"M":a+=parseInt(l[1],10),r=Math.min(r,t.datepicker._getDaysInMonth(o,a));break;case"y":case"Y":o+=parseInt(l[1],10),r=Math.min(r,t.datepicker._getDaysInMonth(o,a))}l=h.exec(i)}return new Date(o,a,r)},a=null==i||""===i?s:"string"==typeof i?o(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return a=a&&"Invalid Date"==""+a?s:a,a&&(a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)),this._daylightSavingAdjust(a)},_daylightSavingAdjust:function(t){return t?(t.setHours(t.getHours()>12?t.getHours()+2:0),t):null},_setDate:function(t,e,i){var s=!e,n=t.selectedMonth,o=t.selectedYear,a=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=a.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=a.getMonth(),t.drawYear=t.selectedYear=t.currentYear=a.getFullYear(),n===t.selectedMonth&&o===t.selectedYear||i||this._notifyChange(t),this._adjustInstDate(t),t.input&&t.input.val(s?"":this._formatDate(t))},_getDate:function(t){var e=!t.currentYear||t.input&&""===t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return e},_attachHandlers:function(e){var i=this._get(e,"stepMonths"),s="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){t.datepicker._adjustDate(s,-i,"M")},next:function(){t.datepicker._adjustDate(s,+i,"M")},hide:function(){t.datepicker._hideDatepicker()},today:function(){t.datepicker._gotoToday(s)},selectDay:function(){return t.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return t.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return t.datepicker._selectMonthYear(s,this,"Y"),!1}};t(this).on(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(t){var e,i,s,n,o,a,r,h,l,c,u,d,p,f,g,m,_,v,b,y,w,k,x,C,D,I,T,P,M,S,H,z,O,A,N,W,E,F,L,R=new Date,B=this._daylightSavingAdjust(new Date(R.getFullYear(),R.getMonth(),R.getDate())),Y=this._get(t,"isRTL"),j=this._get(t,"showButtonPanel"),q=this._get(t,"hideIfNoPrevNext"),K=this._get(t,"navigationAsDateFormat"),U=this._getNumberOfMonths(t),V=this._get(t,"showCurrentAtPos"),$=this._get(t,"stepMonths"),X=1!==U[0]||1!==U[1],G=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),Q=this._getMinMaxDate(t,"min"),J=this._getMinMaxDate(t,"max"),Z=t.drawMonth-V,te=t.drawYear;if(0>Z&&(Z+=12,te--),J)for(e=this._daylightSavingAdjust(new Date(J.getFullYear(),J.getMonth()-U[0]*U[1]+1,J.getDate())),e=Q&&Q>e?Q:e;this._daylightSavingAdjust(new Date(te,Z,1))>e;)Z--,0>Z&&(Z=11,te--);for(t.drawMonth=Z,t.drawYear=te,i=this._get(t,"prevText"),i=K?this.formatDate(i,this._daylightSavingAdjust(new Date(te,Z-$,1)),this._getFormatConfig(t)):i,s=this._canAdjustMonth(t,-1,te,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>":q?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>",n=this._get(t,"nextText"),n=K?this.formatDate(n,this._daylightSavingAdjust(new Date(te,Z+$,1)),this._getFormatConfig(t)):n,o=this._canAdjustMonth(t,1,te,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>":q?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>",a=this._get(t,"currentText"),r=this._get(t,"gotoCurrent")&&t.currentDay?G:B,a=K?this.formatDate(a,r,this._getFormatConfig(t)):a,h=t.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(t,"closeText")+"</button>",l=j?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(Y?h:"")+(this._isInRange(t,r)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+a+"</button>":"")+(Y?"":h)+"</div>":"",c=parseInt(this._get(t,"firstDay"),10),c=isNaN(c)?0:c,u=this._get(t,"showWeek"),d=this._get(t,"dayNames"),p=this._get(t,"dayNamesMin"),f=this._get(t,"monthNames"),g=this._get(t,"monthNamesShort"),m=this._get(t,"beforeShowDay"),_=this._get(t,"showOtherMonths"),v=this._get(t,"selectOtherMonths"),b=this._getDefaultDate(t),y="",k=0;U[0]>k;k++){for(x="",this.maxRows=4,C=0;U[1]>C;C++){if(D=this._daylightSavingAdjust(new Date(te,Z,t.selectedDay)),I=" ui-corner-all",T="",X){if(T+="<div class='ui-datepicker-group",U[1]>1)switch(C){case 0:T+=" ui-datepicker-group-first",I=" ui-corner-"+(Y?"right":"left");break;case U[1]-1:T+=" ui-datepicker-group-last",I=" ui-corner-"+(Y?"left":"right");break;default:T+=" ui-datepicker-group-middle",I=""}T+="'>"}for(T+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+I+"'>"+(/all|left/.test(I)&&0===k?Y?o:s:"")+(/all|right/.test(I)&&0===k?Y?s:o:"")+this._generateMonthYearHeader(t,Z,te,Q,J,k>0||C>0,f,g)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",P=u?"<th class='ui-datepicker-week-col'>"+this._get(t,"weekHeader")+"</th>":"",w=0;7>w;w++)M=(w+c)%7,P+="<th scope='col'"+((w+c+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+d[M]+"'>"+p[M]+"</span></th>";for(T+=P+"</tr></thead><tbody>",S=this._getDaysInMonth(te,Z),te===t.selectedYear&&Z===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,S)),H=(this._getFirstDayOfMonth(te,Z)-c+7)%7,z=Math.ceil((H+S)/7),O=X?this.maxRows>z?this.maxRows:z:z,this.maxRows=O,A=this._daylightSavingAdjust(new Date(te,Z,1-H)),N=0;O>N;N++){for(T+="<tr>",W=u?"<td class='ui-datepicker-week-col'>"+this._get(t,"calculateWeek")(A)+"</td>":"",w=0;7>w;w++)E=m?m.apply(t.input?t.input[0]:null,[A]):[!0,""],F=A.getMonth()!==Z,L=F&&!v||!E[0]||Q&&Q>A||J&&A>J,W+="<td class='"+((w+c+6)%7>=5?" ui-datepicker-week-end":"")+(F?" ui-datepicker-other-month":"")+(A.getTime()===D.getTime()&&Z===t.selectedMonth&&t._keyEvent||b.getTime()===A.getTime()&&b.getTime()===D.getTime()?" "+this._dayOverClass:"")+(L?" "+this._unselectableClass+" ui-state-disabled":"")+(F&&!_?"":" "+E[1]+(A.getTime()===G.getTime()?" "+this._currentClass:"")+(A.getTime()===B.getTime()?" ui-datepicker-today":""))+"'"+(F&&!_||!E[2]?"":" title='"+E[2].replace(/'/g,"'")+"'")+(L?"":" data-handler='selectDay' data-event='click' data-month='"+A.getMonth()+"' data-year='"+A.getFullYear()+"'")+">"+(F&&!_?" ":L?"<span class='ui-state-default'>"+A.getDate()+"</span>":"<a class='ui-state-default"+(A.getTime()===B.getTime()?" ui-state-highlight":"")+(A.getTime()===G.getTime()?" ui-state-active":"")+(F?" ui-priority-secondary":"")+"' href='#'>"+A.getDate()+"</a>")+"</td>",A.setDate(A.getDate()+1),A=this._daylightSavingAdjust(A);T+=W+"</tr>"}Z++,Z>11&&(Z=0,te++),T+="</tbody></table>"+(X?"</div>"+(U[0]>0&&C===U[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),x+=T}y+=x}return y+=l,t._keyEvent=!1,y},_generateMonthYearHeader:function(t,e,i,s,n,o,a,r){var h,l,c,u,d,p,f,g,m=this._get(t,"changeMonth"),_=this._get(t,"changeYear"),v=this._get(t,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",y="";if(o||!m)y+="<span class='ui-datepicker-month'>"+a[e]+"</span>";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,y+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",c=0;12>c;c++)(!h||c>=s.getMonth())&&(!l||n.getMonth()>=c)&&(y+="<option value='"+c+"'"+(c===e?" selected='selected'":"")+">"+r[c]+"</option>");y+="</select>"}if(v||(b+=y+(!o&&m&&_?"":" ")),!t.yearshtml)if(t.yearshtml="",o||!_)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(u=this._get(t,"yearRange").split(":"),d=(new Date).getFullYear(),p=function(t){var e=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?d+parseInt(t,10):parseInt(t,10);return isNaN(e)?d:e},f=p(u[0]),g=Math.max(f,p(u[1]||"")),f=s?Math.max(f,s.getFullYear()):f,g=n?Math.min(g,n.getFullYear()):g,t.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";g>=f;f++)t.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";t.yearshtml+="</select>",b+=t.yearshtml,t.yearshtml=null}return b+=this._get(t,"yearSuffix"),v&&(b+=(!o&&m&&_?"":" ")+y),b+="</div>"},_adjustInstDate:function(t,e,i){var s=t.selectedYear+("Y"===i?e:0),n=t.selectedMonth+("M"===i?e:0),o=Math.min(t.selectedDay,this._getDaysInMonth(s,n))+("D"===i?e:0),a=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(s,n,o)));t.selectedDay=a.getDate(),t.drawMonth=t.selectedMonth=a.getMonth(),t.drawYear=t.selectedYear=a.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),s=this._getMinMaxDate(t,"max"),n=i&&i>e?i:e;return s&&n>s?s:n},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){var e=this._get(t,"numberOfMonths");return null==e?[1,1]:"number"==typeof e?[1,e]:e},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,i,s){var n=this._getNumberOfMonths(t),o=this._daylightSavingAdjust(new Date(i,s+(0>e?e:n[0]*n[1]),1));return 0>e&&o.setDate(this._getDaysInMonth(o.getFullYear(),o.getMonth())),this._isInRange(t,o)},_isInRange:function(t,e){var i,s,n=this._getMinMaxDate(t,"min"),o=this._getMinMaxDate(t,"max"),a=null,r=null,h=this._get(t,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),a=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(a+=s),i[1].match(/[+\-].*/)&&(r+=s)),(!n||e.getTime()>=n.getTime())&&(!o||e.getTime()<=o.getTime())&&(!a||e.getFullYear()>=a)&&(!r||r>=e.getFullYear())},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),{shortYearCutoff:e,dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,s){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);var n=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(s,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),n,this._getFormatConfig(t))}}),t.fn.datepicker=function(e){if(!this.length)return this;t.datepicker.initialized||(t(document).on("mousedown",t.datepicker._checkExternalClick),t.datepicker.initialized=!0),0===t("#"+t.datepicker._mainDivId).length&&t("body").append(t.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof e||"isDisabled"!==e&&"getDate"!==e&&"widget"!==e?"option"===e&&2===arguments.length&&"string"==typeof arguments[1]?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof e?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this].concat(i)):t.datepicker._attachDatepicker(this,e)}):t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i))},t.datepicker=new s,t.datepicker.initialized=!1,t.datepicker.uuid=(new Date).getTime(),t.datepicker.version="1.12.1",t.datepicker,t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var _=!1;t(document).on("mouseup",function(){_=!1}),t.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){if(!_){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e;var i=this,s=1===e.which,n="string"==typeof this.options.cancel&&e.target.nodeName?t(e.target).closest(this.options.cancel).length:!1;return s&&!n&&this._mouseCapture(e)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(e)!==!1,!this._mouseStarted)?(e.preventDefault(),!0):(!0===t.data(e.target,this.widgetName+".preventClickEvent")&&t.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return i._mouseMove(t)},this._mouseUpDelegate=function(t){return i._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),_=!0,!0)):!0}},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button)return this._mouseUp(e);if(!e.which)if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,_=!1,e.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),t.ui.plugin={add:function(e,i,s){var n,o=t.ui[e].prototype;for(n in s)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([i,s[n]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;o.length>n;n++)t.options[o[n][0]]&&o[n][1].apply(t.element,i)}},t.ui.safeBlur=function(e){e&&"body"!==e.nodeName.toLowerCase()&&t(e).trigger("blur")},t.widget("ui.draggable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(t,e){this._super(t,e),"handle"===t&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(e){var i=this.options;return this.helper||i.disabled||t(e.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(e),this.handle?(this._blurActiveElement(e),this._blockFrames(i.iframeFix===!0?"iframe":i.iframeFix),!0):!1)},_blockFrames:function(e){this.iframeBlocks=this.document.find(e).map(function(){var e=t(this);return t("<div>").css("position","absolute").appendTo(e.parent()).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(e){var i=t.ui.safeActiveElement(this.document[0]),s=t(e.target);s.closest(i).length||t.ui.safeBlur(i)},_mouseStart:function(e){var i=this.options;return this.helper=this._createHelper(e),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===t(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(e),this.originalPosition=this.position=this._generatePosition(e,!1),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",e)===!1?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(e,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",e,s)===!1)return this._mouseUp(new t.Event("mouseup",e)),!1;this.position=s.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var i=this,s=!1;return t.ui.ddmanager&&!this.options.dropBehaviour&&(s=t.ui.ddmanager.drop(this,e)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",e)!==!1&&i._clear()}):this._trigger("stop",e)!==!1&&this._clear(),!1},_mouseUp:function(e){return this._unblockFrames(),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),this.handleElement.is(e.target)&&this.element.trigger("focus"),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new t.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(e){return this.options.handle?!!t(e.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper),n=s?t(i.helper.apply(this.element[0],[e])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s&&n[0]===this.element[0]&&this._setPositionRelative(),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var e=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(e?0:this.scrollParent.scrollTop()),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(e?0:this.scrollParent.scrollLeft())} + },_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options,o=this.document[0];return this.relativeContainer=null,n.containment?"window"===n.containment?(this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===n.containment?(this.containment=[0,0,t(o).width()-this.helperProportions.width-this.margins.left,(t(o).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):n.containment.constructor===Array?(this.containment=n.containment,void 0):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=t(n.containment),s=i[0],s&&(e=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(e?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i),void 0):(this.containment=null,void 0)},_convertPositionTo:function(t,e){e||(e=this.position);var i="absolute"===t?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(t,e){var i,s,n,o,a=this.options,r=this._isRootNode(this.scrollParent[0]),h=t.pageX,l=t.pageY;return r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),e&&(this.containment&&(this.relativeContainer?(s=this.relativeContainer.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,t.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),t.pageY-this.offset.click.top<i[1]&&(l=i[1]+this.offset.click.top),t.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),a.grid&&(n=a.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/a.grid[1])*a.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-a.grid[1]:n+a.grid[1]:n,o=a.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/a.grid[0])*a.grid[0]:this.originalPageX,h=i?o-this.offset.click.left>=i[0]||o-this.offset.click.left>i[2]?o:o-this.offset.click.left>=i[0]?o-a.grid[0]:o+a.grid[0]:o),"y"===a.axis&&(h=this.originalPageX),"x"===a.axis&&(l=this.originalPageY)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(e,i,s){return s=s||this._uiHash(),t.ui.plugin.call(this,e,[i,s,this],!0),/^(drag|start|stop)/.test(e)&&(this.positionAbs=this._convertPositionTo("absolute"),s.offset=this.positionAbs),t.Widget.prototype._trigger.call(this,e,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i,s){var n=t.extend({},i,{item:s.element});s.sortables=[],t(s.options.connectToSortable).each(function(){var i=t(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push(i),i.refreshPositions(),i._trigger("activate",e,n))})},stop:function(e,i,s){var n=t.extend({},i,{item:s.element});s.cancelHelperRemoval=!1,t.each(s.sortables,function(){var t=this;t.isOver?(t.isOver=0,s.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,n))})},drag:function(e,i,s){t.each(s.sortables,function(){var n=!1,o=this;o.positionAbs=s.positionAbs,o.helperProportions=s.helperProportions,o.offset.click=s.offset.click,o._intersectsWith(o.containerCache)&&(n=!0,t.each(s.sortables,function(){return this.positionAbs=s.positionAbs,this.helperProportions=s.helperProportions,this.offset.click=s.offset.click,this!==o&&this._intersectsWith(this.containerCache)&&t.contains(o.element[0],this.element[0])&&(n=!1),n})),n?(o.isOver||(o.isOver=1,s._parent=i.helper.parent(),o.currentItem=i.helper.appendTo(o.element).data("ui-sortable-item",!0),o.options._helper=o.options.helper,o.options.helper=function(){return i.helper[0]},e.target=o.currentItem[0],o._mouseCapture(e,!0),o._mouseStart(e,!0,!0),o.offset.click.top=s.offset.click.top,o.offset.click.left=s.offset.click.left,o.offset.parent.left-=s.offset.parent.left-o.offset.parent.left,o.offset.parent.top-=s.offset.parent.top-o.offset.parent.top,s._trigger("toSortable",e),s.dropped=o.element,t.each(s.sortables,function(){this.refreshPositions()}),s.currentItem=s.element,o.fromOutside=s),o.currentItem&&(o._mouseDrag(e),i.position=o.position)):o.isOver&&(o.isOver=0,o.cancelHelperRemoval=!0,o.options._revert=o.options.revert,o.options.revert=!1,o._trigger("out",e,o._uiHash(o)),o._mouseStop(e,!0),o.options.revert=o.options._revert,o.options.helper=o.options._helper,o.placeholder&&o.placeholder.remove(),i.helper.appendTo(s._parent),s._refreshOffsets(e),i.position=s._generatePosition(e,!0),s._trigger("fromSortable",e),s.dropped=!1,t.each(s.sortables,function(){this.refreshPositions()}))})}}),t.ui.plugin.add("draggable","cursor",{start:function(e,i,s){var n=t("body"),o=s.options;n.css("cursor")&&(o._cursor=n.css("cursor")),n.css("cursor",o.cursor)},stop:function(e,i,s){var n=s.options;n._cursor&&t("body").css("cursor",n._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,i,s){var n=t(i.helper),o=s.options;n.css("opacity")&&(o._opacity=n.css("opacity")),n.css("opacity",o.opacity)},stop:function(e,i,s){var n=s.options;n._opacity&&t(i.helper).css("opacity",n._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(t,e,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(e,i,s){var n=s.options,o=!1,a=s.scrollParentNotHidden[0],r=s.document[0];a!==r&&"HTML"!==a.tagName?(n.axis&&"x"===n.axis||(s.overflowOffset.top+a.offsetHeight-e.pageY<n.scrollSensitivity?a.scrollTop=o=a.scrollTop+n.scrollSpeed:e.pageY-s.overflowOffset.top<n.scrollSensitivity&&(a.scrollTop=o=a.scrollTop-n.scrollSpeed)),n.axis&&"y"===n.axis||(s.overflowOffset.left+a.offsetWidth-e.pageX<n.scrollSensitivity?a.scrollLeft=o=a.scrollLeft+n.scrollSpeed:e.pageX-s.overflowOffset.left<n.scrollSensitivity&&(a.scrollLeft=o=a.scrollLeft-n.scrollSpeed))):(n.axis&&"x"===n.axis||(e.pageY-t(r).scrollTop()<n.scrollSensitivity?o=t(r).scrollTop(t(r).scrollTop()-n.scrollSpeed):t(window).height()-(e.pageY-t(r).scrollTop())<n.scrollSensitivity&&(o=t(r).scrollTop(t(r).scrollTop()+n.scrollSpeed))),n.axis&&"y"===n.axis||(e.pageX-t(r).scrollLeft()<n.scrollSensitivity?o=t(r).scrollLeft(t(r).scrollLeft()-n.scrollSpeed):t(window).width()-(e.pageX-t(r).scrollLeft())<n.scrollSensitivity&&(o=t(r).scrollLeft(t(r).scrollLeft()+n.scrollSpeed)))),o!==!1&&t.ui.ddmanager&&!n.dropBehaviour&&t.ui.ddmanager.prepareOffsets(s,e)}}),t.ui.plugin.add("draggable","snap",{start:function(e,i,s){var n=s.options;s.snapElements=[],t(n.snap.constructor!==String?n.snap.items||":data(ui-draggable)":n.snap).each(function(){var e=t(this),i=e.offset();this!==s.element[0]&&s.snapElements.push({item:this,width:e.outerWidth(),height:e.outerHeight(),top:i.top,left:i.left})})},drag:function(e,i,s){var n,o,a,r,h,l,c,u,d,p,f=s.options,g=f.snapTolerance,m=i.offset.left,_=m+s.helperProportions.width,v=i.offset.top,b=v+s.helperProportions.height;for(d=s.snapElements.length-1;d>=0;d--)h=s.snapElements[d].left-s.margins.left,l=h+s.snapElements[d].width,c=s.snapElements[d].top-s.margins.top,u=c+s.snapElements[d].height,h-g>_||m>l+g||c-g>b||v>u+g||!t.contains(s.snapElements[d].item.ownerDocument,s.snapElements[d].item)?(s.snapElements[d].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[d].item})),s.snapElements[d].snapping=!1):("inner"!==f.snapMode&&(n=g>=Math.abs(c-b),o=g>=Math.abs(u-v),a=g>=Math.abs(h-_),r=g>=Math.abs(l-m),n&&(i.position.top=s._convertPositionTo("relative",{top:c-s.helperProportions.height,left:0}).top),o&&(i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top),a&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h-s.helperProportions.width}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l}).left)),p=n||o||a||r,"outer"!==f.snapMode&&(n=g>=Math.abs(c-v),o=g>=Math.abs(u-b),a=g>=Math.abs(h-m),r=g>=Math.abs(l-_),n&&(i.position.top=s._convertPositionTo("relative",{top:c,left:0}).top),o&&(i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top),a&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left)),!s.snapElements[d].snapping&&(n||o||a||r||p)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[d].item})),s.snapElements[d].snapping=n||o||a||r||p)}}),t.ui.plugin.add("draggable","stack",{start:function(e,i,s){var n,o=s.options,a=t.makeArray(t(o.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});a.length&&(n=parseInt(t(a[0]).css("zIndex"),10)||0,t(a).each(function(e){t(this).css("zIndex",n+e)}),this.css("zIndex",n+a.length))}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,i,s){var n=t(i.helper),o=s.options;n.css("zIndex")&&(o._zIndex=n.css("zIndex")),n.css("zIndex",o.zIndex)},stop:function(e,i,s){var n=s.options;n._zIndex&&t(i.helper).css("zIndex",n._zIndex)}}),t.ui.draggable,t.widget("ui.resizable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return e[s]>0?!0:(e[s]=1,n=e[s]>0,e[s]=0,n)},_create:function(){var e,i=this.options,s=this;this._addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!i.aspectRatio,aspectRatio:i.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:i.helper||i.ghost||i.animate?i.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(t("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,e={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(e),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(e),this._proportionallyResize()),this._setupHandles(),i.autoHide&&t(this.element).on("mouseenter",function(){i.disabled||(s._removeClass("ui-resizable-autohide"),s._handles.show())}).on("mouseleave",function(){i.disabled||s.resizing||(s._addClass("ui-resizable-autohide"),s._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,i=function(e){t(e).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;default:}},_setupHandles:function(){var e,i,s,n,o,a=this.options,r=this;if(this.handles=a.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=t(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),s=this.handles.split(","),this.handles={},i=0;s.length>i;i++)e=t.trim(s[i]),n="ui-resizable-"+e,o=t("<div>"),this._addClass(o,"ui-resizable-handle "+n),o.css({zIndex:a.zIndex}),this.handles[e]=".ui-resizable-"+e,this.element.append(o);this._renderAxis=function(e){var i,s,n,o;e=e||this.element;for(i in this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=t(this.handles[i]),this._on(this.handles[i],{mousedown:r._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(s=t(this.handles[i],this.element),o=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(n,o),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){r.resizing||(this.className&&(o=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),r.axis=o&&o[1]?o[1]:"se")}),a.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(e){var i,s,n=!1;for(i in this.handles)s=t(this.handles[i])[0],(s===e.target||t.contains(s,e.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(e){var i,s,n,o=this.options,a=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),s=this._num(this.helper.css("top")),o.containment&&(i+=t(o.containment).scrollLeft()||0,s+=t(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:s},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:a.width(),height:a.height()},this.originalSize=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()},this.sizeDiff={width:a.outerWidth()-a.width(),height:a.outerHeight()-a.height()},this.originalPosition={left:i,top:s},this.originalMousePosition={left:e.pageX,top:e.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===n?this.axis+"-resize":n),this._addClass("ui-resizable-resizing"),this._propagate("start",e),!0},_mouseDrag:function(e){var i,s,n=this.originalMousePosition,o=this.axis,a=e.pageX-n.left||0,r=e.pageY-n.top||0,h=this._change[o];return this._updatePrevProperties(),h?(i=h.apply(this,[e,a,r]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",e,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(e){this.resizing=!1;var i,s,n,o,a,r,h,l=this.options,c=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&this._hasScroll(i[0],"left")?0:c.sizeDiff.height,o=s?0:c.sizeDiff.width,a={width:c.helper.width()-o,height:c.helper.height()-n},r=parseFloat(c.element.css("left"))+(c.position.left-c.originalPosition.left)||null,h=parseFloat(c.element.css("top"))+(c.position.top-c.originalPosition.top)||null,l.animate||this.element.css(t.extend(a,{top:h,left:r})),c.helper.height(c.size.height),c.helper.width(c.size.width),this._helper&&!l.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s,n,o,a=this.options;o={minWidth:this._isNumber(a.minWidth)?a.minWidth:0,maxWidth:this._isNumber(a.maxWidth)?a.maxWidth:1/0,minHeight:this._isNumber(a.minHeight)?a.minHeight:0,maxHeight:this._isNumber(a.maxHeight)?a.maxHeight:1/0},(this._aspectRatio||t)&&(e=o.minHeight*this.aspectRatio,s=o.minWidth/this.aspectRatio,i=o.maxHeight*this.aspectRatio,n=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),s>o.minHeight&&(o.minHeight=s),o.maxWidth>i&&(o.maxWidth=i),o.maxHeight>n&&(o.maxHeight=n)),this._vBoundaries=o},_updateCache:function(t){this.offset=this.helper.offset(),this._isNumber(t.left)&&(this.position.left=t.left),this._isNumber(t.top)&&(this.position.top=t.top),this._isNumber(t.height)&&(this.size.height=t.height),this._isNumber(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,i=this.size,s=this.axis;return this._isNumber(t.height)?t.width=t.height*this.aspectRatio:this._isNumber(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===s&&(t.left=e.left+(i.width-t.width),t.top=null),"nw"===s&&(t.top=e.top+(i.height-t.height),t.left=e.left+(i.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,s=this._isNumber(t.width)&&e.maxWidth&&e.maxWidth<t.width,n=this._isNumber(t.height)&&e.maxHeight&&e.maxHeight<t.height,o=this._isNumber(t.width)&&e.minWidth&&e.minWidth>t.width,a=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,r=this.originalPosition.left+this.originalSize.width,h=this.originalPosition.top+this.originalSize.height,l=/sw|nw|w/.test(i),c=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),a&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&l&&(t.left=r-e.minWidth),s&&l&&(t.left=r-e.maxWidth),a&&c&&(t.top=h-e.minHeight),n&&c&&(t.top=h-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];4>e;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;this._proportionallyResizeElements.length>e;e++)t=this._proportionallyResizeElements[e],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(t)),t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t("<div style='overflow:hidden;'></div>"),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize,s=this.originalPosition;return{left:s.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},sw:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,s]))},ne:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},nw:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,s]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var i=t(this).resizable("instance"),s=i.options,n=i._proportionallyResizeElements,o=n.length&&/textarea/i.test(n[0].nodeName),a=o&&i._hasScroll(n[0],"left")?0:i.sizeDiff.height,r=o?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-a},l=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,c=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(h,c&&l?{top:c,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};n&&n.length&&t(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var e,i,s,n,o,a,r,h=t(this).resizable("instance"),l=h.options,c=h.element,u=l.containment,d=u instanceof t?u.get(0):/parent/.test(u)?c.parent().get(0):u;d&&(h.containerElement=t(d),/document/.test(u)||u===document?(h.containerOffset={left:0,top:0},h.containerPosition={left:0,top:0},h.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(e=t(d),i=[],t(["Top","Right","Left","Bottom"]).each(function(t,s){i[t]=h._num(e.css("padding"+s))}),h.containerOffset=e.offset(),h.containerPosition=e.position(),h.containerSize={height:e.innerHeight()-i[3],width:e.innerWidth()-i[1]},s=h.containerOffset,n=h.containerSize.height,o=h.containerSize.width,a=h._hasScroll(d,"left")?d.scrollWidth:o,r=h._hasScroll(d)?d.scrollHeight:n,h.parentData={element:d,left:s.left,top:s.top,width:a,height:r}))},resize:function(e){var i,s,n,o,a=t(this).resizable("instance"),r=a.options,h=a.containerOffset,l=a.position,c=a._aspectRatio||e.shiftKey,u={top:0,left:0},d=a.containerElement,p=!0;d[0]!==document&&/static/.test(d.css("position"))&&(u=h),l.left<(a._helper?h.left:0)&&(a.size.width=a.size.width+(a._helper?a.position.left-h.left:a.position.left-u.left),c&&(a.size.height=a.size.width/a.aspectRatio,p=!1),a.position.left=r.helper?h.left:0),l.top<(a._helper?h.top:0)&&(a.size.height=a.size.height+(a._helper?a.position.top-h.top:a.position.top),c&&(a.size.width=a.size.height*a.aspectRatio,p=!1),a.position.top=a._helper?h.top:0),n=a.containerElement.get(0)===a.element.parent().get(0),o=/relative|absolute/.test(a.containerElement.css("position")),n&&o?(a.offset.left=a.parentData.left+a.position.left,a.offset.top=a.parentData.top+a.position.top):(a.offset.left=a.element.offset().left,a.offset.top=a.element.offset().top),i=Math.abs(a.sizeDiff.width+(a._helper?a.offset.left-u.left:a.offset.left-h.left)),s=Math.abs(a.sizeDiff.height+(a._helper?a.offset.top-u.top:a.offset.top-h.top)),i+a.size.width>=a.parentData.width&&(a.size.width=a.parentData.width-i,c&&(a.size.height=a.size.width/a.aspectRatio,p=!1)),s+a.size.height>=a.parentData.height&&(a.size.height=a.parentData.height-s,c&&(a.size.width=a.size.height*a.aspectRatio,p=!1)),p||(a.position.left=a.prevPosition.left,a.position.top=a.prevPosition.top,a.size.width=a.prevSize.width,a.size.height=a.prevSize.height)},stop:function(){var e=t(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.containerPosition,o=e.containerElement,a=t(e.helper),r=a.offset(),h=a.outerWidth()-e.sizeDiff.width,l=a.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l}),e._helper&&!i.animate&&/static/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).resizable("instance"),i=e.options;t(i.alsoResize).each(function(){var e=t(this);e.data("ui-resizable-alsoresize",{width:parseFloat(e.width()),height:parseFloat(e.height()),left:parseFloat(e.css("left")),top:parseFloat(e.css("top"))})})},resize:function(e,i){var s=t(this).resizable("instance"),n=s.options,o=s.originalSize,a=s.originalPosition,r={height:s.size.height-o.height||0,width:s.size.width-o.width||0,top:s.position.top-a.top||0,left:s.position.left-a.left||0};t(n.alsoResize).each(function(){var e=t(this),s=t(this).data("ui-resizable-alsoresize"),n={},o=e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(o,function(t,e){var i=(s[e]||0)+(r[e]||0);i&&i>=0&&(n[e]=i||null)}),e.css(n)})},stop:function(){t(this).removeData("ui-resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).resizable("instance"),i=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:i.height,width:i.width,margin:0,left:0,top:0}),e._addClass(e.ghost,"ui-resizable-ghost"),t.uiBackCompat!==!1&&"string"==typeof e.options.ghost&&e.ghost.addClass(this.options.ghost),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).resizable("instance");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).resizable("instance");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e,i=t(this).resizable("instance"),s=i.options,n=i.size,o=i.originalSize,a=i.originalPosition,r=i.axis,h="number"==typeof s.grid?[s.grid,s.grid]:s.grid,l=h[0]||1,c=h[1]||1,u=Math.round((n.width-o.width)/l)*l,d=Math.round((n.height-o.height)/c)*c,p=o.width+u,f=o.height+d,g=s.maxWidth&&p>s.maxWidth,m=s.maxHeight&&f>s.maxHeight,_=s.minWidth&&s.minWidth>p,v=s.minHeight&&s.minHeight>f;s.grid=h,_&&(p+=l),v&&(f+=c),g&&(p-=l),m&&(f-=c),/^(se|s|e)$/.test(r)?(i.size.width=p,i.size.height=f):/^(ne)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.top=a.top-d):/^(sw)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.left=a.left-u):((0>=f-c||0>=p-l)&&(e=i._getPaddingPlusBorderDimensions(this)),f-c>0?(i.size.height=f,i.position.top=a.top-d):(f=c-e.height,i.size.height=f,i.position.top=a.top+o.height-f),p-l>0?(i.size.width=p,i.position.left=a.left-u):(p=l-e.width,i.size.width=p,i.position.left=a.left+o.width-p))}}),t.ui.resizable,t.widget("ui.dialog",{version:"1.12.1",options:{appendTo:"body",autoOpen:!0,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:!0,closeText:"Close",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(e){var i=t(this).css(e).offset().top;0>i&&t(this).css("top",e.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),null==this.options.title&&null!=this.originalTitle&&(this.options.title=this.originalTitle),this.options.disabled&&(this.options.disabled=!1),this._createWrapper(),this.element.show().removeAttr("title").appendTo(this.uiDialog),this._addClass("ui-dialog-content","ui-widget-content"),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&t.fn.draggable&&this._makeDraggable(),this.options.resizable&&t.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var e=this.options.appendTo;return e&&(e.jquery||e.nodeType)?t(e):this.document.find(e||"body").eq(0)},_destroy:function(){var t,e=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().css(this.originalCss).detach(),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),t=e.parent.children().eq(e.index),t.length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog + },disable:t.noop,enable:t.noop,close:function(e){var i=this;this._isOpen&&this._trigger("beforeClose",e)!==!1&&(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),this.opener.filter(":focusable").trigger("focus").length||t.ui.safeBlur(t.ui.safeActiveElement(this.document[0])),this._hide(this.uiDialog,this.options.hide,function(){i._trigger("close",e)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(e,i){var s=!1,n=this.uiDialog.siblings(".ui-front:visible").map(function(){return+t(this).css("z-index")}).get(),o=Math.max.apply(null,n);return o>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",o+1),s=!0),s&&!i&&this._trigger("focus",e),s},open:function(){var e=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),void 0):(this._isOpen=!0,this.opener=t(t.ui.safeActiveElement(this.document[0])),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){e._focusTabbable(),e._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"),void 0)},_focusTabbable:function(){var t=this._focusedElement;t||(t=this.element.find("[autofocus]")),t.length||(t=this.element.find(":tabbable")),t.length||(t=this.uiDialogButtonPane.find(":tabbable")),t.length||(t=this.uiDialogTitlebarClose.filter(":tabbable")),t.length||(t=this.uiDialog),t.eq(0).trigger("focus")},_keepFocus:function(e){function i(){var e=t.ui.safeActiveElement(this.document[0]),i=this.uiDialog[0]===e||t.contains(this.uiDialog[0],e);i||this._focusTabbable()}e.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=t("<div>").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front"),this._on(this.uiDialog,{keydown:function(e){if(this.options.closeOnEscape&&!e.isDefaultPrevented()&&e.keyCode&&e.keyCode===t.ui.keyCode.ESCAPE)return e.preventDefault(),this.close(e),void 0;if(e.keyCode===t.ui.keyCode.TAB&&!e.isDefaultPrevented()){var i=this.uiDialog.find(":tabbable"),s=i.filter(":first"),n=i.filter(":last");e.target!==n[0]&&e.target!==this.uiDialog[0]||e.shiftKey?e.target!==s[0]&&e.target!==this.uiDialog[0]||!e.shiftKey||(this._delay(function(){n.trigger("focus")}),e.preventDefault()):(this._delay(function(){s.trigger("focus")}),e.preventDefault())}},mousedown:function(t){this._moveToTop(t)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var e;this.uiDialogTitlebar=t("<div>"),this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix"),this._on(this.uiDialogTitlebar,{mousedown:function(e){t(e.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.trigger("focus")}}),this.uiDialogTitlebarClose=t("<button type='button'></button>").button({label:t("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar),this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close"),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}}),e=t("<span>").uniqueId().prependTo(this.uiDialogTitlebar),this._addClass(e,"ui-dialog-title"),this._title(e),this.uiDialogTitlebar.prependTo(this.uiDialog),this.uiDialog.attr({"aria-labelledby":e.attr("id")})},_title:function(t){this.options.title?t.text(this.options.title):t.html(" ")},_createButtonPane:function(){this.uiDialogButtonPane=t("<div>"),this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix"),this.uiButtonSet=t("<div>").appendTo(this.uiDialogButtonPane),this._addClass(this.uiButtonSet,"ui-dialog-buttonset"),this._createButtons()},_createButtons:function(){var e=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),t.isEmptyObject(i)||t.isArray(i)&&!i.length?(this._removeClass(this.uiDialog,"ui-dialog-buttons"),void 0):(t.each(i,function(i,s){var n,o;s=t.isFunction(s)?{click:s,text:i}:s,s=t.extend({type:"button"},s),n=s.click,o={icon:s.icon,iconPosition:s.iconPosition,showLabel:s.showLabel,icons:s.icons,text:s.text},delete s.click,delete s.icon,delete s.iconPosition,delete s.showLabel,delete s.icons,"boolean"==typeof s.text&&delete s.text,t("<button></button>",s).button(o).appendTo(e.uiButtonSet).on("click",function(){n.apply(e.element[0],arguments)})}),this._addClass(this.uiDialog,"ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),void 0)},_makeDraggable:function(){function e(t){return{position:t.position,offset:t.offset}}var i=this,s=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,n){i._addClass(t(this),"ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",s,e(n))},drag:function(t,s){i._trigger("drag",t,e(s))},stop:function(n,o){var a=o.offset.left-i.document.scrollLeft(),r=o.offset.top-i.document.scrollTop();s.position={my:"left top",at:"left"+(a>=0?"+":"")+a+" "+"top"+(r>=0?"+":"")+r,of:i.window},i._removeClass(t(this),"ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",n,e(o))}})},_makeResizable:function(){function e(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}var i=this,s=this.options,n=s.resizable,o=this.uiDialog.css("position"),a="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:s.maxWidth,maxHeight:s.maxHeight,minWidth:s.minWidth,minHeight:this._minHeight(),handles:a,start:function(s,n){i._addClass(t(this),"ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",s,e(n))},resize:function(t,s){i._trigger("resize",t,e(s))},stop:function(n,o){var a=i.uiDialog.offset(),r=a.left-i.document.scrollLeft(),h=a.top-i.document.scrollTop();s.height=i.uiDialog.height(),s.width=i.uiDialog.width(),s.position={my:"left top",at:"left"+(r>=0?"+":"")+r+" "+"top"+(h>=0?"+":"")+h,of:i.window},i._removeClass(t(this),"ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",n,e(o))}}).css("position",o)},_trackFocus:function(){this._on(this.widget(),{focusin:function(e){this._makeFocusTarget(),this._focusedElement=t(e.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var e=this._trackingInstances(),i=t.inArray(this,e);-1!==i&&e.splice(i,1)},_trackingInstances:function(){var t=this.document.data("ui-dialog-instances");return t||(t=[],this.document.data("ui-dialog-instances",t)),t},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(e){var i=this,s=!1,n={};t.each(e,function(t,e){i._setOption(t,e),t in i.sizeRelatedOptions&&(s=!0),t in i.resizableRelatedOptions&&(n[t]=e)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",n)},_setOption:function(e,i){var s,n,o=this.uiDialog;"disabled"!==e&&(this._super(e,i),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:t("<a>").text(""+this.options.closeText).html()}),"draggable"===e&&(s=o.is(":data(ui-draggable)"),s&&!i&&o.draggable("destroy"),!s&&i&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&(n=o.is(":data(ui-resizable)"),n&&!i&&o.resizable("destroy"),n&&"string"==typeof i&&o.resizable("option","handles",i),n||i===!1||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var t,e,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),t=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),e=Math.max(0,s.minHeight-t),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-t):"none","auto"===s.height?this.element.css({minHeight:e,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var e=t(this);return t("<div>").css({position:"absolute",width:e.outerWidth(),height:e.outerHeight()}).appendTo(e.parent()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(e){return t(e.target).closest(".ui-dialog").length?!0:!!t(e.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var e=!0;this._delay(function(){e=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(t){e||this._allowInteraction(t)||(t.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=t("<div>").appendTo(this._appendTo()),this._addClass(this.overlay,null,"ui-widget-overlay ui-front"),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var t=this.document.data("ui-dialog-overlays")-1;t?this.document.data("ui-dialog-overlays",t):(this._off(this.document,"focusin"),this.document.removeData("ui-dialog-overlays")),this.overlay.remove(),this.overlay=null}}}),t.uiBackCompat!==!1&&t.widget("ui.dialog",t.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super(),this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(t,e){"dialogClass"===t&&this.uiDialog.removeClass(this.options.dialogClass).addClass(e),this._superApply(arguments)}}),t.ui.dialog,t.widget("ui.droppable",{version:"1.12.1",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var e,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=t.isFunction(s)?s:function(t){return t.is(s)},this.proportions=function(){return arguments.length?(e=arguments[0],void 0):e?e:e={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},this._addToManager(i.scope),i.addClasses&&this._addClass("ui-droppable")},_addToManager:function(e){t.ui.ddmanager.droppables[e]=t.ui.ddmanager.droppables[e]||[],t.ui.ddmanager.droppables[e].push(this)},_splice:function(t){for(var e=0;t.length>e;e++)t[e]===this&&t.splice(e,1)},_destroy:function(){var e=t.ui.ddmanager.droppables[this.options.scope];this._splice(e)},_setOption:function(e,i){if("accept"===e)this.accept=t.isFunction(i)?i:function(t){return t.is(i)};else if("scope"===e){var s=t.ui.ddmanager.droppables[this.options.scope];this._splice(s),this._addToManager(i)}this._super(e,i)},_activate:function(e){var i=t.ui.ddmanager.current;this._addActiveClass(),i&&this._trigger("activate",e,this.ui(i))},_deactivate:function(e){var i=t.ui.ddmanager.current;this._removeActiveClass(),i&&this._trigger("deactivate",e,this.ui(i))},_over:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this._addHoverClass(),this._trigger("over",e,this.ui(i)))},_out:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this._removeHoverClass(),this._trigger("out",e,this.ui(i)))},_drop:function(e,i){var s=i||t.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var i=t(this).droppable("instance");return i.options.greedy&&!i.options.disabled&&i.options.scope===s.options.scope&&i.accept.call(i.element[0],s.currentItem||s.element)&&v(s,t.extend(i,{offset:i.element.offset()}),i.options.tolerance,e)?(n=!0,!1):void 0}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this._removeActiveClass(),this._removeHoverClass(),this._trigger("drop",e,this.ui(s)),this.element):!1):!1},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}});var v=t.ui.intersect=function(){function t(t,e,i){return t>=e&&e+i>t}return function(e,i,s,n){if(!i.offset)return!1;var o=(e.positionAbs||e.position.absolute).left+e.margins.left,a=(e.positionAbs||e.position.absolute).top+e.margins.top,r=o+e.helperProportions.width,h=a+e.helperProportions.height,l=i.offset.left,c=i.offset.top,u=l+i.proportions().width,d=c+i.proportions().height;switch(s){case"fit":return o>=l&&u>=r&&a>=c&&d>=h;case"intersect":return o+e.helperProportions.width/2>l&&u>r-e.helperProportions.width/2&&a+e.helperProportions.height/2>c&&d>h-e.helperProportions.height/2;case"pointer":return t(n.pageY,c,i.proportions().height)&&t(n.pageX,l,i.proportions().width);case"touch":return(a>=c&&d>=a||h>=c&&d>=h||c>a&&h>d)&&(o>=l&&u>=o||r>=l&&u>=r||l>o&&r>u);default:return!1}}}();t.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,i){var s,n,o=t.ui.ddmanager.droppables[e.options.scope]||[],a=i?i.type:null,r=(e.currentItem||e.element).find(":data(ui-droppable)").addBack();t:for(s=0;o.length>s;s++)if(!(o[s].options.disabled||e&&!o[s].accept.call(o[s].element[0],e.currentItem||e.element))){for(n=0;r.length>n;n++)if(r[n]===o[s].element[0]){o[s].proportions().height=0;continue t}o[s].visible="none"!==o[s].element.css("display"),o[s].visible&&("mousedown"===a&&o[s]._activate.call(o[s],i),o[s].offset=o[s].element.offset(),o[s].proportions({width:o[s].element[0].offsetWidth,height:o[s].element[0].offsetHeight}))}},drop:function(e,i){var s=!1;return t.each((t.ui.ddmanager.droppables[e.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&v(e,this,this.options.tolerance,i)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(e,i){e.element.parentsUntil("body").on("scroll.droppable",function(){e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)})},drag:function(e,i){e.options.refreshPositions&&t.ui.ddmanager.prepareOffsets(e,i),t.each(t.ui.ddmanager.droppables[e.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,o,a=v(e,this,this.options.tolerance,i),r=!a&&this.isover?"isout":a&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,o=this.element.parents(":data(ui-droppable)").filter(function(){return t(this).droppable("instance").options.scope===n}),o.length&&(s=t(o[0]).droppable("instance"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(e,i){e.element.parentsUntil("body").off("scroll.droppable"),e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)}},t.uiBackCompat!==!1&&t.widget("ui.droppable",t.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super(),this.options.activeClass&&this.element.addClass(this.options.activeClass)},_removeActiveClass:function(){this._super(),this.options.activeClass&&this.element.removeClass(this.options.activeClass)},_addHoverClass:function(){this._super(),this.options.hoverClass&&this.element.addClass(this.options.hoverClass)},_removeHoverClass:function(){this._super(),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass)}}),t.ui.droppable,t.widget("ui.progressbar",{version:"1.12.1",options:{classes:{"ui-progressbar":"ui-corner-all","ui-progressbar-value":"ui-corner-left","ui-progressbar-complete":"ui-corner-right"},max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.attr({role:"progressbar","aria-valuemin":this.min}),this._addClass("ui-progressbar","ui-widget ui-widget-content"),this.valueDiv=t("<div>").appendTo(this.element),this._addClass(this.valueDiv,"ui-progressbar-value","ui-widget-header"),this._refreshValue()},_destroy:function(){this.element.removeAttr("role aria-valuemin aria-valuemax aria-valuenow"),this.valueDiv.remove()},value:function(t){return void 0===t?this.options.value:(this.options.value=this._constrainedValue(t),this._refreshValue(),void 0)},_constrainedValue:function(t){return void 0===t&&(t=this.options.value),this.indeterminate=t===!1,"number"!=typeof t&&(t=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var e=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||e>this.min).width(i.toFixed(0)+"%"),this._toggleClass(this.valueDiv,"ui-progressbar-complete",null,e===this.options.max)._toggleClass("ui-progressbar-indeterminate",null,this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=t("<div>").appendTo(this.valueDiv),this._addClass(this.overlayDiv,"ui-progressbar-overlay"))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":e}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),e===this.options.max&&this._trigger("complete")}}),t.widget("ui.selectable",t.ui.mouse,{version:"1.12.1",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var e=this;this._addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){e.elementPos=t(e.element[0]).offset(),e.selectees=t(e.options.filter,e.element[0]),e._addClass(e.selectees,"ui-selectee"),e.selectees.each(function(){var i=t(this),s=i.offset(),n={left:s.left-e.elementPos.left,top:s.top-e.elementPos.top};t.data(this,"selectable-item",{element:this,$element:i,left:n.left,top:n.top,right:n.left+i.outerWidth(),bottom:n.top+i.outerHeight(),startselected:!1,selected:i.hasClass("ui-selected"),selecting:i.hasClass("ui-selecting"),unselecting:i.hasClass("ui-unselecting")})})},this.refresh(),this._mouseInit(),this.helper=t("<div>"),this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){this.selectees.removeData("selectable-item"),this._mouseDestroy()},_mouseStart:function(e){var i=this,s=this.options;this.opos=[e.pageX,e.pageY],this.elementPos=t(this.element[0]).offset(),this.options.disabled||(this.selectees=t(s.filter,this.element[0]),this._trigger("start",e),t(s.appendTo).append(this.helper),this.helper.css({left:e.pageX,top:e.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=t.data(this,"selectable-item");s.startselected=!0,e.metaKey||e.ctrlKey||(i._removeClass(s.$element,"ui-selected"),s.selected=!1,i._addClass(s.$element,"ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",e,{unselecting:s.element}))}),t(e.target).parents().addBack().each(function(){var s,n=t.data(this,"selectable-item");return n?(s=!e.metaKey&&!e.ctrlKey||!n.$element.hasClass("ui-selected"),i._removeClass(n.$element,s?"ui-unselecting":"ui-selected")._addClass(n.$element,s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",e,{selecting:n.element}):i._trigger("unselecting",e,{unselecting:n.element}),!1):void 0}))},_mouseDrag:function(e){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,o=this.opos[0],a=this.opos[1],r=e.pageX,h=e.pageY;return o>r&&(i=r,r=o,o=i),a>h&&(i=h,h=a,a=i),this.helper.css({left:o,top:a,width:r-o,height:h-a}),this.selectees.each(function(){var i=t.data(this,"selectable-item"),l=!1,c={};i&&i.element!==s.element[0]&&(c.left=i.left+s.elementPos.left,c.right=i.right+s.elementPos.left,c.top=i.top+s.elementPos.top,c.bottom=i.bottom+s.elementPos.top,"touch"===n.tolerance?l=!(c.left>r||o>c.right||c.top>h||a>c.bottom):"fit"===n.tolerance&&(l=c.left>o&&r>c.right&&c.top>a&&h>c.bottom),l?(i.selected&&(s._removeClass(i.$element,"ui-selected"),i.selected=!1),i.unselecting&&(s._removeClass(i.$element,"ui-unselecting"),i.unselecting=!1),i.selecting||(s._addClass(i.$element,"ui-selecting"),i.selecting=!0,s._trigger("selecting",e,{selecting:i.element}))):(i.selecting&&((e.metaKey||e.ctrlKey)&&i.startselected?(s._removeClass(i.$element,"ui-selecting"),i.selecting=!1,s._addClass(i.$element,"ui-selected"),i.selected=!0):(s._removeClass(i.$element,"ui-selecting"),i.selecting=!1,i.startselected&&(s._addClass(i.$element,"ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",e,{unselecting:i.element}))),i.selected&&(e.metaKey||e.ctrlKey||i.startselected||(s._removeClass(i.$element,"ui-selected"),i.selected=!1,s._addClass(i.$element,"ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",e,{unselecting:i.element})))))}),!1}},_mouseStop:function(e){var i=this;return this.dragged=!1,t(".ui-unselecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");i._removeClass(s.$element,"ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",e,{unselected:s.element})}),t(".ui-selecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");i._removeClass(s.$element,"ui-selecting")._addClass(s.$element,"ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",e,{selected:s.element})}),this._trigger("stop",e),this.helper.remove(),!1}}),t.widget("ui.selectmenu",[t.ui.formResetMixin,{version:"1.12.1",defaultElement:"<select>",options:{appendTo:null,classes:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"},disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:!1,change:null,close:null,focus:null,open:null,select:null},_create:function(){var e=this.element.uniqueId().attr("id");this.ids={element:e,button:e+"-button",menu:e+"-menu"},this._drawButton(),this._drawMenu(),this._bindFormResetHandler(),this._rendered=!1,this.menuItems=t()},_drawButton:function(){var e,i=this,s=this._parseOption(this.element.find("option:selected"),this.element[0].selectedIndex);this.labels=this.element.labels().attr("for",this.ids.button),this._on(this.labels,{click:function(t){this.button.focus(),t.preventDefault()}}),this.element.hide(),this.button=t("<span>",{tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true",title:this.element.attr("title")}).insertAfter(this.element),this._addClass(this.button,"ui-selectmenu-button ui-selectmenu-button-closed","ui-button ui-widget"),e=t("<span>").appendTo(this.button),this._addClass(e,"ui-selectmenu-icon","ui-icon "+this.options.icons.button),this.buttonItem=this._renderButtonItem(s).appendTo(this.button),this.options.width!==!1&&this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){i._rendered||i._refreshMenu()})},_drawMenu:function(){var e=this;this.menu=t("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=t("<div>").append(this.menu),this._addClass(this.menuWrap,"ui-selectmenu-menu","ui-front"),this.menuWrap.appendTo(this._appendTo()),this.menuInstance=this.menu.menu({classes:{"ui-menu":"ui-corner-bottom"},role:"listbox",select:function(t,i){t.preventDefault(),e._setSelection(),e._select(i.item.data("ui-selectmenu-item"),t)},focus:function(t,i){var s=i.item.data("ui-selectmenu-item");null!=e.focusIndex&&s.index!==e.focusIndex&&(e._trigger("focus",t,{item:s}),e.isOpen||e._select(s,t)),e.focusIndex=s.index,e.button.attr("aria-activedescendant",e.menuItems.eq(s.index).attr("id"))}}).menu("instance"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(this._getSelectedItem().data("ui-selectmenu-item")||{})),null===this.options.width&&this._resizeButton()},_refreshMenu:function(){var t,e=this.element.find("option");this.menu.empty(),this._parseOptions(e),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup").find(".ui-menu-item-wrapper"),this._rendered=!0,e.length&&(t=this._getSelectedItem(),this.menuInstance.focus(null,t),this._setAria(t.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(t){this.options.disabled||(this._rendered?(this._removeClass(this.menu.find(".ui-state-active"),null,"ui-state-active"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.menuItems.length&&(this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",t)))},_position:function(){this.menuWrap.position(t.extend({of:this.button},this.options.position))},close:function(t){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",t))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderButtonItem:function(e){var i=t("<span>");return this._setText(i,e.label),this._addClass(i,"ui-selectmenu-text"),i},_renderMenu:function(e,i){var s=this,n="";t.each(i,function(i,o){var a;o.optgroup!==n&&(a=t("<li>",{text:o.optgroup}),s._addClass(a,"ui-selectmenu-optgroup","ui-menu-divider"+(o.element.parent("optgroup").prop("disabled")?" ui-state-disabled":"")),a.appendTo(e),n=o.optgroup),s._renderItemData(e,o)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-selectmenu-item",e)},_renderItem:function(e,i){var s=t("<li>"),n=t("<div>",{title:i.element.attr("title")});return i.disabled&&this._addClass(s,null,"ui-state-disabled"),this._setText(n,i.label),s.append(n).appendTo(e)},_setText:function(t,e){e?t.text(e):t.html(" ")},_move:function(t,e){var i,s,n=".ui-menu-item";this.isOpen?i=this.menuItems.eq(this.focusIndex).parent("li"):(i=this.menuItems.eq(this.element[0].selectedIndex).parent("li"),n+=":not(.ui-state-disabled)"),s="first"===t||"last"===t?i["first"===t?"prevAll":"nextAll"](n).eq(-1):i[t+"All"](n).eq(0),s.length&&this.menuInstance.focus(e,s)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex).parent("li")},_toggle:function(t){this[this.isOpen?"close":"open"](t)},_setSelection:function(){var t;this.range&&(window.getSelection?(t=window.getSelection(),t.removeAllRanges(),t.addRange(this.range)):this.range.select(),this.button.focus())},_documentClick:{mousedown:function(e){this.isOpen&&(t(e.target).closest(".ui-selectmenu-menu, #"+t.ui.escapeSelector(this.ids.button)).length||this.close(e))}},_buttonEvents:{mousedown:function(){var t;window.getSelection?(t=window.getSelection(),t.rangeCount&&(this.range=t.getRangeAt(0))):this.range=document.selection.createRange()},click:function(t){this._setSelection(),this._toggle(t)},keydown:function(e){var i=!0;switch(e.keyCode){case t.ui.keyCode.TAB:case t.ui.keyCode.ESCAPE:this.close(e),i=!1;break;case t.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(e);break;case t.ui.keyCode.UP:e.altKey?this._toggle(e):this._move("prev",e);break;case t.ui.keyCode.DOWN:e.altKey?this._toggle(e):this._move("next",e);break;case t.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(e):this._toggle(e);break;case t.ui.keyCode.LEFT:this._move("prev",e);break;case t.ui.keyCode.RIGHT:this._move("next",e);break;case t.ui.keyCode.HOME:case t.ui.keyCode.PAGE_UP:this._move("first",e);break;case t.ui.keyCode.END:case t.ui.keyCode.PAGE_DOWN:this._move("last",e);break;default:this.menu.trigger(e),i=!1}i&&e.preventDefault()}},_selectFocusedItem:function(t){var e=this.menuItems.eq(this.focusIndex).parent("li");e.hasClass("ui-state-disabled")||this._select(e.data("ui-selectmenu-item"),t)},_select:function(t,e){var i=this.element[0].selectedIndex;this.element[0].selectedIndex=t.index,this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(t)),this._setAria(t),this._trigger("select",e,{item:t}),t.index!==i&&this._trigger("change",e,{item:t}),this.close(e)},_setAria:function(t){var e=this.menuItems.eq(t.index).attr("id");this.button.attr({"aria-labelledby":e,"aria-activedescendant":e}),this.menu.attr("aria-activedescendant",e)},_setOption:function(t,e){if("icons"===t){var i=this.button.find("span.ui-icon");this._removeClass(i,null,this.options.icons.button)._addClass(i,null,e.button)}this._super(t,e),"appendTo"===t&&this.menuWrap.appendTo(this._appendTo()),"width"===t&&this._resizeButton()},_setOptionDisabled:function(t){this._super(t),this.menuInstance.option("disabled",t),this.button.attr("aria-disabled",t),this._toggleClass(this.button,null,"ui-state-disabled",t),this.element.prop("disabled",t),t?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?t(e):this.document.find(e).eq(0)),e&&e[0]||(e=this.element.closest(".ui-front, dialog")),e.length||(e=this.document[0].body),e},_toggleAttr:function(){this.button.attr("aria-expanded",this.isOpen),this._removeClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"closed":"open"))._addClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"open":"closed"))._toggleClass(this.menuWrap,"ui-selectmenu-open",null,this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var t=this.options.width;return t===!1?(this.button.css("width",""),void 0):(null===t&&(t=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(t),void 0)},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){var t=this._super();return t.disabled=this.element.prop("disabled"),t},_parseOptions:function(e){var i=this,s=[];e.each(function(e,n){s.push(i._parseOption(t(n),e))}),this.items=s},_parseOption:function(t,e){var i=t.parent("optgroup");return{element:t,index:e,value:t.val(),label:t.text(),optgroup:i.attr("label")||"",disabled:i.prop("disabled")||t.prop("disabled")}},_destroy:function(){this._unbindFormResetHandler(),this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.labels.attr("for",this.ids.element)}}]),t.widget("ui.slider",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"slide",options:{animate:!1,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all","ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this._addClass("ui-slider ui-slider-"+this.orientation,"ui-widget ui-widget-content"),this._refresh(),this._animateOff=!1 + },_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,i,s=this.options,n=this.element.find(".ui-slider-handle"),o="<span tabindex='0'></span>",a=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),e=n.length;i>e;e++)a.push(o);this.handles=n.add(t(a.join("")).appendTo(this.element)),this._addClass(this.handles,"ui-slider-handle","ui-state-default"),this.handle=this.handles.eq(0),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e).attr("tabIndex",0)})},_createRange:function(){var e=this.options;e.range?(e.range===!0&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:t.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?(this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max"),this.range.css({left:"",bottom:""})):(this.range=t("<div>").appendTo(this.element),this._addClass(this.range,"ui-slider-range")),("min"===e.range||"max"===e.range)&&this._addClass(this.range,"ui-slider-range-"+e.range)):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this._mouseDestroy()},_mouseCapture:function(e){var i,s,n,o,a,r,h,l,c=this,u=this.options;return u.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var i=Math.abs(s-c.values(e));(n>i||n===i&&(e===c._lastChangedValue||c.values(e)===u.min))&&(n=i,o=t(this),a=e)}),r=this._start(e,a),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=a,this._addClass(o,null,"ui-state-active"),o.trigger("focus"),h=o.offset(),l=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:e.pageX-h.left-o.width()/2,top:e.pageY-h.top-o.height()/2-(parseInt(o.css("borderTopWidth"),10)||0)-(parseInt(o.css("borderBottomWidth"),10)||0)+(parseInt(o.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,a,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this._removeClass(this.handles,null,"ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,s,n,o;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/e,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),o=this._valueMin()+s*n,this._trimAlignValue(o)},_uiHash:function(t,e,i){var s={handle:this.handles[t],handleIndex:t,value:void 0!==e?e:this.value()};return this._hasMultipleValues()&&(s.value=void 0!==e?e:this.values(t),s.values=i||this.values()),s},_hasMultipleValues:function(){return this.options.values&&this.options.values.length},_start:function(t,e){return this._trigger("start",t,this._uiHash(e))},_slide:function(t,e,i){var s,n,o=this.value(),a=this.values();this._hasMultipleValues()&&(n=this.values(e?0:1),o=this.values(e),2===this.options.values.length&&this.options.range===!0&&(i=0===e?Math.min(n,i):Math.max(n,i)),a[e]=i),i!==o&&(s=this._trigger("slide",t,this._uiHash(e,i,a)),s!==!1&&(this._hasMultipleValues()?this.values(e,i):this.value(i)))},_stop:function(t,e){this._trigger("stop",t,this._uiHash(e))},_change:function(t,e){this._keySliding||this._mouseSliding||(this._lastChangedValue=e,this._trigger("change",t,this._uiHash(e)))},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),this._change(null,0),void 0):this._value()},values:function(e,i){var s,n,o;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),this._change(null,e),void 0;if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this._hasMultipleValues()?this._values(e):this.value();for(s=this.options.values,n=arguments[0],o=0;s.length>o;o+=1)s[o]=this._trimAlignValue(n[o]),this._change(null,o);this._refreshValue()},_setOption:function(e,i){var s,n=0;switch("range"===e&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),t.isArray(this.options.values)&&(n=this.options.values.length),this._super(e,i),e){case"orientation":this._detectOrientation(),this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-"+this.orientation),this._refreshValue(),this.options.range&&this._refreshRange(i),this.handles.css("horizontal"===i?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=n-1;s>=0;s--)this._change(null,s);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_setOptionDisabled:function(t){this._super(t),this._toggleClass(null,"ui-state-disabled",!!t)},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);if(this._hasMultipleValues()){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(t){if(this._valueMin()>=t)return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,s=t-i;return 2*Math.abs(i)>=e&&(s+=i>0?e:-e),parseFloat(s.toFixed(5))},_calculateNewMax:function(){var t=this.options.max,e=this._valueMin(),i=this.options.step,s=Math.round((t-e)/i)*i;t=s+e,t>this.options.max&&(t-=i),this.max=parseFloat(t.toFixed(this._precision()))},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(t){"vertical"===t&&this.range.css({width:"",left:""}),"horizontal"===t&&this.range.css({height:"",bottom:""})},_refreshValue:function(){var e,i,s,n,o,a=this.options.range,r=this.options,h=this,l=this._animateOff?!1:r.animate,c={};this._hasMultipleValues()?this.handles.each(function(s){i=100*((h.values(s)-h._valueMin())/(h._valueMax()-h._valueMin())),c["horizontal"===h.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[l?"animate":"css"](c,r.animate),h.options.range===!0&&("horizontal"===h.orientation?(0===s&&h.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:r.animate})):(0===s&&h.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:r.animate}))),e=i}):(s=this.value(),n=this._valueMin(),o=this._valueMax(),i=o!==n?100*((s-n)/(o-n)):0,c["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](c,r.animate),"min"===a&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},r.animate),"max"===a&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:100-i+"%"},r.animate),"min"===a&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},r.animate),"max"===a&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:100-i+"%"},r.animate))},_handleEvents:{keydown:function(e){var i,s,n,o,a=t(e.target).data("ui-slider-handle-index");switch(e.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(e.preventDefault(),!this._keySliding&&(this._keySliding=!0,this._addClass(t(e.target),null,"ui-state-active"),i=this._start(e,a),i===!1))return}switch(o=this.options.step,s=n=this._hasMultipleValues()?this.values(a):this.value(),e.keyCode){case t.ui.keyCode.HOME:n=this._valueMin();break;case t.ui.keyCode.END:n=this._valueMax();break;case t.ui.keyCode.PAGE_UP:n=this._trimAlignValue(s+(this._valueMax()-this._valueMin())/this.numPages);break;case t.ui.keyCode.PAGE_DOWN:n=this._trimAlignValue(s-(this._valueMax()-this._valueMin())/this.numPages);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(s===this._valueMax())return;n=this._trimAlignValue(s+o);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(s===this._valueMin())return;n=this._trimAlignValue(s-o)}this._slide(e,a,n)},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),this._removeClass(t(e.target),null,"ui-state-active"))}}}),t.widget("ui.sortable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,i){return t>=e&&e+i>t},_isFloating:function(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(t,e){this._super(t,e),"handle"===t&&this._setHandleClassName()},_setHandleClassName:function(){var e=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),t.each(this.items,function(){e._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(e,i){var s=null,n=!1,o=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(e),t(e.target).parents().each(function(){return t.data(this,o.widgetName+"-item")===o?(s=t(this),!1):void 0}),t.data(e.target,o.widgetName+"-item")===o&&(s=t(e.target)),s?!this.options.handle||i||(t(this.options.handle,s).find("*").addBack().each(function(){this===e.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(e,i,s){var n,o,a=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),a.containment&&this._setContainment(),a.cursor&&"auto"!==a.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",a.cursor),this.storedStylesheet=t("<style>*{ cursor: "+a.cursor+" !important; }</style>").appendTo(o)),a.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",a.opacity)),a.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",a.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,n,o,a=this.options,r=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<a.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+a.scrollSpeed:e.pageY-this.overflowOffset.top<a.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-a.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<a.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+a.scrollSpeed:e.pageX-this.overflowOffset.left<a.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-a.scrollSpeed)):(e.pageY-this.document.scrollTop()<a.scrollSensitivity?r=this.document.scrollTop(this.document.scrollTop()-a.scrollSpeed):this.window.height()-(e.pageY-this.document.scrollTop())<a.scrollSensitivity&&(r=this.document.scrollTop(this.document.scrollTop()+a.scrollSpeed)),e.pageX-this.document.scrollLeft()<a.scrollSensitivity?r=this.document.scrollLeft(this.document.scrollLeft()-a.scrollSpeed):this.window.width()-(e.pageX-this.document.scrollLeft())<a.scrollSensitivity&&(r=this.document.scrollLeft(this.document.scrollLeft()+a.scrollSpeed))),r!==!1&&t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],o=this._intersectsWithPointer(s),o&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===o?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],n):!0)){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset(),o=this.options.axis,a={};o&&"x"!==o||(a.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(a.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(a,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp(new t.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,o=t.left,a=o+t.width,r=t.top,h=r+t.height,l=this.offset.click.top,c=this.offset.click.left,u="x"===this.options.axis||s+l>r&&h>s+l,d="y"===this.options.axis||e+c>o&&a>e+c,p=u&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?p:e+this.helperProportions.width/2>o&&a>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(t){var e,i,s="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),n="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width),o=s&&n;return o?(e=this._getDragVerticalDirection(),i=this._getDragHorizontalDirection(),this.floating?"right"===i||"down"===e?2:1:e&&("down"===e?2:1)):!1},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),s=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&i||"left"===n&&!i:s&&("down"===s&&e||"up"===s&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){function i(){r.push(this)}var s,n,o,a,r=[],h=[],l=this._connectWith();if(l&&e)for(s=l.length-1;s>=0;s--)for(o=t(l[s],this.document[0]),n=o.length-1;n>=0;n--)a=t.data(o[n],this.widgetFullName),a&&a!==this&&!a.options.disabled&&h.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);for(h.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=h.length-1;s>=0;s--)h[s][0].each(i);return t(r)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,n,o,a,r,h,l,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(n=t(d[i],this.document[0]),s=n.length-1;s>=0;s--)o=t.data(n[s],this.widgetFullName),o&&o!==this&&!o.options.disabled&&(u.push([t.isFunction(o.options.items)?o.options.items.call(o.element[0],e,{item:this.currentItem}):t(o.options.items,o.element),o]),this.containers.push(o));for(i=u.length-1;i>=0;i--)for(a=u[i][1],r=u[i][0],s=0,l=r.length;l>s;s++)h=t(r[s]),h.data(this.widgetName+"-item",a),c.push({item:h,instance:a,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.floating=this.items.length?"x"===this.options.axis||this._isFloating(this.items[0].item):!1,this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,o;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item,e||(s.width=n.outerWidth(),s.height=n.outerHeight()),o=n.offset(),s.left=o.left,s.top=o.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)o=this.containers[i].element.offset(),this.containers[i].containerCache.left=o.left,this.containers[i].containerCache.top=o.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var i,s=e.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),n=t("<"+s+">",e.document[0]);return e._addClass(n,"ui-sortable-placeholder",i||e.currentItem[0].className)._removeClass(n,"ui-sortable-helper"),"tbody"===s?e._createTrPlaceholder(e.currentItem.find("tr").eq(0),t("<tr>",e.document[0]).appendTo(n)):"tr"===s?e._createTrPlaceholder(e.currentItem,n):"img"===s&&n.attr("src",e.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(t,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_createTrPlaceholder:function(e,i){var s=this;e.children().each(function(){t("<td> </td>",s.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(i)})},_contactContainers:function(e){var i,s,n,o,a,r,h,l,c,u,d=null,p=null;for(i=this.containers.length-1;i>=0;i--)if(!t.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(d&&t.contains(this.containers[i].element[0],d.element[0]))continue;d=this.containers[i],p=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",e,this._uiHash(this)),this.containers[i].containerCache.over=0);if(d)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",e,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(n=1e4,o=null,c=d.floating||this._isFloating(this.currentItem),a=c?"left":"top",r=c?"width":"height",u=c?"pageX":"pageY",s=this.items.length-1;s>=0;s--)t.contains(this.containers[p].element[0],this.items[s].item[0])&&this.items[s].item[0]!==this.currentItem[0]&&(h=this.items[s].item.offset()[a],l=!1,e[u]-h>this.items[s][r]/2&&(l=!0),n>Math.abs(e[u]-h)&&(n=Math.abs(e[u]-h),o=this.items[s],this.direction=l?"up":"down"));if(!o&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",e,this._uiHash()),this.currentContainer.containerCache.over=1),void 0;o?this._rearrange(e,o,null,!0):this._rearrange(e,null,this.containers[p].element,!0),this._trigger("change",e,this._uiHash()),this.containers[p]._trigger("change",e,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",e,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===n.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===n.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(e=t(n.containment)[0],i=t(n.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())*s}},_generatePosition:function(e){var i,s,n=this.options,o=e.pageX,a=e.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(o=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(a=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(o=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((a-this.originalPageY)/n.grid[1])*n.grid[1],a=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((o-this.originalPageX)/n.grid[0])*n.grid[0],o=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter; + this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){function i(t,e,i){return function(s){i._trigger(t,s,e._uiHash(e))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&n.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||n.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(n.push(function(t){this._trigger("remove",t,this._uiHash())}),n.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)e||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}}),t.widget("ui.spinner",{version:"1.12.1",defaultElement:"<input>",widgetEventPrefix:"spin",options:{classes:{"ui-spinner":"ui-corner-all","ui-spinner-down":"ui-corner-br","ui-spinner-up":"ui-corner-tr"},culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var e=this._super(),i=this.element;return t.each(["min","max","step"],function(t,s){var n=i.attr(s);null!=n&&n.length&&(e[s]=n)}),e},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t),void 0)},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((e>0?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(e){function i(){var e=this.element[0]===t.ui.safeActiveElement(this.document[0]);e||(this.element.trigger("focus"),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===t.ui.safeActiveElement(this.document[0])?this.previous:this.element.val(),e.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(e)!==!1&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){return t(e.currentTarget).hasClass("ui-state-active")?this._start(e)===!1?!1:(this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap("<span>").parent().append("<a></a><a></a>")},_draw:function(){this._enhance(),this._addClass(this.uiSpinner,"ui-spinner","ui-widget ui-widget-content"),this._addClass("ui-spinner-input"),this.element.attr("role","spinbutton"),this.buttons=this.uiSpinner.children("a").attr("tabIndex",-1).attr("aria-hidden",!0).button({classes:{"ui-button":""}}),this._removeClass(this.buttons,"ui-corner-all"),this._addClass(this.buttons.first(),"ui-spinner-button ui-spinner-up"),this._addClass(this.buttons.last(),"ui-spinner-button ui-spinner-down"),this.buttons.first().button({icon:this.options.icons.up,showLabel:!1}),this.buttons.last().button({icon:this.options.icons.down,showLabel:!1}),this.buttons.height()>Math.ceil(.5*this.uiSpinner.height())&&this.uiSpinner.height()>0&&this.uiSpinner.height(this.uiSpinner.height())},_keydown:function(e){var i=this.options,s=t.ui.keyCode;switch(e.keyCode){case s.UP:return this._repeat(null,1,e),!0;case s.DOWN:return this._repeat(null,-1,e),!0;case s.PAGE_UP:return this._repeat(null,i.page,e),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,e),!0}return!1},_start:function(t){return this.spinning||this._trigger("start",t)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,i)},t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&this._trigger("spin",e,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(e){var i=this.options.incremental;return i?t.isFunction(i)?i(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_adjustValue:function(t){var e,i,s=this.options;return e=null!==s.min?s.min:0,i=t-e,i=Math.round(i/s.step)*s.step,t=e+i,t=parseFloat(t.toFixed(this._precision())),null!==s.max&&t>s.max?s.max:null!==s.min&&s.min>t?s.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){var i,s,n;return"culture"===t||"numberFormat"===t?(i=this._parse(this.element.val()),this.options[t]=e,this.element.val(this._format(i)),void 0):(("max"===t||"min"===t||"step"===t)&&"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(s=this.buttons.first().find(".ui-icon"),this._removeClass(s,null,this.options.icons.up),this._addClass(s,null,e.up),n=this.buttons.last().find(".ui-icon"),this._removeClass(n,null,this.options.icons.down),this._addClass(n,null,e.down)),this._super(t,e),void 0)},_setOptionDisabled:function(t){this._super(t),this._toggleClass(this.uiSpinner,null,"ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable")},_setOptions:r(function(t){this._super(t)}),_parse:function(t){return"string"==typeof t&&""!==t&&(t=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t),""===t||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var t=this.value();return null===t?!1:t===this._adjustValue(t)},_value:function(t,e){var i;""!==t&&(i=this._parse(t),null!==i&&(e||(i=this._adjustValue(i)),t=this._format(i))),this.element.val(t),this._refresh()},_destroy:function(){this.element.prop("disabled",!1).removeAttr("autocomplete role aria-valuemin aria-valuemax aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:r(function(t){this._stepUp(t)}),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:r(function(t){this._stepDown(t)}),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:r(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:r(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){return arguments.length?(r(this._value).call(this,t),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}}),t.uiBackCompat!==!1&&t.widget("ui.spinner",t.ui.spinner,{_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml())},_uiSpinnerHtml:function(){return"<span>"},_buttonHtml:function(){return"<a></a><a></a>"}}),t.ui.spinner,t.widget("ui.tabs",{version:"1.12.1",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var t=/#.*$/;return function(e){var i,s;i=e.href.replace(t,""),s=location.href.replace(t,"");try{i=decodeURIComponent(i)}catch(n){}try{s=decodeURIComponent(s)}catch(n){}return e.hash.length>1&&i===s}}(),_create:function(){var e=this,i=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-widget-content"),this._toggleClass("ui-tabs-collapsible",null,i.collapsible),this._processTabs(),i.active=this._initialActive(),t.isArray(i.disabled)&&(i.disabled=t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):t(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var e=this.options.active,i=this.options.collapsible,s=location.hash.substring(1);return null===e&&(s&&this.tabs.each(function(i,n){return t(n).attr("aria-controls")===s?(e=i,!1):void 0}),null===e&&(e=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===e||-1===e)&&(e=this.tabs.length?0:!1)),e!==!1&&(e=this.tabs.index(this.tabs.eq(e)),-1===e&&(e=i?!1:0)),!i&&e===!1&&this.anchors.length&&(e=0),e},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(e){var i=t(t.ui.safeActiveElement(this.document[0])).closest("li"),s=this.tabs.index(i),n=!0;if(!this._handlePageNav(e)){switch(e.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:s++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:n=!1,s--;break;case t.ui.keyCode.END:s=this.anchors.length-1;break;case t.ui.keyCode.HOME:s=0;break;case t.ui.keyCode.SPACE:return e.preventDefault(),clearTimeout(this.activating),this._activate(s),void 0;case t.ui.keyCode.ENTER:return e.preventDefault(),clearTimeout(this.activating),this._activate(s===this.options.active?!1:s),void 0;default:return}e.preventDefault(),clearTimeout(this.activating),s=this._focusNextTab(s,n),e.ctrlKey||e.metaKey||(i.attr("aria-selected","false"),this.tabs.eq(s).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",s)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.trigger("focus"))},_handlePageNav:function(e){return e.altKey&&e.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):e.altKey&&e.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(e,i){function s(){return e>n&&(e=0),0>e&&(e=n),e}for(var n=this.tabs.length-1;-1!==t.inArray(s(),this.options.disabled);)e=i?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).trigger("focus"),t},_setOption:function(t,e){return"active"===t?(this._activate(e),void 0):(this._super(t,e),"collapsible"===t&&(this._toggleClass("ui-tabs-collapsible",null,e),e||this.options.active!==!1||this._activate(0)),"event"===t&&this._setupEvents(e),"heightStyle"===t&&this._setupHeightStyle(e),void 0)},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,i=this.tablist.children(":has(a[href])");e.disabled=t.map(i.filter(".ui-state-disabled"),function(t){return i.index(t)}),this._processTabs(),e.active!==!1&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t()),this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass(this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this,i=this.tabs,s=this.anchors,n=this.panels;this.tablist=this._getList().attr("role","tablist"),this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("mousedown"+this.eventNamespace,"> li",function(e){t(this).is(".ui-state-disabled")&&e.preventDefault()}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass(this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map(function(){return t("a",this)[0]}).attr({role:"presentation",tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=t(),this.anchors.each(function(i,s){var n,o,a,r=t(s).uniqueId().attr("id"),h=t(s).closest("li"),l=h.attr("aria-controls");e._isLocal(s)?(n=s.hash,a=n.substring(1),o=e.element.find(e._sanitizeSelector(n))):(a=h.attr("aria-controls")||t({}).uniqueId()[0].id,n="#"+a,o=e.element.find(n),o.length||(o=e._createPanel(a),o.insertAfter(e.panels[i-1]||e.tablist)),o.attr("aria-live","polite")),o.length&&(e.panels=e.panels.add(o)),l&&h.data("ui-tabs-aria-controls",l),h.attr({"aria-controls":a,"aria-labelledby":r}),o.attr("aria-labelledby",r)}),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),i&&(this._off(i.not(this.tabs)),this._off(s.not(this.anchors)),this._off(n.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(e){return t("<div>").attr("id",e).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(e){var i,s,n;for(t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1),n=0;s=this.tabs[n];n++)i=t(s),e===!0||-1!==t.inArray(n,e)?(i.attr("aria-disabled","true"),this._addClass(i,null,"ui-state-disabled")):(i.removeAttr("aria-disabled"),this._removeClass(i,null,"ui-state-disabled"));this.options.disabled=e,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,e===!0)},_setupEvents:function(e){var i={};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(t){t.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var i,s=this.element.parent();"fill"===e?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.panels.each(function(){i=Math.max(i,t(this).height("").height())}).height(i))},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),o=n.closest("li"),a=o[0]===s[0],r=a&&i.collapsible,h=r?t():this._getPanelForTab(o),l=s.length?this._getPanelForTab(s):t(),c={oldTab:s,oldPanel:l,newTab:r?t():o,newPanel:h};e.preventDefault(),o.hasClass("ui-state-disabled")||o.hasClass("ui-tabs-loading")||this.running||a&&!i.collapsible||this._trigger("beforeActivate",e,c)===!1||(i.active=r?!1:this.tabs.index(o),this.active=a?t():o,this.xhr&&this.xhr.abort(),l.length||h.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(o),e),this._toggle(e,c))},_toggle:function(e,i){function s(){o.running=!1,o._trigger("activate",e,i)}function n(){o._addClass(i.newTab.closest("li"),"ui-tabs-active","ui-state-active"),a.length&&o.options.show?o._show(a,o.options.show,s):(a.show(),s())}var o=this,a=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){o._removeClass(i.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),n()}):(this._removeClass(i.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),r.hide(),n()),r.attr("aria-hidden","true"),i.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),a.length&&r.length?i.oldTab.attr("tabIndex",-1):a.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),a.attr("aria-hidden","false"),i.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(e){var i,s=this._findActive(e);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return e===!1?t():this.tabs.eq(e)},_getIndex:function(e){return"string"==typeof e&&(e=this.anchors.index(this.anchors.filter("[href$='"+t.ui.escapeSelector(e)+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}),this.tabs.each(function(){var e=t(this),i=e.data("ui-tabs-aria-controls");i?e.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(e){var i=this.options.disabled;i!==!1&&(void 0===e?i=!1:(e=this._getIndex(e),i=t.isArray(i)?t.map(i,function(t){return t!==e?t:null}):t.map(this.tabs,function(t,i){return i!==e?i:null})),this._setOptionDisabled(i))},disable:function(e){var i=this.options.disabled;if(i!==!0){if(void 0===e)i=!0;else{if(e=this._getIndex(e),-1!==t.inArray(e,i))return;i=t.isArray(i)?t.merge([e],i).sort():[e]}this._setOptionDisabled(i)}},load:function(e,i){e=this._getIndex(e);var s=this,n=this.tabs.eq(e),o=n.find(".ui-tabs-anchor"),a=this._getPanelForTab(n),r={tab:n,panel:a},h=function(t,e){"abort"===e&&s.panels.stop(!1,!0),s._removeClass(n,"ui-tabs-loading"),a.removeAttr("aria-busy"),t===s.xhr&&delete s.xhr};this._isLocal(o[0])||(this.xhr=t.ajax(this._ajaxSettings(o,i,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(this._addClass(n,"ui-tabs-loading"),a.attr("aria-busy","true"),this.xhr.done(function(t,e,n){setTimeout(function(){a.html(t),s._trigger("load",i,r),h(n,e)},1)}).fail(function(t,e){setTimeout(function(){h(t,e)},1)})))},_ajaxSettings:function(e,i,s){var n=this;return{url:e.attr("href").replace(/#.*$/,""),beforeSend:function(e,o){return n._trigger("beforeLoad",i,t.extend({jqXHR:e,ajaxSettings:o},s))}}},_getPanelForTab:function(e){var i=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}}),t.uiBackCompat!==!1&&t.widget("ui.tabs",t.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}}),t.ui.tabs,t.widget("ui.tooltip",{version:"1.12.1",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var e=t(this).attr("title")||"";return t("<a>").text(e).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,track:!1,close:null,open:null},_addDescribedBy:function(e,i){var s=(e.attr("aria-describedby")||"").split(/\s+/);s.push(i),e.data("ui-tooltip-id",i).attr("aria-describedby",t.trim(s.join(" ")))},_removeDescribedBy:function(e){var i=e.data("ui-tooltip-id"),s=(e.attr("aria-describedby")||"").split(/\s+/),n=t.inArray(i,s);-1!==n&&s.splice(n,1),e.removeData("ui-tooltip-id"),s=t.trim(s.join(" ")),s?e.attr("aria-describedby",s):e.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.liveRegion=t("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this.disabledTitles=t([])},_setOption:function(e,i){var s=this;this._super(e,i),"content"===e&&t.each(this.tooltips,function(t,e){s._updateContent(e.element)})},_setOptionDisabled:function(t){this[t?"_disable":"_enable"]()},_disable:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s.element[0],e.close(n,!0)}),this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var e=t(this);return e.is("[title]")?e.data("ui-tooltip-title",e.attr("title")).removeAttr("title"):void 0}))},_enable:function(){this.disabledTitles.each(function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))}),this.disabledTitles=t([])},open:function(e){var i=this,s=t(e?e.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&s.parents().each(function(){var e,s=t(this);s.data("ui-tooltip-open")&&(e=t.Event("blur"),e.target=e.currentTarget=this,i.close(e,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._registerCloseHandlers(e,s),this._updateContent(s,e))},_updateContent:function(t,e){var i,s=this.options.content,n=this,o=e?e.type:null;return"string"==typeof s||s.nodeType||s.jquery?this._open(e,t,s):(i=s.call(t[0],function(i){n._delay(function(){t.data("ui-tooltip-open")&&(e&&(e.type=o),this._open(e,t,i))})}),i&&this._open(e,t,i),void 0)},_open:function(e,i,s){function n(t){l.of=t,a.is(":hidden")||a.position(l)}var o,a,r,h,l=t.extend({},this.options.position);if(s){if(o=this._find(i))return o.tooltip.find(".ui-tooltip-content").html(s),void 0;i.is("[title]")&&(e&&"mouseover"===e.type?i.attr("title",""):i.removeAttr("title")),o=this._tooltip(i),a=o.tooltip,this._addDescribedBy(i,a.attr("id")),a.find(".ui-tooltip-content").html(s),this.liveRegion.children().hide(),h=t("<div>").html(a.find(".ui-tooltip-content").html()),h.removeAttr("name").find("[name]").removeAttr("name"),h.removeAttr("id").find("[id]").removeAttr("id"),h.appendTo(this.liveRegion),this.options.track&&e&&/^mouse/.test(e.type)?(this._on(this.document,{mousemove:n}),n(e)):a.position(t.extend({of:i},this.options.position)),a.hide(),this._show(a,this.options.show),this.options.track&&this.options.show&&this.options.show.delay&&(r=this.delayedShow=setInterval(function(){a.is(":visible")&&(n(l.of),clearInterval(r))},t.fx.interval)),this._trigger("open",e,{tooltip:a})}},_registerCloseHandlers:function(e,i){var s={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var s=t.Event(e);s.currentTarget=i[0],this.close(s,!0)}}};i[0]!==this.element[0]&&(s.remove=function(){this._removeTooltip(this._find(i).tooltip)}),e&&"mouseover"!==e.type||(s.mouseleave="close"),e&&"focusin"!==e.type||(s.focusout="close"),this._on(!0,i,s)},close:function(e){var i,s=this,n=t(e?e.currentTarget:this.element),o=this._find(n);return o?(i=o.tooltip,o.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&!n.attr("title")&&n.attr("title",n.data("ui-tooltip-title")),this._removeDescribedBy(n),o.hiding=!0,i.stop(!0),this._hide(i,this.options.hide,function(){s._removeTooltip(t(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,i){t(i.element).attr("title",i.title),delete s.parents[e]}),o.closing=!0,this._trigger("close",e,{tooltip:i}),o.hiding||(o.closing=!1)),void 0):(n.removeData("ui-tooltip-open"),void 0)},_tooltip:function(e){var i=t("<div>").attr("role","tooltip"),s=t("<div>").appendTo(i),n=i.uniqueId().attr("id");return this._addClass(s,"ui-tooltip-content"),this._addClass(i,"ui-tooltip","ui-widget ui-widget-content"),i.appendTo(this._appendTo(e)),this.tooltips[n]={element:e,tooltip:i}},_find:function(t){var e=t.data("ui-tooltip-id");return e?this.tooltips[e]:null},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_appendTo:function(t){var e=t.closest(".ui-front, dialog");return e.length||(e=this.document[0].body),e},_destroy:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur"),o=s.element;n.target=n.currentTarget=o[0],e.close(n,!0),t("#"+i).remove(),o.data("ui-tooltip-title")&&(o.attr("title")||o.attr("title",o.data("ui-tooltip-title")),o.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}}),t.uiBackCompat!==!1&&t.widget("ui.tooltip",t.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var t=this._superApply(arguments);return this.options.tooltipClass&&t.tooltip.addClass(this.options.tooltipClass),t}}),t.ui.tooltip}); + }).call(window, window); \ No newline at end of file diff --git a/src/002-config/fc-js-init.js b/src/002-config/fc-js-init.js index f2d1087953d8beef9b67e9ab917148946fcd23fe..ddc82db7712e2c964754f0d0f5e5a9d89066abb7 100644 --- a/src/002-config/fc-js-init.js +++ b/src/002-config/fc-js-init.js @@ -4,8 +4,8 @@ * does not work. */ window.App = { }; -// the same declaration for code parsers that don't like the line above -var App = window.App || {}; +// the same declaration for code parsers that don't line the line above +let App = window.App || {}; App.Data = {}; App.Debug = {}; @@ -16,3 +16,19 @@ App.UI.View = {}; App.Utils = {}; App.Interact = {}; App.Desc = {}; +App.ExtendedFamily = {}; +App.Facilities = { + Brothel: {}, + Club: {}, + Dairy: {}, + Farmyard: {}, + ServantsQuarters: {}, + MasterSuite: {}, + Spa: {}, + Nursery: {}, + Clinic: {}, + Schoolroom: {}, + Cellblock: {}, + Arcade: {}, + HGSuite: {} +}; diff --git a/src/SpecialForce/Firebase.tw b/src/SpecialForce/Firebase.tw index fc68eb2a0dd8ac0a90621575e572a4a09f59b5b3..59406c612b08fe8a874416b0ea171214b31e950e 100644 --- a/src/SpecialForce/Firebase.tw +++ b/src/SpecialForce/Firebase.tw @@ -159,7 +159,7 @@ <</if>> <<if _T1 && _LB> 0>> <br><br>''Launch Bay:'' <<if $SF.Squad.Satellite.lv > 0>> <<= UnitText('sat')>> - <<if $SF.Squad.Satellite.InOrbit < 1>> <br> [[Launch it into geostationary orbit.|Firebase][$SF.Squad.Satellite.InOrbit=1]] //You <span class='red'>cannot</span> upgrade the satellite once it has been launched.// <</if>> + <<if $SF.Squad.Satellite.InOrbit < 1>> <br> [[Launch it into geostationary orbit.|Firebase][$SF.Squad.Satellite.InOrbit=1]] //You <span class="red">cannot</span> upgrade the satellite once it has been launched.// <</if>> <</if>> <<= UnitText('GR')>> <<= UnitText('ms')>> <</if>> diff --git a/src/SpecialForce/SpecialForce.js b/src/SpecialForce/SpecialForce.js index 326f02f17bc06a1c0d0e529a53ab6e1533dfb6a3..a88da511caa1d2cf2918cb75d19e810b111dd624 100644 --- a/src/SpecialForce/SpecialForce.js +++ b/src/SpecialForce/SpecialForce.js @@ -1,43 +1,35 @@ // V=SugarCube.State.variables, T=SugarCube.State.temporary; window.Main = function() { - const V = State.variables; - V.SF = { - Toggle:V.SF.Toggle, Active:-1, Depravity:0, Size:0, Upgrade:0, Gift:0, + const V = State.variables; + V.SF = {Toggle:V.SF.Toggle, Active:-1, Depravity:0, Size:0, Upgrade:0, Gift:0, UC:{Assign:0, Lock:0, num:0}, ROE:"hold", Target:"recruit", Regs:"strict", - Caps:"The Special Force", Lower:"the special force", Subsidy:1, BadOutcome:"" - }; - V.arcologies[0].SFRaid = 1; V.arcologies[0].SFRaidTarget = -1; + Caps:"The Special Force", Lower:"the special force", Subsidy:1, BadOutcome:""}; + V.arcologies[0].SFRaid = 1; V.arcologies[0].SFRaidTarget = -1; }; window.Squad = function() { - const V = State.variables; - V.SF.Squad = { - Troops:40, Armoury:0, Firebase:0, AV:0, TV:0, Drones:0, Drugs:0, + const V = State.variables; + V.SF.Squad = {Troops:40, Armoury:0, Firebase:0, AV:0, TV:0, Drones:0, Drugs:0, PGT:0, AA:0, TA:0, SpacePlane:0, GunS:0, Satellite:{lv:0, InOrbit:0}, - GiantRobot:0, MissileSilo:0, AircraftCarrier:0, Sub:0, HAT:0 - }; + GiantRobot:0, MissileSilo:0, AircraftCarrier:0, Sub:0, HAT:0}; }; window.Colonel = function() { - const V = State.variables; - V.SF.Colonel = {Core:"", Talk:0, Fun:0, Status:0}; + const V = State.variables; + V.SF.Colonel = {Core:"", Talk:0, Fun:0, Status:0}; }; window.MercCon = function() { - const V = State.variables; - V.SF.MercCon = { - History:0, CanAttend:-2, Income:0, Revenue:0, Menials:0, - TotalMenials:0, Mercs:0, TotalMercs:0 - }; + const V = State.variables; + V.SF.MercCon = {History:0, CanAttend:-2, Income:0, Revenue:0, Menials:0, + TotalMenials:0, Mercs:0, TotalMercs:0}; }; window.Facility = function() { - const V = State.variables; - V.SF.Facility = { - Toggle:0, Active:0, LC:0, Workers:0, Max:5, + const V = State.variables; + V.SF.Facility = {Toggle:0, Active:0, LC:0, Workers:0, Max:5, Caps:"Special force support facility", Lower:"special force support facility", - Decoration:"standard", Speed:0, Upgrade:0, IDs:[] - }; + Decoration:"standard", Speed:0, Upgrade:0, IDs:[]}; }; window.SFInit = function() { - Main(); Squad(); Colonel(); + Main(); Squad(); Colonel(); }; window.SFBC = function() { @@ -133,8 +125,7 @@ window.SFBC = function() { if (V.ColonelCore === undefined) V.ColonelCore = ""; if (V.ColonelDiscussion === undefined) V.ColonelDiscussion = 0; if (V.ColonelSexed === undefined) V.ColonelSexed = 0; - V.SF.Colonel = { - Core:V.ColonelCore, + V.SF.Colonel = {Core:V.ColonelCore, Talk:V.securityForceColonelToken, Fun:V.securityForceColonelSexed, Status:V.ColonelRelationship}; ColonelClean(); @@ -143,8 +134,7 @@ window.SFBC = function() { if (V.TotalTradeShowIncome === undefined) V.TotalTradeShowIncome = 0; if (V.TradeShowHelots === undefined) V.TradeShowHelots = 0; if (V.TotalTradeShowHelots === undefined) V.TotalTradeShowHelots = 0; - V.SF.MercCon = { - History:V.OverallTradeShowAttendance, + V.SF.MercCon = {History:V.OverallTradeShowAttendance, CanAttend:V.CurrentTradeShowAttendance, Income:V.TradeShowIncome, Revenue:V.TotalTradeShowIncome, @@ -236,9 +226,9 @@ window.SFBC = function() { V.SF.Squad.Satellite = V.SF.Squad.Sat; delete V.SF.Squad.Sat; } } - InitClean(); MainClean(); ColonelClean(); TradeShowClean(); UnitsClean(); - if (V.SF.Facility === undefined) Facility(); - if (V.SF.Squad.Satellite === undefined) V.SF.Squad.Satellite = {lv:0, InOrbit:0}; + InitClean(); MainClean(); ColonelClean(); TradeShowClean(); UnitsClean(); + if (V.SF.Facility === undefined) Facility(); + if (V.SF.Squad.Satellite === undefined) V.SF.Squad.Satellite = {lv:0, InOrbit:0}; }; window.SFReport = function() { @@ -531,8 +521,8 @@ window.Count = function() { }; window.SFNameCapsCheck = function() { - const V = State.variables; - if (V.SF.Lower !== "the special force") V.SF.Caps = V.SF.Lower.replace("the ", "The "); + const V = State.variables; + if (V.SF.Lower !== "the special force") V.SF.Caps = V.SF.Lower.replace("the ", "The "); }; window.SFUpgradeCost = function(cost, unit) { @@ -570,8 +560,8 @@ window.SFC = function() { return `The Colonel`; } else { /* if (V.SF.Facility.LCActive > 0) { - * return `Lieutenant Colonel ${SlaveFullName(V.SF.Facility.LC)}`; - }*/ + * return `Lieutenant Colonel ${SlaveFullName(V.SF.Facility.LC)}`; + }*/ return `a designated soldier`; } }; @@ -724,6 +714,7 @@ window.UnitText = function(input) { let activate2 = `has been recommissioned for use by ${V.SF.Lower}. Currently, it `; let barrels = `Miniguns and Gatling cannons line`, distance = `, though the distance to ground targets renders the smaller calibers somewhat less useful`; + // eslint-disable-next-line camelcase let b4 = ``, c2 = ``, fuel = ``, GS_Speed = ``, countermeasures = ``, ammunition = ``, DFA = ``, autocannon = ``; let loc1 = `An unused science satellite has been purchased from an old world nation. While currently useless, it holds potential to be a powerful tool.`; @@ -918,11 +909,13 @@ window.UnitText = function(input) { if (S.GunS >= 3) c2 = `The underside of the aircraft has been better armored against small-arms fire`; countermeasures = `.`; if (S.GunS >= 4) fuel = `Larger fuel tanks have been installed in the wings and fuselage, allowing the gunship to provide aerial support for longer periods before refueling.`; if (S.GunS >= 5) barrels = `25 mm Gatling cannons`; distance = `; allowing the gunship to eliminate infantry`; DFA = ` and light vehicles from above`; autocannon = ` and a 40 mm autocannon are mounted on`; + // eslint-disable-next-line camelcase if (S.GunS >= 6) GS_Speed = `The engines have been replaced, allowing both faster travel to a target, and slower travel around a target.`; if (S.GunS >= 7) countermeasures = `; and multi-spectrum countermeasures have been installed to protect against guided missiles.`; if (S.GunS >= 8) b4 = `Upgraded multi-spectrum sensors can clearly depict targets even with IR shielding.`; if (S.GunS >= 9) ammunition = `The ammunition storage has been increased, only slightly depriving loaders of a place to sit.`; if (S.GunS >= 10) DFA = `; both light and heavy vehicles, and most enemy cover from above`; autocannon = `; a 40 mm autocannon, and a 105 mm howitzer are mounted on`; + // eslint-disable-next-line camelcase return `${text11} A large gunship ${activate2} is being refueled in the hangar. ${barrels}${autocannon} the port side of the fuselage${distance}${DFA}. ${b4} ${ammunition} ${GS_Speed} ${c2}${countermeasures} ${fuel}`; } break; @@ -1158,7 +1151,7 @@ window.UnitText = function(input) { MEMU_OPTION('title','OptPOS',cost), text += ` `; } else if (![FSPOS].includes(V.SF.FS.ColonelGift)) { text += `\n `, MEMU_OPTION('Buy the Colonel a ','ColonelGift',1000000), text += ` `; - } + } } } } diff --git a/src/art/artJS.js b/src/art/artJS.js index 7a18eab3ac7b2a128b5a4115e25ac16e962af752..cfeaba2ae90a47cbf47b504a5e7f5b7d555bf22a 100644 --- a/src/art/artJS.js +++ b/src/art/artJS.js @@ -13,6 +13,9 @@ UIDisplay (optional, only used by legacy art): icon UI Display for vector art, 1 */ /** * @param {App.Entity.SlaveState} artSlave + * @param {number} artSize + * @param {number} UIDisplay + * @returns {object} // TODO: I think */ window.SlaveArt = function(artSlave, artSize, UIDisplay) { const imageChoice = State.variables.imageChoice; @@ -100,6 +103,8 @@ window.ArtControlRendered = function ArtControlRendered(slave, sizePlacement) { /** * @param {App.Entity.SlaveState} slave + * @param {number} imageSize + * @returns {string} */ window.CustomArt = function(slave, imageSize) { const fileType = slave.custom.image.format || "png"; @@ -124,12 +129,12 @@ eyes can be nearly anything, it only indicates that the function is being used f This code's working is described to the user in the Encyclopedia, chapter "Lore", section "Dyes". */ -window.extractColor = function (color, eyes) { +window.extractColor = function(color, eyes) { /* these are color names known and used in FreeCities attributed color names are at the front of the array */ - var FCname2HTMLarray = [ + let FCname2HTMLarray = [ ["amber", "#ffbf00"], ["auburn", "#a53f2a"], ["black", "#171717"], @@ -171,11 +176,11 @@ window.extractColor = function (color, eyes) { ]; /* these are HTML color names supported by most browsers */ - var HTMLstandardColors = ["aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige", "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue", "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod", "darkgray", "darkgrey", "darkgreen", "darkkhaki", "darkmagenta", "darkolivegreen", "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen", "darkslateblue", "darkslategray", "darkslategrey", "darkturquoise", "darkviolet", "deeppink", "deepskyblue", "dimgray", "dimgrey", "dodgerblue", "firebrick", "floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite", "gold", "goldenrod", "gray", "grey", "green", "greenyellow", "honeydew", "hotpink", "indianred", "indigo", "ivory", "khaki", "lavender", "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral", "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgrey", "lightgreen", "lightpink", "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray", "lightslategrey", "lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta", "maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple", "mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise", "mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin", "navajowhite", "navy", "oldlace", "olive", "olivedrab", "orange", "orangered", "orchid", "palegoldenrod", "palegreen", "paleturquoise", "palevioletred", "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue", "purple", "rebeccapurple", "red", "rosybrown", "royalblue", "saddlebrown", "salmon", "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue", "slateblue", "slategray", "slategrey", "snow", "springgreen", "steelblue", "tan", "teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white", "whitesmoke", "yellow", "yellowgreen"]; + let HTMLstandardColors = ["aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige", "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue", "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod", "darkgray", "darkgrey", "darkgreen", "darkkhaki", "darkmagenta", "darkolivegreen", "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen", "darkslateblue", "darkslategray", "darkslategrey", "darkturquoise", "darkviolet", "deeppink", "deepskyblue", "dimgray", "dimgrey", "dodgerblue", "firebrick", "floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite", "gold", "goldenrod", "gray", "grey", "green", "greenyellow", "honeydew", "hotpink", "indianred", "indigo", "ivory", "khaki", "lavender", "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral", "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgrey", "lightgreen", "lightpink", "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray", "lightslategrey", "lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta", "maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple", "mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise", "mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin", "navajowhite", "navy", "oldlace", "olive", "olivedrab", "orange", "orangered", "orchid", "palegoldenrod", "palegreen", "paleturquoise", "palevioletred", "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue", "purple", "rebeccapurple", "red", "rosybrown", "royalblue", "saddlebrown", "salmon", "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue", "slateblue", "slategray", "slategrey", "snow", "springgreen", "steelblue", "tan", "teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white", "whitesmoke", "yellow", "yellowgreen"]; - var FCnames = new Map(FCname2HTMLarray); + let FCnames = new Map(FCname2HTMLarray); color = color.toLowerCase(); /* normalization: lowercase color name */ - var colorCode = FCnames.get(color); /* look up in FreeCities color names */ + let colorCode = FCnames.get(color); /* look up in FreeCities color names */ if (!colorCode) { /* not a FreeCities color name*/ if (HTMLstandardColors.includes(color) || color.match(/^#([0-9a-f]{3}){1,2}$/) !== null) { colorCode = color; /* is a HTML color name or value, use it directly */ @@ -184,23 +189,23 @@ window.extractColor = function (color, eyes) { is not even a HTML color name. color probably is a description. look for anything resembling a valid color name within the description. */ - var colorNoSpaces = color.replace(/\s+/g, ''); /* remove all spaces from description */ - var FCkeys = Array.from(FCnames.keys()); - var colorCodes = [ - FCnames.get(FCkeys.find(function (e) { + let colorNoSpaces = color.replace(/\s+/g, ''); /* remove all spaces from description */ + let FCkeys = Array.from(FCnames.keys()); + let colorCodes = [ + FCnames.get(FCkeys.find(function(e) { return color.startsWith(e); })), - HTMLstandardColors.find(function (e) { + HTMLstandardColors.find(function(e) { return colorNoSpaces.startsWith(e); }), - FCnames.get(FCkeys.find(function (e) { + FCnames.get(FCkeys.find(function(e) { return color.includes(e); })), - HTMLstandardColors.find(function (e) { + HTMLstandardColors.find(function(e) { return colorNoSpaces.includes(e); }) ]; - colorCode = colorCodes.find(function (e) { + colorCode = colorCodes.find(function(e) { return e; }); /* picks the first successful guess */ } @@ -215,7 +220,7 @@ window.extractColor = function (color, eyes) { return colorCode; }; -window.clothing2artSuffix = function (v) { +window.clothing2artSuffix = function(v) { if (v === "restrictive latex") { v = "latex"; } /* universal "special case": latex art is actually "restrictive latex" TODO: align name in vector source */ @@ -223,7 +228,7 @@ window.clothing2artSuffix = function (v) { .replace(/ ?(outfit|clothing) ?/, "") /* remove "outfit" and "clothing" (redundant) */ .replace("-", "") /* remove minus character */ .replace(/\w\S*/g, - function (txt) { + function(txt) { return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); } @@ -231,7 +236,7 @@ window.clothing2artSuffix = function (v) { .replace(/\W/g, ""); /* remove remaining whitespace */ }; -window.skinColorCatcher = function (artSlave) { +window.skinColorCatcher = function(artSlave) { let colorSlave = { skinColor: "#e8b693", areolaColor: "#d76b93", diff --git a/src/art/vector/VectorArtJS.js b/src/art/vector/VectorArtJS.js index a7d7b943d94dea630d361bccf193f7cb190d224e..fd6860d8b914afa6a2f4ef9b848cdcd7e13847d8 100644 --- a/src/art/vector/VectorArtJS.js +++ b/src/art/vector/VectorArtJS.js @@ -1,6 +1,4 @@ -/* eslint-disable no-case-declarations */ -/* eslint-disable no-undef */ -window.VectorArt = (function () { +window.VectorArt = (function() { "use strict"; let V, T, slave; let r; @@ -18,6 +16,7 @@ window.VectorArt = (function () { /* reset/initialize some variables */ T.artTransformBelly = ""; T.artTransformBoob = ""; + // eslint-disable-next-line camelcase T.art_transform = ""; /* in case other files are trying to use this, and expecting a string */ setStylesheet(artSize); /* initializes the stylesheet, and r */ @@ -77,8 +76,10 @@ window.VectorArt = (function () { if (T.art_display_id > 0) T.art_display_id++; else + // eslint-disable-next-line camelcase T.art_display_id = 1; displayClass = `ad${T.art_display_id}`; + // eslint-disable-next-line camelcase T.art_display_class = displayClass; /* setup height scaling and style */ @@ -595,6 +596,7 @@ window.VectorArt = (function () { } function ArtVectorBalls() { + let ballsScaleFactor; switch (slave.clothes) { case "a bra": case "a button-up shirt": @@ -629,7 +631,7 @@ window.VectorArt = (function () { case "slutty jewelry": case "uncomfortable straps": case "Western clothing": - let ballsScaleFactor = (slave.scrotum / 3) * heightScaleFactor; + ballsScaleFactor = (slave.scrotum / 3) * heightScaleFactor; artTranslationX = -271 * (ballsScaleFactor - 1); artTranslationY = -453 * (ballsScaleFactor - 1); T.artTransformBalls = `matrix(${ballsScaleFactor},0,0,${ballsScaleFactor},${artTranslationX},${artTranslationY})`; @@ -1092,7 +1094,7 @@ window.VectorArt = (function () { /* BEGIN SKIN COLOR OVERRIDES FOR LATEX CLOTHING EMULATION */ if (slave.clothes === "a Fuckdoll suit") { - /* slave is a Fuckdoll - display all skin as if it was black rubber */ + /* slave is a fuckdoll - display all skin as if it was black rubber */ T.skinColour = outfitBaseColour; T.areolaStyle = "fill:rgba(81,83,81,1);"; T.labiaStyle = T.areolaStyle; @@ -2228,8 +2230,10 @@ window.VectorArt = (function () { if (slave.fuckdoll !== 0 || slave.clothes !== "a latex catsuit") { if (V.showBodyMods === 1 && slave.vaginaTat === "rude words") { if (slave.dick !== 0) + // eslint-disable-next-line camelcase T.art_pussy_tattoo_text = "Useless"; else + // eslint-disable-next-line camelcase T.art_pussy_tattoo_text = "Fucktoy"; r += jsInclude("Art_Vector_Pussy_Tattoo"); } @@ -2658,7 +2662,7 @@ window.LegacyVectorArt = function(slave, artSize) { /* if pregnant or has a belly */ if (slave.belly >= 5000) { r += `<img class='paperdoll' src=${skinFilePath}/preg belly 5000.svg' style='${skinFilter}'>`; - if (slave.navelPiercing >= 1) /*Navel Piercing*/ + if (slave.navelPiercing >= 1) /* Navel Piercing*/ r += `<img class='paperdoll' src=${filePath}/body/addon/preg navel piercing.svg'/>`; if (slave.navelPiercing === 2) r += `<img class='paperdoll' src=${filePath}/body/addon/preg navel piercing heavy.svg'/>`; @@ -2671,7 +2675,7 @@ window.LegacyVectorArt = function(slave, artSize) { r += `<img class='paperdoll' src=${filePath}/body/addon/preg navel piercing heavy.svg'/>`; */ } else { - if (slave.navelPiercing >= 1) /*Navel Piercing*/ + if (slave.navelPiercing >= 1) /* Navel Piercing*/ r += `<img class='paperdoll' src=${filePath}/body/addon/navel piercing.svg'/>`; if (slave.navelPiercing === 2) r += `<img class='paperdoll' src=${filePath}/body/addon/navel piercing heavy.svg'/>`; diff --git a/src/art/vector_revamp/vectorRevampedArtControl.js b/src/art/vector_revamp/vectorRevampedArtControl.js index 7e1f419ffc7738643f55f1af0db7ad24b7a657ed..a08cabbd3e8989fd91bd0457a1b3e5d6afb445f1 100644 --- a/src/art/vector_revamp/vectorRevampedArtControl.js +++ b/src/art/vector_revamp/vectorRevampedArtControl.js @@ -711,8 +711,7 @@ class RevampedArtControl { case "a leotard": /*return this.clothingControl.leotard;*/ break; - default: - break; + } return clothing; } diff --git a/src/debugging/debugJS.js b/src/debugging/debugJS.js index 5675664ec6d6537aa37c7309676c06da467d7f70..86ca5dd2d9c83f88edf02c4049205e3a3e2a7379 100644 --- a/src/debugging/debugJS.js +++ b/src/debugging/debugJS.js @@ -5,7 +5,7 @@ Given an object, this will return an array where for each property of the origin {variable: property, oldVal: _oldDiff.property, newVal: _newDiff.property} */ window.generateDiffArray = function generateDiffArray(obj) { - var diffArray = Object.keys(obj).map(function(key) { + let diffArray = Object.keys(obj).map(function(key) { return {variable: key, oldVal: State.temporary.oldDiff[key], newVal: State.temporary.newDiff[key]}; }); return diffArray; @@ -16,7 +16,7 @@ Shamelessly copied from https://codereview.stackexchange.com/a/11580 Finds and returns the difference between two objects. Potentially will have arbitrary nestings of objects. */ window.difference = function difference(o1, o2) { - var k, kDiff, diff = {}; + let k, kDiff, diff = {}; for (k in o1) { if (!o1.hasOwnProperty(k)) { } else if (typeof o1[k] !== 'object' || typeof o2[k] !== 'object') { @@ -49,17 +49,17 @@ Flattens an object while concatenating property names. For example {id: {number: 4, name: "A"}} --> {id.number: 4, id.name: "A"} */ window.diffFlatten = function diffFlatten(data) { - var result = {}; - function recurse (cur, prop) { + let result = {}; + function recurse(cur, prop) { if (Object(cur) !== cur) { result[prop] = cur; } else if (Array.isArray(cur)) { - for(var i=0, l=cur.length; i<l; i++) + for (let i=0, l=cur.length; i<l; i++) recurse(cur[i], prop + "[" + i + "]"); if (l === 0) result[prop] = []; } else { - var isEmpty = true; + let isEmpty = true; for (let p in cur) { isEmpty = false; recurse(cur[p], prop ? prop+"."+p : p); @@ -77,7 +77,7 @@ Finds all NaN values anywhere in the State.variables object. Returns an array wi */ window.findNaN = function findNan() { const flatV = diffFlatten(State.variables); - var result = []; + let result = []; for (let key in flatV) { if (Number.isNaN(flatV[key])) { result.push('$$'+key); /* double dollar signs to escape sugarcube markup */ @@ -89,12 +89,12 @@ window.findNaN = function findNan() { /** * Dumps game save as a readable JSON to the browser for saving in a file */ -App.Debug.dumpGameState = function () { +App.Debug.dumpGameState = function() { // helper to download a blob // borrowed from stackexchange function downloadToFile(content, fileName, contentType) { - var a = document.createElement("a"); - var file = new Blob([content], { + let a = document.createElement("a"); + let file = new Blob([content], { type: contentType }); a.href = URL.createObjectURL(file); @@ -105,7 +105,7 @@ App.Debug.dumpGameState = function () { // we will replace SugarCube onSave handler let oldHandler = SugarCube.Config.saves.onSave; try { - SugarCube.Config.saves.onSave = function (save) { + SugarCube.Config.saves.onSave = function(save) { if (oldHandler) { oldHandler(save); } diff --git a/src/endWeek/minorInjuryResponse.js b/src/endWeek/minorInjuryResponse.js index 8781ec6293afa63c2dc282585523c754f58bf6ba..49416c41d34eb5deeac9ad4e2bbc6b82899b3c98 100644 --- a/src/endWeek/minorInjuryResponse.js +++ b/src/endWeek/minorInjuryResponse.js @@ -1,6 +1,8 @@ -/* eslint-disable no-undef */ -/* eslint-disable no-unused-vars */ -window.minorInjuryResponse = /** @param {App.Entity.SlaveState} slave */ function minorInjuryResponse(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {string} + */ +window.minorInjuryResponse = function minorInjuryResponse(slave) { const arcology = State.variables.arcologies[0]; const arcologyUpgrade = State.variables.arcologyUpgrade; const pronouns = getPronouns(slave); diff --git a/src/endWeek/saChoosesOwnClothes.js b/src/endWeek/saChoosesOwnClothes.js index 7ba75136b79cfb66c747eacb117a5847360f811a..de9badc60f82c7d2cc776ed0effd76339b5fea0d 100644 --- a/src/endWeek/saChoosesOwnClothes.js +++ b/src/endWeek/saChoosesOwnClothes.js @@ -3,6 +3,7 @@ window.saChoosesOwnClothes = (function() { let V; let player; let r; + /* eslint-disable */ let pronouns; let he; let him; @@ -12,8 +13,12 @@ window.saChoosesOwnClothes = (function() { let boy; let He; let His; + /* eslint-enable */ - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @returns {string} + */ function saChoosesOwnClothes(slave) { V = State.variables; player = V.PC; @@ -91,7 +96,10 @@ window.saChoosesOwnClothes = (function() { return r; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @returns {string} // I think + */ function todaysOutfit(slave) { const clothing = []; let chosenClothing; @@ -946,7 +954,10 @@ window.saChoosesOwnClothes = (function() { return selection; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @returns {string} + */ function todaysShoes(slave) { const shoes = []; @@ -989,12 +1000,17 @@ window.saChoosesOwnClothes = (function() { return jsEither(shoes); } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @returns {string} + */ function todaysCollar(slave) { const neck = []; if (slave.fetish === "mindbroken") { + // } else if (slave.devotion <= 20) { + // } else { if (V.arcologies[0].FSEgyptianRevivalist > 0) { neck.push({text: `dons a wesekh to support your ancient Egyptian pretensions,`, collar: "ancient Egyptian"}); @@ -1016,7 +1032,10 @@ window.saChoosesOwnClothes = (function() { return jsEither(neck); } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @returns {string} + */ function todaysCorset(slave) { const belly = []; const empathyBellies = ["a small empathy belly", "a medium empathy belly", "a large empathy belly", "a huge empathy belly"]; diff --git a/src/endWeek/saPorn.js b/src/endWeek/saPorn.js index fea7013dedb26444c9d3ff878d4761ec26a8e83e..93ab5aa36c52c40b03030d04339859f23b79298d 100644 --- a/src/endWeek/saPorn.js +++ b/src/endWeek/saPorn.js @@ -1,6 +1,10 @@ /* to later be rolled into saPorn */ -window.getHighestPorn = /** @param {App.Entity.SlaveState} slave */ function(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {object} + */ +window.getHighestPorn = function(slave) { let max = {value: 0, type: "none"}; if (slave.porn.fame.general > max.value) { diff --git a/src/endWeek/saRest.js b/src/endWeek/saRest.js index cd32de24646df7155de4da6c5142851baa9732ea..009befc9e6b397d3426d5f13dc73ae0136b75b50 100644 --- a/src/endWeek/saRest.js +++ b/src/endWeek/saRest.js @@ -1,5 +1,10 @@ -window.saRest = /** @param {App.Entity.SlaveState} slave */ function saRest(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {string} + */ +window.saRest = function saRest(slave) { const V = State.variables; + /* eslint-disable */ const pronouns = getPronouns(slave); const he = pronouns.pronoun; const him = pronouns.object; @@ -9,6 +14,7 @@ window.saRest = /** @param {App.Entity.SlaveState} slave */ function saRest(slav const boy = pronouns.noun; const He = capFirstChar(he); const His = capFirstChar(his); + /* eslint-enable */ let t = " takes the week off."; @@ -25,13 +31,13 @@ window.saRest = /** @param {App.Entity.SlaveState} slave */ function saRest(slav if (slave.health > 90) { t += ` ${His} health is so outstanding that rest does not improve it.`; } else if (slave.health > -100) { - t += ` ${His} <span class='green'>health recovers</span> with rest.`; + t += ` ${His} <span class="green">health recovers</span> with rest.`; slave.health += 10; if (!(canHear(slave))) { - t += ` Since ${he} is deaf, the hustle and bustle of daily life in the penthouse <span class='green'>didn't bother ${him} at all.</span>`; + t += ` Since ${he} is deaf, the hustle and bustle of daily life in the penthouse <span class="green">didn't bother ${him} at all.</span>`; slave.health += 3; } else if ((slave.hears === -1 && slave.earwear !== "hearing aids") || (slave.hears === 0 && slave.earwear === "muffling ear plugs")) { - t += ` Since ${he} is hard of hearing, the hustle and bustle of daily life in the penthouse <span class='green'>didn't disturb ${his} rest as much.</span>`; + t += ` Since ${he} is hard of hearing, the hustle and bustle of daily life in the penthouse <span class="green">didn't disturb ${his} rest as much.</span>`; slave.health += 1; } } @@ -39,18 +45,18 @@ window.saRest = /** @param {App.Entity.SlaveState} slave */ function saRest(slav if (slave.fuckdoll === 0 && slave.fetish !== "mindbroken") { if (slave.devotion > 20) { if (slave.trust <= 20) { - t += ` Being allowed to rest <span class='mediumaquamarine'>reduces ${his} fear</span> of you.`; + t += ` Being allowed to rest <span class="mediumaquamarine">reduces ${his} fear</span> of you.`; slave.trust += 4; } else if (slave.trust <= 50) { - t += ` Being allowed to rest <span class='mediumaquamarine'>builds ${his} trust</span> in you.`; + t += ` Being allowed to rest <span class="mediumaquamarine">builds ${his} trust</span> in you.`; slave.trust += 2; } else { - t += ` Being allowed to rest <span class='mediumaquamarine'>confirms ${his} trust</span> in you.`; + t += ` Being allowed to rest <span class="mediumaquamarine">confirms ${his} trust</span> in you.`; slave.trust += 2; } } else { if (slave.trust < -20) { - t += ` Being allowed to rest <span class='mediumaquamarine'>reduces ${his} fear</span> of you.`; + t += ` Being allowed to rest <span class="mediumaquamarine">reduces ${his} fear</span> of you.`; slave.trust += 4; } } @@ -61,77 +67,77 @@ window.saRest = /** @param {App.Entity.SlaveState} slave */ function saRest(slav t += ` __This week__ ${_vignette.text} `; if (_vignette.type === "cash") { if (_vignette.effect > 0) { - t += `<span class='yellowgreen'>making you an extra ${cashFormat(Math.trunc(V.FResult*_vignette.effect))}.</span>`; + t += `<span class="yellowgreen">making you an extra ${cashFormat(Math.trunc(V.FResult*_vignette.effect))}.</span>`; } else if (_vignette.effect < 0) { - t += `<span class='red'>losing you ${cashFormat(Math.abs(Math.trunc(V.FResult*_vignette.effect)))}.</span>`; + t += `<span class="red">losing you ${cashFormat(Math.abs(Math.trunc(V.FResult*_vignette.effect)))}.</span>`; } else { t += `an incident without lasting effect.`; } - cashX(Math.trunc(V.FResult*_vignette.effect), "rest", slave); + cashX(Math.trunc(V.FResult * _vignette.effect), "rest", slave); } else if (_vignette.type === "devotion") { if (_vignette.effect > 0) { if (slave.devotion > 50) { - t += `<span class='hotpink'>increasing ${his} devotion to you.</span>`; + t += `<span class="hotpink">increasing ${his} devotion to you.</span>`; } else if (slave.devotion >= -20) { - t += `<span class='hotpink'>increasing ${his} acceptance of you.</span>`; + t += `<span class="hotpink">increasing ${his} acceptance of you.</span>`; } else if (slave.devotion > -10) { - t += `<span class='hotpink'>reducing ${his} dislike of you.</span>`; + t += `<span class="hotpink">reducing ${his} dislike of you.</span>`; } else { - t += `<span class='hotpink'>reducing ${his} hatred of you.</span>`; + t += `<span class="hotpink">reducing ${his} hatred of you.</span>`; } } else if (_vignette.effect < 0) { if (slave.devotion > 50) { - t += `<span class='mediumorchid'>reducing ${his} devotion to you.</span>`; + t += `<span class="mediumorchid">reducing ${his} devotion to you.</span>`; } else if (slave.devotion >= -20) { - t += `<span class='mediumorchid'>reducing ${his} acceptance of you.</span>`; + t += `<span class="mediumorchid">reducing ${his} acceptance of you.</span>`; } else if (slave.devotion > -10) { - t += `<span class='mediumorchid'>increasing ${his} dislike of you.</span>`; + t += `<span class="mediumorchid">increasing ${his} dislike of you.</span>`; } else { - t += `<span class='mediumorchid'>increasing ${his} hatred of you.</span>`; + t += `<span class="mediumorchid">increasing ${his} hatred of you.</span>`; } } else { t += `an incident without lasting effect.`; } - slave.devotion += (1*_vignette.effect); + slave.devotion += (1 * _vignette.effect); } else if (_vignette.type === "trust") { if (_vignette.effect > 0) { if (slave.trust > 20) { - t += `<span class='mediumaquamarine'>increasing ${his} trust in you.</span>`; + t += `<span class="mediumaquamarine">increasing ${his} trust in you.</span>`; } else if (slave.trust > -10) { - t += `<span class='mediumaquamarine'>reducing ${his} fear of you.</span>`; + t += `<span class="mediumaquamarine">reducing ${his} fear of you.</span>`; } else { - t += `<span class='mediumaquamarine'>reducing ${his} terror of you.</span>`; + t += `<span class="mediumaquamarine">reducing ${his} terror of you.</span>`; } } else if (_vignette.effect < 0) { if (slave.trust > 20) { - t += `<span class='gold'>reducing ${his} trust in you.</span>`; + t += `<span class="gold">reducing ${his} trust in you.</span>`; } else if (slave.trust >= -20) { - t += `<span class='gold'>increasing ${his} fear of you.</span>`; + t += `<span class="gold">increasing ${his} fear of you.</span>`; } else { - t += `<span class='gold'>increasing ${his} terror of you.</span>`; + t += `<span class="gold">increasing ${his} terror of you.</span>`; } } else { t += `an incident without lasting effect.`; } - slave.trust += (1*_vignette.effect); + slave.trust += (1 * _vignette.effect); } else if (_vignette.type === "health") { if (_vignette.effect > 0) { - t += `<span class='green'>improving ${his} health.</span>`; + t += `<span class="green">improving ${his} health.</span>`; } else if (_vignette.effect < 0) { - t += `<span class='red'>affecting ${his} health.</span>`; + t += `<span class="red">affecting ${his} health.</span>`; } else { t += `an incident without lasting effect.`; } - slave.health += (2*_vignette.effect); + slave.health += (2 * _vignette.effect); } else { if (_vignette.effect > 0) { - t += `<span class='green'>gaining you a bit of reputation.</span>`; + t += `<span class="green">gaining you a bit of reputation.</span>`; } else if (_vignette.effect < 0) { - t += `<span class='red'>losing you a bit of reputation.</span>`; + t += `<span class="red">losing you a bit of reputation.</span>`; } else { t += `an incident without lasting effect.`; } - repX((V.FResult*_vignette.effect*0.1), "vignette", slave); + repX((V.FResult * _vignette.effect * 0.1), "vignette", slave); } } diff --git a/src/endWeek/saServant.js b/src/endWeek/saServant.js index 5b13a5642fc18f95b36025845633b90a9c556885..7125a95b18c2258d193979513773d0a1421410e8 100644 --- a/src/endWeek/saServant.js +++ b/src/endWeek/saServant.js @@ -1,5 +1,10 @@ -window.saServant = /** @param {App.Entity.SlaveState} slave */ function saServant(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {string} + */ +window.saServant = function saServant(slave) { const V = State.variables; + /* eslint-disable */ const pronouns = getPronouns(slave); const he = pronouns.pronoun; const him = pronouns.object; @@ -9,6 +14,7 @@ window.saServant = /** @param {App.Entity.SlaveState} slave */ function saServan const boy = pronouns.noun; const He = capFirstChar(he); const His = capFirstChar(his); + /* eslint-enable */ let t = `works as a servant. ${He} performs the lowest jobs in your penthouse, cleaning up after your other slaves, bathing them, helping them dress, and giving them sexual relief.`; @@ -21,14 +27,14 @@ window.saServant = /** @param {App.Entity.SlaveState} slave */ function saServan if (V.Stewardess !== 0) { t += ` This brings ${him} under ${V.Stewardess.slaveName}'s supervision. The Stewardess `; if (slave.devotion < -20) { - t += `subjects ${him} to <span class='gold'>corrective rape</span> when ${his} service is imperfect, <span class='hotpink'>when ${he} steps out of line,</span> or when the Stewardess just feels like raping ${him}, forcing the poor slave to <span class='yellowgreen'>find refuge in work.</span>`; + t += `subjects ${him} to <span class="gold">corrective rape</span> when ${his} service is imperfect, <span class="hotpink">when ${he} steps out of line,</span> or when the Stewardess just feels like raping ${him}, forcing the poor slave to <span class="yellowgreen">find refuge in work.</span>`; slave.devotion += 2; slave.trust -= 2; } else if (slave.devotion <= 20) { - t += `molests ${him}, encouraging the poor slave to <span class='hotpink'>keep ${his} head down</span> and <span class='yellowgreen'>work harder.</span>`; + t += `molests ${him}, encouraging the poor slave to <span class="hotpink">keep ${his} head down</span> and <span class="yellowgreen">work harder.</span>`; slave.devotion += 2; } else { - t += `uses <span class='hotpink'>sex as a reward,</span> getting ${him} off when ${he} <span class='yellowgreen'>works harder.</span>`; + t += `uses <span class="hotpink">sex as a reward,</span> getting ${him} off when ${he} <span class="yellowgreen">works harder.</span>`; slave.devotion++; } if (!(canHear(slave))) { @@ -46,21 +52,21 @@ window.saServant = /** @param {App.Entity.SlaveState} slave */ function saServan t += ` ${He} is `; if (slave.trust < -20) { - t += "frightened of punishment and works very hard, <span class='yellowgreen'>reducing the upkeep</span> of your slaves."; + t += `frightened of punishment and works very hard, <span class="yellowgreen">reducing the upkeep</span> of your slaves.`; } else if (slave.devotion < -20) { if (slave.trust >= 20) { - t += `uninterested in doing such work and barely lifts a finger to <span class='yellowgreen'>reduce the upkeep</span> of your slaves.`; + t += `uninterested in doing such work and barely lifts a finger to <span class="yellowgreen">reduce the upkeep</span> of your slaves.`; } else { - t += `reluctant, requiring your other slaves to force ${his} services, and does not <span class='yellowgreen'>reduce upkeep</span> of your slaves much.`; + t += `reluctant, requiring your other slaves to force ${his} services, and does not <span class="yellowgreen">reduce upkeep</span> of your slaves much.`; } } else if (slave.devotion <= 20) { - t += `hesitant, requiring your other slaves to demand ${his} services, and only slightly <span class='yellowgreen'>reduces upkeep</span> of your slaves.`; + t += `hesitant, requiring your other slaves to demand ${his} services, and only slightly <span class="yellowgreen">reduces upkeep</span> of your slaves.`; } else if (slave.devotion <= 50) { - t += `obedient, offering your other slaves ${his} services, and moderately <span class='yellowgreen'>reduces the upkeep</span> of your slaves.`; + t += `obedient, offering your other slaves ${his} services, and moderately <span class="yellowgreen">reduces the upkeep</span> of your slaves.`; } else if (slave.devotion <= 95) { - t += `devoted, happily giving your other slaves ${his} services, and <span class='yellowgreen'>reduces the upkeep</span> of your slaves.`; + t += `devoted, happily giving your other slaves ${his} services, and <span class="yellowgreen">reduces the upkeep</span> of your slaves.`; } else { - t += `so happy to serve your other slaves that ${he} often sees to their needs before they know they have them, and greatly <span class='yellowgreen'>reduces the upkeep</span> of your slaves.`; + t += `so happy to serve your other slaves that ${he} often sees to their needs before they know they have them, and greatly <span class="yellowgreen">reduces the upkeep</span> of your slaves.`; } if (slave.releaseRules !== "chastity") { @@ -121,9 +127,9 @@ window.saServant = /** @param {App.Entity.SlaveState} slave */ function saServan t += ` __This week__ ${_vignette.text} `; if (_vignette.type === "cash") { if (_vignette.effect > 0) { - t += `<span class='yellowgreen'>making you an extra ${cashFormat(Math.trunc(V.FResult*_vignette.effect))}.</span>`; + t += `<span class="yellowgreen">making you an extra ${cashFormat(Math.trunc(V.FResult*_vignette.effect))}.</span>`; } else if (_vignette.effect < 0) { - t += `<span class='red'>losing you ${cashFormat(Math.abs(Math.trunc(V.FResult*_vignette.effect)))}.</span>`; + t += `<span class="red">losing you ${cashFormat(Math.abs(Math.trunc(V.FResult*_vignette.effect)))}.</span>`; } else { t += `an incident without lasting effect.`; } @@ -131,23 +137,23 @@ window.saServant = /** @param {App.Entity.SlaveState} slave */ function saServan } else if (_vignette.type === "devotion") { if (_vignette.effect > 0) { if (slave.devotion > 50) { - t += `<span class='hotpink'>increasing ${his} devotion to you.</span>`; + t += `<span class="hotpink">increasing ${his} devotion to you.</span>`; } else if (slave.devotion >= -20) { - t += `<span class='hotpink'>increasing ${his} acceptance of you.</span>`; + t += `<span class="hotpink">increasing ${his} acceptance of you.</span>`; } else if (slave.devotion > -10) { - t += `<span class='hotpink'>reducing ${his} dislike of you.</span>`; + t += `<span class="hotpink">reducing ${his} dislike of you.</span>`; } else { - t += `<span class='hotpink'>reducing ${his} hatred of you.</span>`; + t += `<span class="hotpink">reducing ${his} hatred of you.</span>`; } } else if (_vignette.effect < 0) { if (slave.devotion > 50) { - t += `<span class='mediumorchid'>reducing ${his} devotion to you.</span>`; + t += `<span class="mediumorchid">reducing ${his} devotion to you.</span>`; } else if (slave.devotion >= -20) { - t += `<span class='mediumorchid'>reducing ${his} acceptance of you.</span>`; + t += `<span class="mediumorchid">reducing ${his} acceptance of you.</span>`; } else if (slave.devotion > -10) { - t += `<span class='mediumorchid'>increasing ${his} dislike of you.</span>`; + t += `<span class="mediumorchid">increasing ${his} dislike of you.</span>`; } else { - t += `<span class='mediumorchid'>increasing ${his} hatred of you.</span>`; + t += `<span class="mediumorchid">increasing ${his} hatred of you.</span>`; } } else { t += `an incident without lasting effect.`; @@ -156,19 +162,19 @@ window.saServant = /** @param {App.Entity.SlaveState} slave */ function saServan } else if (_vignette.type === "trust") { if (_vignette.effect > 0) { if (slave.trust > 20) { - t += `<span class='mediumaquamarine'>increasing ${his} trust in you.</span>`; + t += `<span class="mediumaquamarine">increasing ${his} trust in you.</span>`; } else if (slave.trust > -10) { - t += `<span class='mediumaquamarine'>reducing ${his} fear of you.</span>`; + t += `<span class="mediumaquamarine">reducing ${his} fear of you.</span>`; } else { - t += `<span class='mediumaquamarine'>reducing ${his} terror of you.</span>`; + t += `<span class="mediumaquamarine">reducing ${his} terror of you.</span>`; } } else if (_vignette.effect < 0) { if (slave.trust > 20) { - t += `<span class='gold'>reducing ${his} trust in you.</span>`; + t += `<span class="gold">reducing ${his} trust in you.</span>`; } else if (slave.trust >= -20) { - t += `<span class='gold'>increasing ${his} fear of you.</span>`; + t += `<span class="gold">increasing ${his} fear of you.</span>`; } else { - t += `<span class='gold'>increasing ${his} terror of you.</span>`; + t += `<span class="gold">increasing ${his} terror of you.</span>`; } } else { t += `an incident without lasting effect.`; @@ -176,18 +182,18 @@ window.saServant = /** @param {App.Entity.SlaveState} slave */ function saServan slave.trust += (1 * _vignette.effect); } else if (_vignette.type === "health") { if (_vignette.effect > 0) { - t += `<span class='green'>improving ${his} health.</span>`; + t += `<span class="green">improving ${his} health.</span>`; } else if (_vignette.effect < 0) { - t += `<span class='red'>affecting ${his} health.</span>`; + t += `<span class="red">affecting ${his} health.</span>`; } else { t += `an incident without lasting effect.`; } slave.health += (2 * _vignette.effect); } else { if (_vignette.effect > 0) { - t += `<span class='green'>gaining you a bit of reputation.</span>`; + t += `<span class="green">gaining you a bit of reputation.</span>`; } else if (_vignette.effect < 0) { - t += `<span class='red'>losing you a bit of reputation.</span>`; + t += `<span class="red">losing you a bit of reputation.</span>`; } else { t += `an incident without lasting effect.`; } diff --git a/src/endWeek/saServeThePublic.js b/src/endWeek/saServeThePublic.js index 366c7736815a4cb4e84a7f433c07f9df4d7e3c36..c7c0ba7403f24862bcb4465b4a128956e9096a39 100644 --- a/src/endWeek/saServeThePublic.js +++ b/src/endWeek/saServeThePublic.js @@ -18,7 +18,10 @@ window.saServeThePublic = (function saServeThePublic() { return saServeThePublic; - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @returns {string} + */ function saServeThePublic(slave) { V = State.variables; T = State.temporary; @@ -59,7 +62,10 @@ window.saServeThePublic = (function saServeThePublic() { return r; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * + */ function gatherStatistics(slave) { /* Statistics gathering */ const facility = slave.assignment === Job.CLUB ? V.facility.club : undefined; @@ -67,7 +73,10 @@ window.saServeThePublic = (function saServeThePublic() { T.incomeStats.customers = slave.sexAmount; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * + */ function jobPreface(slave) { if (slave.devotion > 95 || slave.energy > 95) { r += `enthusiastically serves`; @@ -84,7 +93,10 @@ window.saServeThePublic = (function saServeThePublic() { } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * + */ function bonusMultiplierText(slave) { if (V.club > 0) { if ((V.universalRulesFacilityWork === 1 && slave.assignment === "serve the public" && V.clubSpots > 0) || (slave.assignment === "serve in the club")) { @@ -198,7 +210,10 @@ window.saServeThePublic = (function saServeThePublic() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * + */ function usageCountDescriptions(slave) { r += ` ${His} appearance attracted ${slave.sexAmount} members of the public (${Math.trunc(slave.sexAmount / 7)} a day)`; if (slave.sexAmount > 160) { @@ -238,7 +253,10 @@ window.saServeThePublic = (function saServeThePublic() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * + */ function comingOfAge(slave) { if (slave.physicalAge === V.minimumSlaveAge && slave.physicalAge === V.fertilityAge && canGetPregnant(slave) && (arcology.FSRepopulationFocus !== "unset" || arcology.FSGenderFundamentalist !== "unset") && arcology.FSRestart === "unset") { if (slave.birthWeek === 0) { @@ -261,7 +279,10 @@ window.saServeThePublic = (function saServeThePublic() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * + */ function mentalEffects(slave) { if (slave.behavioralQuirk === "advocate") { r += ` ${slave.slaveName} <span class="hotpink">really enjoys</span> being able to share ${his} convert's enthusiasm about slavery with new people.`; @@ -279,7 +300,10 @@ window.saServeThePublic = (function saServeThePublic() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * + */ function physicalEffects(slave) { let injury = 0; if (slave.assignment !== "serve in the club") { @@ -422,7 +446,10 @@ window.saServeThePublic = (function saServeThePublic() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * + */ function slaveSkills(slave) { let skillIncrease; if (!setup.entertainmentCareers.includes(slave.career) && slave.skill.entertainer < V.masteredXP) { @@ -510,27 +537,30 @@ window.saServeThePublic = (function saServeThePublic() { } r += `.`; skillIncrease = (5 + Math.floor((slave.intelligence + slave.intelligenceImplant) / 32) + V.oralUseWeight); - r += `${SkillIncrease.Oral(slave, skillIncrease)}`; + r += ` ${SkillIncrease.Oral(slave, skillIncrease)}`; if (canDoVaginal(slave)) { skillIncrease = (5 + Math.floor((slave.intelligence + slave.intelligenceImplant) / 32) + V.vaginalUseWeight); - r += `${SkillIncrease.Vaginal(slave, skillIncrease)}`; + r += ` ${SkillIncrease.Vaginal(slave, skillIncrease)}`; } if (canDoAnal(slave)) { skillIncrease = (5 + Math.floor((slave.intelligence + slave.intelligenceImplant) / 32) + V.analUseWeight); - r += `${SkillIncrease.Anal(slave, skillIncrease)}`; + r += ` ${SkillIncrease.Anal(slave, skillIncrease)}`; } } if (slave.amp !== 1) { if (slave.skill.entertainment < 100) { r += ` ${He} gains experience as a public slut.`; skillIncrease = (10 + Math.floor((slave.intelligence + slave.intelligenceImplant) / 32)); - r += `${SkillIncrease.Entertain(slave, skillIncrease)}`; + r += ` ${SkillIncrease.Entertain(slave, skillIncrease)}`; } } } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * + */ function publicReactions(slave) { let sstp; @@ -538,7 +568,7 @@ window.saServeThePublic = (function saServeThePublic() { r += ` ${He}'s a better slut because public service is ${his} main sexual outlet.`; } - //Someone double check this block + // Someone double check this block if (V.familyTesting === 1) { if (totalRelatives(slave) > 0) { let children = []; @@ -611,7 +641,7 @@ window.saServeThePublic = (function saServeThePublic() { r += ` ${He} attracts fewer people due to ${his} minor injury.`; } - if ((slave.hears === -1 && slave.earwear !== "hearing aids") || (slave.hears === 0 && slave.earwear === "muffling ear plugs") ||(slave.hears === -2)) { + if ((slave.hears === -1 && slave.earwear !== "hearing aids") || (slave.hears === 0 && slave.earwear === "muffling ear plugs") || (slave.hears === -2)) { r += ` ${His} trouble hearing causes ${him} to miss potential partners.`; } @@ -1171,7 +1201,10 @@ window.saServeThePublic = (function saServeThePublic() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * + */ function addFlaw(slave) { if (slave.devotion < 10) { if (jsRandom(1, 100) > 70) { @@ -1189,7 +1222,10 @@ window.saServeThePublic = (function saServeThePublic() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * + */ function addRep(slave) { if (slave.assignment !== "recruit girls") { if (slave.assignment === "serve in the club" || slave.assignment === "be the DJ") { @@ -1203,7 +1239,10 @@ window.saServeThePublic = (function saServeThePublic() { T.incomeStats.income += Math.trunc((slave.sexAmount * slave.sexQuality) * (1 + (0.003 * slave.skill.entertainment)) * 0.15); } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * + */ function applyFSDecoration(slave) { /* FACILITY DECORATION IMPACTS */ const fsBeauty = (0.0005 * V.FSSingleSlaveRep * slave.sexAmount); @@ -1283,7 +1322,10 @@ window.saServeThePublic = (function saServeThePublic() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * + */ function sexCounts(slave) { /* SEX ACT COUNTS AND SEXUAL SATISFACTION */ @@ -1303,7 +1345,7 @@ window.saServeThePublic = (function saServeThePublic() { } } mammaryUse = 0; - //perhaps boost this for truly massive breasts + // perhaps boost this for truly massive breasts if (slave.boobs > 10000) { mammaryUse = (5 + V.mammaryUseWeight); } else if (slave.boobs > 2000) { @@ -1362,7 +1404,10 @@ window.saServeThePublic = (function saServeThePublic() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * + */ function sexualSatiation(slave) { if (slave.need) { if (slave.fetishKnown) { @@ -1442,7 +1487,10 @@ window.saServeThePublic = (function saServeThePublic() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * + */ function assignmentVignette(slave) { let vignette; if (slave.assignment !== "recruit girls") { diff --git a/src/endWeek/saStayConfined.js b/src/endWeek/saStayConfined.js index 26404bd0f72d461ed0215064b927db8567e7d95e..a76ddbb0f2c5de970f1ead3e6a46600697fc1cbb 100644 --- a/src/endWeek/saStayConfined.js +++ b/src/endWeek/saStayConfined.js @@ -1,5 +1,10 @@ -window.saStayConfined = /** @param {App.Entity.SlaveState} slave */ function saStayConfined(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {string} + */ +window.saStayConfined = function saStayConfined(slave) { const V = State.variables; + /* eslint-disable */ const pronouns = getPronouns(slave); const he = pronouns.pronoun; const him = pronouns.object; @@ -9,33 +14,34 @@ window.saStayConfined = /** @param {App.Entity.SlaveState} slave */ function saS const boy = pronouns.noun; const He = capFirstChar(he); const His = capFirstChar(his); + /* eslint-enable */ let t = ""; if (slave.fetish !== "mindbroken") { if (slave.devotion < -50) { - t += `is kept in solitary confinement whenever ${he} is not being forced to do something else. ${He} still hates ${his} place in the world, but being forced to rely on slave life as ${his} only human contact <span class='hotpink'>grinds down ${his} resistance.</span>`; + t += `is kept in solitary confinement whenever ${he} is not being forced to do something else. ${He} still hates ${his} place in the world, but being forced to rely on slave life as ${his} only human contact <span class="hotpink">grinds down ${his} resistance.</span>`; slave.devotion += 2; } else if (slave.devotion <= 20) { - t += `is kept in solitary confinement whenever ${he} is not being forced to do something else. With nothing to do but look forward to the next time ${he}'s let out to serve, <span class='hotpink'>${he} begins to rely on servitude.</span>`; + t += `is kept in solitary confinement whenever ${he} is not being forced to do something else. With nothing to do but look forward to the next time ${he}'s let out to serve, <span class="hotpink">${he} begins to rely on servitude.</span>`; slave.devotion += 1; } else if (slave.devotion <= 50) { t += `accepts solitary confinement whenever ${he} is not being forced to do something else. Since ${he} is obedient, the mental torture neither breaks ${him} further nor causes ${him} to hate you.`; } else { - t += `accepts solitary confinement whenever ${he} is not being forced to do something else. ${He} spends ${his} time wondering hopelessly how ${he} has failed you, <span class='mediumorchid'>damaging ${his} devotion to you.</span>`; + t += `accepts solitary confinement whenever ${he} is not being forced to do something else. ${He} spends ${his} time wondering hopelessly how ${he} has failed you, <span class="mediumorchid">damaging ${his} devotion to you.</span>`; slave.devotion -= 2; } if (slave.trust < -50) { t += ` ${He} is so terrified of you that this confinement does not make ${him} fear you any more.`; } else if (slave.trust < -20) { - t += ` ${He} is already afraid of you, but this confinement makes ${him} <span class='gold'>fear you even more.</span>`; + t += ` ${He} is already afraid of you, but this confinement makes ${him} <span class="gold">fear you even more.</span>`; slave.trust -= 2; } else if (slave.trust <= 20) { - t += ` This confinement makes ${him} <span class='gold'>fear your power</span> over ${him}.`; + t += ` This confinement makes ${him} <span class="gold">fear your power</span> over ${him}.`; slave.trust -= 4; } else { - t += ` This confinement makes ${him} <span class='gold'>trust you less,</span> and fear you more.`; + t += ` This confinement makes ${him} <span class="gold">trust you less,</span> and fear you more.`; slave.trust -= 5; } @@ -45,7 +51,7 @@ window.saStayConfined = /** @param {App.Entity.SlaveState} slave */ function saS } } - t += ` The stress of confinement <span class='red'>damages ${his} health.</span>`; + t += ` The stress of confinement <span class="red">damages ${his} health.</span>`; slave.health -= 10; } else { t += `is oblivious to ${his} confinement.`; @@ -73,9 +79,9 @@ window.saStayConfined = /** @param {App.Entity.SlaveState} slave */ function saS if (slave.fetish === "mindbroken") { t += ` ${His} broken mind hinges entirely on other's guidance,`; } else { - t += ` ${He} is now willing to <span class='hotpink'>do as ${he}'s told,</span>`; + t += ` ${He} is now willing to <span class="hotpink">do as ${he}'s told,</span>`; } - t += ` so <span class='yellow'>${his} assignment has defaulted to rest.</span>`; + t += ` so <span class="yellow">${his} assignment has defaulted to rest.</span>`; if (slave.assignment === "be confined in the cellblock") { State.temporary.brokenSlaves++; State.temporary.DL--; diff --git a/src/endWeek/saWhore.js b/src/endWeek/saWhore.js index 91a818e2e3f9bc326669d62bcf3a37661345c3ec..57caf147ec2ec0fe0871fe0a7d4c8ecc172c4b92 100644 --- a/src/endWeek/saWhore.js +++ b/src/endWeek/saWhore.js @@ -25,7 +25,10 @@ window.saWhore = (function saWhore() { return saWhore; - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @returns {string} + */ function saWhore(slave) { V = State.variables; T = State.temporary; @@ -68,7 +71,9 @@ window.saWhore = (function saWhore() { return r; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * */ function gatherStatistics(slave) { /* Statistics gathering */ const facility = slave.assignment === Job.BROTHEL ? V.facility.brothel : undefined; @@ -76,11 +81,13 @@ window.saWhore = (function saWhore() { } // I suspect this one will mostly be cut out in the overhauling - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function updateNonSlaveVariables(slave) { // FResult setting FuckResult = FResult(slave); - //slave needs release + // slave needs release if ((slave.releaseRules === "restrictive" || slave.releaseRules === "chastity") && slave.standardReward !== "orgasm" && slave.energy >= 20) { FuckResult += 2; } @@ -227,8 +234,10 @@ window.saWhore = (function saWhore() { } T.incomeStats.customers = beauty; } - - /** @param {App.Entity.SlaveState} slave */ + + /** + * @param {App.Entity.SlaveState} slave + */ function jobPreface(slave) { if (slave.devotion > 95 || slave.energy > 95) { r += `enthusiastically sells`; @@ -244,7 +253,9 @@ window.saWhore = (function saWhore() { r += ` ${his} body.`; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function bonusMultiplierText(slave) { if (V.brothel > 0) { if ((V.universalRulesFacilityWork === 1 && slave.assignment === "whore" && V.brothelSpots > 0) || (slave.assignment === "work in the brothel")) { @@ -360,7 +371,9 @@ window.saWhore = (function saWhore() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function usageCountDescriptions(slave) { r += ` ${His} appearance attracted ${beauty} members of the public (${Math.trunc(beauty / 7)} a day)`; if (beauty > 160) { @@ -395,7 +408,9 @@ window.saWhore = (function saWhore() { r += `.`; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function comingOfAge(slave) { if (slave.physicalAge === V.minimumSlaveAge && slave.physicalAge === V.fertilityAge && canGetPregnant(slave) && (arcology.FSRepopulationFocus !== "unset" || arcology.FSGenderFundamentalist !== "unset") && arcology.FSRestart === "unset") { if (slave.birthWeek === 0) { @@ -418,7 +433,9 @@ window.saWhore = (function saWhore() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function mentalEffects(slave) { if (slave.behavioralQuirk === "sinful") { r += ` ${slave.slaveName} <span class="hotpink">secretly enjoys</span> how utterly sinful and depraved it is for ${him} to sell ${his} body.`; @@ -436,7 +453,9 @@ window.saWhore = (function saWhore() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function physicalEffects(slave) { let injury = 0; if (slave.assignment !== "work in the brothel") { @@ -579,7 +598,9 @@ window.saWhore = (function saWhore() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function slaveSkills(slave) { let skillIncrease; if (!setup.whoreCareers.includes(slave.career) && slave.skill.whore < V.masteredXP) { @@ -684,28 +705,29 @@ window.saWhore = (function saWhore() { } r += `.`; skillIncrease = (5 + Math.floor((slave.intelligence + slave.intelligenceImplant) / 32) + V.oralUseWeight); - r += `${SkillIncrease.Oral(slave, skillIncrease)}`; + r += ` ${SkillIncrease.Oral(slave, skillIncrease)}`; if (canDoVaginal(slave)) { skillIncrease = (5 + Math.floor((slave.intelligence + slave.intelligenceImplant) / 32) + V.vaginalUseWeight); - r += `${SkillIncrease.Vaginal(slave, skillIncrease)}`; + r += ` ${SkillIncrease.Vaginal(slave, skillIncrease)}`; } if (canDoAnal(slave)) { skillIncrease = (5 + Math.floor((slave.intelligence + slave.intelligenceImplant) / 32) + V.analUseWeight); - r += `${SkillIncrease.Anal(slave, skillIncrease)}`; + r += ` ${SkillIncrease.Anal(slave, skillIncrease)}`; } } } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function publicReactions(slave) { let SWi; if ((slave.releaseRules === "restrictive" || slave.releaseRules === "chastity") && slave.standardReward !== "orgasm") { r += ` ${He}'s a better whore because prostitution is ${his} main sexual outlet.`; } - - //Someone double check this block + if (V.familyTesting === 1) { if (totalRelatives(slave) > 0) { let children = []; @@ -1340,7 +1362,9 @@ window.saWhore = (function saWhore() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function addFlaw(slave) { if (slave.devotion < 10) { if (jsRandom(1, 100) > 70) { @@ -1358,7 +1382,9 @@ window.saWhore = (function saWhore() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function addCash(slave) { cash = Math.trunc((beauty * FuckResult) * (1 + (0.002 * slave.skill.whoring))); T.incomeStats.income += cash; @@ -1370,14 +1396,18 @@ window.saWhore = (function saWhore() { cashX(cash, "whoring in an unregistered building", slave); } } - - /** @param {App.Entity.SlaveState} slave */ + + /** + * @param {App.Entity.SlaveState} slave + */ function addCashText(slave) { r += ` In total, you were paid <span class="yellowgreen">${cashFormat(cash)}</span> for the use of ${slave.slaveName}'s body this week.`; } - /** @param {App.Entity.SlaveState} slave */ - function applyFSDecoration(slave) { + /** + * @param {App.Entity.SlaveState} slave + */ + function applyFSDecoration() { /* FACILITY DECORATION IMPACTS */ const fsBeauty = (0.0005 * V.FSSingleSlaveRep * beauty); switch (V.brothelDecoration) { @@ -1456,7 +1486,9 @@ window.saWhore = (function saWhore() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function sexCounts(slave) { /* SEX ACT COUNTS AND SEXUAL SATISFACTION */ @@ -1476,7 +1508,7 @@ window.saWhore = (function saWhore() { } } mammaryUse = 0; - //perhaps boost this for truly massive breasts + // perhaps boost this for truly massive breasts if (slave.boobs > 10000) { mammaryUse = (5 + V.mammaryUseWeight); } else if (slave.boobs > 2000) { @@ -1535,7 +1567,9 @@ window.saWhore = (function saWhore() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function sexualSatiation(slave) { if (slave.need) { if (slave.fetishKnown) { @@ -1615,7 +1649,9 @@ window.saWhore = (function saWhore() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function assignmentVignette(slave) { const vignette = GetVignette(slave); // I forgot what to do with __X__ diff --git a/src/endWeek/saWorkAGloryHole.js b/src/endWeek/saWorkAGloryHole.js index 2a478efce3caf56801400473b2119a53624295d4..f0e681998571cf3f877cacfa3e28333c38bb94e9 100644 --- a/src/endWeek/saWorkAGloryHole.js +++ b/src/endWeek/saWorkAGloryHole.js @@ -5,12 +5,24 @@ window.saWorkAGloryHole = (function saWorkAGloryHole() { let r; let beauty; let FResult; + /* eslint-disable */ let pronouns; - let he, him, his, hers, himself, boy, He, His; + let he; + let him; + let his; + let hers; + let himself; + let boy; + let He; + let His; + /* eslint-enable */ return saWorkAGloryHole; - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @returns {string} + */ function saWorkAGloryHole(slave) { V = State.variables; T = State.temporary; @@ -33,7 +45,10 @@ window.saWorkAGloryHole = (function saWorkAGloryHole() { return r; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * + */ function gatherStatistics(slave) { /* Statistics gathering */ const facility = slave.assignment === Job.ARCADE ? V.facility.arcade : undefined; @@ -41,7 +56,10 @@ window.saWorkAGloryHole = (function saWorkAGloryHole() { T.incomeStats.customers = beauty; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * + */ function jobPreface(slave) { r += ` is `; if (slave.fuckdoll === 0) { @@ -75,9 +93,12 @@ window.saWorkAGloryHole = (function saWorkAGloryHole() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * + */ function physicalEffects(slave) { - //check usage counts for these — more fucks should be more damaging + // check usage counts for these — more fucks should be more damaging if (slave.curatives > 0 || slave.inflationType === "curative") { r += ` The drugs ${he}'s `; if (slave.inflationType === "curative") { @@ -148,20 +169,23 @@ window.saWorkAGloryHole = (function saWorkAGloryHole() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * + */ function mentalEffects(slave) { if (slave.fetish === "mindbroken") { r += ` ${He} serves ${his} role as a mindless set of holes to perfection.`; } else { if (slave.skill.oral <= 10) { r += ` With ${his} throat being brutally used, ${his} gag reflex is suppressed and ${his} oral skills improve.`; - r += `${SkillIncrease.Oral(slave, 5)}`; + r += ` ${SkillIncrease.Oral(slave, 5)}`; } else if (slave.skill.vaginal <= 10 && canDoVaginal(slave)) { r += ` With ${his} pussy being harshly used, ${his} vaginal skills improve.`; - r += `${SkillIncrease.Vaginal(slave, 5)}`; + r += ` ${SkillIncrease.Vaginal(slave, 5)}`; } else if (slave.skill.anal <= 10 && canDoAnal(slave)) { r += ` With ${his} butt being mercilessly fucked, ${his} anal skills improve.`; - r += `${SkillIncrease.Anal(slave, 5)}`; + r += ` ${SkillIncrease.Anal(slave, 5)}`; } if (slave.sexualFlaw === "self hating") { r += ` ${His} self hatred is so deep that ${he} believes ${he} deserves to serve in a glory hole, and even gets off on the degradation.`; @@ -205,7 +229,10 @@ window.saWorkAGloryHole = (function saWorkAGloryHole() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * + */ function jobBody(slave) { r += ` ${His} feelings, skills, and appearance do not matter. ${He} is condemned to a world that consists of a tiny cell, featureless except for the never-ending dicks ${he} is required to service. You `; if (V.publicFuckdolls === 0) { @@ -216,7 +243,10 @@ window.saWorkAGloryHole = (function saWorkAGloryHole() { r += ` for the use of ${slave.slaveName}'s holes this week.`; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * + */ function applyFSDecoration(slave) { /* FACILITY DECORATION IMPACTS */ if (slave.assignment === "be confined in the arcade" && V.arcadeDecoration !== "standard") { @@ -298,7 +328,10 @@ window.saWorkAGloryHole = (function saWorkAGloryHole() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * + */ function sexCounts(slave) { /* SEX ACT COUNTS AND SEXUAL SATISFACTION */ @@ -342,7 +375,7 @@ window.saWorkAGloryHole = (function saWorkAGloryHole() { cervixPump += (20 * analUse); } - //this may need improvement with the new system + // this may need improvement with the new system if (slave.need) { if (slave.fetishKnown) { switch (slave.fetish) { @@ -403,7 +436,10 @@ window.saWorkAGloryHole = (function saWorkAGloryHole() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * + */ function profitReport(slave) { if (V.publicFuckdolls === 0) { if (slave.assignment === "work a glory hole") { diff --git a/src/endWeek/saWorkTheFarm.js b/src/endWeek/saWorkTheFarm.js index 8a1c5bb3c3a2a75b6f0a159d3da766b3ff0e525e..75b64a10d38478124b500ff956e14d2a06ef4423 100644 --- a/src/endWeek/saWorkTheFarm.js +++ b/src/endWeek/saWorkTheFarm.js @@ -1,10 +1,22 @@ -window.saWorkTheFarm = /** @param {App.Entity.SlaveState} slave */ function saWorkTheFarm(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {string} + */ +window.saWorkTheFarm = function saWorkTheFarm(slave) { "use strict"; const V = State.variables; const arcology = V.arcologies[0]; + /* eslint-disable */ const pronouns = getPronouns(slave); - const he = pronouns.pronoun; const him = pronouns.object; const his = pronouns.possessive; const hers = pronouns.possessivePronoun; const himself = pronouns.objectReflexive; const boy = pronouns.noun; - const He = capFirstChar(he); const His = capFirstChar(his); + const he = pronouns.pronoun; + const him = pronouns.object; + const his = pronouns.possessive; + const hers = pronouns.possessivePronoun; + const himself = pronouns.objectReflexive; + const boy = pronouns.noun; + const He = capFirstChar(he); + const His = capFirstChar(his); + /* eslint-enable */ const incomeStats = getSlaveStatisticData(slave, V.facility.farmyard); let t = `works as a farmhand this week. `; @@ -16,7 +28,7 @@ window.saWorkTheFarm = /** @param {App.Entity.SlaveState} slave */ function saWo } else { t += `care`; } - if (V.Farmer.skill.oral) { // TODO: keep this? replace with something else? + if (V.Farmer.skill.oral) { // TODO: keep this? replace with something else? t += ` and talented tongue`; } t += `. `; @@ -83,7 +95,7 @@ window.saWorkTheFarm = /** @param {App.Entity.SlaveState} slave */ function saWo if (slave.tired === 1) { t += `${He} is so tired that ${he} doesn't have the energy to work efficiently, impacting ${his} production. `; } - t += `As a result, ${he} produces @@.chocolate;${ massFormat(food) }@@ of food over the week. `; + t += `As a result, ${he} produces <span class="chocolate">${massFormat(food)}</span> of food over the week. `; // Close Food Production @@ -94,26 +106,26 @@ window.saWorkTheFarm = /** @param {App.Entity.SlaveState} slave */ function saWo if (V.farmyardShows) { t += `${He} also puts on shows with animals this week. `; - //Open FS Subsection + // Open FS Subsection if (arcology.FSSupremacist !== "unset") { if (slave.race === arcology.FFSupremacistRace) { - t += `Society @@.red;disapproves@@ of your allowing a member of the elite race to be degraded in such a fashion, and thus ${he} didn't earn as much. `; + t += `Society <span class="red">disapproves</span> of your allowing a member of the elite race to be degraded in such a fashion, and thus ${he} didn't earn as much. `; } } if (arcology.FSSubjugationist !== "unset") { if (slave.race === arcology.FSSubjugationistRace) { - t += `Society @@.green;approves@@ of the degradation you submit your ${ arcology.FSSubjugationistRace } slaves to, and so ${he} earns you a bit more. `; + t += `Society <span class="green">approves</span> of the degradation you submit your ${arcology.FSSubjugationistRace} slaves to, and so ${he} earns you a bit more. `; } else { - t += `Society doesn't disapprove of ${him} not being ${ arcology.FSSubjugationistRace }, but ${he} doesn't earn as much as ${he} would if ${he} was ${ arcology.FSSubjugationistRace }. `; + t += `Society doesn't disapprove of ${him} not being ${arcology.FSSubjugationistRace}, but ${he} doesn't earn as much as ${he} would if ${he} was ${arcology.FSSubjugationistRace}. `; } } if (arcology.FSRepopulationFocus !== "unset") { if (slave.pregWeek > 16) { if (slave.eggType !== "human") { - t += `Society is @@.red;disgusted@@ by ${his} pregnancy when they realize that what it is in ${his} womb is not human. `; + t += `Society is <span class="red">disgusted</span> by ${his} pregnancy when they realize that what it is in ${his} womb is not human. `; } else { - t += `Society @@.green;greatly approves@@ of your having pregnant slaves `; + t += `Society <span class="green">greatly approves</span> of your having pregnant slaves `; if (V.seeBestiality === 1) { t += `have sex`; } else { @@ -128,7 +140,7 @@ window.saWorkTheFarm = /** @param {App.Entity.SlaveState} slave */ function saWo if (slave.eggType !== "human") { t += `Society is disgusted by ${his} pregnancy until they learn that what is in ${his} womb is not human. `; } else { - t += `Society is @@.red;extremely disgusted@@ by ${his} pregnancy and the fact that you would have ${him} `; + t += `Society is <span class="red">extremely disgusted</span> by ${his} pregnancy and the fact that you would have ${him} `; if (V.seeBestiality === 1) { t += `have sex`; } else if (V.farmyardShows) { @@ -140,14 +152,14 @@ window.saWorkTheFarm = /** @param {App.Entity.SlaveState} slave */ function saWo } if (arcology.FSGenderRadicalist !== "unset") { if (slave.dick > 0) { - t += `${His} patrons @@.green;approve@@ of the fact that ${he} has a dick. `; + t += `${His} patrons <span class="green">approve</span> of the fact that ${he} has a dick. `; } else { // TODO: not sure what to do for this } } if (arcology.FSGenderFundamentalist !== "unset") { if (slave.pregWeek > 16) { - t += `${His} patrons @@.green;approve@@ of the fact that ${he} is sporting a baby bump.`; + t += `${His} patrons <span class="green">approve</span> of the fact that ${he} is sporting a baby bump.`; } else { // TODO: also this } @@ -157,16 +169,16 @@ window.saWorkTheFarm = /** @param {App.Entity.SlaveState} slave */ function saWo } if (arcology.FSPaternalist !== "unset") { if (V.seeBestiality === 1 && V.farmyardBreeding) { - t += `Your citizens are @@.red;very disapproving@@ of the fact that you would allow something as degrading as having your slaves to be knocked up by filthy beasts. `; + t += `Your citizens are <span class="red">very disapproving</span> of the fact that you would allow something as degrading as having your slaves to be knocked up by filthy beasts. `; } else { - t += `Your citizens @@.red;disapprove@@ of the fact that you would allow your slaves to be degraded in such a manner. `; + t += `Your citizens <span class="red">disapprove</span> of the fact that you would allow your slaves to be degraded in such a manner. `; } } if (arcology.FSDegradationist !== "unset") { if (V.seeBestiality === 1 && V.farmyardBreeding) { - t += `Your citizens are @@.green;very approving@@ of the fact that you would allow something as degrading as having your slaves to be knocked up by filthy beasts. `; + t += `Your citizens are <span class="green">very approving</span> of the fact that you would allow something as degrading as having your slaves to be knocked up by filthy beasts. `; } else { - t += `Your citizens @@.green;approve@@ of the fact that you would allow your slaves to be degraded in such a manner. `; + t += `Your citizens <span class="green">approve</span> of the fact that you would allow your slaves to be degraded in such a manner. `; } } if (arcology.FSBodyPurist !== "unset") { @@ -200,22 +212,22 @@ window.saWorkTheFarm = /** @param {App.Entity.SlaveState} slave */ function saWo } } if (arcology.FSYouthPreferentialist !== "unset") { - if (slave.visualAge > 25) { // TODO: not sure about this age - t += `${arcology.name }'s citizens @@.red;disapprove@@ of your using such old slaves to put on shows. `; + if (slave.visualAge > 25) { // TODO: not sure about this age + t += `${arcology.name}'s citizens <span class="red">disapprove</span> of your using such old slaves to put on shows. `; } else { - t += `${arcology.name }'s citizens @@.green;approve@@ of your using young slaves to put on shows. `; + t += `${arcology.name}'s citizens <span class="green">approve</span> of your using young slaves to put on shows. `; } } if (arcology.FSMaturityPreferentialist !== "unset") { - if (slave.visualAge > 25) { // TODO: not sure about this age - t += `${arcology.name }'s citizens @@.green;approve@@ of your using mature slaves to put on shows. `; + if (slave.visualAge > 25) { // TODO: not sure about this age + t += `${arcology.name}'s citizens <span class="green">approve</span> of your using mature slaves to put on shows. `; } else { - t += `${arcology.name }'s citizens @@.red;disapprove@@ of your using such young slaves to put on shows. `; + t += `${arcology.name}'s citizens <span class="red">disapprove</span> of your using such young slaves to put on shows. `; } } if (arcology.FSSlimnessEnthusiast !== "unset") { if (slave.weight > 10) { - t += `Society finds a slave with such a flabby body @@.red;absolutely disgusting.@@ `; + t += `Society finds a slave with such a flabby body <span class="red">absolutely disgusting.</span> `; } if (slave.boobs > 799) { t += `Your citizens `; @@ -274,7 +286,7 @@ window.saWorkTheFarm = /** @param {App.Entity.SlaveState} slave */ function saWo if (setup.entertainmentCareers.includes(slave.career)) { t += ` ${He} has experience with putting on shows from ${his} life before ${he} was a slave, making ${him} more effective at putting on shows.`; } - if (setup.farmerCareers.includes(slave.career)) { // TODO: does this even make sense to include? + if (setup.farmerCareers.includes(slave.career)) { // TODO: does this even make sense to include? // TODO: write this } if (slave.prestige === 1) { @@ -284,7 +296,7 @@ window.saWorkTheFarm = /** @param {App.Entity.SlaveState} slave */ function saWo } else if (slave.prestige === 3) { t += `Because ${he} is so famous, ${he} earns a lot more then ${he} would otherwise.`; } - if (slave.pornPrestige === 1) { // TODO: are prestige and pornPrestige mutually exclusive? + if (slave.pornPrestige === 1) { // TODO: are prestige and pornPrestige mutually exclusive? t += `${He} earns a bit more because some of your citizens already know $him from porn. `; } else if (slave.pornPrestige === 2) { t += `${He} earns quite a bit more because a lot of your citizens already know $him from porn. `; @@ -376,7 +388,7 @@ window.saWorkTheFarm = /** @param {App.Entity.SlaveState} slave */ function saWo } else if (slave.intelligence < -50) { // TODO: write this } - if (slave.energy <= 20 ) { + if (slave.energy <= 20) { // TODO: write this } else if (slave.energy <= 40) { // TODO: write this @@ -395,7 +407,7 @@ window.saWorkTheFarm = /** @param {App.Entity.SlaveState} slave */ function saWo // TODO: write this } else if (slave.fetish === "masochist") { // TODO: write this - } // TODO: incoroporate quirks + } // TODO: incoroporate quirks } // Close Shows @@ -405,9 +417,9 @@ window.saWorkTheFarm = /** @param {App.Entity.SlaveState} slave */ function saWo if (slave.fetishKnown && (slave.fetish === "submissive" || slave.fetish === "humiliation" || slave.fetish === "masochist") || slave.energy > 95) { if (V.farmyardShows) { if (V.seeBestiality === 1) { - t += `Getting fucked by animals is the perfect job for ${him}, as far as ${he} can tell. @@.hotpink;${He} is happy@@ to spend ${his} days being utterly degraded. `; + t += `Getting fucked by animals is the perfect job for ${him}, as far as ${he} can tell. <span class="hotpink">${He} is happy</span> to spend ${his} days being utterly degraded. `; } else { - t += `${He} loves putting on shows with animals, and as far as ${he} can tell, it's the perfect job for ${him}. @@.hotpink;${He} is happy@@ to spend ${his} days doing something so degrading. `; // TODO: not sure how degrading putting on shows is + t += `${He} loves putting on shows with animals, and as far as ${he} can tell, it's the perfect job for ${him}. <span class="hotpink">${He} is happy</span> to spend ${his} days doing something so degrading. `; // TODO: not sure how degrading putting on shows is } } slave.devotion += 1; @@ -416,7 +428,7 @@ window.saWorkTheFarm = /** @param {App.Entity.SlaveState} slave */ function saWo } } if (slave.behavioralQuirk === "fitness") { - t += `${slave.slaveName } @@.hotpink;privately enjoys@@ the exercise ${he} receives while working in ${farmyardName}. `; + t += `${slave.slaveName} <span class="hotpink">privately enjoys</span> the exercise ${he} receives while working in ${farmyardName}. `; slave.devotion += 1; } @@ -426,84 +438,84 @@ window.saWorkTheFarm = /** @param {App.Entity.SlaveState} slave */ function saWo if (V.showVignettes) { const vignette = GetVignette(slave); - t += `__This week__ ${ vignette.text}`; + t += `__This week__ ${vignette.text}`; if (vignette.type === "cash") { FResult(slave); if (vignette.effect > 0) { - t += ` @@.yellowgreen;making you an extra ${ cashFormat(Math.trunc(V.FResult*vignette.effect)) }.@@ `; + t += ` <span class="yellowgreen">making you an extra ${cashFormat(Math.trunc(V.FResult*vignette.effect))}.</span> `; } else if (vignette.effect < 0) { - t += ` @@.red;losing you ${ cashFormat(Math.abs(Math.trunc(V.FResult*vignette.effect))) }.@@ `; + t += ` <span class="red">losing you ${cashFormat(Math.abs(Math.trunc(V.FResult*vignette.effect)))}.</span> `; } else { t += ` an incident without lasting effect. `; } - cashX(Math.trunc(V.FResult*vignette.effect), "farmyard"); - incomeStats.income += (Math.trunc(V.FResult*vignette.effect)); + cashX(Math.trunc(V.FResult * vignette.effect), "farmyard"); + incomeStats.income += (Math.trunc(V.FResult * vignette.effect)); } else if (vignette.type === "devotion") { if (vignette.effect > 0) { if (slave.devotion > 50) { - t += ` @@.hotpink;increasing ${his} devotion to you.@@ `; + t += ` <span class="hotpink">increasing ${his} devotion to you.</span> `; } else if (slave.devotion >= -20) { - t += ` @@.hotpink;increasing ${his} acceptance of you.@@ `; + t += ` <span class="hotpink">increasing ${his} acceptance of you.</span> `; } else if (slave.devotion >= -20) { - t += ` @@.hotpink;reducing ${his} dislike of you.@@ `; + t += ` <span class="hotpink">reducing ${his} dislike of you.</span> `; } else { - t += ` @@.hotpink;reducing ${his} hatred of you.@@ `; + t += ` <span class="hotpink">reducing ${his} hatred of you.</span> `; } } else if (vignette.effect < 0) { if (slave.devotion > 50) { - t += ` @@.mediumorchid;reducing ${his} devotion to you.@@ `; + t += ` <span class="mediumorchid">reducing ${his} devotion to you.</span> `; } else if (slave.devotion >= 20) { - t += ` @@.mediumorchid;reducing ${his} acceptance of you.@@ `; + t += ` <span class="mediumorchid">reducing ${his} acceptance of you.</span> `; } else if (slave.devotion >= -20) { - t += ` @@.mediumorchid;increasing ${his} dislike of you.@@ `; + t += ` <span class="mediumorchid">increasing ${his} dislike of you.</span> `; } else { - t += ` @@.mediumorchid;increasing ${his} hatred of you.@@ `; + t += ` <span class="mediumorchid">increasing ${his} hatred of you.</span> `; } } else { t += ` an incident without lasting effect. `; } - slave.devotion += 1*vignette.effect; + slave.devotion += 1 * vignette.effect; } else if (vignette.type === "trust") { if (vignette.effect > 0) { if (slave.trust > 20) { - t += ` @@.mediumaquamarine;increasing ${his} trust in you.@@ `; + t += ` <span class="mediumaquamarine">increasing ${his} trust in you.</span> `; } else if (slave.trust >= -20) { - t += ` @@.mediumaquamarine;reducing ${his} fear of you.@@ `; + t += ` <span class="mediumaquamarine">reducing ${his} fear of you.</span> `; } else { - t += ` @@.mediumaquamarine;reducing ${his} terror of you.@@ `; + t += ` <span class="mediumaquamarine">reducing ${his} terror of you.</span> `; } } else if (vignette.effect < 0) { if (slave.trust > 20) { - t += ` @@.gold;reducing ${his} trust in you.@@ `; + t += ` <span class="gold">reducing ${his} trust in you.</span> `; } else if (slave.trust >= -20) { - t += ` @@.gold;increasing ${his} fear of you.@@ `; + t += ` <span class="gold">increasing ${his} fear of you.</span> `; } else { - t += ` @@.gold;increasing ${his} terror of you.@@ `; + t += ` <span class="gold">increasing ${his} terror of you.</span> `; } } else { t += ` an incident without lasting effect. `; } - slave.trust += 1*vignette.effect; + slave.trust += 1 * vignette.effect; } else if (vignette.type === "health") { if (vignette.effect > 0) { - t += ` @@.green;improving ${his} health.@@ `; + t += ` <span class="green">improving ${his} health.</span> `; } else if (vignette.effect < 0) { - t += ` @@.red;affecting ${his} health.@@ `; + t += ` <span class="red">affecting ${his} health.</span> `; } else { t += ` an incident without lasting effect. `; } - slave.health += 2*vignette.effect; + slave.health += 2 * vignette.effect; } else { FResult(slave); if (vignette.effect > 0) { - t += ` @@.green;gaining you a bit of reputation.@@ `; + t += ` <span class="green">gaining you a bit of reputation.</span> `; } else if (vignette.effect < 0) { - t += ` @@.red;losing you a bit of reputation.@@ `; + t += ` <span class="red">losing you a bit of reputation.</span> `; } else { t += ` an incident without lasting effect. `; } - repX(Math.trunc(V.FResult*vignette.effect*0.1), "vignette", slave); - incomeStats.rep += Math.trunc(V.FResult*vignette.effect*0.1); + repX(Math.trunc(V.FResult * vignette.effect * 0.1), "vignette", slave); + incomeStats.rep += Math.trunc(V.FResult * vignette.effect * 0.1); } } @@ -512,7 +524,7 @@ window.saWorkTheFarm = /** @param {App.Entity.SlaveState} slave */ function saWo // Open Facility Decorations if (V.farmyardDecoration !== "standard") { - const fsGain = Math.min(0.0001*V.FSSingleSlaveRep*(food), 1); + const fsGain = Math.min(0.0001 * V.FSSingleSlaveRep * (food), 1); switch (V.farmyardDecoration) { case "Roman Revivalist": arcology.FSRomanRevivalist = Math.clamp(arcology.FSRomanRevivalist += fsGain, 0, 100); diff --git a/src/facilities/nursery/childSummary.tw b/src/facilities/nursery/childSummary.tw index df36e3788188cb1d9f73b786eb9763f4a958e20d..35f8efbff88e59a4646bb1cb06c6631e30e7a496 100644 --- a/src/facilities/nursery/childSummary.tw +++ b/src/facilities/nursery/childSummary.tw @@ -81,7 +81,7 @@ <</for>> </div> <script> - $("[data-quick-index]").click(function () { + $("[data-quick-index]").click(function() { var $this = $(this), which = $this.attr('data-quick-index'); var $quick = $('div#list_index' + which); $quick.toggleClass("hidden"); diff --git a/src/init/storyInit.tw b/src/init/storyInit.tw index 8a786260645e53536d191a0d6faa11f79a1a2b3f..36edcad3daae9d432b650de84c640b4d914e18ab 100644 --- a/src/init/storyInit.tw +++ b/src/init/storyInit.tw @@ -341,9 +341,7 @@ You should have received a copy of the GNU General Public License along with thi <<set $useAccordion = 0>> <<set $useTabs = 0>> - <<set $tabChoice = { - Main: "all" - }>> + <<set $tabChoice = {Main: "all"}>> <<set $formatNumbers = 0>> /* onlyintendeddickgirls variables */ @@ -1467,7 +1465,7 @@ You should have received a copy of the GNU General Public License along with thi menials: 0, }>> <<set $prosthetics = {}>> -<<run setup.prostheticIDs.forEach(function (id) { +<<run setup.prostheticIDs.forEach(function(id) { $prosthetics[id] = {amount: 0, research: 0}; })>> diff --git a/src/interaction/main/mainLinks.js b/src/interaction/main/mainLinks.js index ea1ba21aa32cc7a1d7238e4ae03d936e2e5a9e95..65430da9617ea8a2668f7a93c16e25a03357d9fc 100644 --- a/src/interaction/main/mainLinks.js +++ b/src/interaction/main/mainLinks.js @@ -1,23 +1,23 @@ -/** breaks in the last case in switches are not required, but are highly recommended */ - /* OPEN MAIN */ -App.UI.View.MainLinks = function () { +App.UI.View.MainLinks = function() { "use strict"; const V = State.variables; - const PA = Array.isArray(V.personalAttention) ? V.personalAttention.map(function (x) { + const PA = Array.isArray(V.personalAttention) ? V.personalAttention.map(function(x) { return getSlave(x.ID); }) : []; let r = ``; if (V.HeadGirl) { - var pronouns = getPronouns(V.HeadGirl), - he = pronouns.pronoun, - him = pronouns.object, - his = pronouns.possessive, - hers = pronouns.possessivePronoun, - himself = pronouns.objectReflexive, - boy = pronouns.noun, - He = capFirstChar(he), - His = capFirstChar(his); + /* eslint-disable */ + const pronouns = getPronouns(V.HeadGirl); + const he = pronouns.pronoun; + const him = pronouns.object; + const his = pronouns.possessive; + const hers = pronouns.possessivePronoun; + const himself = pronouns.objectReflexive; + const boy = pronouns.noun; + const He = capFirstChar(he); + const His = capFirstChar(his); + /* eslint-enable */ } if (V.PCWounded === 1) { @@ -74,7 +74,7 @@ App.UI.View.MainLinks = function () { if (dwi > 0 && dwi === l - 1) { r += ` and `; } - r += `<strong><u><span class=pink>${SlaveFullName(PA[dwi])}</span></u></strong> to ${V.personalAttention[dwi].trainingRegimen}`; + r += `<strong><u><span class="pink">${SlaveFullName(PA[dwi])}</span></u></strong> to ${V.personalAttention[dwi].trainingRegimen}`; if (dwi > 0 && dwi < l - 2) { r += `,`; } @@ -86,39 +86,39 @@ App.UI.View.MainLinks = function () { } if (V.PCWounded !== 1) { - r += ` <span id="managePA"><strong><<link "Change plans">><<goto "Personal Attention Select">><</link>></strong></span> <span class=cyan>[A]</span>`; + r += ` <span id="managePA"><strong><<link "Change plans">><<goto "Personal Attention Select">><</link>></strong></span> <span class="cyan">[A]</span>`; } if (V.useSlaveSummaryOverviewTab !== 1) { if (typeof V.slaveIndices[V.HeadGirl.ID] !== 'undefined') { - r += `<br><strong><u><span class=pink>${SlaveFullName(V.HeadGirl)}</span></u></strong> is serving as your Head Girl`; + r += `<br><strong><u><span class="pink">${SlaveFullName(V.HeadGirl)}</span></u></strong> is serving as your Head Girl`; if (V.arcologies[0].FSEgyptianRevivalistLaw === 1) { r += ` and Consort`; } - r += `. <span id="manageHG"><strong><<link "Manage Head Girl">><<goto "HG Select">><</link>></strong></span> <span class=cyan>[H]</span>`; + r += `. <span id="manageHG"><strong><<link "Manage Head Girl">><<goto "HG Select">><</link>></strong></span> <span class="cyan">[H]</span>`; } else if (typeof V.slaveIndices[V.HeadGirl.ID] === 'undefined' && (V.slaves.length > 1)) { r += `<br>You have not selected a Head Girl`; if (V.arcologies[0].FSEgyptianRevivalistLaw === 1) { r += ` and Consort`; } - r += `. <span id="manageHG"><strong><<link "Select one">><<goto "HG Select">><</link>></strong></span> <span class=cyan>[H]</span>`; + r += `. <span id="manageHG"><strong><<link "Select one">><<goto "HG Select">><</link>></strong></span> <span class="cyan">[H]</span>`; } else if (typeof V.slaveIndices[V.HeadGirl.ID] === 'undefined') { r += `//You do not have enough slaves to keep a Head Girl//`; } r += `<br>`; if (typeof V.slaveIndices[V.Recruiter.ID] !== 'undefined') { - r += `<strong><u><span class=pink>${SlaveFullName(V.Recruiter)}</span></u></strong> is working to recruit girls. <span id="manageRecruiter"><strong><<link "Manage Recruiter">><<goto "Recruiter Select">><</link>></strong></span> <span class=cyan>[U]</span>`; + r += `<strong><u><span class="pink">${SlaveFullName(V.Recruiter)}</span></u></strong> is working to recruit girls. <span id="manageRecruiter"><strong><<link "Manage Recruiter">><<goto "Recruiter Select">><</link>></strong></span> <span class="cyan">[U]</span>`; } else { - r += `You have not selected a Recruiter. <span id="manageRecruiter"><strong><<link "Select one">><<goto "Recruiter Select">><</link>></strong></span> <span class=cyan>[U]</span>`; + r += `You have not selected a Recruiter. <span id="manageRecruiter"><strong><<link "Select one">><<goto "Recruiter Select">><</link>></strong></span> <span class="cyan">[U]</span>`; } if (V.dojo) { r += `<br>`; if (typeof V.slaveIndices[V.Bodyguard.ID] !== 'undefined') { - r += `<strong><u><span class=pink>${SlaveFullName(V.Bodyguard)}</span></u></strong> is serving as your bodyguard. <span id="manageBG"><strong><<link "Manage Bodyguard">><<goto "BG Select">><</link>></strong></span> <span class=cyan>[B]</span>`; + r += `<strong><u><span class="pink">${SlaveFullName(V.Bodyguard)}</span></u></strong> is serving as your bodyguard. <span id="manageBG"><strong><<link "Manage Bodyguard">><<goto "BG Select">><</link>></strong></span> <span class="cyan">[B]</span>`; } else { - r += `You have not selected a Bodyguard. <span id="manageBG"><strong><<link "Select one">><<goto "BG Select">><</link>></strong></span> <span class=cyan>[B]</span>`; + r += `You have not selected a Bodyguard. <span id="manageBG"><strong><<link "Select one">><<goto "BG Select">><</link>></strong></span> <span class="cyan">[B]</span>`; } } } @@ -137,13 +137,13 @@ App.UI.View.MainLinks = function () { }); /* if the interrogated slave has one or more organs ready: */ if (slaveOrgans > 0) { - r += '<br><span class=yellow>The fabricator has completed '; + r += '<br><span class="yellow">The fabricator has completed '; if (slaveOrgans > 1) { r += `${slaveOrgans} organs`; } else { r += 'an organ'; } - r += ` for </span><<link "<<print $slaves[${i}].slaveName>>">><<set $activeSlave = $slaves[${i}]>><<goto "Slave Interact">><</link>>, <span class=yellow> which `; + r += ` for </span><<link "<<print $slaves[${i}].slaveName>>">><<set $activeSlave = $slaves[${i}]>><<goto "Slave Interact">><</link>>, <span class="yellow"> which `; if (slaveOrgans > 1) { r += 'are'; } else { @@ -159,7 +159,7 @@ App.UI.View.MainLinks = function () { if (getSlave(V.adjustProsthetics[j].slaveID) !== undefined) { let i = V.slaveIndices[V.adjustProsthetics[j].slaveID]; if (V.adjustProsthetics[j].workLeft <= 0) { - r += `<br><span class=yellow>The lab has completed <<= addA(setup.prosthetics[$adjustProsthetics[${j}].id].name)>> for</span> <span id="name"><<= "[[SlaveFullName($slaves[${i}])|Slave Interact][$activeSlave = $slaves[${i}]]]">>,</span> <span class=yellow> which is ready to be attached.</span>`; + r += `<br><span class="yellow">The lab has completed <<= addA(setup.prosthetics[$adjustProsthetics[${j}].id].name)>> for</span> <span id="name"><<= "[[SlaveFullName($slaves[${i}])|Slave Interact][$activeSlave = $slaves[${i}]]]">>,</span> <span class="yellow"> which is ready to be attached.</span>`; } } else { V.adjustProsthetics.splice(j, 1); @@ -169,51 +169,51 @@ App.UI.View.MainLinks = function () { } if (V.completedOrgans.length > 0 && V.adjustProstheticsCompleted > 0) { - r += `<br>[[Implant and Attach|Multiple Organ Implant]] <span class=yellow>all organs and prosthetics that are ready.</span>`; + r += `<br>[[Implant and Attach|Multiple Organ Implant]] <span class="yellow">all organs and prosthetics that are ready.</span>`; } else if (V.completedOrgans.length > 0) { - r += `<br>[[Implant|Multiple Organ Implant]] <span class=yellow>all organs that are ready for implantation.</span>`; + r += `<br>[[Implant|Multiple Organ Implant]] <span class="yellow">all organs that are ready for implantation.</span>`; } else if (V.adjustProstheticsCompleted > 0) { - r += `<br>[[Attach|Multiple Organ Implant]] <span class=yellow>all prosthetics that are ready to be attached.</span>`; + r += `<br>[[Attach|Multiple Organ Implant]] <span class="yellow">all prosthetics that are ready to be attached.</span>`; } if (V.slaveCostFactor > 1.05) { - r += `<br><span class=yellow>There is a bull market for slaves; the price of slaves is very high.</span>`; + r += `<br><span class="yellow">There is a bull market for slaves; the price of slaves is very high.</span>`; } else if (V.slaveCostFactor > 1) { - r += `<br><span class=yellow>The slave market is bullish; the price of slaves is high.</span>`; + r += `<br><span class="yellow">The slave market is bullish; the price of slaves is high.</span>`; } else if (V.slaveCostFactor < 0.95) { - r += `<br><span class=yellow>There is a bear market for slaves; the price of slaves is very low.</span>`; + r += `<br><span class="yellow">There is a bear market for slaves; the price of slaves is very low.</span>`; } else if (V.slaveCostFactor < 1) { - r += `<br><span class=yellow>The slave market is bearish; the price of slaves is low.</span>`; + r += `<br><span class="yellow">The slave market is bearish; the price of slaves is low.</span>`; } else { r += `<br>The slave market is stable; the price of slaves is average.`; } - r += ` <span id="buySlaves"><strong><<link "Buy Slaves">><<goto "Buy Slaves">><</link>></strong></span> <span class=cyan>[S]</span>`; + r += ` <span id="buySlaves"><strong><<link "Buy Slaves">><<goto "Buy Slaves">><</link>></strong></span> <span class="cyan">[S]</span>`; if (V.TSS.schoolSale !== 0) { - r += `<br><span class=yellow>For your first purchase, </span><strong>[[The Slavegirl School][$slavesSeen += 1]]</strong><span class=yellow> will sell at half price this week.</span>`; + r += `<br><span class="yellow">For your first purchase, </span><strong>[[The Slavegirl School][$slavesSeen += 1]]</strong><span class="yellow"> will sell at half price this week.</span>`; } if (V.GRI.schoolSale !== 0) { - r += `<br><span class=yellow>For your first purchase, </span><strong>[[Growth Research Institute][$slavesSeen += 1]]</strong><span class=yellow> will sell at half price this week.</span>`; + r += `<br><span class="yellow">For your first purchase, </span><strong>[[Growth Research Institute][$slavesSeen += 1]]</strong><span class="yellow"> will sell at half price this week.</span>`; } if (V.SCP.schoolSale !== 0) { - r += `<br><span class=yellow>For your first purchase, </span><strong>[[St. Claver Preparatory][$slavesSeen += 1]]</strong><span class=yellow> will sell at half price this week.</span>`; + r += `<br><span class="yellow">For your first purchase, </span><strong>[[St. Claver Preparatory][$slavesSeen += 1]]</strong><span class="yellow"> will sell at half price this week.</span>`; } if (V.TCR.schoolSale !== 0) { - r += `<br><span class=yellow>For your first purchase, </span><strong>[[The Cattle Ranch][$slavesSeen += 1]]</strong><span class=yellow> will sell at half price this week.</span>`; + r += `<br><span class="yellow">For your first purchase, </span><strong>[[The Cattle Ranch][$slavesSeen += 1]]</strong><span class="yellow"> will sell at half price this week.</span>`; } if (V.HA.schoolSale !== 0) { - r += `<br><span class=yellow>For your first purchase, </span><strong>[[The Hippolyta Academy][$slavesSeen += 1]]</strong><span class=yellow> will sell at half price this week.</span>`; + r += `<br><span class="yellow">For your first purchase, </span><strong>[[The Hippolyta Academy][$slavesSeen += 1]]</strong><span class="yellow"> will sell at half price this week.</span>`; } if (V.seeDicks !== 0) { if (V.LDE.schoolSale !== 0) { - r += `<br><span class=yellow>For your first purchase, </span><strong>[[L'École des Enculées][$slavesSeen += 1]]</strong><span class=yellow> will sell at half price this week.</span>`; + r += `<br><span class="yellow">For your first purchase, </span><strong>[[L'École des Enculées][$slavesSeen += 1]]</strong><span class="yellow"> will sell at half price this week.</span>`; } if (V.TGA.schoolSale !== 0) { - r += `<br><span class=yellow>For your first purchase, </span><strong>[[The Gymnasium-Academy][$slavesSeen += 1]]</strong><span class=yellow> will sell at half price this week.</span>`; + r += `<br><span class="yellow">For your first purchase, </span><strong>[[The Gymnasium-Academy][$slavesSeen += 1]]</strong><span class="yellow"> will sell at half price this week.</span>`; } if (V.TFS.schoolSale !== 0) { - r += `<br><span class=yellow>For your first purchase, </span><strong>[[The Futanari Sisters][$slavesSeen += 1]]</strong><span class=yellow> will sell at half price this week.</span>`; + r += `<br><span class="yellow">For your first purchase, </span><strong>[[The Futanari Sisters][$slavesSeen += 1]]</strong><span class="yellow"> will sell at half price this week.</span>`; } } return r; diff --git a/src/interaction/prothesticLab.tw b/src/interaction/prothesticLab.tw index 0e22853a2d6217a0f3706fcea1d11536c624c573..8f3cc31836f3ef8695ca00f07a7d5c19e507dd6d 100644 --- a/src/interaction/prothesticLab.tw +++ b/src/interaction/prothesticLab.tw @@ -144,7 +144,7 @@ Prosthetic Lab <<case "craftFit">> For @@.yellow;<<= SlaveFullName($slaves[$slaveIndices[$researchLab.tasks[_i].slaveID]])>>@@ you <<if _i == 0>>are constructing<<else>> plan to construct<</if>> <<default>> - @@.red;Error: Unknown $$researchLab.tasks[].type: $researchLab.tasks[_i].type@@ + @@.red;Error: Unknown $researchLab.tasks[].type: $researchLab.tasks[_i].type@@ <</switch>> <<set _j += $researchLab.tasks[_i].workLeft>> @@.yellow;<<= capFirstChar(setup.prosthetics[$researchLab.tasks[_i].id].name)>>@@. diff --git a/src/js/DefaultRules.js b/src/js/DefaultRules.js index 2d262388ed78306b62977c40c5cf5d5843f50bbf..95575dbabc3c673ff9796331f618e12979c27b4a 100644 --- a/src/js/DefaultRules.js +++ b/src/js/DefaultRules.js @@ -9,7 +9,10 @@ window.DefaultRules = (function() { let him; let his; - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @returns {object} + */ function DefaultRules(slave) { if (slave.useRulesAssistant === 0) return r; // exempted @@ -77,7 +80,10 @@ window.DefaultRules = (function() { return r; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @returns {map} + */ function MergeRules(slave) { // merge all rules applying on a slave into one big rule const rules = V.defaultRules.filter((x) => ruleAppliesP(x.condition, slave)); @@ -85,7 +91,11 @@ window.DefaultRules = (function() { return mergeRules(rules.map((x) => ProcessAssignments(slave, Object.assign({}, x.set)))); } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule // not sure about this + * @returns {object} // not sure about this + */ function ProcessAssignments(slave, rule) { // Before merging rules, we process assignments for each rule separately so we can remove slaves from facilities when they no longer qualify, even if the final "winning" rule assigns them elsewhere // We also ignore inapplicable assignments for the current slave, so we only merge assignments that are valid @@ -172,7 +182,7 @@ window.DefaultRules = (function() { break; case "work in the dairy": - if ((V.dairy > V.dairySlaves+V.bioreactorsXY+V.bioreactorsXX+V.bioreactorsHerm+V.bioreactorsBarren)) { + if ((V.dairy > V.dairySlaves + V.bioreactorsXY + V.bioreactorsXX + V.bioreactorsHerm + V.bioreactorsBarren)) { if ((slave.indentureRestrictions > 0) && (V.dairyRestraintsSetting > 1)) { break; } else if (((slave.indentureRestrictions > 1) && (V.dairyRestraintsSetting > 0)) || (slave.breedingMark === 1 && V.propOutcome === 1 && V.dairyRestraintsSetting > 0) || ((V.dairyPregSetting > 0) && ((slave.bellyImplant !== -1) || (slave.broodmother !== 0)))) { @@ -223,7 +233,7 @@ window.DefaultRules = (function() { case "learn in the schoolroom": if ((V.schoolroomSlaves < V.schoolroom && slave.fetish !== "mindbroken" && (slave.devotion >= -20 || slave.trust < -50 || (slave.devotion >= -50 && slave.trust < -20)))) { - if ((slave.intelligenceImplant < 30) || (slave.voice !== 0 && slave.accent+V.schoolroomUpgradeLanguage > 2) || (slave.skill.oral <= 10+V.schoolroomUpgradeSkills*20) || (slave.skill.whoring <= 10+V.schoolroomUpgradeSkills*20) || (slave.skill.entertainment <= 10+V.schoolroomUpgradeSkills*20) || (slave.skill.anal < 10+V.schoolroomUpgradeSkills*20) || ((slave.vagina >= 0) && (slave.skill.vaginal < 10+V.schoolroomUpgradeSkills*20))) { + if ((slave.intelligenceImplant < 30) || (slave.voice !== 0 && slave.accent + V.schoolroomUpgradeLanguage > 2) || (slave.skill.oral <= 10 + V.schoolroomUpgradeSkills * 20) || (slave.skill.whoring <= 10 + V.schoolroomUpgradeSkills * 20) || (slave.skill.entertainment <= 10 + V.schoolroomUpgradeSkills * 20) || (slave.skill.anal < 10 + V.schoolroomUpgradeSkills * 20) || ((slave.vagina >= 0) && (slave.skill.vaginal < 10 + V.schoolroomUpgradeSkills * 20))) { break; } else { RAFacilityRemove(slave, rule); // before deleting rule.setAssignment @@ -295,13 +305,16 @@ window.DefaultRules = (function() { break; default: - r += "<span class=\"red\">raWidgets missing case for assignment 'V.{rule.setAssignment}'</span>."; + r += `<span class="red">raWidgets missing case for assignment 'V.{rule.setAssignment}'</span>.`; break; } return rule; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function AssignJobToSlave(slave, rule) { // place slave on assignment defined by the rule if ((rule.setAssignment !== undefined && rule.setAssignment !== "no default setting")) { @@ -358,7 +371,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessClothing(slave, rule) { // apply clothes to slave if ((rule.clothes !== undefined) && (rule.clothes !== "no default setting")) { @@ -376,7 +392,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessCollar(slave, rule) { // apply collar to slave if ((rule.collar !== undefined) && (rule.collar !== "no default setting")) { @@ -404,7 +423,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessEyewear(slave, rule) { // apply glasses, contacts to slave if ((rule.eyewear !== undefined) && (rule.eyewear !== "no default setting")) { @@ -495,7 +517,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessEarwear(slave, rule) { // apply earplugs to slave if ((rule.earwear !== undefined) && (rule.earwear !== "no default setting")) { @@ -555,7 +580,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessDildos(slave, rule) { // apply vaginal dildos to slave if (slave.vagina === 0) { @@ -568,7 +596,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessVVirginDildos(slave, rule) { // apply vaginal dildos to vaginal virgins if ((rule.virginAccessory !== undefined) && (rule.virginAccessory !== "no default setting")) { @@ -626,7 +657,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessAVirginDildos(slave, rule) { // apply vaginal dildos to anal virgins if ((rule.aVirginAccessory !== undefined) && (rule.aVirginAccessory !== "no default setting")) { @@ -684,7 +718,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessNonVirginDildos(slave, rule) { // apply vaginal dildos to non-virgins if ((rule.vaginalAccessory !== undefined) && (rule.vaginalAccessory !== "no default setting")) { @@ -741,7 +778,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessVaginalAttachments(slave, rule) { // apply vaginal accessories to slaves if (slave.vaginalAccessory === "none" && slave.vaginalAttachment === "vibrator") { @@ -778,7 +818,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessDickAccessories(slave, rule) { // apply dick accessories to slave if ((slave.dick > 0)) { @@ -808,7 +851,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessChastity(slave, rule) { // apply chastity to slave if ((rule.chastityVagina !== undefined) && (rule.chastityVagina !== "no default setting")) { @@ -847,7 +893,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessShoes(slave, rule) { // apply shoes to slave if ((rule.shoes !== undefined) && (rule.shoes !== "no default setting")) { @@ -860,7 +909,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessBellyAccessories(slave, rule) { // apply belly accessories to slave if ((rule.bellyAccessory !== undefined) && (rule.bellyAccessory !== "no default setting")) { @@ -880,7 +932,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessLegAccessory(slave, rule) { if (rule.legAccessory !== undefined && rule.legAccessory !== "no default setting" && slave.amp !== 1 && slave.legAccessory !== rule.legAccessory) { slave.legAccessory = rule.legAccessory; @@ -888,7 +943,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessAnalAccessories(slave, rule) { // apply buttplugs and buttplug accessories to slave if (slave.chastityAnus !== 1) { @@ -901,7 +959,10 @@ window.DefaultRules = (function() { ProcessButtplugAttachments(slave, rule); } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessAnalVirginButtplugs(slave, rule) { // apply buttplugs to virgins if ((rule.aVirginButtplug !== undefined) && (rule.aVirginButtplug !== "no default setting")) { @@ -959,7 +1020,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessNonVirginButtplugs(slave, rule) { // apply buttplugs to non-virgins if ((rule.buttplug !== undefined) && (rule.buttplug !== "no default setting")) { @@ -1017,7 +1081,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessButtplugAttachments(slave, rule) { // apply buttplug accessories to slaves if (slave.buttplug === "none" && slave.buttplugAttachment !== "none") { @@ -1038,29 +1105,32 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessBellyImplant(slave, rule) { // Here is belly implant size control, it's used in Surgery Degradation passage to setup devotion and trust changes. // silent calls to surgery degradation have been replaced with a js function, which is less hacky if ((rule.bellyImplantVol !== undefined) && slave.bellyImplant >= 0 && rule.bellyImplantVol >= 0) { r += "<br>"; - if (slave.health > -10 ) { + if (slave.health > -10) { let diff = rule.bellyImplantVol - slave.bellyImplant; if (diff >= 5000 && slave.bellyPain === 0 && slave.health > 50) { r += `${slave.slaveName}'s belly is way too small, so ${he} has been directed to have intensive belly implant filling procedures throughout this week.`; slave.bellyImplant += 1000; slave.bellyPain += 2; BellySurgery(slave, diff); - } else if (diff >= 500 && slave.bellyPain < 2 ) { + } else if (diff >= 500 && slave.bellyPain < 2) { r += `${slave.slaveName}'s belly has not reached the desired size, so ${he} has been directed to have belly implant filling procedures throughout this week.`; slave.bellyImplant += 500; slave.bellyPain += 1; BellySurgery(slave, diff); - } else if (diff <= -5000 ) { + } else if (diff <= -5000) { r += `${slave.slaveName}'s belly is way too big, so ${he} has been directed to have intensive belly implant draining procedures throughout this week.`; slave.bellyImplant -= 1000; BellySurgery(slave, diff); - } else if (diff <= -500 ) { + } else if (diff <= -500) { r += `${slave.slaveName}'s belly is too big, so ${he} has been directed to have belly implant draining procedures throughout this week.`; slave.bellyImplant -= 500; BellySurgery(slave, diff); @@ -1071,7 +1141,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} volume + */ function BellySurgery(slave, volume) { // this is a port of the belly implant portion of surgeryDegradation.tw // that way, we don't have to use ugly hacks @@ -1114,7 +1187,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessContraceptives(slave, rule) { if ((rule.preg !== undefined) && (rule.preg !== "no default setting")) { if (rule.preg === true && slave.preg === 0) { @@ -1127,7 +1203,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessAbortions(slave, rule) { if ((rule.abortion !== undefined) && (rule.abortion !== "no default setting")) { if (rule.abortion === "all") { @@ -1208,7 +1287,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessAssetGrowthDrugs(slave, rule) { // Asset Growth const growthDrugs = new Set(["breast injections", "breast redistributors", "butt injections", "butt redistributors", "hyper breast injections", "hyper butt injections", "hyper penis enhancement", "hyper testicle enhancement", "intensive breast injections", "intensive butt injections", "intensive penis enhancement", "intensive testicle enhancement", "lip atrophiers", "lip injections", "penis atrophiers", "penis enhancement", "testicle atrophiers", "testicle enhancement"]); @@ -1223,60 +1305,50 @@ window.DefaultRules = (function() { if (rule.growth_boobs !== "no default setting") { let _priority; if (slave.boobs < rule.growth_boobs) { - _priority = {drug: "breast injections", weight: (rule.growth_boobs-slave.boobs)/rule.growth_boobs}; + _priority = {drug: "breast injections", weight: (rule.growth_boobs - slave.boobs) / rule.growth_boobs}; _priorities.push(_priority); - } else if ((slave.boobs > parseInt(rule.growth_boobs)+200) && slave.weight < 100 && (V.arcologies[0].FSSlimnessEnthusiastResearch === 1)) { - _priority = { - drug: "breast redistributors", - weight: (1+((slave.boobs-slave.boobsImplant-slave.boobsMilk-rule.growth_boobs)/rule.growth_boobs))}; + } else if ((slave.boobs > parseInt(rule.growth_boobs) + 200) && slave.weight < 100 && (V.arcologies[0].FSSlimnessEnthusiastResearch === 1)) { + _priority = {drug: "breast redistributors", weight: (1 + ((slave.boobs - slave.boobsImplant - slave.boobsMilk - rule.growth_boobs) / rule.growth_boobs))}; _priorities.push(_priority); } } if (rule.growth_butt !== "no default setting") { let _priority; if (slave.butt < rule.growth_butt) { - _priority = {drug: "butt injections", weight: (rule.growth_butt-slave.butt)/rule.growth_butt}; + _priority = {drug: "butt injections", weight: (rule.growth_butt - slave.butt) / rule.growth_butt}; _priorities.push(_priority); } else if ((Math.trunc(slave.butt) > rule.growth_butt) && slave.weight < 100 && (V.arcologies[0].FSSlimnessEnthusiastResearch === 1)) { - _priority = { - drug: "butt redistributors", - weight: (1+((slave.butt-slave.buttImplant-rule.growth_butt)/rule.growth_butt))}; + _priority = {drug: "butt redistributors", weight: (1 + ((slave.butt - slave.buttImplant - rule.growth_butt) / rule.growth_butt))}; _priorities.push(_priority); } } if (rule.growth_lips !== "no default setting") { let _priority; if (slave.lips < rule.growth_lips) { - _priority = {drug: "lip injections", weight: (rule.growth_lips-slave.lips)/rule.growth_lips}; + _priority = {drug: "lip injections", weight: (rule.growth_lips - slave.lips) / rule.growth_lips}; _priorities.push(_priority); } else if ((slave.lips > rule.growth_lips) && (V.arcologies[0].FSSlimnessEnthusiastResearch === 1)) { - _priority = { - drug: "lip atrophiers", - weight: (1+((slave.lips-slave.lipsImplant-rule.growth_lips)/rule.growth_lips))}; + _priority = {drug: "lip atrophiers", weight: (1 + ((slave.lips - slave.lipsImplant - rule.growth_lips) / rule.growth_lips))}; _priorities.push(_priority); } } if (rule.growth_dick !== "no default setting" && slave.dick) { let _priority; if (slave.dick < rule.growth_dick) { - _priority = {drug: "penis enhancement", weight: (rule.growth_dick-slave.dick)/rule.growth_dick}; + _priority = {drug: "penis enhancement", weight: (rule.growth_dick - slave.dick) / rule.growth_dick}; _priorities.push(_priority); } else if ((slave.dick > rule.growth_dick) && (V.arcologies[0].FSSlimnessEnthusiastResearch === 1)) { - _priority = { - drug: "penis atrophiers", - weight: (1+((slave.dick-rule.growth_dick)/rule.growth_dick))}; + _priority = {drug: "penis atrophiers", weight: (1 + ((slave.dick - rule.growth_dick) / rule.growth_dick))}; _priorities.push(_priority); } } if (rule.growth_balls !== "no default setting" && slave.balls) { let _priority; if (slave.balls < rule.growth_balls) { - _priority = {drug: "testicle enhancement", weight: (rule.growth_balls-slave.balls)/rule.growth_balls}; + _priority = {drug: "testicle enhancement", weight: (rule.growth_balls - slave.balls) / rule.growth_balls}; _priorities.push(_priority); } else if ((slave.balls > rule.growth_balls) && (V.arcologies[0].FSSlimnessEnthusiastResearch === 1)) { - _priority = { - drug: "testicle atrophiers", - weight: (1+((slave.balls-rule.growth_balls)/rule.growth_balls))}; + _priority = {drug: "testicle atrophiers", weight: (1 + ((slave.balls - rule.growth_balls) / rule.growth_balls))}; _priorities.push(_priority); } } @@ -1304,9 +1376,9 @@ window.DefaultRules = (function() { r += `${Math.trunc(_priorities[0].weight*100)}% `; } if (_priorities[0].weight < 1) { - r+= "below "; + r += "below "; } else { - r+= "above "; + r += "above "; } r += "the targeted size."; } @@ -1374,7 +1446,7 @@ window.DefaultRules = (function() { } if (V.arcologies[0].FSSlimnessEnthusiastResearch === 1) { if (rule.growth_boobs !== "no default setting") { - if (slave.boobs-slave.boobsImplant-slave.boobsMilk > parseInt(rule.growth_boobs)+200 && slave.weight < 100) { + if (slave.boobs - slave.boobsImplant - slave.boobsMilk > parseInt(rule.growth_boobs) + 200 && slave.weight < 100) { if (slave.drugs !== "breast redistributors") { slave.drugs = "breast redistributors"; r += `<br>${slave.slaveName} has been put on ${slave.drugs}.`; @@ -1383,7 +1455,7 @@ window.DefaultRules = (function() { } } if (rule.growth_butt !== "no default setting") { - if (Math.trunc(slave.butt-slave.buttImplant) > rule.growth_butt && slave.weight < 100) { + if (Math.trunc(slave.butt - slave.buttImplant) > rule.growth_butt && slave.weight < 100) { if (slave.drugs !== "butt redistributors") { slave.drugs = "butt redistributors"; r += `<br>${slave.slaveName} has been put on ${slave.drugs}.`; @@ -1392,7 +1464,7 @@ window.DefaultRules = (function() { } } if (rule.growth_lips !== "no default setting") { - if (slave.lips-slave.lipsImplant > rule.growth_lips) { + if (slave.lips - slave.lipsImplant > rule.growth_lips) { if (slave.drugs !== "lip atrophiers") { slave.drugs = "lip atrophiers"; r += `<br>${slave.slaveName} has been put on ${slave.drugs}.`; @@ -1426,7 +1498,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessOtherDrugs(slave, rule) { // Other Drugs if (slave.indentureRestrictions < 2 && rule.drug !== "no default setting" && slave.drugs !== rule.drug) { @@ -1582,8 +1657,7 @@ window.DefaultRules = (function() { } break; - default: - break; + } if (flag) { slave.drugs = rule.drug; @@ -1595,7 +1669,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessEnema(slave, rule) { if ((rule.inflationType !== undefined) && (rule.inflationType !== "no default setting")) { if (slave.inflationType !== rule.inflationType) { @@ -1608,6 +1685,7 @@ window.DefaultRules = (function() { slave.cumSource = 0; SetBellySize(slave); } else if ((rule.inflationType === "curative" && slave.health > 90) || (rule.inflationType === "tightener" && slave.anus <= 1 && slave.vagina <= 1)) { + // empty block } else { r += `<br>${slave.slaveName}'s current enema regimen has been set to ${rule.inflationType}.`; slave.inflation = 1; @@ -1636,7 +1714,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessDiet(slave, rule) { // Diet Setting if (rule.diet !== undefined && rule.diet !== "no default setting") { @@ -1672,12 +1753,12 @@ window.DefaultRules = (function() { r += `<br>${slave.slaveName} is too skinny so ${his} diet has been set to fattening.`; } } else if ((rule.muscles !== undefined) && (rule.muscles !== "no default setting") && (slave.amp !== 1)) { - if ((slave.muscles >= rule.muscles+8)) { + if ((slave.muscles >= rule.muscles + 8)) { if ((slave.diet !== "slimming")) { slave.diet = "slimming"; r += `<br>${slave.slaveName} has been put on a slimming exercise regime.`; } - } else if ((slave.muscles <= rule.muscles-2)) { + } else if ((slave.muscles <= rule.muscles - 2)) { if ((slave.diet !== "muscle building")) { slave.diet = "muscle building"; r += `<br>${slave.slaveName} has been put on a muscle building exercise regime.`; @@ -1706,12 +1787,12 @@ window.DefaultRules = (function() { r += `<br>${slave.slaveName} is too skinny so ${his} diet has been set to fattening.`; } } else if ((rule.muscles !== undefined) && (rule.muscles !== "no default setting") && (slave.amp !== 1)) { - if ((slave.muscles >= rule.muscles+8)) { + if ((slave.muscles >= rule.muscles + 8)) { if ((slave.diet !== "slimming")) { slave.diet = "slimming"; r += `<br>${slave.slaveName} has been put on a slimming exercise regime.`; } - } else if ((slave.muscles <= rule.muscles-2)) { + } else if ((slave.muscles <= rule.muscles - 2)) { if ((slave.diet !== "muscle building")) { slave.diet = "muscle building"; r += `<br>${slave.slaveName} has been put on a muscle building exercise regime.`; @@ -1787,12 +1868,12 @@ window.DefaultRules = (function() { } } } else if ((rule.muscles !== undefined) && (rule.muscles !== "no default setting") && (slave.amp !== 1)) { // no diet rule, muscles only - if ((slave.muscles >= rule.muscles+8)) { + if ((slave.muscles >= rule.muscles + 8)) { if ((slave.diet !== "slimming")) { slave.diet = "slimming"; r += `<br>${slave.slaveName} has been put on a slimming exercise regime.`; } - } else if ((slave.muscles <= rule.muscles-2)) { + } else if ((slave.muscles <= rule.muscles - 2)) { if ((slave.diet !== "muscle building")) { slave.diet = "muscle building"; r += `<br>${slave.slaveName} has been put on a muscle building exercise regime.`; @@ -1814,7 +1895,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessCuratives(slave, rule) { if ((rule.curatives !== undefined) && (rule.curatives !== "no default setting")) { if (slave.curatives !== rule.curatives) { @@ -1836,7 +1920,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessAphrodisiacs(slave, rule) { if ((rule.aphrodisiacs !== undefined) && (rule.aphrodisiacs !== "no default setting")) { if (slave.aphrodisiacs !== rule.aphrodisiacs) { @@ -1846,7 +1933,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessPenisHormones(slave, rule) { if ((slave.dick > 0)) { if ((slave.balls === 0)) { @@ -1885,7 +1975,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessFemaleHormones(slave, rule) { if ((slave.vagina > -1) && (slave.dick === 0) && (rule.XX !== undefined) && (rule.XX !== "no default setting")) { if ((slave.hormones !== rule.XX)) { @@ -1901,7 +1994,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessPregnancyDrugs(slave, rule) { if (slave.pregKnown === 1 && rule.pregSpeed !== "no default setting" && (slave.breedingMark !== 1 || V.propOutcome === 0) && slave.indentureRestrictions < 1 && slave.broodmother === 0) { if (rule.pregSpeed === "slow" && slave.preg < slave.pregData.minLiveBirth) { @@ -1928,7 +2024,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessLivingStandard(slave, rule) { if ((rule.livingRules !== undefined) && (rule.livingRules !== "no default setting")) { if (setup.facilityCareers.includes(slave.assignment)) { @@ -1942,7 +2041,7 @@ window.DefaultRules = (function() { } } else if (slave.livingRules !== rule.livingRules) { if (rule.livingRules !== "luxurious") { - if (V.roomsPopulation <= V.rooms-0.5) { + if (V.roomsPopulation <= V.rooms - 0.5) { slave.livingRules = rule.livingRules; r += `<br>${slave.slaveName}'s living standard has been set to ${rule.livingRules}.`; if (slave.relationship >= 4) { @@ -1962,7 +2061,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessSpeech(slave, rule) { if ((rule.speechRules !== undefined) && (rule.speechRules !== "no default setting") && (slave.speechRules !== rule.speechRules)) { if (slave.fetish === "mindbroken") { @@ -1993,11 +2095,14 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessRelationship(slave, rule) { if ((slave.fetish !== "mindbroken")) { if ((rule.relationshipRules !== undefined) && (rule.relationshipRules !== "no default setting")) { - if ((slave.relationshipRules !== rule.relationshipRules )) { + if ((slave.relationshipRules !== rule.relationshipRules)) { slave.relationshipRules = rule.relationshipRules; r += `<br>${slave.slaveName}'s relationship rules have been set to ${rule.relationshipRules}.`; } @@ -2005,7 +2110,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessRelease(slave, rule) { if ((rule.releaseRules !== undefined) && (rule.releaseRules !== "no default setting")) { let _release = 0; @@ -2028,7 +2136,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessPunishment(slave, rule) { if ((rule.standardPunishment !== undefined) && (rule.standardPunishment !== "no default setting")) { if ((slave.standardPunishment !== rule.standardPunishment)) { @@ -2038,7 +2149,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessReward(slave, rule) { if ((rule.standardReward !== undefined) && (rule.standardReward !== "no default setting")) { if ((slave.standardReward !== rule.standardReward)) { @@ -2048,7 +2162,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessToyHole(slave, rule) { if ((rule.toyHole !== undefined) && (rule.toyHole !== "no default setting")) { if (rule.toyHole === "pussy") { @@ -2082,7 +2199,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessDietCum(slave, rule) { if ((rule.dietCum !== undefined) && (rule.dietCum !== "no default setting")) { if (slave.dietCum !== rule.dietCum) { @@ -2099,7 +2219,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessDietMilk(slave, rule) { if ((rule.dietMilk !== undefined) && (rule.dietMilk !== "no default setting")) { if (slave.dietMilk !== rule.dietMilk) { @@ -2116,7 +2239,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessSolidFood(slave, rule) { if ((rule.onDiet !== undefined) && (rule.onDiet !== "no default setting")) { if ((slave.onDiet !== rule.onDiet)) { @@ -2130,7 +2256,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessTeeth(slave, rule) { if ((rule.teeth !== undefined) && (rule.teeth !== "no default setting")) { if ((rule.teeth === "universal")) { @@ -2172,7 +2301,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessStyle(slave, rule) { if (rule.eyeColor !== undefined && (rule.eyeColor !== "no default setting")) { if ((slave.eyeColor !== rule.eyeColor)) { @@ -2232,7 +2364,7 @@ window.DefaultRules = (function() { cashX(forceNeg(V.modCost), "slaveMod", slave); r += `<br>${slave.slaveName}'s hair has been cut; it `; } else { - cashX(forceNeg(V.modCost*Math.trunc((rule.hLength-slave.hLength)/10)), "slaveMod", slave); + cashX(forceNeg(V.modCost * Math.trunc((rule.hLength - slave.hLength) / 10)), "slaveMod", slave); r += `<br>${slave.slaveName} has been given extensions; ${his} hair `; } r += `is now ${lengthToEitherUnit(rule.hLength)} long.`; @@ -2567,7 +2699,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessSmartPiercings(slave, rule) { if ((slave.clitPiercing === 3)) { let _used = 0; @@ -2634,7 +2769,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessTattoos(slave, rule) { if (rule.boobsTat !== undefined && (rule.boobsTat !== "no default setting")) { if ((slave.boobsTat !== rule.boobsTat)) { @@ -2735,13 +2873,16 @@ window.DefaultRules = (function() { } slave.trust -= 5; slave.health -= 10; - r += `<br>${slave.slaveName} has been branded, with <span class="gold">fear</span>${slave.devotion < 18? ", <span class=\"mediumorchid\">regard,</span>":""} and <span class="red">health</span> consequences.`; + r += `<br>${slave.slaveName} has been branded, with <span class="gold">fear</span>${slave.devotion < 18 ? `, <span class="mediumorchid">regard,</span>` : ``} and <span class="red">health</span> consequences.`; } } } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessPornFeedEnabled(slave, rule) { if (rule.pornFeed === undefined || rule.pornFeed === "no default setting") { return; @@ -2768,7 +2909,10 @@ window.DefaultRules = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {object} rule + */ function ProcessLabel(slave, rule) { if (rule.label !== "no default setting" && !slave.custom.label.includes(`[${rule.label}]`)) { slave.custom.label = `${slave.custom.label }[${ rule.label }]`; diff --git a/src/js/SetBellySize.js b/src/js/SetBellySize.js index 78d2eec4a50fdf0a59d1e954863fd2848acf0610..abe9d645c9d6eb5f404fce22772d2b8d6bdef957 100644 --- a/src/js/SetBellySize.js +++ b/src/js/SetBellySize.js @@ -1,4 +1,6 @@ -/** @param {App.Entity.SlaveState} slave */ +/** + * @param {App.Entity.SlaveState} slave + */ window.SetBellySize = function SetBellySize(slave) { WombNormalizePreg(slave); /* now with support for legacy code that advances pregnancy by setting .preg++ */ @@ -14,5 +16,5 @@ window.SetBellySize = function SetBellySize(slave) { slave.bellyFluid = 0; } - slave.belly = slave.bellyPreg+slave.bellyFluid+_implantSize; + slave.belly = slave.bellyPreg + slave.bellyFluid + _implantSize; }; diff --git a/src/js/SlaveState.js b/src/js/SlaveState.js index c3578570fef6ae45a5fb70a325d06efb81d82a52..3554944697d05b69931d5a87eec0014b443ec15a 100644 --- a/src/js/SlaveState.js +++ b/src/js/SlaveState.js @@ -1,4 +1,3 @@ -/* eslint-disable no-undef */ /** * Encapsulates the full description of a slave state. Serializable by the SugarCube state * management. @@ -276,18 +275,18 @@ App.Entity.SlaveCustomAddonsState = class SlaveCustomAddonsState { * @property {string} format one of "png", "jpg", "gif" or "webm" */ /** - * holds the custom slave image file name (used if images are enabled) - * - * null: no custom image - * @type {CustomImage} - */ + * holds the custom slave image file name (used if images are enabled) + * + * null: no custom image + * @type {CustomImage} + */ this.image = null; /** - * holds the custom hair vector base file name - * - * used if vector images are enabled - * @type {number|string} - */ + * holds the custom hair vector base file name + * + * used if vector images are enabled + * @type {number|string} + */ this.hairVector = 0; } }; @@ -369,7 +368,7 @@ App.Entity.SlaveState = class SlaveState { * * 3: friends with benefits with relationshipTarget * * 4: lover with relationshipTarget * * 5: relationshipTarget 's slave wife - */ + */ this.relationship = 0; /** target of relationship (ID) */ this.relationshipTarget = 0; @@ -555,7 +554,7 @@ App.Entity.SlaveState = class SlaveState { * "neko", "inu", "kit", "tanuki" */ this.earT = "none"; /** kemonomimi ear color - * "hairless" */ + * "hairless" */ this.earTColor = "hairless"; /** sense of smell 0 - yes, -1 - no */ @@ -1748,22 +1747,22 @@ App.Entity.SlaveState = class SlaveState { */ this.dickAccessory = "none"; /** - * whether the slave has a chastity device on their anus - * 0 - no - * 1 - yes - */ + * whether the slave has a chastity device on their anus + * 0 - no + * 1 - yes + */ this.chastityAnus = 0; /** - * whether the slave has a chastity device on their penis - * 0 - no - * 1 - yes - */ + * whether the slave has a chastity device on their penis + * 0 - no + * 1 - yes + */ this.chastityPenis = 0; /** - * whether the slave has a chastity device on their vagina - * 0 - no - * 1 - yes - */ + * whether the slave has a chastity device on their vagina + * 0 - no + * 1 - yes + */ this.chastityVagina = 0; /** * may accept strings, use at own risk @@ -1864,7 +1863,7 @@ App.Entity.SlaveState = class SlaveState { * *if both attrXX and attrXY > 95, slave will be omnisexual* * * *if energy > 95 and either attrXX or attrXY > 95, slave will be nymphomaniac* - */ + */ this.attrXY = 0; /** 0: no; 1: yes */ this.attrKnown = 0; @@ -1952,8 +1951,8 @@ App.Entity.SlaveState = class SlaveState { */ this.sexualQuirk = "none"; /** 0: does not have; 1: carrier; 2: active - * * heterochromia is an exception. String = active - */ + * * heterochromia is an exception. String = active + */ this.geneticQuirks = { /** Oversized breasts. Increased growth rate, reduced shrink rate. Breasts try to return to oversized state if reduced. */ macromastia: 0, @@ -2136,7 +2135,7 @@ App.Entity.SlaveState = class SlaveState { * * 8000+: looks full term * * 16000+: hyperpregnant 1 * * 32000+: hyperpregnant 2 - */ + */ this.bellyImplant = -1; /** How saggy her belly is after being distended for too long. * @@ -2364,9 +2363,9 @@ App.Entity.SlaveState = class SlaveState { */ static makeSkeleton() { return { - counter: { }, + counter: {}, porn: { - fame: { } + fame: {} }, skill: {}, custom: {}, diff --git a/src/js/accordianJS.js b/src/js/accordianJS.js index 88c9f9abd3903366b41f8945ccdbcb55f4b88078..34158aa86d151a03748c25af995f13ab36e4994d 100644 --- a/src/js/accordianJS.js +++ b/src/js/accordianJS.js @@ -11,27 +11,27 @@ * might benefit. * * 000-250-006 03092017 -*/ + */ -postdisplay["doAccordionSet"] = function (content) { +postdisplay["doAccordionSet"] = function() { if (variables().useAccordion === 1) { Array.prototype.slice.call(document.querySelectorAll(".macro-include")) - .forEach(function (element) { + .forEach(function(element) { element.classList.add("accHidden"); }); } }; -postdisplay["doAccordion"] = function (content) { +postdisplay["doAccordion"] = function() { const acc = document.getElementsByClassName("accordion"); for (let i = 0; i < acc.length; i += 1) { - acc[i].onclick = function () { + acc[i].onclick = function() { this.classList.toggle("active"); let panel = this.nextElementSibling; if (panel === null || panel === undefined) { panel = document.getElementById(`${this.id }accHidden`); - if ( panel.style.display === "none" ) { + if (panel.style.display === "none") { panel.style.display = ""; } else { panel.style.display = "none"; diff --git a/src/js/assayJS.js b/src/js/assayJS.js index 3d5e1305b5349b4ddaba21c8ce3f2a22b071eda9..3b9a38cf3225ef9f4a44bd6d3803bf6ad99d8937 100644 --- a/src/js/assayJS.js +++ b/src/js/assayJS.js @@ -1,5 +1,3 @@ -/* eslint-disable no-unused-vars */ -/* eslint-disable no-undef */ window.sameAssignmentP = function sameAssignmentP(A, B) { return A.assignment === B.assignment; }; @@ -16,22 +14,39 @@ window.isRivalP = function isRivalP(slave, target) { return slave.rivalryTarget === target.ID; }; -window.supremeRaceP = /** @param {App.Entity.SlaveState} slave */ function supremeRaceP(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.supremeRaceP = function supremeRaceP(slave) { return State.variables.arcologies[0].FSSupremacistRace === slave.race; }; -window.inferiorRaceP = /** @param {App.Entity.SlaveState} slave */ function inferiorRaceP(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.inferiorRaceP = function inferiorRaceP(slave) { return State.variables.arcologies[0].FSSubjugationistRace === slave.race; }; -window.hasVisibleHeterochromia = /** @param {App.Entity.SlaveState} slave */ function hasVisibleHeterochromia(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.hasVisibleHeterochromia = function hasVisibleHeterochromia(slave) { return slave.geneticQuirks.heterochromia !== 0 && slave.geneticQuirks.heterochromia !== 1 && slave.geneticQuirks.albinism !== 2 && slave.geneticQuirks.heterochromia !== slave.eyeColor && slave.eyeColor === slave.origEye; }; -window.isLeaderP = /** @param {App.Entity.SlaveState} slave */ function isLeaderP(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} // I think + */ +window.isLeaderP = function isLeaderP(slave) { const V = State.variables; - /** @type {App.Entity.SlaveState[]}*/ - const leaders = [V.HeadGirl, V.Bodyguard, V.Recruiter, V.Concubine, V.Nurse, V.Attendant, V.Matron, V.Madam, V.DJ, V.Milkmaid, V. Farmer, V.Stewardess, V.Schoolteacher, V.Wardeness]; + /** + * @type {App.Entity.SlaveState[]}*/ + const leaders = [V.HeadGirl, V.Bodyguard, V.Recruiter, V.Concubine, V.Nurse, V.Attendant, V.Matron, V.Madam, V.DJ, V.Milkmaid, V.Farmer, V.Stewardess, V.Schoolteacher, V.Wardeness]; return leaders.some(leader => leader.ID && leader.ID === slave.ID); }; @@ -51,7 +66,10 @@ window.properMaster = function properMaster() { else return "Mistress"; }; -window.newSlave = /** @param {App.Entity.SlaveState} slave */ function newSlave(slave) { +/** + * @param {App.Entity.SlaveState} slave + */ +window.newSlave = function newSlave(slave) { const V = State.variables; if (slave.override_Eye_Color !== 1) { @@ -91,7 +109,7 @@ window.newSlave = /** @param {App.Entity.SlaveState} slave */ function newSlave( slave.origSkin = slave.skin; } } - + /* eslint-disable camelcase */ slave.override_Race = 0; slave.override_H_Color = 0; slave.override_Arm_H_Color = 0; @@ -99,6 +117,7 @@ window.newSlave = /** @param {App.Entity.SlaveState} slave */ function newSlave( slave.override_Brow_H_Color = 0; slave.override_Skin = 0; slave.override_Eye_Color = 0; + /* eslint-enable camelcase */ if (V.surnamesForbidden === 1) { slave.slaveSurname = 0; @@ -147,7 +166,7 @@ window.newSlave = /** @param {App.Entity.SlaveState} slave */ function newSlave( if (slave.actualAge > 35 && slave.face < 40 && slave.skill.anal <= 30) { V.REMILFCheckinIDs.push(slave.ID); } - if (slave.attrXY <= 60 && slave.attrXX > 60 ) { + if (slave.attrXY <= 60 && slave.attrXX > 60) { V.REOrientationCheckinIDs.push(slave.ID); } if (slave.face < -10) { @@ -168,7 +187,7 @@ window.newSlave = /** @param {App.Entity.SlaveState} slave */ function newSlave( V.genePool.push(slave); /* Store non-albino stats in genePool */ if (slave.geneticQuirks.albinism === 2) { - const albInd = V.genePool.findIndex(function(s) { return s.ID === slave.ID; }); + const albInd = V.genePool.findIndex(function(s) {return s.ID === slave.ID;}); V.genePool[albInd].origSkin = slave.albinismOverride.skin; V.genePool[albInd].origEye = slave.albinismOverride.eyeColor; V.genePool[albInd].origHColor = slave.albinismOverride.hColor; @@ -178,9 +197,7 @@ window.newSlave = /** @param {App.Entity.SlaveState} slave */ function newSlave( slave.albinismOverride = 0; } } else { - if (V.genePool.findIndex(function(s) { return s.ID === slave.ID; }) === -1) { - V.genePool.push(slave); - } + if (V.genePool.findIndex(function(s) {return s.ID === slave.ID;}) === -1) {V.genePool.push(slave);} } assignJob(slave, slave.assignment); @@ -191,7 +208,10 @@ window.newSlave = /** @param {App.Entity.SlaveState} slave */ function newSlave( } }; -window.newChild = /** @param {App.Entity.SlaveState} slave */ function newChild(child) { +/** + * @param {App.Entity.SlaveState} child + */ +window.newChild = function newChild(child) { const V = State.variables; child.age = 0; /* not sure if this is the correct way to do this or if more is required */ @@ -230,7 +250,7 @@ window.newChild = /** @param {App.Entity.SlaveState} slave */ function newChild( if (child.override_Skin !== 1) { child.origSkin = child.skin; } - + /* eslint-disable */ child.override_Race = 0; child.override_H_Color = 0; child.override_Arm_H_Color = 0; @@ -238,6 +258,7 @@ window.newChild = /** @param {App.Entity.SlaveState} slave */ function newChild( child.override_Brow_H_Color = 0; child.override_Skin = 0; child.override_Eye_Color = 0; + /* eslint-enable */ if (V.surnamesForbidden === 1) { child.childSurname = 0; @@ -273,7 +294,10 @@ window.newChild = /** @param {App.Entity.SlaveState} slave */ function newChild( State.variables.nurseryBabies++; }; -window.addSlave = /** @param {App.Entity.SlaveState} slave */ function addSlave(slave) { +/** + * @param {App.Entity.SlaveState} slave + */ +window.addSlave = function addSlave(slave) { State.variables.slaves.push(slave); State.variables.slaveIndices[slave.ID] = State.variables.slaves.length - 1; }; @@ -291,26 +315,38 @@ window.slaves2indices = function slaves2indices() { State.variables.slaves.forEach((slave, i) => obj[slave.ID] = i); return obj; }; -window.getSlave = /** @returns {App.Entity.SlaveState} */ function getSlave(ID) { +/** + * @param {number} ID + * @returns {App.Entity.SlaveState} + */ +window.getSlave = function getSlave(ID) { const index = State.variables.slaveIndices[ID]; if (index === undefined) return undefined; else return State.variables.slaves[index]; }; window.getChild = function getChild(ID) { const V = State.variables; - return V.cribs.find(function(s) { return s.ID === ID; }); + return V.cribs.find(function(s) {return s.ID === ID;}); }; -window.getPronouns = /** @param {App.Entity.SlaveState} slave */ function getPronouns(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {object} + */ +window.getPronouns = function getPronouns(slave) { return { pronoun: slave.pronoun, possessivePronoun: slave.possessivePronoun, possessive: slave.possessive, object: slave.object, objectReflexive: slave.objectReflexive, - noun: slave.noun}; + noun: slave.noun + }; }; -window.SlavePronouns = /** @param {App.Entity.SlaveState} slave */ function SlavePronouns(slave) { +/** + * @param {App.Entity.SlaveState} slave + */ +window.SlavePronouns = function SlavePronouns(slave) { const V = State.variables; const pronouns = getPronouns(slave); V.pronoun = pronouns.pronoun; @@ -320,7 +356,11 @@ window.SlavePronouns = /** @param {App.Entity.SlaveState} slave */ function Slav V.object = pronouns.object; }; -window.WrittenMaster = /** @param {App.Entity.SlaveState} slave */ function WrittenMaster(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {string} // I think + */ +window.WrittenMaster = function WrittenMaster(slave) { const V = State.variables; if (slave !== undefined) Enunciate(slave); @@ -329,7 +369,10 @@ window.WrittenMaster = /** @param {App.Entity.SlaveState} slave */ function Writ return V.writtenTitle; }; -window.Enunciate = /** @param {App.Entity.SlaveState} slave */ function Enunciate(slave) { +/** + * @param {App.Entity.SlaveState} slave + */ +window.Enunciate = function Enunciate(slave) { const V = State.variables; if (SlaveStatsChecker.checkForLisp(slave)) { if (V.PC.customTitleLisp !== undefined) @@ -470,24 +513,32 @@ window.Enunciate = /** @param {App.Entity.SlaveState} slave */ function Enunciat } }; -window.fetishChangeChance = /** @param {App.Entity.SlaveState} slave */ function fetishChangeChance(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {number} + */ +window.fetishChangeChance = function fetishChangeChance(slave) { const V = State.variables; - let chance = 0, sex = 0; + let chance = 0, + sex = 0; if (slave.clitSetting !== slave.fetish) { if (slave.balls) { sex = V.potencyAge - slave.actualAge; - } - else if (slave.ovaries || slave.mpreg) { + } else if (slave.ovaries || slave.mpreg) { sex = V.fertilityAge - slave.actualAge; } - chance = Math.trunc(Math.clamp((slave.devotion/4)-(slave.fetishStrength/4)-(Math.max(sex, 0)*10), 0, 100)); + chance = Math.trunc(Math.clamp((slave.devotion / 4) - (slave.fetishStrength / 4) - (Math.max(sex, 0) * 10), 0, 100)); } return chance; }; -window.SlaveFullName = /** @param {App.Entity.SlaveState} slave */ function SlaveFullName(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {string} + */ +window.SlaveFullName = function SlaveFullName(slave) { const V = State.variables; const pair = slave.slaveSurname ? [slave.slaveName, slave.slaveSurname] : [slave.slaveName]; if ((V.surnameOrder !== 1 && ["Cambodian", "Chinese", "Hungarian", "Japanese", "Korean", "Mongolian", "Taiwanese", "Vietnamese"].includes(slave.nationality)) || (V.surnameOrder === 2)) @@ -495,7 +546,11 @@ window.SlaveFullName = /** @param {App.Entity.SlaveState} slave */ function Slav return pair.join(" "); }; -window.SlaveFullBirthName = /** @param {App.Entity.SlaveState} slave */ function SlaveFullBirthName(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {string} + */ +window.SlaveFullBirthName = function SlaveFullBirthName(slave) { const V = State.variables; const pair = slave.birthSurname ? [slave.birthName, slave.birthSurname] : [slave.birthName]; if ((V.surnameOrder !== 1 && ["Cambodian", "Chinese", "Hungarian", "Japanese", "Korean", "Mongolian", "Taiwanese", "Vietnamese"].includes(slave.nationality)) || (V.surnameOrder === 2)) @@ -597,8 +652,7 @@ window.PCTitle = function PCTitle() { case "Exodus": titles.push("The Abandoned"); break; - default: - break; + } } @@ -911,7 +965,9 @@ window.PCTitle = function PCTitle() { titles.push("Caretaker of the Youth"); } - const schoolsPresent = []; const schoolsPerfected = []; let schoolTitle = ""; + const schoolsPresent = []; + const schoolsPerfected = []; + let schoolTitle = ""; if (V.TSS.schoolProsperity >= 10) { schoolsPerfected.push("The Slave School"); } else if (V.TSS.schoolPresent === 1) { @@ -1047,7 +1103,11 @@ window.PCTitle = function PCTitle() { } }; -window.PoliteRudeTitle = /** @param {App.Entity.SlaveState} slave */ function PoliteRudeTitle(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {string} + */ +window.PoliteRudeTitle = function PoliteRudeTitle(slave) { const V = State.variables; const PC = V.PC; const s = V.sEnunciate; @@ -1061,9 +1121,9 @@ window.PoliteRudeTitle = /** @param {App.Entity.SlaveState} slave */ function Po r += (PC.surname ? PC.surname : `${PC.name}${s}an`); } } else { - if (slave.intelligence+slave.intelligenceImplant < -95) { + if (slave.intelligence + slave.intelligenceImplant < -95) { r += V.titleEnunciate; - } else if (slave.intelligence+slave.intelligenceImplant > 50) { + } else if (slave.intelligence + slave.intelligenceImplant > 50) { r += (PC.title > 0 ? `Ma${s}ter` : `Mi${s}tre${ss}`); } else if (slave.trust > 0) { r += PC.name; @@ -1074,7 +1134,11 @@ window.PoliteRudeTitle = /** @param {App.Entity.SlaveState} slave */ function Po return r; }; -window.SlaveTitle = /** @param {App.Entity.SlaveState} slave */ function SlaveTitle(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {string} + */ +window.SlaveTitle = function SlaveTitle(slave) { const V = State.variables; let r = ""; if (V.newDescriptions === 1) { @@ -1202,7 +1266,7 @@ window.SlaveTitle = /** @param {App.Entity.SlaveState} slave */ function SlaveTi r = `indentured ${ r}`; } - if (slave.preg > slave.pregData.normalBirth/4 && slave.pregKnown === 1) { + if (slave.preg > slave.pregData.normalBirth / 4 && slave.pregKnown === 1) { r = `pregnant ${ r}`; } else if (slave.bellyFluid >= 5000) { r = `bloated ${ r}`; @@ -1215,7 +1279,8 @@ window.SlaveTitle = /** @param {App.Entity.SlaveState} slave */ function SlaveTi } } else { r = "slave"; /* I don't tihnk there is an 'else'? */ - if ((slave.dick === 0) && (slave.vagina === -1)) { /* NULLS */ + if ((slave.dick === 0) && (slave.vagina === -1)) { + /* NULLS */ r = "null"; if ((slave.lactation > 0) && (slave.boobs > 2000)) { r = `${r } cow`; @@ -1239,7 +1304,8 @@ window.SlaveTitle = /** @param {App.Entity.SlaveState} slave */ function SlaveTi } } - if ((slave.dick === 0) && (slave.vagina !== -1)) { /* FEMALES */ + if ((slave.dick === 0) && (slave.vagina !== -1)) { + /* FEMALES */ if (slave.visualAge > 55) { r = "GILF"; } else if (slave.visualAge > 35) { @@ -1263,9 +1329,11 @@ window.SlaveTitle = /** @param {App.Entity.SlaveState} slave */ function SlaveTi } if ((slave.dick !== 0) && (slave.vagina !== -1)) { - if (slave.balls > 0) { /* FUTANARI: cock & balls & vagina */ + if (slave.balls > 0) { + /* FUTANARI: cock & balls & vagina */ r = "futanari "; - } else { /* FUTANARI: cock & vagina */ + } else { + /* FUTANARI: cock & vagina */ r = "futa "; } if ((slave.lactation > 0) && (slave.boobs > 2000)) { @@ -1293,7 +1361,8 @@ window.SlaveTitle = /** @param {App.Entity.SlaveState} slave */ function SlaveTi } } - if ((slave.dick !== 0) && (slave.vagina === -1) && (slave.balls > 0) && (slave.boobs > 300) && (slave.butt > 2)) { /* SHEMALES: cock & balls, T&A above minimum */ + if ((slave.dick !== 0) && (slave.vagina === -1) && (slave.balls > 0) && (slave.boobs > 300) && (slave.butt > 2)) { + /* SHEMALES: cock & balls, T&A above minimum */ if (slave.visualAge > 55) { r = "sheGILF"; } else if (slave.visualAge > 35) { @@ -1319,7 +1388,8 @@ window.SlaveTitle = /** @param {App.Entity.SlaveState} slave */ function SlaveTi if ((slave.boobs < 300) || (slave.butt < 2)) { if ((slave.dick !== 0) && (slave.vagina === -1) && (slave.balls > 0)) { if ((slave.shoulders < 1) || (slave.muscles <= 30)) { - if ((slave.faceShape === "masculine") || (slave.faceShape === "androgynous")) { /* SISSIES: feminine shoulders or muscles, masculine faces */ + if ((slave.faceShape === "masculine") || (slave.faceShape === "androgynous")) { + /* SISSIES: feminine shoulders or muscles, masculine faces */ if (slave.visualAge > 55) { r = "sissyGILF"; } else if (slave.visualAge > 35) { @@ -1327,7 +1397,8 @@ window.SlaveTitle = /** @param {App.Entity.SlaveState} slave */ function SlaveTi } else { r = "sissy"; } - } else { /* TRAPS: feminine shoulders or muscles, feminine faces */ + } else { + /* TRAPS: feminine shoulders or muscles, feminine faces */ if (slave.visualAge > 55) { r = "trapGILF"; } else if (slave.visualAge > 35) { @@ -1349,7 +1420,8 @@ window.SlaveTitle = /** @param {App.Entity.SlaveState} slave */ function SlaveTi if ((slave.boobs < 300) || (slave.butt < 2)) { if ((slave.dick !== 0) && (slave.vagina === -1) && (slave.balls > 0)) { - if ((slave.shoulders > 1) || (slave.muscles >= 30)) { /* BITCHES: masculine shoulders or muscles */ + if ((slave.shoulders > 1) || (slave.muscles >= 30)) { + /* BITCHES: masculine shoulders or muscles */ r = "bitch"; if ((slave.muscles > 30) && (slave.height < 185)) { r = `muscle${ r}`; @@ -1417,7 +1489,7 @@ window.SlaveTitle = /** @param {App.Entity.SlaveState} slave */ function SlaveTi r = `indentured ${ r}`; } - if (slave.preg > slave.pregData.normalBirth/4 && slave.pregKnown === 1) { + if (slave.preg > slave.pregData.normalBirth / 4 && slave.pregKnown === 1) { r = `pregnant ${ r}`; } else if (slave.bellyFluid >= 5000) { r = `bloated ${ r}`; @@ -1432,7 +1504,10 @@ window.SlaveTitle = /** @param {App.Entity.SlaveState} slave */ function SlaveTi return r; }; -window.DegradingName = /** @param {App.Entity.SlaveState} slave */ function DegradingName(slave) { +/** + * @param {App.Entity.SlaveState} slave + */ +window.DegradingName = function DegradingName(slave) { const V = State.variables; const leadershipPosition = [ "be the Attendant", @@ -1448,7 +1523,8 @@ window.DegradingName = /** @param {App.Entity.SlaveState} slave */ function Degr "be the Nurse", "be your Head Girl", "guard you", - "recruit girls"]; + "recruit girls" + ]; const names = []; const suffixes = []; @@ -1497,8 +1573,7 @@ window.DegradingName = /** @param {App.Entity.SlaveState} slave */ function Degr case "mixed race": names.push("Mixed", "Mulatto", "Mutt"); break; - default: - break; + } } names.push(slave.hColor); @@ -1547,7 +1622,7 @@ window.DegradingName = /** @param {App.Entity.SlaveState} slave */ function Degr names.push("Fertile"); } } - if (slave.boobs*slave.lactation > 1000) { + if (slave.boobs * slave.lactation > 1000) { names.push("Creamy", "Milky"); suffixes.push("Cow"); } @@ -1577,7 +1652,7 @@ window.DegradingName = /** @param {App.Entity.SlaveState} slave */ function Degr names.push("Potent"); suffixes.push("Cannon", "Daddy"); } - if (slave.preg > slave.pregData.normalBirth/1.33) { + if (slave.preg > slave.pregData.normalBirth / 1.33) { if (slave.broodmother === 2) { names.push("Bursting", "Seeded"); suffixes.push("Factory", "Nursery"); @@ -1639,12 +1714,12 @@ window.DegradingName = /** @param {App.Entity.SlaveState} slave */ function Degr if (slave.skill.anal > 95) { suffixes.push("Asspussy", "Sphincter"); } - if (slave.intelligence+slave.intelligenceImplant > 50) { + if (slave.intelligence + slave.intelligenceImplant > 50) { names.push("Bright", "Clever", "Smart"); if (slave.intelligenceImplant >= 15) { names.push("College", "Graduate", "Nerdy"); } - } else if (slave.intelligence+slave.intelligenceImplant < -50) { + } else if (slave.intelligence + slave.intelligenceImplant < -50) { names.push("Cretin", "Dumb", "Retarded", "Stupid"); } if (slave.vagina === 1 && slave.skill.vaginal <= 10) { @@ -1689,16 +1764,20 @@ window.DegradingName = /** @param {App.Entity.SlaveState} slave */ function Degr suffixes.push("Futa"); } else { if (slave.balls > 0) { - if (slave.boobs > 300 && slave.butt > 2) { /* SHEMALES: cock & balls, T&A above minimum */ + if (slave.boobs > 300 && slave.butt > 2) { + /* SHEMALES: cock & balls, T&A above minimum */ suffixes.push("Shemale"); } else { if (slave.shoulders < 1 && slave.muscles <= 30) { - if (slave.faceShape === "masculine" || slave.faceShape === "androgynous") { /* SISSIES: feminine shoulders or muscles, masculine faces */ + if (slave.faceShape === "masculine" || slave.faceShape === "androgynous") { + /* SISSIES: feminine shoulders or muscles, masculine faces */ suffixes.push("Sissy"); - } else { /* TRAPS: feminine shoulders or muscles, feminine faces */ + } else { + /* TRAPS: feminine shoulders or muscles, feminine faces */ suffixes.push("Trap"); } - } else { /* BITCHES: masculine shoulders or muscles */ + } else { + /* BITCHES: masculine shoulders or muscles */ suffixes.push("Bitch"); } } @@ -1820,8 +1899,7 @@ window.DegradingName = /** @param {App.Entity.SlaveState} slave */ function Degr case "recruit girls": slave.slaveName = jsEither(["Cam", "Recruiter"]); break; - default: - break; + } } const surname = jsEither(suffixes); @@ -1832,7 +1910,11 @@ window.DegradingName = /** @param {App.Entity.SlaveState} slave */ function Degr slave.slaveSurname = surname; }; -window.SlaveSort = /** @param {App.Entity.SlaveState[]} slaves */ function SlaveSort(slaves, main = false) { +/** + * @param {App.Entity.SlaveState[]} slaves + * @param {boolean} main + */ +window.SlaveSort = function SlaveSort(slaves, main = false) { const V = State.variables; if (main) { switch (V.sortSlavesBy) { @@ -1887,7 +1969,12 @@ window.SlaveSort = /** @param {App.Entity.SlaveState[]} slaves */ function Slave } }; -window.slaveSortMinor = /** @param {App.Entity.SlaveState[]} slaves */ function slaveSortMinor(slaves) { +/** + * @param {App.Entity.SlaveState[]} slaves + */ +// this line is giving a false positive for some reason +// eslint-disable-next-line no-unused-vars +window.slaveSortMinor = function slaveSortMinor(slaves) { slaves = slaves.sort((a, b) => a.slaveName < b.slaveName ? -1 : 1); }; @@ -1945,7 +2032,12 @@ window.MenialPopCap = function MenialPopCap() { return r; }; -window.faceIncrease = /** @param {App.Entity.SlaveState} slave */ function faceIncrease(slave, amount) { +/** + * @param {App.Entity.SlaveState} slave + * @param {number} amount + * @returns {string} + */ +window.faceIncrease = function faceIncrease(slave, amount) { const pronouns = getPronouns(slave); const his = pronouns.possessive; const His = capFirstChar(his); @@ -1965,9 +2057,13 @@ window.faceIncrease = /** @param {App.Entity.SlaveState} slave */ function faceI slave.face = Math.clamp(slave.face + amount, -100, 100); if (slave.face > 95) slave.face = 100; return r; -}; +} -window.Deadliness = /** @param {App.Entity.SlaveState} slave */ function Deadliness(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {number} + */ +window.Deadliness = function Deadliness(slave) { const V = State.variables; let deadliness = 2; diff --git a/src/js/assignJS.js b/src/js/assignJS.js index f3e7b9462b266e9f0ad7572f45ae0d052acc01ed..e36c6b3e5bff089e0e223d6fb82c2bf6f6c0c651 100644 --- a/src/js/assignJS.js +++ b/src/js/assignJS.js @@ -1,5 +1,4 @@ /* eslint-disable no-case-declarations */ -/* eslint-disable no-undef */ window.assignJob = function assignJob(slave, job) { "use strict"; const V = State.variables; @@ -304,7 +303,7 @@ window.assignJob = function assignJob(slave, job) { } if (slave.assignmentVisible === 0 && Array.isArray(V.personalAttention)) { - const awi = V.personalAttention.findIndex(function(s) { return s.ID === slave.ID; }); + const awi = V.personalAttention.findIndex(function(s) {return s.ID === slave.ID;}); if (awi !== -1) { V.personalAttention.deleteAt(awi); if (V.personalAttention.length === 0) { @@ -490,12 +489,15 @@ window.removeJob = function removeJob(slave, assignment) { case "be your agent": case "live with your agent": slave.assignment = "rest"; - const _leaderIndex = V.leaders.findIndex(function(x) { return x.ID === slave.ID; }); + const _leaderIndex = V.leaders.findIndex(function(x) { + return x.ID === slave.ID; + }); if (_leaderIndex !== -1) V.leaders.deleteAt(_leaderIndex); - if (slave.relationshipTarget > 0) { /* following code assumes there can be at most one companion */ - const _lover = V.slaves.findIndex(function(s) { return haveRelationshipP(s, slave) && s.assignment === "live with your agent"; }); + if (slave.relationshipTarget > 0) { + /* following code assumes there can be at most one companion */ + const _lover = V.slaves.findIndex(function(s) {return haveRelationshipP(s, slave) && s.assignment === "live with your agent";}); if (_lover !== -1) { V.slaves[_lover].assignment = "rest"; V.slaves[_lover].assignmentVisible = 1; @@ -522,7 +524,8 @@ window.removeJob = function removeJob(slave, assignment) { return r; }; -window.resetJobIDArray = function resetJobIDArray() { /* todo: expand to all assignments */ +window.resetJobIDArray = function resetJobIDArray() { + /* todo: expand to all assignments */ const slaves = State.variables.slaves; const JobIDArray = { "rest": [], @@ -537,7 +540,7 @@ window.resetJobIDArray = function resetJobIDArray() { /* todo: expand to all ass "be a subordinate slave": [] }; - slaves.forEach(function (slave) { + slaves.forEach(function(slave) { if (JobIDArray.hasOwnProperty(slave.assignment)) JobIDArray[slave.assignment].push(slave.ID); }); @@ -548,7 +551,7 @@ window.resetJobIDArray = function resetJobIDArray() { /* todo: expand to all ass /** * Generates string with links for changing slave assignment */ -App.UI.jobLinks = function () { +App.UI.jobLinks = function() { "use strict"; const facilitiesOrder = [ /* sorted by improvement before work, within improvement in order of progress, within work alphabetical for facilities*/ @@ -567,10 +570,7 @@ App.UI.jobLinks = function () { App.Entity.facilities.servantsQuarters ]; - return { - assignments: assignmentLinks, - transfers: transferLinks - }; + return {assignments: assignmentLinks, transfers: transferLinks}; /** * Generates assignment links @@ -616,7 +616,7 @@ App.UI.jobLinks = function () { }(); App.UI.SlaveInteract = { - fucktoyPref: function () { + fucktoyPref: function() { let elem = jQuery('#fucktoypref'); elem.empty(); let res = ""; @@ -651,7 +651,7 @@ App.UI.SlaveInteract = { elem.append(ins); }, - assignmentBlock: function (blockId) { + assignmentBlock: function(blockId) { let res = App.UI.jobLinks.assignments(-1, undefined, () => { return `<<replace "#assign">>$activeSlave.assignment<</replace>><<replace "#${blockId}">><<= App.UI.SlaveInteract.assignmentBlock("${blockId}")>><<= App.UI.SlaveInteract.fucktoyPref()>><</replace>>`; }); diff --git a/src/js/colorModeJS.js b/src/js/colorModeJS.js index 38131f52fe3e43f0350ddbf4d7a97361358ca1d1..3c495cdb5229aa5ffa74cd92fb3820adc9554b35 100644 --- a/src/js/colorModeJS.js +++ b/src/js/colorModeJS.js @@ -1,5 +1,4 @@ -/* eslint-disable no-undef */ -window.flipColors = function (lightColorMap) { +window.flipColors = function(lightColorMap) { if (!window.savedColorMap) { window.savedColorMap = setColors(lightColorMap); } else { @@ -8,7 +7,7 @@ window.flipColors = function (lightColorMap) { } }; -window.setColors = function (colorMap) { +window.setColors = function(colorMap) { let originalState = []; let props = ["color", "backgroundColor", "backgroundImage"]; let styleSheetArray = Array.from(document.styleSheets); @@ -25,13 +24,11 @@ window.setColors = function (colorMap) { let newVal = colorMap[currentValue]; if (typeof newVal !== "undefined") { cssRule.style[propName] = newVal; - originalState.push( - { - element: cssRule, - propName: propName, - value: currentValue - } - ); + originalState.push({ + element: cssRule, + propName: propName, + value: currentValue + }); } } }); diff --git a/src/js/colorinput.js b/src/js/colorinput.js index 4aa2438276d69dfd21d06d4b4b0666526e90be97..066743e17728444ceeb71145bdbf4b66f7f96bf4 100644 --- a/src/js/colorinput.js +++ b/src/js/colorinput.js @@ -1,26 +1,26 @@ Macro.add("colorinput", { handler: function() { if (this.args.length < 2) { - var e = []; + let e = []; return this.args.length < 1 && e.push("variable name"), this.args.length < 2 && e.push("default value"), this.error("no " + e.join(" or ") + " specified"); } - if ("string" != typeof this.args[0]) return this.error("variable name argument is not a string"); - var varName = this.args[0].trim(); + if ("string" !== typeof this.args[0]) return this.error("variable name argument is not a string"); + let varName = this.args[0].trim(); if ("$" !== varName[0] && "_" !== varName[0]) return this.error('variable name "' + this.args[0] + '" is missing its sigil ($ or _)'); Config.debug && this.debugView.modes({ block: true }); - var r = Util.slugify(varName); - var value = this.args[1]; - var inputElement = document.createElement("input"), + let r = Util.slugify(varName); + let value = this.args[1]; + let inputElement = document.createElement("input"), passage = void 0; - var setargs = null; + let setargs = null; if (this.args.length > 3) { passage = this.args[2]; } else if (this.args.length > 2) { passage = this.args[2]; } - if (passage !== (void 0) && typeof(passage) === "object") { + if (passage !== (void 0) && typeof (passage) === "object") { passage = passage.link; } if (!passage) { @@ -29,27 +29,28 @@ Macro.add("colorinput", { function gotoPassage() { if (passage) { - var currentScrollPosition = window.pageYOffset; - var currentPassage = State.passage; + let currentScrollPosition = window.pageYOffset; + const currentPassage = State.passage; if (setargs) { Scripting.evalTwineScript(setargs); } Engine.play(passage); - if (currentPassage == passage) { + if (currentPassage === passage) { Scripting.evalJavaScript("window.scrollTo(0, " + currentScrollPosition + ");"); } } } jQuery(inputElement).attr({ - id: this.name + "-" + r, - name: this.name + "-" + r, - type: 'color', - value: value, - tabindex: 0 - }).addClass("macro-" + this.name) + id: this.name + "-" + r, + name: this.name + "-" + r, + type: 'color', + value: value, + tabindex: 0 + }).addClass("macro-" + this.name) .on("change", function() { State.setVar(varName, this.value); + // eslint-disable-next-line eqeqeq if (this.value != value) { // If the value has actually changed, reload the page. Note != and not !== because types might be different gotoPassage(); } diff --git a/src/js/datatypeCleanupJS.js b/src/js/datatypeCleanupJS.js index 1edb9708fd8882990bb8000f099b3981b251ee0d..2bdf933b8dd6984491f4a3c28a8778a4eaffa69e 100644 --- a/src/js/datatypeCleanupJS.js +++ b/src/js/datatypeCleanupJS.js @@ -1,4 +1,3 @@ -/* eslint-disable no-undef */ /** * Applies data scheme updates to the slave object * @@ -6,19 +5,23 @@ * and in general pays no attention to the property values unless they need to be changed due * to the schema change. */ -App.Entity.Utils.SlaveDataSchemeCleanup = (function () { +App.Entity.Utils.SlaveDataSchemeCleanup = (function() { "use strict"; return SlaveDataSchemeCleanup; - /** @param {App.Entity.SlaveState} slave */ - function SlaveDataSchemeCleanup(slave) { // eslint-disable-line no-unused-vars + /** + * @param {App.Entity.SlaveState} slave + */ + function SlaveDataSchemeCleanup(slave) { migratePorn(slave); migrateSkills(slave); migrateCounters(slave); migrateCustomProperties(slave); } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function migratePorn(slave) { if (!slave.hasOwnProperty("porn")) { slave.porn = new App.Entity.SlavePornPerformanceState(); @@ -45,7 +48,9 @@ App.Entity.Utils.SlaveDataSchemeCleanup = (function () { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function migrateSkills(slave) { if (!slave.hasOwnProperty("skill")) { slave.skill = new App.Entity.SlaveSkillsState(); @@ -91,7 +96,9 @@ App.Entity.Utils.SlaveDataSchemeCleanup = (function () { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function migrateCounters(slave) { if (!slave.hasOwnProperty("counter")) { slave.counter = new App.Entity.SlaveActionsCountersState(); @@ -123,7 +130,9 @@ App.Entity.Utils.SlaveDataSchemeCleanup = (function () { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function migrateCustomProperties(slave) { if (!slave.hasOwnProperty("custom")) { slave.custom = new App.Entity.SlaveCustomAddonsState(); @@ -223,7 +232,9 @@ window.SlaveDatatypeCleanup = (function SlaveDatatypeCleanup() { generatePronouns(slave); } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function slaveAgeDatatypeCleanup(slave) { slave.birthWeek = Math.clamp(+slave.birthWeek, 0, 51) || 0; if (slave.age > 0) { // delete slave.age? @@ -241,7 +252,9 @@ window.SlaveDatatypeCleanup = (function SlaveDatatypeCleanup() { slave.NCSyouthening = Math.max(+slave.NCSyouthening, 0) || 0; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function slavePhysicalDatatypeCleanup(slave) { if (typeof slave.nationality !== "string") { slave.nationality = "slave"; @@ -270,7 +283,9 @@ window.SlaveDatatypeCleanup = (function SlaveDatatypeCleanup() { slave.hips = Math.clamp(+slave.hips, -2, 3) || 0; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function slaveFaceDatatypeCleanup(slave) { slave.face = Math.clamp(+slave.face, -100, 100) || 0; if (typeof slave.faceShape !== "string") { @@ -294,7 +309,9 @@ window.SlaveDatatypeCleanup = (function SlaveDatatypeCleanup() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function slaveHairDatatypeCleanup(slave) { if (typeof slave.hColor !== "string") { slave.hColor = "brown"; @@ -333,7 +350,9 @@ window.SlaveDatatypeCleanup = (function SlaveDatatypeCleanup() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function slaveBoobsDatatypeCleanup(slave) { slave.boobs = Math.max(+slave.boobs, 100) || 200; if (typeof slave.boobShape !== "string") { @@ -354,7 +373,9 @@ window.SlaveDatatypeCleanup = (function SlaveDatatypeCleanup() { slave.lactationAdaptation = Math.clamp(+slave.lactationAdaptation, 0, 100) || 0; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function slaveButtDatatypeCleanup(slave) { if (slave.butt !== 0) { slave.butt = Math.clamp(+slave.butt, 0, 20) || 1; @@ -363,7 +384,9 @@ window.SlaveDatatypeCleanup = (function SlaveDatatypeCleanup() { slave.analArea = Math.max(+slave.analArea, 0) || 0; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function slaveNekoDatatypeCleanup(slave) { if (typeof slave.earShape !== "string") { slave.earShape = "normal"; @@ -391,7 +414,9 @@ window.SlaveDatatypeCleanup = (function SlaveDatatypeCleanup() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function slavePregnancyDatatypeCleanup(slave) { slave.induce = Math.clamp(+slave.induce, 0, 1) || 0; slave.labor = Math.clamp(+slave.labor, 0, 1) || 0; @@ -417,7 +442,9 @@ window.SlaveDatatypeCleanup = (function SlaveDatatypeCleanup() { WombNormalizePreg(slave); } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function slaveBellyDatatypeCleanup(slave) { slave.inflation = Math.clamp(+slave.inflation, 0, 3) || 0; if (typeof slave.inflationType !== "string") { @@ -437,7 +464,9 @@ window.SlaveDatatypeCleanup = (function SlaveDatatypeCleanup() { SetBellySize(slave); } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function slaveGenitaliaDatatypeCleanup(slave) { slave.vagina = Math.clamp(+slave.vagina, -1, 10) || 0; slave.vaginaLube = Math.clamp(+slave.vaginaLube, 0, 2) || 0; @@ -456,7 +485,9 @@ window.SlaveDatatypeCleanup = (function SlaveDatatypeCleanup() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function slaveImplantsDatatypeCleanup(slave) { slave.ageImplant = Math.clamp(+slave.ageImplant, 0, 1) || 0; slave.faceImplant = Math.clamp(+slave.faceImplant, 0, 100) || 0; @@ -473,7 +504,9 @@ window.SlaveDatatypeCleanup = (function SlaveDatatypeCleanup() { slave.hipsImplant = Math.clamp(+slave.hipsImplant, -1, 1) || 0; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function slavePiercingsDatatypeCleanup(slave) { slave.earPiercing = Math.clamp(+slave.earPiercing, 0, 2) || 0; slave.nosePiercing = Math.clamp(+slave.nosePiercing, 0, 2) || 0; @@ -490,7 +523,9 @@ window.SlaveDatatypeCleanup = (function SlaveDatatypeCleanup() { slave.anusPiercing = Math.clamp(+slave.anusPiercing, 0, 2) || 0; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function slaveTattooDatatypeCleanup(slave) { if (typeof slave.shouldersTat !== "string") { slave.shouldersTat = 0; @@ -533,7 +568,9 @@ window.SlaveDatatypeCleanup = (function SlaveDatatypeCleanup() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function slaveCosmeticsDatatypeCleanup(slave) { slave.makeup = Math.clamp(+slave.makeup, 0, 8) || 0; slave.nails = Math.clamp(+slave.nails, 0, 9) || 0; @@ -595,7 +632,9 @@ window.SlaveDatatypeCleanup = (function SlaveDatatypeCleanup() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function slaveDietDatatypeCleanup(slave) { if (typeof slave.diet !== "string") { slave.diet = "healthy"; @@ -612,7 +651,9 @@ window.SlaveDatatypeCleanup = (function SlaveDatatypeCleanup() { slave.curatives = Math.clamp(+slave.curatives, 0, 2) || 0; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function slavePornDatatypeCleanup(slave) { slave.pornFeed = Math.clamp(+slave.pornFeed, 0, 1) || 0; slave.pornFame = Math.max(+slave.pornFame, 0) || 0; @@ -664,7 +705,9 @@ window.SlaveDatatypeCleanup = (function SlaveDatatypeCleanup() { slave.porn.fame.pregnancy = Math.max(+slave.porn.fame.pregnancy, 0) || 0; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function slaveRelationDatatypeCleanup(slave) { slave.mother = +slave.mother || 0; slave.father = +slave.father || 0; @@ -679,7 +722,9 @@ window.SlaveDatatypeCleanup = (function SlaveDatatypeCleanup() { slave.cloneID = +slave.cloneID || 0; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function slaveSkillsDatatypeCleanup(slave) { slave.skill.oral = Math.clamp(+slave.skill.oral, 0, 100) || 0; slave.skill.vaginal = Math.clamp(+slave.skill.vaginal, 0, 100) || 0; @@ -705,7 +750,9 @@ window.SlaveDatatypeCleanup = (function SlaveDatatypeCleanup() { slave.skill.whore = Math.clamp(+slave.skill.whore, 0, 200) || 0; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function slaveStatCountDatatypeCleanup(slave) { slave.counter.oral = Math.max(+slave.counter.oral, 0) || 0; slave.counter.vaginal = Math.max(+slave.counter.vaginal, 0) || 0; @@ -726,7 +773,9 @@ window.SlaveDatatypeCleanup = (function SlaveDatatypeCleanup() { slave.bodySwap = Math.max(+slave.bodySwap, 0) || 0; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function slavePreferencesDatatypeCleanup(slave) { slave.energy = Math.clamp(+slave.energy, 0, 100) || 0; slave.need = Math.max(+slave.need, 0) || 0; @@ -737,7 +786,9 @@ window.SlaveDatatypeCleanup = (function SlaveDatatypeCleanup() { slave.fetishKnown = Math.clamp(+slave.fetishKnown, 0, 1) || 0; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function slaveRulesDatatypeCleanup(slave) { if (typeof slave.standardPunishment !== "string") { slave.standardPunishment = "situational"; @@ -755,7 +806,9 @@ window.SlaveDatatypeCleanup = (function SlaveDatatypeCleanup() { slave.rudeTitle = Math.clamp(+slave.rudeTitle, 0, 1) || 0; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function slaveCustomStatsDatatypeCleanup(slave) { if (typeof slave.custom.label !== "string") { slave.custom.label = ""; @@ -776,7 +829,9 @@ window.SlaveDatatypeCleanup = (function SlaveDatatypeCleanup() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function slaveMiscellaneousDatatypeCleanup(slave) { slave.weekAcquired = Math.max(+slave.weekAcquired, 0) || 0; slave.newGamePlus = Math.clamp(+slave.newGamePlus, 0, 1) || 0; @@ -1390,7 +1445,7 @@ window.PCDatatypeCleanup = function PCDatatypeCleanup() { PC.ballsImplant = Math.clamp(+PC.ballsImplant, 0, 4) || 0; PC.degeneracy = Math.max(+PC.degeneracy, 0) || 0; PC.birthWeek = Math.clamp(+PC.birthWeek, 0, 51) || 0; - if (PC.sexualEnergy !== 0 ) { + if (PC.sexualEnergy !== 0) { PC.sexualEnergy = +PC.sexualEnergy || 4; } PC.refreshmentType = Math.clamp(+PC.refreshmentType, 0, 6) || 0; @@ -1557,11 +1612,11 @@ window.ArcologyDatatypeCleanup = function ArcologyDatatypeCleanup() { } generateAssistantPronouns(); - V.foodCost = Math.trunc(2500/V.economy); - V.drugsCost = Math.trunc(10000/V.economy); - V.rulesCost = Math.trunc(10000/V.economy); - V.modCost = Math.trunc(5000/V.economy); - V.surgeryCost = Math.trunc(30000/V.economy); + V.foodCost = Math.trunc(2500 / V.economy); + V.drugsCost = Math.trunc(10000 / V.economy); + V.rulesCost = Math.trunc(10000 / V.economy); + V.modCost = Math.trunc(5000 / V.economy); + V.surgeryCost = Math.trunc(30000 / V.economy); V.facilityCost = +V.facilityCost || 100; V.policyCost = +V.policyCost || 5000; @@ -1856,11 +1911,13 @@ window.FacilityDatatypeCleanup = (function() { * It removes all the unneeded properties for the gene pool attributes. * @todo remove after refactoring the slave state class */ -App.Entity.Utils.GenePoolRecordCleanup = (function () { +App.Entity.Utils.GenePoolRecordCleanup = (function() { "use strict"; return GenePoolRecordCleanup; - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function GenePoolRecordCleanup(slave) { App.Entity.Utils.SlaveDataSchemeCleanup(slave); diff --git a/src/js/descriptionWidgets.js b/src/js/descriptionWidgets.js index 57a3172174a9c3df53cf17e99bcfa22cbced390a..cd503f1ab64be3e99df30b19e79387cfdbab47e7 100644 --- a/src/js/descriptionWidgets.js +++ b/src/js/descriptionWidgets.js @@ -1,8 +1,8 @@ /** * @param {App.Entity.SlaveState} slave - * @return {string} The slave's eyes + * @return {string} Slave's eyes */ -App.Desc.eyes = function (slave) { +App.Desc.eyes = function(slave) { "use strict"; const V = State.variables; let r = ``; @@ -247,7 +247,7 @@ App.Desc.eyes = function (slave) { * @param {App.Entity.SlaveState} slave * @returns {string} Slave's eye color */ -App.Desc.eyeColor = function (slave) { +App.Desc.eyeColor = function(slave) { "use strict"; let r; @@ -263,9 +263,9 @@ App.Desc.eyeColor = function (slave) { /** * @param {App.Entity.SlaveState} slave - * @returns {string} The slave's age and health + * @returns {string} Slave's age and health */ -App.Desc.ageAndHealth = function (slave) { +App.Desc.ageAndHealth = function(slave) { "use strict"; const V = State.variables; let r = ``; @@ -568,104 +568,112 @@ App.Desc.ageAndHealth = function (slave) { return r; }; -App.Desc.brand = - /** - * @param {App.Entity.SlaveState} slave - * @returns {string} Slave's brand - */ - function (slave) { - "use strict"; - let r = ``; - let bellyAccessory; - /* eslint-disable */ - let pronouns = getPronouns(slave); - let he = pronouns.pronoun; - let him = pronouns.object; - let his = pronouns.possessive; - let hers = pronouns.possessivePronoun; - let himself = pronouns.objectReflexive; - let boy = pronouns.noun; - let He = capFirstChar(he); - let His = capFirstChar(his); - /* eslint-enable */ +/** + * @param {App.Entity.SlaveState} slave + * @returns {string} Slave's brand + */ +App.Desc.brand = function(slave) { + "use strict"; + let r = ``; + let bellyAccessory; + /* eslint-disable */ + let pronouns = getPronouns(slave); + let he = pronouns.pronoun; + let him = pronouns.object; + let his = pronouns.possessive; + let hers = pronouns.possessivePronoun; + let himself = pronouns.objectReflexive; + let boy = pronouns.noun; + let He = capFirstChar(he); + let His = capFirstChar(his); + /* eslint-enable */ - if (slave.brand) { - bellyAccessory = slave.bellyAccessory; - if (setup.fakeBellies.includes(bellyAccessory) && slave.brandLocation === "belly") { - r += `${His} fake belly has ${slave.brand} branded on it. `; - } else { - r += `${He} has ${slave.brand} branded into the flesh of ${his} ${slave.brandLocation}. `; - } + if (slave.brand) { + bellyAccessory = slave.bellyAccessory; + if (setup.fakeBellies.includes(bellyAccessory) && slave.brandLocation === "belly") { + r += `${His} fake belly has ${slave.brand} branded on it. `; + } else { + r += `${He} has ${slave.brand} branded into the flesh of ${his} ${slave.brandLocation}. `; } return r; - }; + } +} -App.Desc.amputee = - /** - * @param {App.Entity.SlaveState} slave - * @returns {string} Description of slave's amputation, if present - */ - function (slave) { - "use strict"; - let r = ``; - /* eslint-disable */ - let pronouns = getPronouns(slave); - let he = pronouns.pronoun; - let him = pronouns.object; - let his = pronouns.possessive; - let hers = pronouns.possessivePronoun; - let himself = pronouns.objectReflexive; - let boy = pronouns.noun; - let He = capFirstChar(he); - let His = capFirstChar(his); - /* eslint-enable */ +/** + * @param {App.Entity.SlaveState} slave + * @returns {string} Description of slave's amputation, if present + */ +App.Desc.amputee = function(slave) { + "use strict"; + let r = ``; + /* eslint-disable */ + let pronouns = getPronouns(slave); + let he = pronouns.pronoun; + let him = pronouns.object; + let his = pronouns.possessive; + let hers = pronouns.possessivePronoun; + let himself = pronouns.objectReflexive; + let boy = pronouns.noun; + let He = capFirstChar(he); + let His = capFirstChar(his); + /* eslint-enable */ - if (slave.amp) { - if (slave.amp === -1) { - r += `${slave.slaveName} is a <span class=pink>quadruple amputee,</span> but ${he}'s equipped with a set of modern prosthetic limbs that allow ${him} a fairly normal life. `; - } else if (slave.amp === -2) { - r += `${slave.slaveName} is a <span class=pink>quadruple amputee,</span> but ${he}'s equipped with P-Limbs customized for sex. ${His} fingertips vibrate, ${his} finger joints are masked to prevent pinching, and ${his} hands can dispense lube. `; - } else if (slave.amp === -3) { - r += `${slave.slaveName} is a <span class=pink>quadruple amputee,</span> but ${he}'s equipped with P-Limbs customized to look natural. They are covered in a material that closely mimics living ${slave.skin} skin, and their servos are noise dampened. `; - } else if (slave.amp === -4) { - r += `${slave.slaveName} is a <span class=pink>quadruple amputee,</span> but ${he}'s equipped with P-Limbs customized for combat. They're hardened, strengthened, and more responsive, and they conceal taser knuckles and extensible forearm blades. `; - } else if (slave.amp === -5) { - r += `${slave.slaveName} is a <span class=pink>quadruple amputee,</span> but ${he}'s equipped with advanced cybernetic P-Limbs. The ultimate fusion of combat effectiveness and instruments of pleasure, they're capable of performing multiple functions. They can enhance sex through ${his} vibrating hands and increase ${his} combat skills with hardened, yet flexible artificial muscles. They have an advanced artificial skin that can send electrical impulses that can cause stimulation or extreme pain. `; - } else if (slave.amp > 0) { - r += `${slave.slaveName} is a <span class=pink>quadruple amputee,</span> making ${him} a convenient torso-only sex toy. `; - } else { - r += `The most obvious thing about ${slave.slaveName} is that ${he} is a <span class=pink>quadruple amputee:</span> ${he} has neither arms nor legs. `; - } + if (slave.amp) { + if (slave.amp === -1) { + r += `${slave.slaveName} is a <span class="pink">quadruple amputee,</span> but ${he}'s equipped with a set of modern prosthetic limbs that allow ${him} a fairly normal life. `; + } else if (slave.amp === -2) { + r += `${slave.slaveName} is a <span class="pink">quadruple amputee,</span> but ${he}'s equipped with P-Limbs customized for sex. ${His} fingertips vibrate, ${his} finger joints are masked to prevent pinching, and ${his} hands can dispense lube. `; + } else if (slave.amp === -3) { + r += `${slave.slaveName} is a <span class="pink">quadruple amputee,</span> but ${he}'s equipped with P-Limbs customized to look natural. They are covered in a material that closely mimics living ${slave.skin} skin, and their servos are noise dampened. `; + } else if (slave.amp === -4) { + r += `${slave.slaveName} is a <span class="pink">quadruple amputee,</span> but ${he}'s equipped with P-Limbs customized for combat. They're hardened, strengthened, and more responsive, and they conceal taser knuckles and extensible forearm blades. `; + } else if (slave.amp === -5) { + r += `${slave.slaveName} is a <span class="pink">quadruple amputee,</span> but ${he}'s equipped with advanced cybernetic P-Limbs. The ultimate fusion of combat effectiveness and instruments of pleasure, they're capable of performing multiple functions. They can enhance sex through ${his} vibrating hands and increase ${his} combat skills with hardened, yet flexible artificial muscles. They have an advanced artificial skin that can send electrical impulses that can cause stimulation or extreme pain. `; + } else if (slave.amp > 0) { + r += `${slave.slaveName} is a <span class="pink">quadruple amputee,</span> making ${him} a convenient torso-only sex toy. `; + } else { + r += `The most obvious thing about ${slave.slaveName} is that ${he} is a <span class="pink">quadruple amputee:</span> ${he} has neither arms nor legs. `; } return r; - }; + } +} + +/** + * @param {App.Entity.SlaveState} slave + * @returns {string} Description of slave's waist + */ +App.Desc.waist = function(slave) { + "use strict"; + const V = State.variables; + let r = ``; + let belly; + let woman; + /* eslint-disable */ + let pronouns = getPronouns(slave); + let he = pronouns.pronoun; + let him = pronouns.object; + let his = pronouns.possessive; + let hers = pronouns.possessivePronoun; + let himself = pronouns.objectReflexive; + let boy = pronouns.noun; + let He = capFirstChar(he); + let His = capFirstChar(his); + /* eslint-enable */ -App.Desc.waist = - /** - * @param {App.Entity.SlaveState} slave - * @returns {string} Description of slave's waist - */ - function (slave) { - "use strict"; - const V = State.variables; - let r = ``; - let belly; - let woman; - /* eslint-disable */ - let pronouns = getPronouns(slave); - let he = pronouns.pronoun; - let him = pronouns.object; - let his = pronouns.possessive; - let hers = pronouns.possessivePronoun; - let himself = pronouns.objectReflexive; - let boy = pronouns.noun; - let He = capFirstChar(he); - let His = capFirstChar(his); - /* eslint-enable */ + (boy === "girl" ? woman = "woman" : woman = "man"); + if (slave.belly >= 1500) { + belly = bellyAdjective(slave); + } - (boy === "girl" ? woman = "woman" : woman = "man"); - if (slave.belly >= 1500) { - belly = bellyAdjective(slave); + r += `${He} has `; + if (slave.waist > 95) { + r += `a badly <span class="red">masculine waist</span> that ruins ${his} figure`; + if (slave.weight > 30) { + r += ` and greatly exaggerates how fat ${he} is. `; + } else if (slave.weight < -30) { + r += ` despite how thin ${he} is. `; + } else { + r += `. `; } r += `${He} has `; @@ -688,27 +696,27 @@ App.Desc.waist = r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; } } - } else if (slave.belly < 300000) { - r += `${His} ${belly} belly is hidden by ${his} thick waist. `; - } else if (slave.belly < 450000) { - r += `${His} ${belly} belly can be seen around ${his} thick waist. `; - } else if (slave.belly < 600000) { - r += `${His} ${belly} belly can clearly be seen around ${his} thick waist. `; - if (slave.preg > 3) { - if (slave.belly > (slave.pregAdaptation * 1000)) { - r += `${His} waist is swollen wider than usual by ${his} crowded womb in its search for more room, leaving ${his} original waistline only visible from behind. `; - } else { - r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; - } + } + } else if (slave.belly < 300000) { + r += `${His} ${belly} belly is hidden by ${his} thick waist. `; + } else if (slave.belly < 450000) { + r += `${His} ${belly} belly can be seen around ${his} thick waist. `; + } else if (slave.belly < 600000) { + r += `${His} ${belly} belly can clearly be seen around ${his} thick waist. `; + if (slave.preg > 3) { + if (slave.belly > (slave.pregAdaptation * 1000)) { + r += `${His} waist is swollen wider than usual by ${his} crowded womb in its search for more room, leaving ${his} original waistline only visible from behind. `; + } else { + r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; } - } else if (slave.belly < 750000) { - r += `${His} ${belly} belly lewdly bulges around ${his} thick waist. `; - if (slave.preg > 3) { - if (slave.belly > (slave.pregAdaptation * 1000)) { - r += `${His} waist is greatly distended by ${his} overfilled womb in its desperate search for more room, leaving ${his} original waistline only visible from behind. `; - } else { - r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; - } + } + } else if (slave.belly < 750000) { + r += `${His} ${belly} belly lewdly bulges around ${his} thick waist. `; + if (slave.preg > 3) { + if (slave.belly > (slave.pregAdaptation * 1000)) { + r += `${His} waist is greatly distended by ${his} overfilled womb in its desperate search for more room, leaving ${his} original waistline only visible from behind. `; + } else { + r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; } } } @@ -744,14 +752,18 @@ App.Desc.waist = r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; } } - } else if (slave.belly < 750000) { - r += `${His} ${belly} belly lewdly bulges around ${his} chunky waist. `; - if (slave.preg > 3) { - if (slave.belly > (slave.pregAdaptation * 1000)) { - r += `${His} waist is greatly distended by ${his} overfilled womb in its desperate search for more room, leaving ${his} original waistline only visible from behind. `; - } else { - r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; - } + } + } else if (slave.belly < 150000) { + r += `${His} ${belly} belly is hidden by ${his} chunky waist. `; + } else if (slave.belly < 450000) { + r += `${His} ${belly} belly can be seen around ${his} chunky waist. `; + } else if (slave.belly < 600000) { + r += `${His} ${belly} belly can clearly be seen around ${his} chunky waist. `; + if (slave.preg > 3) { + if (slave.belly > (slave.pregAdaptation * 1000)) { + r += `${His} waist is swollen wider than usual by ${his} crowded womb in its search for more room, leaving ${his} original waistline only visible from behind. `; + } else { + r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; } } } @@ -770,195 +782,211 @@ App.Desc.waist = } else { r += `. `; } - if (slave.belly >= 1500) { - if (slave.belly >= 750000) { - r += `${His} ${belly} belly grotesquely bulges around ${his} waist. `; - if (slave.preg > 3) { - if (slave.belly > (slave.pregAdaptation * 1000)) { - r += `${His} waist is horribly distended by ${his} bursting womb in a last ditch effort to find more room for ${his} children, leaving ${his} original waistline barely visible from behind. `; - } else { - r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; - } - } - } else if (slave.belly < 10000) { - r += `From behind, ${his} figure hides ${his} ${belly} belly. `; - } else if (slave.belly < 200000) { - r += `From behind, ${his} figure barely hides ${his} ${belly} belly. `; - } else if (slave.belly < 300000) { - r += `${His} ${belly} belly can be seen around ${his} waist. `; - } else if (slave.belly < 450000) { - r += `${His} ${belly} belly can clearly be seen around ${his} waist. `; - } else if (slave.belly < 600000) { - r += `${His} ${belly} belly can clearly be seen around ${his} waist. `; - if (slave.preg > 3) { - if (slave.belly > (slave.pregAdaptation * 1000)) { - r += `${His} waist is swollen wider than usual by ${his} crowded womb in its search for more room, leaving ${his} original waistline only visible from behind. `; - } else { - r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; - } - } - } else if (slave.belly < 750000) { - r += `${His} ${belly} belly lewdly bulges around ${his} waist. `; - if (slave.preg > 3) { - if (slave.belly > (slave.pregAdaptation * 1000)) { - r += `${His} waist is greatly distended by ${his} overfilled womb in its desperate search for more room, leaving ${his} original waistline only visible from behind. `; - } else { - r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; - } + } + } else if (slave.waist > 10) { + r += `an <span class="red">unattractive waist</span> that conceals ${his} `; + if (slave.visualAge > 25) { + r += `girlish`; + } else { + r += `womanly`; + } + r += ` figure`; + if (slave.weight > 30) { + r += ` and accentuates how fat ${he} is. `; + } else if (slave.weight < -30) { + r += ` despite how thin ${he} is. `; + } else { + r += `. `; + } + if (slave.belly >= 1500) { + if (slave.belly >= 750000) { + r += `${His} ${belly} belly grotesquely bulges around ${his} waist. `; + if (slave.preg > 3) { + if (slave.belly > (slave.pregAdaptation * 1000)) { + r += `${His} waist is horribly distended by ${his} bursting womb in a last ditch effort to find more room for ${his} children, leaving ${his} original waistline barely visible from behind. `; + } else { + r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; } } } - } else if (slave.waist > -10) { - r += `an average waist for a `; - if (slave.visualAge > 25) { - r += `${boy}`; - } else { - r += `${woman}`; + } else if (slave.belly < 150000) { + r += `${His} ${belly} belly is hidden by ${his} chunky waist. `; + } else if (slave.belly < 450000) { + r += `${His} ${belly} belly can be seen around ${his} chunky waist. `; + } else if (slave.belly < 600000) { + r += `${His} ${belly} belly can clearly be seen around ${his} chunky waist. `; + if (slave.preg > 3) { + if (slave.belly > (slave.pregAdaptation * 1000)) { + r += `${His} waist is swollen wider than usual by ${his} crowded womb in its search for more room, leaving ${his} original waistline only visible from behind. `; + } else { + r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; + } } - if (slave.weight > 30) { - r += `, though it looks broader since ${he}'s fat. `; - } else if (slave.weight < -30) { - r += `, though it looks narrower since ${he}'s thin. `; - } else { - r += `. `; + } else if (slave.belly < 750000) { + r += `${His} ${belly} belly lewdly bulges around ${his} chunky waist. `; + if (slave.preg > 3) { + if (slave.belly > (slave.pregAdaptation * 1000)) { + r += `${His} waist is greatly distended by ${his} overfilled womb in its desperate search for more room, leaving ${his} original waistline only visible from behind. `; + } else { + r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; + } } - if (slave.belly >= 1500) { - if (slave.belly >= 750000) { - r += `${His} ${belly} belly grotesquely bulges around ${his} waist. `; - if (slave.preg > 3) { - if (slave.belly > (slave.pregAdaptation * 1000)) { - r += `${His} waist is horribly distended by ${his} bursting womb in a last ditch effort to find more room for ${his} children, leaving ${his} original waistline barely visible from behind. `; - } else { - r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; - } - } - } else if (slave.belly < 10000) { - r += `From behind, ${his} figure hides ${his} ${belly} belly. `; - } else if (slave.belly < 200000) { - r += `From behind, ${his} figure barely hides ${his} ${belly} belly. `; - } else if (slave.belly < 300000) { - r += `${His} ${belly} belly can be seen around ${his} waist. `; - } else if (slave.belly < 450000) { - r += `${His} ${belly} belly can clearly be seen around ${his} waist. `; - } else if (slave.belly < 600000) { - r += `${His} ${belly} belly can clearly be seen around ${his} waist. `; - if (slave.preg > 3) { - if (slave.belly > (slave.pregAdaptation * 1000)) { - r += `${His} waist is swollen wider than usual by ${his} crowded womb in its search for more room, leaving ${his} original waistline only visible from behind. `; - } else { - r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; - } - } - } else if (slave.belly < 750000) { - r += `${His} ${belly} belly lewdly bulges around ${his} waist. `; - if (slave.preg > 3) { - if (slave.belly > (slave.pregAdaptation * 1000)) { - r += `${His} waist is greatly distended by ${his} overfilled womb in its desperate search for more room, leaving ${his} original waistline only visible from behind. `; - } else { - r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; - } + } + } else if (slave.waist > -10) { + r += `an average waist for a `; + if (slave.visualAge > 25) { + r += `${boy}`; + } else { + r += `${woman}`; + } + if (slave.weight > 30) { + r += `, though it looks broader since ${he}'s fat. `; + } else if (slave.weight < -30) { + r += `, though it looks narrower since ${he}'s thin. `; + } else { + r += `. `; + } + if (slave.belly >= 1500) { + if (slave.belly >= 750000) { + r += `${His} ${belly} belly grotesquely bulges around ${his} waist. `; + if (slave.preg > 3) { + if (slave.belly > (slave.pregAdaptation * 1000)) { + r += `${His} waist is horribly distended by ${his} bursting womb in a last ditch effort to find more room for ${his} children, leaving ${his} original waistline barely visible from behind. `; + } else { + r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; } } } - } else if (slave.waist > -40) { - r += `a nice <span class=pink>feminine waist</span> that gives ${him} a `; - if (slave.visualAge > 25) { - r += `girlish`; - } else { - r += `womanly`; + } else if (slave.belly < 10000) { + r += `From behind, ${his} figure hides ${his} ${belly} belly. `; + } else if (slave.belly < 200000) { + r += `From behind, ${his} figure barely hides ${his} ${belly} belly. `; + } else if (slave.belly < 300000) { + r += `${His} ${belly} belly can be seen around ${his} waist. `; + } else if (slave.belly < 450000) { + r += `${His} ${belly} belly can clearly be seen around ${his} waist. `; + } else if (slave.belly < 600000) { + r += `${His} ${belly} belly can clearly be seen around ${his} waist. `; + if (slave.preg > 3) { + if (slave.belly > (slave.pregAdaptation * 1000)) { + r += `${His} waist is swollen wider than usual by ${his} crowded womb in its search for more room, leaving ${his} original waistline only visible from behind. `; + } else { + r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; + } } - r += ` figure`; - if (slave.weight > 30) { - r += ` despite ${his} extra weight. `; - } else if (slave.weight < -30) { - r += ` and accentuates how thin ${he} is. `; - } else { - r += `. `; + } else if (slave.belly < 750000) { + r += `${His} ${belly} belly lewdly bulges around ${his} waist. `; + if (slave.preg > 3) { + if (slave.belly > (slave.pregAdaptation * 1000)) { + r += `${His} waist is greatly distended by ${his} overfilled womb in its desperate search for more room, leaving ${his} original waistline only visible from behind. `; + } else { + r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; + } } - if (slave.belly >= 1500) { - if (slave.belly >= 750000) { - r += `${His} ${belly} belly grotesquely bulges around ${his} waist. `; - if (slave.preg > 3) { - if (slave.belly > (slave.pregAdaptation * 1000)) { - r += `${His} waist is horribly distended by ${his} bursting womb in a last ditch effort to find more room for ${his} children, leaving ${his} original waistline barely visible from behind. `; - } else { - r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; - } - } - } else if (slave.belly < 10000) { - r += `From behind, ${his} figure hides ${his} ${belly} belly. `; - } else if (slave.belly < 100000) { - r += `From behind, ${his} figure barely hides ${his} ${belly} belly. `; - } else if (slave.belly < 300000) { - r += `${His} ${belly} belly can be seen around ${his} waist. `; - } else if (slave.belly < 450000) { - r += `${His} ${belly} belly can clearly be seen around ${his} waist. `; - } else if (slave.belly < 600000) { - r += `${His} ${belly} belly can clearly be seen around ${his} waist. `; - if (slave.preg > 3) { - if (slave.belly > (slave.pregAdaptation * 1000)) { - r += `${His} waist is swollen wider than usual by ${his} crowded womb in its search for more room, leaving ${his} original waistline only visible from behind. `; - } else { - r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; - } - } - } else if (slave.belly < 750000) { - r += `${His} ${belly} belly lewdly bulges around ${his} waist. `; - if (slave.preg > 3) { - if (slave.belly > (slave.pregAdaptation * 1000)) { - r += `${His} waist is greatly distended by ${his} overfilled womb in its desperate search for more room, leaving ${his} original waistline only visible from behind. `; - } else { - r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; - } + } + } else if (slave.waist > -40) { + r += `a nice <span class="pink">feminine waist</span> that gives ${him} a `; + if (slave.visualAge > 25) { + r += `girlish`; + } else { + r += `womanly`; + } + r += ` figure`; + if (slave.weight > 30) { + r += ` despite ${his} extra weight. `; + } else if (slave.weight < -30) { + r += ` and accentuates how thin ${he} is. `; + } else { + r += `. `; + } + if (slave.belly >= 1500) { + if (slave.belly >= 750000) { + r += `${His} ${belly} belly grotesquely bulges around ${his} waist. `; + if (slave.preg > 3) { + if (slave.belly > (slave.pregAdaptation * 1000)) { + r += `${His} waist is horribly distended by ${his} bursting womb in a last ditch effort to find more room for ${his} children, leaving ${his} original waistline barely visible from behind. `; + } else { + r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; } } } - } else if (slave.waist > -95) { - r += `a hot <span class=pink>wasp waist</span> that gives ${him} an hourglass figure`; - if (slave.weight > 30) { - r += ` despite $his extra weight. `; - } else if (slave.weight < -30) { - r += ` further accentuated by how thin $he is. `; - } else { - r += `. `; + } else if (slave.belly < 10000) { + r += `From behind, ${his} figure hides ${his} ${belly} belly. `; + } else if (slave.belly < 200000) { + r += `From behind, ${his} figure barely hides ${his} ${belly} belly. `; + } else if (slave.belly < 300000) { + r += `${His} ${belly} belly can be seen around ${his} waist. `; + } else if (slave.belly < 450000) { + r += `${His} ${belly} belly can clearly be seen around ${his} waist. `; + } else if (slave.belly < 600000) { + r += `${His} ${belly} belly can clearly be seen around ${his} waist. `; + if (slave.preg > 3) { + if (slave.belly > (slave.pregAdaptation * 1000)) { + r += `${His} waist is swollen wider than usual by ${his} crowded womb in its search for more room, leaving ${his} original waistline only visible from behind. `; + } else { + r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; + } } - if (slave.belly >= 1500) { - if (slave.belly >= 750000) { - r += `${His} ${belly} belly grotesquely bulges around ${his} narrow waist and continues `; - if (slave.belly >= 1000000) { - r += `quite the distance`; + } else if (slave.belly < 750000) { + r += `${His} ${belly} belly lewdly bulges around ${his} waist. `; + if (slave.preg > 3) { + if (slave.belly > (slave.pregAdaptation * 1000)) { + r += `${His} waist is greatly distended by ${his} overfilled womb in its desperate search for more room, leaving ${his} original waistline only visible from behind. `; + } else { + r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; + } + } + } + + } else if (slave.waist > -40) { + r += `a nice <span class="pink">feminine waist</span> that gives ${him} a ` + if (slave.visualAge > 25) { + r += `girlish`; + } else { + r += `womanly`; + } + r += ` figure`; + if (slave.weight > 30) { + r += ` despite ${his} extra weight. `; + } else if (slave.weight < -30) { + r += ` and accentuates how thin ${he} is. `; + } else { + r += `. `; + } + if (slave.belly >= 1500) { + if (slave.belly >= 750000) { + r += `${His} ${belly} belly grotesquely bulges around ${his} waist. `; + if (slave.preg > 3) { + if (slave.belly > (slave.pregAdaptation * 1000)) { + r += `${His} waist is horribly distended by ${his} bursting womb in a last ditch effort to find more room for ${his} children, leaving ${his} original waistline barely visible from behind. `; } else { - r += `over half a `; - if (V.showInches === 2) { - r += `yard`; - } else { - r += `meter`; - } - r += ` farther to either side. `; + r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; } - if (slave.preg > 3) { - if (slave.belly > (slave.pregAdaptation * 1000)) { - r += `${His} waist is horribly distended by ${his} bursting womb in a last ditch effort to find more room for ${his} children, leaving ${his} original waistline barely visible from behind. `; - } else { - r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; - } + } + } else if (slave.belly < 10000) { + r += `From behind, ${his} figure hides ${his} ${belly} belly. `; + } else if (slave.belly < 100000) { + r += `From behind, ${his} figure barely hides ${his} ${belly} belly. `; + } else if (slave.belly < 300000) { + r += `${His} ${belly} belly can be seen around ${his} waist. `; + } else if (slave.belly < 450000) { + r += `${His} ${belly} belly can clearly be seen around ${his} waist. `; + } else if (slave.belly < 600000) { + r += `${His} ${belly} belly can clearly be seen around ${his} waist. `; + if (slave.preg > 3) { + if (slave.belly > (slave.pregAdaptation * 1000)) { + r += `${His} waist is swollen wider than usual by ${his} crowded womb in its search for more room, leaving ${his} original waistline only visible from behind. `; + } else { + r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; } - } else if (slave.belly < 5000) { - r += `From behind, ${his} narrow figure hides ${his} ${belly} belly. `; - } else if (slave.belly < 80000) { - r += `From behind, ${his} narrow figure barely hides ${his} ${belly} belly. `; - } else if (slave.belly < 100000) { - r += `${His} ${belly} belly can be seen around ${his} narrow waist. `; - } else if (slave.belly < 450000) { - r += `${His} ${belly} belly lewdly extends past ${his} narrow waist. `; - } else if (slave.belly < 600000) { - r += `${His} ${belly} belly lewdly distends far to either side of ${his} narrow waist. `; - if (slave.preg > 3) { - if (slave.belly > (slave.pregAdaptation * 1000)) { - r += `${His} waist is swollen wider than usual by ${his} crowded womb in its search for more room, leaving ${his} original waistline only visible from behind. `; - } else { - r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; - } + } + } else if (slave.belly < 750000) { + r += `${His} ${belly} belly lewdly bulges around ${his} waist. `; + if (slave.preg > 3) { + if (slave.belly > (slave.pregAdaptation * 1000)) { + r += `${His} waist is greatly distended by ${his} overfilled womb in its desperate search for more room, leaving ${his} original waistline only visible from behind. `; + } else { + r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; } } else if (slave.belly < 750000) { r += `${His} ${belly} belly lewdly bulges to either side of ${his} narrow waist and continues for nearly half a `; @@ -967,18 +995,11 @@ App.Desc.waist = } else { r += `meter`; } - r += `in both directions. `; - if (slave.preg > 3) { - if (slave.belly > (slave.pregAdaptation * 1000)) { - r += `${His} waist is greatly distended by ${his} overfilled womb in its desperate search for more room, leaving ${his} original waistline barely visible from behind. `; - } else { - r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; - } - } + r += ` farther to either side. `; } } } else { - r += `an <span class=pink>absurdly narrow waist</span> that gives ${him} a cartoonishly hourglass figure`; + r += `an <span class="pink">absurdly narrow waist</span> that gives ${him} a cartoonishly hourglass figure`; if (slave.weight > 30) { r += ` made even more ludicrous by ${his} extra weight. `; } else if (slave.weight < -30) { @@ -992,39 +1013,39 @@ App.Desc.waist = if (slave.belly >= 1000000) { r += `quite the distance`; } else { - r += `over half a `; - if (V.showInches === 2) { - r += `yard`; - } else { - r += `meter`; - } - r += ` farther to either side. `; + r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; } - if (slave.preg > 3) { - if (slave.belly > (slave.pregAdaptation * 1000)) { - r += `${His} waist is horribly distended by ${his} bursting womb in a last ditch effort to find more room for ${his} children, leaving ${his} original waistline barely visible from behind. `; - } else { - r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; - } + } + } else if (slave.belly < 5000) { + r += `From behind, ${his} narrow figure hides ${his} ${belly} belly. `; + } else if (slave.belly < 80000) { + r += `From behind, ${his} narrow figure barely hides ${his} ${belly} belly. `; + } else if (slave.belly < 100000) { + r += `${His} ${belly} belly can be seen around ${his} narrow waist. `; + } else if (slave.belly < 450000) { + r += `${His} ${belly} belly lewdly extends past ${his} narrow waist. `; + } else if (slave.belly < 600000) { + r += `${His} ${belly} belly lewdly distends far to either side of ${his} narrow waist. `; + if (slave.preg > 3) { + if (slave.belly > (slave.pregAdaptation * 1000)) { + r += `${His} waist is swollen wider than usual by ${his} crowded womb in its search for more room, leaving ${his} original waistline only visible from behind. `; + } else { + r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; } - } else if (slave.belly < 2000) { - r += `From behind, ${his} narrow figure hides ${his} ${belly} belly. `; - } else if (slave.belly < 5000) { - r += `From behind, ${his} narrow figure barely hides ${his} ${belly} belly. `; - } else if (slave.belly < 8000) { - r += `${His} ${belly} belly can be seen around ${his} narrow waist. `; - } else if (slave.belly < 15000) { - r += `${His} ${belly} belly lewdly extends past ${his} narrow waist. `; - } else if (slave.belly < 45000) { - r += `${His} ${belly} belly lewdly distends far to either side of ${his} narrow waist. `; - } else if (slave.belly < 600000) { - r += `${His} ${belly} belly lewdly distends far to either side of ${his} narrow waist. `; - if (slave.preg > 3) { - if (slave.belly > (slave.pregAdaptation * 1000)) { - r += `${His} waist is swollen wider than usual by ${his} crowded womb in its search for more room, leaving ${his} original waistline only visible from behind. `; - } else { - r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; - } + } + } else if (slave.belly < 750000) { + r += `${His} ${belly} belly lewdly bulges to either side of ${his} narrow waist and continues for nearly half a ` + if (V.showInches === 2) { + r += `yard`; + } else { + r += `meter`; + } + r += `in both directions. `; + if (slave.preg > 3) { + if (slave.belly > (slave.pregAdaptation * 1000)) { + r += `${His} waist is greatly distended by ${his} overfilled womb in its desperate search for more room, leaving ${his} original waistline barely visible from behind. `; + } else { + r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; } } else if (slave.belly < 750000) { r += `${His} ${belly} belly lewdly bulges to either side of ${his} narrow waist and continues for nearly half a `; @@ -1033,16 +1054,51 @@ App.Desc.waist = } else { r += `meter`; } - r += ` in both directions. `; - if (slave.preg > 3) { - if (slave.belly > (slave.pregAdaptation * 1000)) { - r += `${His} waist is greatly distended by ${his} overfilled womb in its desperate search for more room, leaving ${his} original waistline barely visible from behind. `; - } else { - r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; - } + r += ` farther to either side. `; + } + if (slave.preg > 3) { + if (slave.belly > (slave.pregAdaptation * 1000)) { + r += `${His} waist is horribly distended by ${his} bursting womb in a last ditch effort to find more room for ${his} children, leaving ${his} original waistline barely visible from behind. `; + } else { + r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; + } + } + } else if (slave.belly < 2000) { + r += `From behind, ${his} narrow figure hides ${his} ${belly} belly. `; + } else if (slave.belly < 5000) { + r += `From behind, ${his} narrow figure barely hides ${his} ${belly} belly. `; + } else if (slave.belly < 8000) { + r += `${His} ${belly} belly can be seen around ${his} narrow waist. `; + } else if (slave.belly < 15000) { + r += `${His} ${belly} belly lewdly extends past ${his} narrow waist. `; + } else if (slave.belly < 45000) { + r += `${His} ${belly} belly lewdly distends far to either side of ${his} narrow waist. `; + } else if (slave.belly < 600000) { + r += `${His} ${belly} belly lewdly distends far to either side of ${his} narrow waist. `; + if (slave.preg > 3) { + if (slave.belly > (slave.pregAdaptation * 1000)) { + r += `${His} waist is swollen wider than usual by ${his} crowded womb in its search for more room, leaving ${his} original waistline only visible from behind. `; + } else { + r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; + } + } + } else if (slave.belly < 750000) { + r += `${His} ${belly} belly lewdly bulges to either side of ${his} narrow waist and continues for nearly half a ` + if (V.showInches === 2) { + r += `yard`; + } else { + r += `meter`; + } + r += ` in both directions. `; + if (slave.preg > 3) { + if (slave.belly > (slave.pregAdaptation * 1000)) { + r += `${His} waist is greatly distended by ${his} overfilled womb in its desperate search for more room, leaving ${his} original waistline barely visible from behind. `; + } else { + r += `However, ${his} body is so adapted to pregnancy that ${his} womb rests forward enough to preserve the shape of ${his} waistline. `; } } } } return r; - }; + } +} diff --git a/src/js/displayVariables.js b/src/js/displayVariables.js index c153952509e31eab3818533944d8eaf82e651061..2863f516b41e556f9a58ef191266429ad3f187dd 100644 --- a/src/js/displayVariables.js +++ b/src/js/displayVariables.js @@ -1,2 +1,2 @@ /*! <<checkvars>> macro for SugarCube 2.x */ -!function(){"use strict";if("undefined"==typeof version||"undefined"==typeof version.title||"SugarCube"!==version.title||"undefined"==typeof version.major||version.major<2)throw new Error("<<checkvars>> macro requires SugarCube 2.0 or greater, aborting load");Macro.add("checkvars",{handler:function(){function toString(value,indent){var baseType=typeof value;switch(baseType){case"number":return isNaN(value)?"NaN":isFinite(value)?String(value):"Infinity";case"string":return JSON.stringify(value);case"function":return"(function)";default:if("object"!==baseType||null==value)return String(value);var objType=Object.prototype.toString.call(value);if("[object Date]"===objType)return'(object: Date, value: "'+value.toISOString()+'")';if("[object RegExp]"===objType)return"(object: RegExp, value: "+value.toString()+")";var opener,closer,result=[],indentText=" ";return indent||(indent=""),("[object Set]"===objType||value instanceof Set)&&(value=Array.from(value)),Array.isArray(value)?(opener="[\n",closer="\n"+indent+"]",value.forEach(function(p,i){result.push(indent+indentText+i+" ⇒ "+toString(value[i],indent+indentText))}),Object.keys(value).forEach(function(p){/^\d+$/.test(p)||result.push(indent+indentText+toString(p)+" ⇒ "+toString(value[p],indent+indentText))})):"[object Map]"===objType||value instanceof Map?(opener="{\n",closer="\n"+indent+"}",Array.from(value).map(function(kv){result.push(indent+indentText+toString(kv[0],indent+indentText)+" ⇒ "+toString(kv[1],indent+indentText))})):(opener="{\n",closer="\n"+indent+"}",Object.keys(value).forEach(function(p){result.push(indent+indentText+toString(p)+" ⇒ "+toString(value[p],indent+indentText))})),opener+result.join(",\n")+closer}}var dialog,sv=State.variables,names=Object.keys(sv);if(dialog=UI.setup("Story $variables","checkvars"),0===names.length)return dialog.innerHTML="<h1>Story $variables (<code>State.variables</code>):</h1><p><em>No $variables currently set…</em></p>",void UI.open();dialog.innerHTML="<h1>Story $variables (<code>State.variables</code>):</h1><table><thead><tr><th>Name</th><th>Value</th></tr></thead><tbody></tbody></table>"+(/applewebkit|chrome/.test(Browser.userAgent)?"":'<div class="scroll-pad"> </div>');var tbody=dialog.querySelector("tbody");names.sort(function(a,b){return Util.isNumeric(a)&&Util.isNumeric(b)?Number(a)-Number(b):a.localeCompare(b)});for(var i=0;i<names.length;i++){var tr=document.createElement("tr"),tdName=document.createElement("td"),tdValue=document.createElement("td");tdName.textContent="$"+names[i],tdValue.textContent = toString(sv[names[i]]),tr.appendChild(tdName),tr.appendChild(tdValue),tbody.appendChild(tr)}UI.open()}})}(); +!function(){"use strict";if("undefined"==typeof version||"undefined"==typeof version.title||"SugarCube"!==version.title||"undefined"==typeof version.major||version.major<2)throw new Error("<<checkvars>> macro requires SugarCube 2.0 or greater, aborting load");Macro.add("checkvars",{handler:function(){function toString(value,indent){var baseType=typeof value;switch(baseType){case"number":return isNaN(value)?"NaN":isFinite(value)?String(value):"Infinity";case"string":return JSON.stringify(value);case"function":return"(function)";default:if("object"!==baseType||null==value)return String(value);var objType=Object.prototype.toString.call(value);if("[object Date]"===objType)return'(object: Date, value: "'+value.toISOString()+'")';if("[object RegExp]"===objType)return"(object: RegExp, value: "+value.toString()+")";var opener,closer,result=[],indentText=" ";return indent||(indent=""),("[object Set]"===objType||value instanceof Set)&&(value=Array.from(value)),Array.isArray(value)?(opener="[\n",closer="\n"+indent+"]",value.forEach(function(p,i){result.push(indent+indentText+i+" ⇒ "+toString(value[i],indent+indentText))}),Object.keys(value).forEach(function(p){/^\d+$/.test(p)||result.push(indent+indentText+toString(p)+" ⇒ "+toString(value[p],indent+indentText))})):"[object Map]"===objType||value instanceof Map?(opener="{\n",closer="\n"+indent+"}",Array.from(value).map(function(kv){result.push(indent+indentText+toString(kv[0],indent+indentText)+" ⇒ "+toString(kv[1],indent+indentText))})):(opener="{\n",closer="\n"+indent+"}",Object.keys(value).forEach(function(p){result.push(indent+indentText+toString(p)+" ⇒ "+toString(value[p],indent+indentText))})),opener+result.join(",\n")+closer}}var dialog,sv=State.variables,names=Object.keys(sv);if(dialog=UI.setup("Story $variables","checkvars"),0===names.length)return dialog.innerHTML="<h1>Story $variables (<code>State.variables</code>):</h1><p><em>No $variables currently set…</em></p>",void UI.open();dialog.innerHTML="<h1>Story $variables (<code>State.variables</code>):</h1><table><thead><tr><th>Name</th><th>Value</th></tr></thead><tbody></tbody></table>"+(/applewebkit|chrome/.test(Browser.userAgent)?"":'<div class="scroll-pad"> </div>');var tbody=dialog.querySelector("tbody");names.sort(function(a,b){return Util.isNumeric(a)&&Util.isNumeric(b)?Number(a)-Number(b):a.localeCompare(b)});for(var i=0;i<names.length;i++){var tr=document.createElement("tr"),tdName=document.createElement("td"),tdValue=document.createElement("td");tdName.textContent="$"+names[i],tdValue.textContent = toString(sv[names[i]]),tr.appendChild(tdName),tr.appendChild(tdValue),tbody.appendChild(tr)}UI.open()}})}(); \ No newline at end of file diff --git a/src/js/economyJS.js b/src/js/economyJS.js index 6e0945b05d72d5a6acf0ac749233fd5a13d926b3..970863e4f81ca2df95beb098beba9f53a34ea804 100644 --- a/src/js/economyJS.js +++ b/src/js/economyJS.js @@ -1,13 +1,42 @@ window.LivingRule = Object.freeze({LUXURIOUS: 'luxurious', NORMAL: 'normal', SPARE: 'spare'}); window.Job = Object.freeze({ - DAIRY: 'work in the dairy', MILKMAID: 'be the Milkmaid', MASTER_SUITE: 'serve in the master suite', CONCUBINE: 'be your Concubine', - BABY_FACTORY: 'labor in the production line', BROTHEL: 'work in the brothel', MADAM: 'be the Madam', ARCADE: 'be confined in the arcade', - SERVANT: 'work as a servant', SERVER: 'be a servant', STEWARD: 'be the Stewardess', CLUB: 'serve in the club', DJ: 'be the DJ', - JAIL: 'be confined in the cellblock', WARDEN: 'be the Wardeness', CLINIC: 'get treatment in the clinic', NURSE: 'be the Nurse', - HGTOY: 'live with your Head Girl', SCHOOL: 'learn in the schoolroom', TEACHER: 'be the Schoolteacher', SPA: 'rest in the spa', ATTEND: 'be the Attendant', - NANNY: 'work as a nanny', MATRON: 'be the Matron', FARMYARD: 'work as a farmhand', FARMER: 'be the Farmer', REST: 'rest' + DAIRY: 'work in the dairy', + MILKMAID: 'be the Milkmaid', + MASTER_SUITE: 'serve in the master suite', + CONCUBINE: 'be your Concubine', + BABY_FACTORY: 'labor in the production line', + BROTHEL: 'work in the brothel', + MADAM: 'be the Madam', + ARCADE: 'be confined in the arcade', + SERVANT: 'work as a servant', + SERVER: 'be a servant', + STEWARD: 'be the Stewardess', + CLUB: 'serve in the club', + DJ: 'be the DJ', + JAIL: 'be confined in the cellblock', + WARDEN: 'be the Wardeness', + CLINIC: 'get treatment in the clinic', + NURSE: 'be the Nurse', + HGTOY: 'live with your Head Girl', + SCHOOL: 'learn in the schoolroom', + TEACHER: 'be the Schoolteacher', + SPA: 'rest in the spa', + ATTEND: 'be the Attendant', + NANNY: 'work as a nanny', + MATRON: 'be the Matron', + FARMYARD: 'work as a farmhand', + FARMER: 'be the Farmer', + REST: 'rest' +}); +window.PersonalAttention = Object.freeze({ + TRADE: 'trading', + WAR: 'warfare', + SLAVING: 'slaving', + ENGINEERING: 'engineering', + MEDICINE: 'medicine', + MAID: 'upkeep', + HACKING: 'hacking' }); -window.PersonalAttention = Object.freeze({TRADE: 'trading', WAR: 'warfare', SLAVING: 'slaving', ENGINEERING: 'engineering', MEDICINE: 'medicine', MAID: 'upkeep', HACKING: 'hacking'}); window.predictCost = function(array) { const array2 = array; @@ -40,14 +69,14 @@ window.predictCost = function(array) { predictTotalSlaveCosts(array2) ); - //these two apply a multiplicative effect to all costs so far. + // these two apply a multiplicative effect to all costs so far. totalCosts = getEnvironmentCosts(totalCosts); totalCosts = getPCMultiplierCosts(totalCosts); - //in the old order these were applied after multiplication. Not sure if deliberate, but I'm leaving it for now. + // in the old order these were applied after multiplication. Not sure if deliberate, but I'm leaving it for now. totalCosts += ( getSFCosts() + - getWeatherCosts() + getWeatherCosts() ); /* // clean up @@ -92,24 +121,24 @@ window.getCost = function(array) { getTotalSlaveCosts(array2); - //these two apply a multiplicative effect to all costs so far. + // these two apply a multiplicative effect to all costs so far. // Calculate what the deduced expenses would be, then subtract - costSoFar = (oldCash - State.variables.cash); //How much we have spent by this point; expected to be positive. - cashX(costSoFar - getEnvironmentCosts(costSoFar), "environment"); //getEnv takes total costs and makes it worse. Figure out how much worse and record it + costSoFar = (oldCash - State.variables.cash); // How much we have spent by this point; expected to be positive. + cashX(costSoFar - getEnvironmentCosts(costSoFar), "environment"); // getEnv takes total costs and makes it worse. Figure out how much worse and record it costSoFar = (oldCash - State.variables.cash); cashX(costSoFar - getPCMultiplierCosts(costSoFar), "PCskills"); - //in the old order these were applied after multiplication. Not sure if deliberate, but I'm leaving it for now. + // in the old order these were applied after multiplication. Not sure if deliberate, but I'm leaving it for now. cashX(forceNeg(getSFCosts()), "specialForces"); cashX(forceNeg(getWeatherCosts()), "weather"); return (oldCash - State.variables.cash); }; -//slave expenses +// slave expenses window.predictTotalSlaveCosts = function(array3) { let loopCosts = 0; - //slave expenses + // slave expenses for (const slave of array3) { loopCosts += getSlaveCost(slave); loopCosts += getSlaveMinorCosts(slave); @@ -126,10 +155,10 @@ window.getTotalSlaveCosts = function(array3) { slaveCostMinor = getSlaveMinorCosts(slave); cashX(Math.abs(slaveCostMinor), "houseServant", slave); } - //nothing to return, cashX already billed. + // nothing to return, cashX already billed. }; -//facility expenses +// facility expenses window.getBrothelCosts = function() { const facilityCost = State.variables.facilityCost; const brothel = State.variables.brothel; @@ -148,9 +177,9 @@ window.getBrothelAdsCosts = function() { }; window.getArcadeCosts = function() { - var facilityCost = State.variables.facilityCost; - var arcade = State.variables.arcade; - var costs = (arcade * facilityCost * 0.05); + const facilityCost = State.variables.facilityCost; + const arcade = State.variables.arcade; + let costs = (arcade * facilityCost * 0.05); costs += (0.02 * State.variables.arcadeUpgradeInjectors * arcade * facilityCost) + (0.05 * State.variables.arcadeUpgradeCollectors * arcade * facilityCost) + (0.02 * State.variables.arcadeUpgradeHealth * arcade * facilityCost); return costs; }; @@ -178,9 +207,9 @@ window.getClubAdsCosts = function() { window.getDairyCosts = function() { const facilityCost = State.variables.facilityCost; const dairy = State.variables.dairy; - let costs = (dairy * facilityCost) + (0.2 * State.variables.dairyFeedersUpgrade * dairy * facilityCost) - + (0.1 * State.variables.dairyPregUpgrade * dairy * facilityCost) - + (0.2 * State.variables.dairyStimulatorsUpgrade * facilityCost); + let costs = (dairy * facilityCost) + (0.2 * State.variables.dairyFeedersUpgrade * dairy * facilityCost) + + (0.1 * State.variables.dairyPregUpgrade * dairy * facilityCost) + + (0.2 * State.variables.dairyStimulatorsUpgrade * facilityCost); if (dairy > 0) { costs += ((State.variables.bioreactorsXY + State.variables.bioreactorsXX + State.variables.bioreactorsHerm + State.variables.bioreactorsBarren) * 100); } @@ -191,11 +220,11 @@ window.getIncubatorCosts = function() { const facilityCost = State.variables.facilityCost; const incubator = State.variables.incubator; let costs = (State.variables.incubator * facilityCost * 10); - costs += (0.2 * State.variables.incubatorUpgradeWeight * incubator * facilityCost) - + (0.2 * State.variables.incubatorUpgradeMuscles * incubator * facilityCost) - + (0.2 * State.variables.incubatorUpgradeReproduction * incubator * facilityCost) - + (0.2 * State.variables.incubatorUpgradeGrowthStims * incubator * facilityCost) - + (0.5 * State.variables.incubatorUpgradeSpeed * incubator * facilityCost); + costs += (0.2 * State.variables.incubatorUpgradeWeight * incubator * facilityCost) + + (0.2 * State.variables.incubatorUpgradeMuscles * incubator * facilityCost) + + (0.2 * State.variables.incubatorUpgradeReproduction * incubator * facilityCost) + + (0.2 * State.variables.incubatorUpgradeGrowthStims * incubator * facilityCost) + + (0.5 * State.variables.incubatorUpgradeSpeed * incubator * facilityCost); if (incubator > 0) { costs += ((State.variables.incubatorWeightSetting + State.variables.incubatorMusclesSetting + State.variables.incubatorReproductionSetting + State.variables.incubatorGrowthStimsSetting) * 500); } @@ -235,7 +264,7 @@ window.getFarmyardCosts = function() { }; window.getSecurityExpansionCost = function() { - //security expansion + // security expansion let secExpCost = 0; let soldierMod = 0; if (State.variables.secExp === 1) { @@ -259,11 +288,9 @@ window.getSecurityExpansionCost = function() { } if (State.variables.soldierWages === 0) { soldierMod = 1; - } - else if (State.variables.soldierWages === 1) { + } else if (State.variables.soldierWages === 1) { soldierMod = 1.5; - } - else { + } else { soldierMod = 2; } if (State.variables.militiaUnits !== null) { @@ -291,7 +318,7 @@ window.getSecurityExpansionCost = function() { return secExpCost; }; -//general arcology costs +// general arcology costs window.getLifestyleCosts = function() { let costs = 0; @@ -448,22 +475,22 @@ window.getProstheticsCosts = function() { }; -//player expenses +// player expenses window.getPCTrainingCosts = function() { let costs = 0; if (State.variables.PC.actualAge >= State.variables.IsInPrimePC && State.variables.PC.actualAge < State.variables.IsPastPrimePC) { if (State.variables.personalAttention === PersonalAttention.TRADE) { - costs += 10000*State.variables.AgeEffectOnTrainerPricingPC; + costs += 10000 * State.variables.AgeEffectOnTrainerPricingPC; } else if (State.variables.personalAttention === PersonalAttention.WAR) { - costs += 10000*State.variables.AgeEffectOnTrainerPricingPC; + costs += 10000 * State.variables.AgeEffectOnTrainerPricingPC; } else if (State.variables.personalAttention === PersonalAttention.SLAVING) { - costs += 10000*State.variables.AgeEffectOnTrainerPricingPC; + costs += 10000 * State.variables.AgeEffectOnTrainerPricingPC; } else if (State.variables.personalAttention === PersonalAttention.ENGINEERING) { - costs += 10000*State.variables.AgeEffectOnTrainerPricingPC; + costs += 10000 * State.variables.AgeEffectOnTrainerPricingPC; } else if (State.variables.personalAttention === PersonalAttention.MEDICINE) { - costs += 10000*State.variables.AgeEffectOnTrainerPricingPC; + costs += 10000 * State.variables.AgeEffectOnTrainerPricingPC; } else if (State.variables.personalAttention === PersonalAttention.HACKING) { - costs += 10000*State.variables.AgeEffectOnTrainerPricingPC; + costs += 10000 * State.variables.AgeEffectOnTrainerPricingPC; } } return costs; @@ -516,7 +543,8 @@ window.getEnvironmentCosts = function(cost) { window.getSFCosts = function() { let costs = 0; if (State.variables.SF.Toggle && State.variables.SF.Active >= 1 && State.variables.SF.Subsidy !== undefined) { - Count(); costs += Math.ceil(State.temporary.SFSubsidy); + Count(); + costs += Math.ceil(State.temporary.SFSubsidy); } return costs; }; @@ -578,7 +606,9 @@ window.getSlaveMinorCosts = function(slave) { }; window.getSlaveCost = function(s) { - if (!s) { return 0; } + if (!s) { + return 0; + } // Data duplicated from Cost Report let cost = 0; const rulesCost = State.variables.rulesCost; @@ -617,7 +647,8 @@ window.getSlaveCost = function(s) { cost += rulesCost; } break; - case Job.SCHOOL: case Job.CLUB: + case Job.SCHOOL: + case Job.CLUB: cost += rulesCost * 1.5; break; case Job.CLINIC: @@ -629,7 +660,8 @@ window.getSlaveCost = function(s) { cost += rulesCost; } break; - case Job.SPA: case Job.NANNY: + case Job.SPA: + case Job.NANNY: if (s.livingRules === LivingRule.LUXURIOUS) { cost += rulesCost * 1.75; } else if (s.livingRules === LivingRule.NORMAL) { @@ -656,7 +688,16 @@ window.getSlaveCost = function(s) { cost += rulesCost * 0.90; } break; - case Job.MADAM: case Job.DJ: case Job.NURSE: case Job.WARDEN: case Job.ATTEND: case Job.STEWARD: case Job.MILKMAID: case Job.FARMER: case Job.TEACHER: case Job.MATRON: + case Job.MADAM: + case Job.DJ: + case Job.NURSE: + case Job.WARDEN: + case Job.ATTEND: + case Job.STEWARD: + case Job.MILKMAID: + case Job.FARMER: + case Job.TEACHER: + case Job.MATRON: cost += rulesCost * 2; break; default: @@ -673,10 +714,12 @@ window.getSlaveCost = function(s) { // Food cost += foodCost * 4; switch (s.diet) { - case 'fattening': case 'muscle building': + case 'fattening': + case 'muscle building': cost += foodCost; break; - case 'restricted': case 'slimming': + case 'restricted': + case 'slimming': cost -= foodCost; break; } @@ -697,14 +740,14 @@ window.getSlaveCost = function(s) { cost -= foodCost; } if (s.lactation > 0) { - cost += foodCost * s.lactation * (1 + Math.trunc(s.boobs/10000)); + cost += foodCost * s.lactation * (1 + Math.trunc(s.boobs / 10000)); } - if (s.preg > s.pregData.normalBirth/8) { + if (s.preg > s.pregData.normalBirth / 8) { if (s.assignment === Job.DAIRY && State.variables.dairyFeedersSetting > 0) { // Extra feeding costs to support pregnancy are covered by dairy feeders. // TODO: Include them here anyway? - } else if ((s.assignment === Job.MASTER_SUITE || s.assignment === Job.CONCUBINE) - && State.variables.masterSuiteUpgradePregnancy === 1) { + } else if ((s.assignment === Job.MASTER_SUITE || s.assignment === Job.CONCUBINE) && + State.variables.masterSuiteUpgradePregnancy === 1) { // Extra feeding costs to support pregnancy are covered by master suite luxuries. // TODO: Include them here anyway? } else { @@ -729,12 +772,12 @@ window.getSlaveCost = function(s) { } // Accessibility costs - if (State.variables.boobAccessibility !== 1 && s.boobs > 20000 - && (s.assignment !== Job.DAIRY || State.variables.dairyRestraintsSetting < 2) && (s.assignment !== Job.ARCADE)) { + if (State.variables.boobAccessibility !== 1 && s.boobs > 20000 && + (s.assignment !== Job.DAIRY || State.variables.dairyRestraintsSetting < 2) && (s.assignment !== Job.ARCADE)) { cost += 50; } - if (State.variables.pregAccessibility !== 1 - && (s.belly >= 60000) && s.assignment !== Job.BABY_FACTORY && (s.assignment !== Job.DAIRY || State.variables.dairyRestraintsSetting < 2) && (s.assignment !== Job.ARCADE)) { + if (State.variables.pregAccessibility !== 1 && + (s.belly >= 60000) && s.assignment !== Job.BABY_FACTORY && (s.assignment !== Job.DAIRY || State.variables.dairyRestraintsSetting < 2) && (s.assignment !== Job.ARCADE)) { cost += 100; } if (State.variables.dickAccessibility !== 1 && s.dick > 45 && (s.assignment !== Job.DAIRY || State.variables.dairyRestraintsSetting < 2) && (s.assignment !== Job.ARCADE)) { @@ -803,7 +846,9 @@ window.getSlaveCost = function(s) { case 'food': cost += (foodCost * 4); break; - case 'curative': case 'aphrodisiac': case 'tightener': + case 'curative': + case 'aphrodisiac': + case 'tightener': cost += (100 + (drugsCost * 2)); break; } @@ -815,7 +860,9 @@ window.getSlaveCost = function(s) { case 'food': cost += (foodCost * 2); break; - case 'curative': case 'aphrodisiac': case 'tightener': + case 'curative': + case 'aphrodisiac': + case 'tightener': cost += (50 + (drugsCost * 2)); break; } @@ -827,7 +874,9 @@ window.getSlaveCost = function(s) { case 'food': cost += (foodCost); break; - case 'curative': case 'aphrodisiac': case 'tightener': + case 'curative': + case 'aphrodisiac': + case 'tightener': cost += (25 + (drugsCost * 2)); break; } @@ -838,17 +887,26 @@ window.getSlaveCost = function(s) { case 'anti-aging cream': cost += drugsCost * 10; break; - case 'female hormone injections': case 'male hormone injections': case 'intensive breast injections': - case 'intensive butt injections': case 'intensive penis enhancement': case 'intensive testicle enhancement': - case 'intensive lip injections': case 'hyper breast injections': case 'hyper butt injections': - case 'hyper penis enhancement': case 'hyper testicle enhancement': case 'hyper lip injections': + case 'female hormone injections': + case 'male hormone injections': + case 'intensive breast injections': + case 'intensive butt injections': + case 'intensive penis enhancement': + case 'intensive testicle enhancement': + case 'intensive lip injections': + case 'hyper breast injections': + case 'hyper butt injections': + case 'hyper penis enhancement': + case 'hyper testicle enhancement': + case 'hyper lip injections': case 'growth stimulants': cost += drugsCost * 5; break; case 'sag-B-gone': cost += Math.trunc(drugsCost * 0.1); break; - case 'no drugs': case 'none': + case 'no drugs': + case 'none': break; default: cost += drugsCost * 2; @@ -873,7 +931,7 @@ window.getSlaveCost = function(s) { // Promotion costs if (State.variables.studio === 1) { if (s.pornFameSpending > 0) { - cost += (s.pornFameSpending/State.variables.PCSlutContacts); + cost += (s.pornFameSpending / State.variables.PCSlutContacts); } } @@ -932,23 +990,23 @@ window.slaveJobValues = function() { }); if (V.DJ !== 0) { if (!canTalk(V.DJ)) { - //''__@@.pink;$DJ.slaveName@@__'' can't speak @@.yellow;and cannot serve as your DJ any more.@@<br> + // <strong><u><span class="pink">$DJ.slaveName</span></u></strong> can't speak <span class="yellow">and cannot serve as your DJ any more.</span><br> V.DJ = 0; V.unDJ = 1; } else if (V.DJ.preg > 37 && V.DJ.broodmother === 2) { - //''__@@.pink;$DJ.slaveName@@__'' spends so much time giving birth and laboring that @@.yellow;$he cannot effectively serve as your DJ any longer.@@ + // <strong><u><span class="pink">$DJ.slaveName</span></u></strong> spends so much time giving birth and laboring that <span class="yellow">$he cannot effectively serve as your DJ any longer.</span> V.DJ = 0; V.unDJ = 2; } else if (V.DJ.fetish === "mindbroken") { - //''__@@.pink;$DJ.slaveName@@__'' is mindbroken @@.yellow;and cannot serve as your DJ any more.@@<br> + // <strong><u><span class="pink">$DJ.slaveName</span></u></strong> is mindbroken <span class="yellow">and cannot serve as your DJ any more.</span><br> V.DJ = 0; V.unDJ = 3; } else if (!canWalk(V.DJ)) { - //''__@@.pink;$DJ.slaveName@@__'' is no longer independently mobile @@.yellow;and cannot serve as your DJ any more.@@<br> + // <strong><u><span class="pink">$DJ.slaveName</span></u></strong> is no longer independently mobile <span class="yellow">and cannot serve as your DJ any more.</span><br> V.DJ = 0; V.unDJ = 4; } else if (!canHear(V.DJ)) { - //''__@@.pink;$DJ.slaveName@@__'' can no longer hear @@.yellow;and cannot serve as your DJ any more.@@<br> + // <strong><u><span class="pink">$DJ.slaveName</span></u></strong> can no longer hear <span class="yellow">and cannot serve as your DJ any more.</span><br> V.DJ = 0; V.unDJ = 5; } @@ -956,44 +1014,44 @@ window.slaveJobValues = function() { if (V.DJ !== 0) { if (V.DJ.relationship === -3 && V.DJ.devotion > 50) { DJRepBonus += 0.1; - //$He tries $his best to be your energetic, cheerful wife. + // $He tries $his best to be your energetic, cheerful wife. } if (V.DJ.eyes === -2) { DJRepBonus += 0.15; } if (V.DJ.skill.entertainment <= 10) { - //Though $DJ.slaveName does $his best to lead on the club, with $his lack of skill $he can do little. + // Though $DJ.slaveName does $his best to lead on the club, with $his lack of skill $he can do little. } else if (V.DJ.skill.entertainment <= 30) { DJRepBonus += 0.05; - //$DJ.slaveName's basic skills marginally @@.green;improve@@ the atmosphere on $clubName. + // $DJ.slaveName's basic skills marginally <span class="green">improve</span> the atmosphere on $clubName. } else if (V.DJ.skill.entertainment <= 60) { DJRepBonus += 0.1; - //$DJ.slaveName's skills @@.green;improve@@ the atmosphere on $clubName. + // $DJ.slaveName's skills <span class="green">improve</span> the atmosphere on $clubName. } else if (V.DJ.skill.entertainment < 100) { DJRepBonus += 0.15; - //$DJ.slaveName's skills greatly @@.green;improve@@ the atmosphere on $clubName. + // $DJ.slaveName's skills greatly <span class="green">improve</span> the atmosphere on $clubName. } else if (V.DJ.skill.entertainment >= 100) { DJRepBonus += 0.20; - //$DJ.slaveName's mastery immensely @@.green;improves@@ the atmosphere on $clubName. + // $DJ.slaveName's mastery immensely <span class="green">;improves</span> the atmosphere on $clubName. } if (V.DJ.muscles > 5 && V.DJ.muscles <= 95) { V.DJRepBonus += 0.05; - //$His toned body helps $him lead $his fellow club girls by letting $him dance all night. + // $His toned body helps $him lead $his fellow club girls by letting $him dance all night. } if (V.DJ.intelligence + V.DJ.intelligenceImplant > 15) { - DJRepBonus += 0.05 * Math.floor((V.DJ.intelligence + V.DJ.intelligenceImplant)/32); - //$He's smart enough to make an actual contribution to the music, greatly enhancing the entire experience. + DJRepBonus += 0.05 * Math.floor((V.DJ.intelligence + V.DJ.intelligenceImplant) / 32); + // $He's smart enough to make an actual contribution to the music, greatly enhancing the entire experience. } if (V.DJ.face > 95) { DJRepBonus += 0.05; - //$His great beauty is a further draw, even when $he's in $his DJ booth, but especially when $he comes out to dance. + // $His great beauty is a further draw, even when $he's in $his DJ booth, but especially when $he comes out to dance. } if (setup.DJCareers.includes(V.DJ.career)) { DJRepBonus += 0.05; - //$He has musical experience from $his life before $he was a slave, a grounding that gives $his tracks actual depth. + // $He has musical experience from $his life before $he was a slave, a grounding that gives $his tracks actual depth. } else if (V.DJ.skill.DJ >= V.masteredXP) { DJRepBonus += 0.05; - //$He has musical experience from working for you, giving $his tracks actual depth. + // $He has musical experience from working for you, giving $his tracks actual depth. } // The DJ adding to 'club' @@ -1034,7 +1092,8 @@ window.slaveJobValues = function() { }); function SJVClub(s) { - let toTheClub = 0, beautyMultiplier = 1; + let toTheClub = 0, + beautyMultiplier = 1; s.minorInjury = 0; // The beauty multiplier @@ -1053,77 +1112,77 @@ window.slaveJobValues = function() { if (V.clubAdsStacked === 1) { if (isStacked(s) === true) { beautyMultiplier += 0.05; - //$His stacked body fits $clubName's ad campaign, getting $him more attention. + // $His stacked body fits $clubName's ad campaign, getting $him more attention. } } else if (V.clubAdsStacked === -1) { if (isSlim(s) === true) { beautyMultiplier += 0.05; - //$His slim body fits $clubName's ad campaign, getting $him more attention. + // $His slim body fits $clubName's ad campaign, getting $him more attention. } } if (V.clubAdsPreg === 1) { if (isPreg(s) === true) { beautyMultiplier += 0.05; - //$His gravid body fits $clubName's ad campaign, getting $him more attention. + // $His gravid body fits $clubName's ad campaign, getting $him more attention. } } else if (V.clubAdsPreg === -1) { if (isNotPreg(s) === true) { beautyMultiplier += 0.05; - //$His flat belly fits $clubName's ad campaign, getting $him more attention. + // $His flat belly fits $clubName's ad campaign, getting $him more attention. } } if (V.clubAdsModded === 1) { if (SlaveStatsChecker.isModded(s) === true) { beautyMultiplier += 0.05; - //Body art like $hers is a major draw. + // Body art like $hers is a major draw. } } else if (V.clubAdsModded === -1) { if (SlaveStatsChecker.isUnmodded(s) === true) { beautyMultiplier += 0.05; - //Very clean bodies like $hers are a major draw. + // Very clean bodies like $hers are a major draw. } } if (V.clubAdsImplanted === 1) { if (isSurgicallyImproved(s) === true) { beautyMultiplier += 0.05; - //Many citizens come to $clubName looking to fuck a plastic slut like $him. + // Many citizens come to $clubName looking to fuck a plastic slut like $him. } } else if (V.clubAdsImplanted === -1) { if (isPure(s) === true) { beautyMultiplier += 0.05; - //Many citizens come to $clubName looking to get with a natural $girl like $him. + // Many citizens come to $clubName looking to get with a natural $girl like $him. } } if (V.clubAdsOld === 1) { if (isYoung(s) === false) { beautyMultiplier += 0.05; - //$He's perfect for $clubName, which practically exists to match citizens up with mature slaves. + // $He's perfect for $clubName, which practically exists to match citizens up with mature slaves. } } else if (V.clubAdsOld === -1) { if (isYoung(s) === true && s.physical >= 18) { beautyMultiplier += 0.05; - //$He's perfect for $clubName, which practically exists to match citizens up with young slaves. + // $He's perfect for $clubName, which practically exists to match citizens up with young slaves. } } else if (V.clubAdsOld === -2) { if (s.physical <= 18 && s.physical >= 13) { beautyMultiplier += 0.05; - //$He's perfect for $clubName, which practically exists to match citizens up with teenage slaves. + // $He's perfect for $clubName, which practically exists to match citizens up with teenage slaves. } } else if (V.clubAdsOld === -3) { if (s.physical < 13) { beautyMultiplier += 0.05; - //$He's perfect for $clubName, which practically exists to match citizens up with $loli slaves. + // $He's perfect for $clubName, which practically exists to match citizens up with $loli slaves. } } if (V.clubAdsXX === 1) { if (s.dick === 0) { beautyMultiplier += 0.05; - //Almost everyone who comes to $clubName is looking to fuck a $girl like $him. + // Almost everyone who comes to $clubName is looking to fuck a $girl like $him. } } else if (V.clubAdsXX === -1) { if (s.dick > 0) { beautyMultiplier += 0.05; - //Almost everyone who comes to $clubName is looking to poke a $girl who cums when buttfucked. + // Almost everyone who comes to $clubName is looking to poke a $girl who cums when buttfucked. } } } @@ -1133,10 +1192,10 @@ window.slaveJobValues = function() { } if (canHear(s) === false) { beautyMultiplier -= 0.15; - //$His inability to move to the rhythm of the music is very off putting to those looking to party. + // $His inability to move to the rhythm of the music is very off putting to those looking to party. } - //Injuries + // Injuries if (s.curatives < 1 || s.inflationType !== "curative") { if (s.health < -50) { s.health -= 8; @@ -1146,7 +1205,7 @@ window.slaveJobValues = function() { s.minorInjury = 1; } else if (!canDoVaginal(s)) { if (canDoAnal(s)) { - if (jsRandom(1, 100) > 40+(10*(s.skill.anal + s.skill.oral))) { + if (jsRandom(1, 100) > 40 + (10 * (s.skill.anal + s.skill.oral))) { s.health -= 5; s.minorInjury = 1; } @@ -1155,7 +1214,7 @@ window.slaveJobValues = function() { s.minorInjury = 1; } } else if (s.skill.anal + s.skill.oral + s.skill.vaginal < 300) { - if (jsRandom(1, 100) > 10+((s.skill.anal + s.skill.oral + s.skill.vaginal)/10)) { + if (jsRandom(1, 100) > 10 + ((s.skill.anal + s.skill.oral + s.skill.vaginal) / 10)) { s.minorInjury = 1; } } @@ -1360,8 +1419,8 @@ window.corpDivWhoreSlavesRoom = function() { return 0; }; -//Corporation race blacklisting/whitelisting -//race is the lowercase string representing the race, 'blacklist' is either 1 or 0. 1 means we are blacklisting and 0 means we are whitelisting said race +// Corporation race blacklisting/whitelisting +// race is the lowercase string representing the race, 'blacklist' is either 1 or 0. 1 means we are blacklisting and 0 means we are whitelisting said race window.corpBlacklistRace = function(race, blacklist) { let raceArray = State.variables.corpSpecRaces; if (raceArray.length > 0 && blacklist === 1) { @@ -1378,8 +1437,14 @@ window.getSlaveStatisticData = function(s, facility) { if (!s || !facility) { // Base data, even without facility return { - ID: s.ID, slaveName: s.slaveName, customLabel: s.custom.label, - income: 0, adsIncome: 0, rep: 0, food: 0, cost: getSlaveCost(s), + ID: s.ID, + slaveName: s.slaveName, + customLabel: s.custom.label, + income: 0, + adsIncome: 0, + rep: 0, + food: 0, + cost: getSlaveCost(s), customers: 0 /* brothel, club, ... */ }; } @@ -1393,8 +1458,14 @@ window.getSlaveStatisticData = function(s, facility) { } const data = { - ID: s.ID, slaveName: s.slaveName, customLabel: s.custom.label, - income: 0, adsIncome: 0, rep: 0, food: 0, cost: getSlaveCost(s), + ID: s.ID, + slaveName: s.slaveName, + customLabel: s.custom.label, + income: 0, + adsIncome: 0, + rep: 0, + food: 0, + cost: getSlaveCost(s), customers: 0 /* brothel, club, ... */ }; facility.income.set(s.ID, data); @@ -1446,38 +1517,38 @@ window.cashX = function(cost, what, who) { return 0; } - //remove fractions from the money + // remove fractions from the money cost = Math.trunc(cost); - //Spend the money + // Spend the money V.cash += cost; - //INCOME + // INCOME if (cost > 0) { - //record the action + // record the action if (typeof V.lastWeeksCashIncome[what] !== 'undefined') { V.lastWeeksCashIncome[what] += cost; } else { V.lastWeeksCashErrors += `Unknown place "${what}" gained you ${cost}<br>`; } - //record the slave, if available + // record the slave, if available if (typeof who !== 'undefined') { who.lastWeeksCashIncome += cost; who.lifetimeCashIncome += cost; } } - //EXPENSES + // EXPENSES else if (cost < 0) { - //record the action + // record the action if (typeof V.lastWeeksCashExpenses[what] !== 'undefined') { V.lastWeeksCashExpenses[what] += cost; } else { V.lastWeeksCashErrors += `Unknown place "${what}" charged you ${cost}<br>`; } - //record the slave, if available + // record the slave, if available if (typeof who !== 'undefined') { if (what === "slaveTransfer") { who.slaveCost = cost; @@ -1497,57 +1568,59 @@ window.repX = function(rep, what, who) { return 0; } - //round the change + // round the change rep = Math.trunc(rep); - //INCOME - //These are all scaled relative to current rep except when recording the who, to keep comparisons between slaves possible across times. This quite drastically reduces rep income at high levels of rep and only slightly at low levels. + // INCOME + // These are all scaled relative to current rep except when recording the who, to keep comparisons between slaves possible across times. This quite drastically reduces rep income at high levels of rep and only slightly at low levels. if (rep > 0) { - //record the slave, if available + // record the slave, if available if (typeof who !== 'undefined') { who.lastWeeksRepIncome += rep; who.lifetimeRepIncome += rep; } - //record the action + // record the action if (what === "cheating" || passage() === "init" || passage() === "init Nationalities") { - /*we don't want to curve startup or cheating.*/ + /* we don't want to curve startup or cheating.*/ V.lastWeeksRepIncome[what] += rep; } else if (typeof V.lastWeeksRepIncome[what] !== 'undefined') { - rep = Math.round(Math.pow(1000 * rep + Math.pow(V.rep, 2), 0.5) - V.rep)* (V.corpEasy + 1); + rep = Math.round(Math.pow(1000 * rep + Math.pow(V.rep, 2), 0.5) - V.rep) * (V.corpEasy + 1); V.lastWeeksRepIncome[what] += rep; } else { V.lastWeeksRepErrors += `Unknown place "${what}" gained you ${rep}<br>`; } } - //EXPENSES + // EXPENSES else if (rep < 0) { - //record the action + // record the action if (typeof V.lastWeeksRepExpenses[what] !== 'undefined') { V.lastWeeksRepExpenses[what] += rep; } else { V.lastWeeksRepErrors += `Unknown place "${what}" cost you ${rep}<br>`; } - //record the slave, if available + // record the slave, if available if (typeof who !== 'undefined') { who.lastWeeksRepExpenses += rep; who.lifetimeRepExpenses += rep; } } - //Apply the reputation change + // Apply the reputation change V.rep += rep; - //Check if total rep is over cap, and use "overflow" category to expense it down if needed. + // Check if total rep is over cap, and use "overflow" category to expense it down if needed. if (V.rep > 20000) { - V.lastWeeksRepExpenses.overflow += (20000 - V.rep); V.rep = 20000; + V.lastWeeksRepExpenses.overflow += (20000 - V.rep); + V.rep = 20000; } - //Rep should never be lower than 0. Record this rounding purely to keep the books balanced. + // Rep should never be lower than 0. Record this rounding purely to keep the books balanced. else if (V.rep < 0) { - V.lastWeeksRepIncome.overflow += (0 - V.rep); V.rep = 0; + V.lastWeeksRepIncome.overflow += (0 - V.rep); + V.rep = 0; } return rep; diff --git a/src/js/eventSelectionJS.js b/src/js/eventSelectionJS.js index 6b33b8d77be4e46282a7b0ea5666a71396d0011b..1929e3b90510eae0046b88b25fd1488d45ccd93e 100644 --- a/src/js/eventSelectionJS.js +++ b/src/js/eventSelectionJS.js @@ -1,4 +1,3 @@ -/* eslint-disable no-undef */ window.generateRandomEventPoolStandard = function(eventSlave) { /* STANDARD EVENTS */ @@ -1071,10 +1070,10 @@ window.generateRandomEventPoolStandard = function(eventSlave) { if (eventSlave.trust >= -50) { if (eventSlave.devotion > 0) { if (eventSlave.devotion <= 50) { - if (((eventSlave.attrXX >= 50) && (State.variables.PC.boobs === 1 || State.variables.PC.title === 0) && (State.variables.PC.belly < 5000)) - || ((eventSlave.attrXY >= 50) && (State.variables.PC.dick === 1) && (State.variables.PC.boobs === 0) && (State.variables.PC.belly < 1500)) - || (eventSlave.fetish === "pregnancy" && State.variables.PC.belly >= 5000) - || (eventSlave.fetish === "boobs" && State.variables.PC.belly < 5000 && State.variables.PC.boobsBonus > 0)) { + if (((eventSlave.attrXX >= 50) && (State.variables.PC.boobs === 1 || State.variables.PC.title === 0) && (State.variables.PC.belly < 5000)) || + ((eventSlave.attrXY >= 50) && (State.variables.PC.dick === 1) && (State.variables.PC.boobs === 0) && (State.variables.PC.belly < 1500)) || + (eventSlave.fetish === "pregnancy" && State.variables.PC.belly >= 5000) || + (eventSlave.fetish === "boobs" && State.variables.PC.belly < 5000 && State.variables.PC.boobsBonus > 0)) { State.variables.RESSevent.push("hot PC"); } } @@ -2483,10 +2482,10 @@ window.generateRandomEventPoolServant = function(eventSlave) { if (eventSlave.trust >= -50) { if (eventSlave.devotion > 0) { if (eventSlave.devotion <= 50) { - if (((eventSlave.attrXX >= 50) && (State.variables.PC.boobs === 1 || State.variables.PC.title === 0) && (State.variables.PC.belly < 5000)) - || ((eventSlave.attrXY >= 50) && (State.variables.PC.dick === 1) && (State.variables.PC.boobs === 0) && (State.variables.PC.belly < 1500)) - || (eventSlave.fetish === "pregnancy" && State.variables.PC.belly >= 5000) - || (eventSlave.fetish === "boobs" && State.variables.PC.belly < 5000 && State.variables.PC.boobsBonus > 0)) { + if (((eventSlave.attrXX >= 50) && (State.variables.PC.boobs === 1 || State.variables.PC.title === 0) && (State.variables.PC.belly < 5000)) || + ((eventSlave.attrXY >= 50) && (State.variables.PC.dick === 1) && (State.variables.PC.boobs === 0) && (State.variables.PC.belly < 1500)) || + (eventSlave.fetish === "pregnancy" && State.variables.PC.belly >= 5000) || + (eventSlave.fetish === "boobs" && State.variables.PC.belly < 5000 && State.variables.PC.boobsBonus > 0)) { State.variables.RESSevent.push("hot PC"); } } diff --git a/src/js/extendedFamilyModeJS.js b/src/js/extendedFamilyModeJS.js index 48237434eb188dfc4143a4cc42460ee822cf4030..a040b9f2f9ebfeac1828758cdc634ac7f2c572eb 100644 --- a/src/js/extendedFamilyModeJS.js +++ b/src/js/extendedFamilyModeJS.js @@ -1,4 +1,3 @@ -/* eslint-disable no-undef */ /* see documentation for details /devNotes/Extended Family Mode Explained.txt */ window.isMotherP = function isMotherP(daughter, mother) { @@ -13,21 +12,26 @@ window.isParentP = function isParentP(daughter, parent) { return isMotherP(daughter, parent) || isFatherP(daughter, parent); }; -window.sameDad = function (slave1, slave2) { +window.sameDad = function(slave1, slave2) { if ((slave1.father === slave2.father) && (slave1.father !== 0 && slave1.father !== -2)) { return true; } return false; }; -window.sameMom = function (slave1, slave2) { +window.sameMom = function(slave1, slave2) { if ((slave1.mother === slave2.mother) && (slave1.mother !== 0 && slave1.mother !== -2)) { return true; } return false; }; -window.isAunt = /** @param {App.Entity.SlaveState} niece, @param {App.Entity.SlaveState} aunt */ function (niece, aunt) { +/** + * @param {App.Entity.SlaveState} niece + * @param {App.Entity.SlaveState} aunt + * @returns {boolean} + */ +window.isAunt = function(niece, aunt) { if (!State.variables.showDistantRelatives) { return false; } @@ -36,8 +40,8 @@ window.isAunt = /** @param {App.Entity.SlaveState} niece, @param {App.Entity.Sla return false; } - var mother; - var father; + let mother; + let father; if ((mother = getSlave(niece.mother)) && (mother.ID !== aunt.ID) && !sameTParent(mother, aunt) && sameMom(mother, aunt) && sameDad(mother, aunt)) { return true; @@ -48,8 +52,8 @@ window.isAunt = /** @param {App.Entity.SlaveState} niece, @param {App.Entity.Sla return false; }; -// testtest catches the case if a mother is a father or a father a mother — thank you familyAnon, for this code -window.sameTParent = function (slave1, slave2) { +// testtest catches the case if a mother is a father or a father a mother - thank you familyAnon, for this code +window.sameTParent = function(slave1, slave2) { if (slave1.mother === -1 && slave1.father === -1 && slave2.mother === -1 && slave2.father === -1) { return 1; } else if (slave1.mother === slave2.father && slave1.father === slave2.mother && slave1.mother !== 0 && slave1.mother !== -2 && slave1.father !== 0 && slave1.father !== -2 && slave1.mother !== slave1.father) { @@ -70,7 +74,7 @@ window.sameTParent = function(slave1, slave2) { }; */ -window.areTwins = function (slave1, slave2) { +window.areTwins = function(slave1, slave2) { if (!sameDad(slave1, slave2)) { return false; } else if (!sameMom(slave1, slave2)) { @@ -81,28 +85,28 @@ window.areTwins = function (slave1, slave2) { return false; }; -window.areSisters = function (slave1, slave2) { +window.areSisters = function(slave1, slave2) { if (slave1.ID === slave2.ID) { - return 0; //you are not your own sister + return 0; // you are not your own sister } else if (((slave1.father === 0) || (slave1.father === -2)) && ((slave1.mother === 0) || (slave1.mother === -2))) { - return 0; //not related + return 0; // not related } else { if (!sameDad(slave1, slave2) && sameMom(slave1, slave2)) { - return 3; //half sisters + return 3; // half sisters } else if (sameDad(slave1, slave2) && !sameMom(slave1, slave2)) { - return 3; //half sisters + return 3; // half sisters } else if (sameTParent(slave1, slave2) === 3) { - return 3; //half sisters + return 3; // half sisters } else if (sameTParent(slave1, slave2) === 2) { - return 2; //sisters + return 2; // sisters } else if (sameDad(slave1, slave2) && sameMom(slave1, slave2)) { if (slave1.actualAge === slave2.actualAge && slave1.birthWeek === slave2.birthWeek) { - return 1; //twins + return 1; // twins } else { - return 2; //sisters + return 2; // sisters } } else { - return 0; //not related + return 0; // not related } } }; @@ -130,7 +134,12 @@ window.areSisters = function(c1, c2) { } } */ -window.areCousins = /** @param {App.Entity.SlaveState} slave1, @param {App.Entity.SlaveState} slave2 */ function (slave1, slave2) { +/** + * @param {App.Entity.SlaveState} slave1 + * @param {App.Entity.SlaveState} slave2 + * @returns {boolean} + */ +window.areCousins = function(slave1, slave2) { if (!State.variables.showDistantRelatives) { return false; } @@ -139,10 +148,10 @@ window.areCousins = /** @param {App.Entity.SlaveState} slave1, @param {App.Entit return false; } - var slave1Mom; - var slave1Dad; - var slave2Mom; - var slave2Dad; + let slave1Mom; + let slave1Dad; + let slave2Mom; + let slave2Dad; if ((slave1Mom = getSlave(slave1.mother)) && (slave2Mom = getSlave(slave2.mother)) && !sameTParent(slave1Mom, slave2Mom) && sameMom(slave1Mom, slave2Mom) && sameDad(slave1Mom, slave2Mom)) { return true; @@ -157,13 +166,22 @@ window.areCousins = /** @param {App.Entity.SlaveState} slave1, @param {App.Entit return false; }; -window.areRelated = /** @param {App.Entity.SlaveState} slave1, @param {App.Entity.SlaveState} slave2 */ - function (slave1, slave2) { +/** + * @param {App.Entity.SlaveState} slave1 + * @param {App.Entity.SlaveState} slave2 + * @returns {boolean} + */ +window.areRelated = + function(slave1, slave2) { return (slave1.father === slave2.ID || slave1.mother === slave2.ID || slave2.father === slave1.ID || slave2.mother === slave1.ID || areSisters(slave1, slave2) > 0); }; -window.totalRelatives = /** @param {App.Entity.SlaveState} slave */ function (slave) { - var relatives = 0; +/** + * @param {App.Entity.SlaveState} slave + * @returns {number} + */ +window.totalRelatives = function(slave) { + let relatives = 0; if (slave.mother > 0) { relatives += 1; } @@ -183,14 +201,19 @@ window.totalRelatives = /** @param {App.Entity.SlaveState} slave */ function (sl * @param {App.Entity.SlaveState} slave1 * @param {App.Entity.SlaveState} slave2 * @param {App.Entity.SlaveState[]} slaves + * @returns {Array} // I think */ -window.mutualChildren = function (slave1, slave2, slaves) { - return slaves.filter(function (s) { +window.mutualChildren = function(slave1, slave2, slaves) { + return slaves.filter(function(s) { return s.ID !== slave1.ID && s.ID !== slave2.ID && s.mother > 0 && s.father > 0 && ((s.mother === slave1.ID && s.father === slave2.ID) || (s.mother === slave2.ID && s.father === slave1.ID)); }).length; }; -window.isSlaveAvailable = /** @param {App.Entity.SlaveState} slave */ function (slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.isSlaveAvailable = function(slave) { if (!slave) { return null; } else if (slave.assignment === "be your agent") { @@ -213,18 +236,23 @@ window.randomRelatedSlave = function(slave, filterFunction) { } */ -window.randomRelatedSlave = /** @param {App.Entity.SlaveState} slave */ function (slave, filterFunction) { +/** + * @param {App.Entity.SlaveState} slave + * @param {function} filterFunction // I think + * @returns {object} // I think + */ +window.randomRelatedSlave = function(slave, filterFunction) { if (!slave || !SugarCube) { return undefined; } if (typeof filterFunction !== 'function') { - filterFunction = function ( /*s, index, array*/ ) { + filterFunction = function( /* s, index, array*/ ) { return true; }; } - var arr = State.variables.slaves.filter(filterFunction); + const arr = State.variables.slaves.filter(filterFunction); arr.shuffle(); - return arr.find(function (s) { + return arr.find(function(s) { return areSisters(slave, s) || slave.ID === s.mother || slave.ID === s.father || @@ -233,62 +261,98 @@ window.randomRelatedSlave = /** @param {App.Entity.SlaveState} slave */ function }); }; -window.randomRelatedAvailableSlave = /** @param {App.Entity.SlaveState} slave */ function (slave) { - return randomRelatedSlave(slave, function (s) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {object} + */ +window.randomRelatedAvailableSlave = function(slave) { + return randomRelatedSlave(slave, function(s) { return isSlaveAvailable(s); }); }; -window.randomSister = /** @param {App.Entity.SlaveState} slave */ function (slave) { - return randomRelatedSlave(slave, function (s) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {object} + */ +window.randomSister = function(slave) { + return randomRelatedSlave(slave, function(s) { return areSisters(slave, s); }); }; -window.randomTwinSister = /** @param {App.Entity.SlaveState} slave */ function (slave) { - return randomRelatedSlave(slave, function (s) { - return areSisters(slave, s) === 1; +/** + * @param {App.Entity.SlaveState} slave + * @returns {object} + */ +window.randomTwinSister = function(slave) { + return randomRelatedSlave(slave, function(s) { + return areSisters(slave, s); }); }; -window.randomAvailableSister = /** @param {App.Entity.SlaveState} slave */ function (slave) { - return randomRelatedSlave(slave, function (s) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {object} + */ +window.randomAvailableSister = function(slave) { + return randomRelatedSlave(slave, function(s) { return isSlaveAvailable(s) && areSisters(slave, s); }); }; -window.randomAvailableTwinSister = /** @param {App.Entity.SlaveState} slave */ function (slave) { - return randomRelatedSlave(slave, function (s) { - return isSlaveAvailable(s) && areSisters(slave, s) === 1; +/** + * @param {App.Entity.SlaveState} slave + * @returns {object} + */ +window.randomAvailableTwinSister = function(slave) { + return randomRelatedSlave(slave, function(s) { + return isSlaveAvailable(s) && areSisters(slave, s); }); }; -window.randomDaughter = /** @param {App.Entity.SlaveState} slave */ function (slave) { - return randomRelatedSlave(slave, function (s) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {object} + */ +window.randomDaughter = function(slave) { + return randomRelatedSlave(slave, function(s) { return s.mother === slave.ID || s.father === slave.ID; }); }; -window.randomAvailableDaughter = /** @param {App.Entity.SlaveState} slave */ function (slave) { - return randomRelatedSlave(slave, function (s) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {object} + */ +window.randomAvailableDaughter = function(slave) { + return randomRelatedSlave(slave, function(s) { return isSlaveAvailable(s) && (s.mother === slave.ID || s.father === slave.ID); }); }; -window.randomParent = /** @param {App.Entity.SlaveState} slave */ function (slave) { - return randomRelatedSlave(slave, function (s) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {object} + */ +window.randomParent = function(slave) { + return randomRelatedSlave(slave, function(s) { return s.ID === slave.mother || s.ID === slave.father; }); }; -window.randomAvailableParent = /** @param {App.Entity.SlaveState} slave */ function (slave) { - return randomRelatedSlave(slave, function (s) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {object} + */ +window.randomAvailableParent = function(slave) { + return randomRelatedSlave(slave, function(s) { return isSlaveAvailable(s) && (s.ID === slave.mother || s.ID === slave.father); }); }; -window.totalPlayerRelatives = function (pc) { - var relatives = 0; +window.totalPlayerRelatives = function(pc) { + let relatives = 0; if (pc.mother > 0) { relatives += 1; } @@ -304,10 +368,15 @@ window.totalPlayerRelatives = function (pc) { return relatives; }; -window.relativeTerm = /** @param {App.Entity.SlaveState} slave1 @param {App.Entity.SlaveState} slave2 */ - function (slave1, slave2) { +/** + * @param {App.Entity.SlaveState} slave1 + * @param {App.Entity.SlaveState} slave2 + * @returns {string} + */ +window.relativeTerm = + function(slave1, slave2) { if (slave2.mother === slave1.ID || slave2.father === slave1.ID) { - if (slave2.genes === "XY" && State.variables.diversePronouns === 1) { + if (slave2.genes === "XY" && State.variables.diversePronouns) { return "son"; } else { return "daughter"; @@ -316,32 +385,32 @@ window.relativeTerm = /** @param {App.Entity.SlaveState} slave1 @param {App.Enti return "mother"; } else if (slave1.father === slave2.ID) { return "father"; - } else if (areSisters(slave2, slave1) === 1) { - if (slave2.genes === "XY" && State.variables.diversePronouns === 1) { + } else if (areSisters(slave2, slave1)) { + if (slave2.genes === "XY" && State.variables.diversePronouns) { return "twin brother"; } else { return "twin sister"; } } else if (areSisters(slave2, slave1) === 2) { - if (slave2.genes === "XY" && State.variables.diversePronouns === 1) { + if (slave2.genes === "XY" && State.variables.diversePronouns) { return "brother"; } else { return "sister"; } } else if (areSisters(slave2, slave1) === 3) { - if (slave2.genes === "XY" && State.variables.diversePronouns === 1) { + if (slave2.genes === "XY" && State.variables.diversePronouns) { return "half-brother"; } else { return "half-sister"; } } else if (isAunt(slave1, slave2)) { - if (slave2.genes === "XY" && State.variables.diversePronouns === 1) { + if (slave2.genes === "XY" && State.variables.diversePronouns) { return "nephew"; } else { return "niece"; } } else if (isAunt(slave2, slave1)) { - if (slave2.genes === "XY" && State.variables.diversePronouns === 1) { + if (slave2.genes === "XY" && State.variables.diversePronouns) { return "uncle"; } else { return "aunt"; diff --git a/src/js/familyTreeJS.js b/src/js/familyTreeJS.js index 491dfcd9d01c0e7699e1e4cb50dbfaaf260b21bf..87f9bab59ea5c47bd0056d63b80d008df6d8c50e 100644 --- a/src/js/familyTreeJS.js +++ b/src/js/familyTreeJS.js @@ -1,7 +1,6 @@ +/* eslint-disable camelcase */ /* eslint-disable no-console */ -/* eslint-disable no-unused-vars */ -/* eslint-disable no-undef */ -var lastActiveSlave, lastSlaves, lastPC; +let lastActiveSlave, lastSlaves, lastPC; /* To use, add something like: @@ -20,16 +19,16 @@ var lastActiveSlave, lastSlaves, lastPC; window.renderFamilyTree = function(slaves, filterID) { 'use strict'; - var ftreeWidth, ftreeHeight; - var chartWidth, chartHeight; - var margin; + let ftreeWidth, ftreeHeight; + let chartWidth, chartHeight; + let margin; d3.select('#ftree-canvas').remove(); - var svg = d3.select('#familyTree') + let svg = d3.select('#familyTree') .append('svg') .attr('id', 'ftree-canvas'); - var chartLayer = svg.append('g').classed('chartLayer', true); + let chartLayer = svg.append('g').classed('chartLayer', true); - var data = buildFamilyTree(slaves, filterID); + let data = buildFamilyTree(slaves, filterID); initFtreeSVG(data); runFtreeSim(data); @@ -48,7 +47,7 @@ window.renderFamilyTree = function(slaves, filterID) { ftreeHeight = 1200; } - margin = { top: 0, left: 0, bottom: 0, right: 0 }; + margin = {top: 0, left: 0, bottom: 0, right: 0}; chartWidth = ftreeWidth - (margin.left + margin.right); @@ -79,15 +78,20 @@ window.renderFamilyTree = function(slaves, filterID) { } function runFtreeSim(data) { - var simulation = d3.forceSimulation() - .force('link', d3.forceLink().id(function (d) { return d.index; })) - .force('collide', d3.forceCollide(function (d) { return 60; }).iterations(4)) + let simulation = d3.forceSimulation() + .force('link', d3.forceLink().id(function(d) { + return d.index; + })) + // eslint-disable-next-line no-unused-vars + .force('collide', d3.forceCollide(function(d) { + return 60; + }).iterations(4)) .force('charge', d3.forceManyBody().strength(-200).distanceMin(100).distanceMax(1000)) .force('center', d3.forceCenter(chartWidth / 2, chartHeight / 2)) .force('y', d3.forceY(100)) .force('x', d3.forceX(200)); - var link = svg.append('g') + let link = svg.append('g') .attr('class', 'link') .selectAll('link') .data(data.links) @@ -106,7 +110,7 @@ window.renderFamilyTree = function(slaves, filterID) { .attr('stroke-width', 2) .attr('fill', 'none'); - var node = svg.selectAll('.node') + let node = svg.selectAll('.node') .data(data.nodes) .enter().append('g') .attr('class', 'node') @@ -116,7 +120,7 @@ window.renderFamilyTree = function(slaves, filterID) { .on('end', dragended)); node.append('circle') - .attr('r', function (d) { return d.r; }) + .attr('r', function(d) { return d.r; }) .attr('stroke', function(d) { if (d.ID === filterID) { return '#ffff20'; @@ -129,7 +133,7 @@ window.renderFamilyTree = function(slaves, filterID) { node.append('text') .text(function(d) { - var ssym; + let ssym; if (d.ID === -1) { if (d.dick === 1 && d.vagina === 1) { ssym = '☿'; @@ -150,7 +154,9 @@ window.renderFamilyTree = function(slaves, filterID) { return `${d.name }(${ssym})`; }) .attr('dy', 4) - .attr('dx', function(d) { return -(8*d.name.length)/2; }) + .attr('dx', function(d) { + return -(8 * d.name.length) / 2; + }) .attr('class', 'node-text') .style('fill', function(d) { if (d.is_mother && d.is_father) { @@ -169,15 +175,15 @@ window.renderFamilyTree = function(slaves, filterID) { svg.selectAll('.node-circle'); svg.selectAll('.node-text'); - var ticked = function () { + let ticked = function() { link - .attr('x1', function (d) { return d.source.x; }) - .attr('y1', function (d) { return d.source.y; }) - .attr('x2', function (d) { return d.target.x; }) - .attr('y2', function (d) { return d.target.y; }); + .attr('x1', function(d) {return d.source.x;}) + .attr('y1', function(d) {return d.source.y;}) + .attr('x2', function(d) {return d.target.x;}) + .attr('y2', function(d) {return d.target.y;}); node - .attr("transform", function (d) { return `translate(${ d.x }, ${ d.y })`; }); + .attr("transform", function(d) {return `translate(${ d.x }, ${ d.y })`;}); }; simulation.nodes(data.nodes) @@ -206,12 +212,9 @@ window.renderFamilyTree = function(slaves, filterID) { }; window.buildFamilyTree = function(slaves = State.variables.slaves, filterID) { - var family_graph = { - nodes: [], - links: [] - }; - var node_lookup = {}; - var preset_lookup = { + let family_graph = {nodes: [], links: []}; + let node_lookup = {}; + let preset_lookup = { '-2': 'A citizen', '-3': 'Former master', '-4': 'An arcology owner', @@ -219,11 +222,11 @@ window.buildFamilyTree = function(slaves = State.variables.slaves, filterID) { '-6': 'Social elite', '-7': 'Gene lab' }; - var outdads = {}; - var outmoms = {}; - var kids = {}; + let outdads = {}; + let outmoms = {}; + let kids = {}; - var fake_pc = { + let fake_pc = { slaveName: `${State.variables.PC.name }(You)`, mother: State.variables.PC.mother, father: State.variables.PC.father, @@ -231,11 +234,11 @@ window.buildFamilyTree = function(slaves = State.variables.slaves, filterID) { vagina: State.variables.PC.vagina, ID: State.variables.PC.ID }; - var charList = [fake_pc]; + let charList = [fake_pc]; charList.push.apply(charList, slaves); charList.push.apply(charList, State.variables.tanks); - var unborn = {}; + let unborn = {}; for (let i = 0; i < State.variables.tanks.length; i++) { unborn[State.variables.tanks[i].ID] = true; } @@ -244,8 +247,8 @@ window.buildFamilyTree = function(slaves = State.variables.slaves, filterID) { } for (let i = 0; i < charList.length; i++) { - var mom = charList[i].mother; - var dad = charList[i].father; + let mom = charList[i].mother; + let dad = charList[i].father; if (mom) { if (!kids[mom]) { @@ -262,7 +265,7 @@ window.buildFamilyTree = function(slaves = State.variables.slaves, filterID) { } for (let i = 0; i < charList.length; i++) { - var character = charList[i]; + let character = charList[i]; if (character.mother === 0 && character.father === 0 && !kids[character.ID]) { continue; } @@ -270,8 +273,16 @@ window.buildFamilyTree = function(slaves = State.variables.slaves, filterID) { if (mom < -6) { if (mom in State.variables.missingTable && State.variables.showMissingSlaves) { node_lookup[mom] = family_graph.nodes.length; - var missing = State.variables.missingTable[mom]; - charList.push({ID: mom, mother: 0, father: 0, is_mother: true, dick: missing.dick, vagina: missing.vagina, slaveName: missing.slaveName}); + let missing = State.variables.missingTable[mom]; + charList.push({ + ID: mom, + mother: 0, + father: 0, + is_mother: true, + dick: missing.dick, + vagina: missing.vagina, + slaveName: missing.slaveName + }); } else { if (typeof outmoms[mom] === 'undefined') { outmoms[mom] = []; @@ -280,7 +291,15 @@ window.buildFamilyTree = function(slaves = State.variables.slaves, filterID) { } } else if (mom < 0 && typeof node_lookup[mom] === 'undefined' && typeof preset_lookup[mom] !== 'undefined') { node_lookup[mom] = family_graph.nodes.length; - charList.push({ID: mom, mother: 0, father: 0, is_father: true, dick: 0, vagina: 1, slaveName: preset_lookup[mom]}); + charList.push({ + ID: mom, + mother: 0, + father: 0, + is_father: true, + dick: 0, + vagina: 1, + slaveName: preset_lookup[mom] + }); } let dad = character.father; @@ -288,7 +307,15 @@ window.buildFamilyTree = function(slaves = State.variables.slaves, filterID) { if (dad in State.variables.missingTable && State.variables.showMissingSlaves) { node_lookup[dad] = family_graph.nodes.length; let missing = State.variables.missingTable[dad]; - charList.push({ID: dad, mother: 0, father: 0, is_father: true, dick: missing.dick, vagina: missing.vagina, slaveName: missing.slaveName}); + charList.push({ + ID: dad, + mother: 0, + father: 0, + is_father: true, + dick: missing.dick, + vagina: missing.vagina, + slaveName: missing.slaveName + }); } else { if (typeof outdads[dad] === 'undefined') { outdads[dad] = []; @@ -297,14 +324,22 @@ window.buildFamilyTree = function(slaves = State.variables.slaves, filterID) { } } else if (dad < 0 && typeof node_lookup[dad] === 'undefined' && typeof preset_lookup[dad] !== 'undefined') { node_lookup[dad] = family_graph.nodes.length; - charList.push({ID: dad, mother: 0, father: 0, is_father: true, dick: 1, vagina: -1, slaveName: preset_lookup[dad]}); + charList.push({ + ID: dad, + mother: 0, + father: 0, + is_father: true, + dick: 1, + vagina: -1, + slaveName: preset_lookup[dad] + }); } } - var mkeys = Object.keys(outmoms); + let mkeys = Object.keys(outmoms); for (let i = 0; i < mkeys.length; i++) { - var name; - var key = mkeys[i]; - var names = outmoms[key]; + let name; + let key = mkeys[i]; + let names = outmoms[key]; if (names.length === 1) { name = names[0]; } else if (names.length === 2) { @@ -314,11 +349,19 @@ window.buildFamilyTree = function(slaves = State.variables.slaves, filterID) { name = names.join(', '); } node_lookup[key] = family_graph.nodes.length; - //Outside extant slaves set - charList.push({ID: key, mother: 0, father: 0, is_mother: true, dick: 0, vagina: 1, slaveName: `${name}'s mother`}); + // Outside extant slaves set + charList.push({ + ID: key, + mother: 0, + father: 0, + is_mother: true, + dick: 0, + vagina: 1, + slaveName: `${name}'s mother` + }); } - var dkeys = Object.keys(outdads); + let dkeys = Object.keys(outdads); for (let i = 0; i < dkeys.length; i++) { let name; let key = dkeys[i]; @@ -332,18 +375,27 @@ window.buildFamilyTree = function(slaves = State.variables.slaves, filterID) { name = names.join(', '); } node_lookup[key] = family_graph.nodes.length; - //Outside extant slaves set - charList.push({ID: key, mother: 0, father: 0, is_father: true, dick: 1, vagina: -1, slaveName: `${name}'s father`}); + // Outside extant slaves set + charList.push({ + ID: key, + mother: 0, + father: 0, + is_father: true, + dick: 1, + vagina: -1, + slaveName: `${name}'s father` + }); } - var charHash = {}; + let charHash = {}; for (let i = 0; i < charList.length; i++) { charHash[charList[i].ID] = charList[i]; } - var related = {}; - var seen = {}; - var saveTree = {}; + let related = {}; + let seen = {}; + let saveTree = {}; + function relatedTo(character, targetID, relIDs = {tree: {}, related: false}) { relIDs.tree[character.ID] = true; if (related[character.ID]) { @@ -371,13 +423,13 @@ window.buildFamilyTree = function(slaves = State.variables.slaves, filterID) { } if (filterID) { if (charHash[filterID]) { - var relIDs = relatedTo(charHash[filterID], filterID); + let relIDs = relatedTo(charHash[filterID], filterID); for (let k in relIDs.tree) { related[k] = true; } for (let i = 0; i < charList.length; i++) { if (charHash[charList[i].ID]) { - var pRelIDs = relatedTo(charHash[charList[i].ID], filterID); + let pRelIDs = relatedTo(charHash[charList[i].ID], filterID); if (pRelIDs.related) { for (let k in pRelIDs.tree) { related[k] = true; @@ -404,7 +456,7 @@ window.buildFamilyTree = function(slaves = State.variables.slaves, filterID) { continue; } node_lookup[char_id] = family_graph.nodes.length; - var char_obj = { + let char_obj = { ID: char_id, name: character.slaveName, dick: character.dick, @@ -437,7 +489,7 @@ window.buildFamilyTree = function(slaves = State.variables.slaves, filterID) { continue; } if (typeof node_lookup[character.mother] !== 'undefined') { - var ltype; + let ltype; if (character.mother === character.father) { ltype = 'homologous'; } else { @@ -445,25 +497,21 @@ window.buildFamilyTree = function(slaves = State.variables.slaves, filterID) { } family_graph.links.push({ type: ltype, - target: node_lookup[char_id]*1, - source: node_lookup[character.mother]*1 + target: node_lookup[char_id] * 1, + source: node_lookup[character.mother] * 1 }); } if (character.mother === character.father) { continue; } if (typeof node_lookup[character.father] !== 'undefined') { - family_graph.links.push({ - type: 'paternal', - target: node_lookup[char_id]*1, - source: node_lookup[character.father]*1 - }); + family_graph.links.push({type: 'paternal', target: node_lookup[char_id] * 1, source: node_lookup[character.father] * 1}); } } return family_graph; }; -/*Old version. To use, do something like: +/* Old version. To use, do something like: <div id="editFamily"> <div id="graph"></div> </div> @@ -482,10 +530,10 @@ window.updateFamilyTree = function(activeSlave = lastActiveSlave, slaves = lastS lastActiveSlave = activeSlave; lastSlaves = slaves; lastPC = PC; - var treeDepth = 0; - var numTreeNodes = 0; + let treeDepth = 0; + let numTreeNodes = 0; - var graphElement = document.getElementById("graph"); + let graphElement = document.getElementById("graph"); if (!graphElement) return; graphElement.innerHTML = ""; @@ -509,7 +557,11 @@ window.updateFamilyTree = function(activeSlave = lastActiveSlave, slaves = lastS if (slaves[i].ID === id) return slaves[i]; } - return {"slaveName": "-", "ID": id, "genes": expectedGenes}; + return { + "slaveName": "-", + "ID": id, + "genes": expectedGenes + }; } function slaveInfo(slave, activeSlaveId, recursionProtectSlaveId = {}) { @@ -536,22 +588,23 @@ window.updateFamilyTree = function(activeSlave = lastActiveSlave, slaves = lastS } return slaveInfo_(slave, activeSlaveId); } - function slaveInfo_(slave, activeSlaveId, slavesAdded={}, depth = 1) { + + function slaveInfo_(slave, activeSlaveId, slavesAdded = {}, depth = 1) { numTreeNodes += 1; treeDepth = Math.max(treeDepth, depth); - var shouldAddChildren = false; + let shouldAddChildren = false; if (!slavesAdded[slave.ID]) { shouldAddChildren = true; slavesAdded[slave.ID] = true; } - var data = { - "name": slave.slaveName + (slave.physicalAge?(` (${ slave.physicalAge })`):""), + let data = { + "name": slave.slaveName + (slave.physicalAge ? (` (${slave.physicalAge})`) : ""), "class": slave.genes, - "textClass": (activeSlaveId === slave.ID)?"emphasis":"", + "textClass": (activeSlaveId === slave.ID) ? "emphasis" : "", "marriages": [], }; - var spouseToChild = {}; + let spouseToChild = {}; function maybeAddSpouseToChild(child) { if (child.ID === slave.ID) @@ -574,24 +627,24 @@ window.updateFamilyTree = function(activeSlave = lastActiveSlave, slaves = lastS maybeAddSpouseToChild(getSlave(-1)); for (let i = 0; i < slaves.length; ++i) { - var child = slaves[i]; + let child = slaves[i]; if (child.ID !== activeSlave.ID) maybeAddSpouseToChild(child); } for (let key in spouseToChild) { if (spouseToChild.hasOwnProperty(key)) { - var children = shouldAddChildren?spouseToChild[key]:[]; - var spouse = getSlave(key, (slaves.genes === "XX")?"unknownXY":(slaves.genes === "XY")?"unknownXX":"unknown"); - var spouseName; + let children = shouldAddChildren?spouseToChild[key]:[]; + let spouse = getSlave(key, (slaves.genes === "XX") ? "unknownXY" : (slaves.genes === "XY") ? "unknownXX" : "unknown"); // FIXME: nested ternary + let spouseName; if (spouse.ID !== slave.ID){ spouseName = spouse.slaveName + (spouse.physicalAge?(` (${ spouse.physicalAge })`):""); } else { - spouseName = (spouse.ID === -1)?"(yourself)":"(themselves)"; + spouseName = (spouse.ID === -1) ? "(yourself)" : "(themselves)"; } - var marriage = { + let marriage = { "spouse": {"name": spouseName, "class": spouse.genes}, - "children": children.map(function (x) { return slaveInfo_(x, activeSlaveId, slavesAdded, depth + 1);} ), + "children": children.map(function(x) {return slaveInfo_(x, activeSlaveId, slavesAdded, depth + 1);}), }; data.marriages.push(marriage); } @@ -604,23 +657,23 @@ window.updateFamilyTree = function(activeSlave = lastActiveSlave, slaves = lastS const treeData = [slaveInfo(activeSlave, activeSlave.ID)]; console.log("Family tree is", treeData, 'and has:', numTreeNodes); - var parentWidth = document.getElementById('editFamily').offsetWidth; + let parentWidth = document.getElementById('editFamily').offsetWidth; console.log(parentWidth, document.getElementById('passages').offsetWidth); if (!parentWidth) parentWidth = document.body.offsetWidth - 483; - console.log(parentWidth, Math.min(200 + 40*numTreeNodes, parentWidth-200) + 200); + console.log(parentWidth, Math.min(200 + 40 * numTreeNodes, parentWidth - 200) + 200); dTree.init(treeData, { target: "#graph", debug: true, - height: 50 + 50*treeDepth, /* very rough heuristics */ - width: Math.min(200 + 40*numTreeNodes, - parentWidth-200) + 200, + height: 50 + 50 * treeDepth, + /* very rough heuristics */ + width: Math.min(200 + 40 * numTreeNodes, + parentWidth - 200) + 200, callbacks: { - nodeClick: function(/*name, extra*/) { - } + nodeClick: function( /* name, extra*/ ) {} } }); }; diff --git a/src/js/food.js b/src/js/food.js index 6286f78f796a6a2a4f056d98479dde4267c3b328..d92bffb1bb4642ba02958506a08e09c5fede630c 100644 --- a/src/js/food.js +++ b/src/js/food.js @@ -1,6 +1,8 @@ -/* eslint-disable no-undef */ -/** @param {App.Entity.SlaveState} slave */ -window.foodAmount = function (slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {number} + */ +window.foodAmount = function(slave) { const V = State.variables; let food = 400; // kg / food produced by base slave / week if (!slave) { @@ -8,7 +10,7 @@ window.foodAmount = function (slave) { } else { if (V.Farmer !== 0) { // if a farmer is assigned food *= 1.1; // TODO: expand this to account for farmer XP and skill - if (V.Farmer.skill.farmer >= V.masteredXP) { // if farmer is master + if (V.Farmer.skill.farmer >= V.masteredXP) { // if farmer is master food *= 1.1; } } @@ -55,8 +57,11 @@ window.foodAmount = function (slave) { } }; -/** @param {App.Entity.SlaveState} slave */ -window.farmShowsIncome = function (slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {number} + */ +window.farmShowsIncome = function(slave) { // TODO: incorporate farmyardRestraints const V = State.variables; let arcology = V.arcologies[0]; @@ -66,7 +71,7 @@ window.farmShowsIncome = function (slave) { } else { if (V.Farmer !== 0) { // farmer is assigned cash *= 1.1; - if (V.Farmer.skill.farmer >= V.masteredXP) { // farmer is master + if (V.Farmer.skill.farmer >= V.masteredXP) { // farmer is master cash *= 1.1; } } diff --git a/src/js/futureSocietyJS.js b/src/js/futureSocietyJS.js index 2cbdac435bd4877aeb91e6a7cd00bb4e0806bc22..0cf8241d6f110e96569e12045d167cfd317679de 100644 --- a/src/js/futureSocietyJS.js +++ b/src/js/futureSocietyJS.js @@ -1,5 +1,3 @@ -/* eslint-disable no-console */ -/* eslint-disable no-undef */ window.FutureSocieties = (function() { return { remove: removeFS, @@ -15,6 +13,7 @@ window.FutureSocieties = (function() { const FSSMR = `${FS }SMR`; let FSLaw = `${FS }Law`; if (arcology[FS] === undefined) { + // eslint-disable-next-line no-console console.log(`ERROR: bad FS reference, $arcologies[0].${FS} not defined`); return; } @@ -102,13 +101,13 @@ window.FutureSocieties = (function() { if (V.arcologies[0].FSNull > 0) { // possibly recalculate for multiculturalism activeFS--; if (V.FSCreditCount === 4) - activeFS += V.arcologies[0].FSNull/25; + activeFS += V.arcologies[0].FSNull / 25; else if (V.FSCreditCount === 6) - activeFS += V.arcologies[0].FSNull/17; + activeFS += V.arcologies[0].FSNull / 17; else if (V.FSCreditCount === 7) - activeFS += V.arcologies[0].FSNull/15; + activeFS += V.arcologies[0].FSNull / 15; else - activeFS += V.arcologies[0].FSNull/20; + activeFS += V.arcologies[0].FSNull / 20; } V.FSCredits = Math.max(Math.trunc(V.FSGotRepCredits - activeFS), 0); } @@ -165,10 +164,12 @@ window.FutureSocieties = (function() { if (activeFS === "standard") { // nothing to do } else if (activeFS === undefined) { + // eslint-disable-next-line no-console console.log(`Error: $${decoration} is ${V[decoration]}`); V[decoration] = "standard"; } else if (!Number.isFinite(V.arcologies[0][activeFS])) { if (V.arcologies[0][activeFS] !== "unset") { + // eslint-disable-next-line no-console console.log(`Error: $arcologies[0].${activeFS} is ${V.arcologies[0][activeFS]}`); } V[decoration] = "standard"; @@ -422,7 +423,7 @@ window.FSChange = function FSChange(FS, magnitude, bonusMultiplier = 1) { } break; default: - errorMessage += '<span class=\'red\'>ERROR: bad FS reference</span>'; + errorMessage += `<span class="red">ERROR: bad FS reference</span>`; } return errorMessage; }; diff --git a/src/js/generateGenetics.js b/src/js/generateGenetics.js index 5e357596254fe22059acbc92a63d71d28fce8797..a326ea7aaf215c0fa2f66d385599dea07d7f67b1 100644 --- a/src/js/generateGenetics.js +++ b/src/js/generateGenetics.js @@ -11,9 +11,35 @@ window.generateGenetics = (function() { function generateGenetics(actor1, actor2, x) { V = State.variables; - genes = {gender: "XX", name: "blank", surname: 0, mother: 0, motherName: "none", father: 0, fatherName: "none", nationality: "Stateless", race: "white", intelligence: 0, face: 0, faceShape: "cute", eyeColor: "brown", hColor: "black", skin: "white", markings: "none", behavioralFlaw: "none", sexualFlaw: "none", pubicHStyle: "bushy", underArmHStyle: "bushy", clone: 0, cloneID: 0, geneticQuirks: 0}; + genes = { + gender: "XX", + name: "blank", + surname: 0, + mother: 0, + motherName: "none", + father: 0, + fatherName: "none", + nationality: "Stateless", + race: "white", + intelligence: 0, + face: 0, + faceShape: "cute", + eyeColor: "brown", + hColor: "black", + skin: "white", + markings: "none", + behavioralFlaw: "none", + sexualFlaw: "none", + pubicHStyle: "bushy", + underArmHStyle: "bushy", + clone: 0, + cloneID: 0, + geneticQuirks: 0 + }; if (actor1.ID > 0) { - mother = V.genePool.find(function(s) { return s.ID === actor1.ID; }); + mother = V.genePool.find(function(s) { + return s.ID === actor1.ID; + }); if (mother === undefined) { mother = actor1; } @@ -26,7 +52,9 @@ window.generateGenetics = (function() { mother = V.PC; } if (actor2 > 0) { - father = V.genePool.find(function(s) { return s.ID === actor2; }); + father = V.genePool.find(function(s) { + return s.ID === actor2; + }); activeFather = V.slaves[V.slaveIndices[actor2]]; if (father === undefined) { father = V.slaves[V.slaveIndices[actor2]]; @@ -34,13 +62,17 @@ window.generateGenetics = (function() { } if (father === undefined) { if (V.incubator > 0) { - father = V.tanks.find(function(s) { return s.ID === actor2; }); + father = V.tanks.find(function(s) { + return s.ID === actor2; + }); activeFather = 0; // activeFather = father? } } if (father === undefined) { if (V.nursery > 0) { - father = V.cribs.find(function(s) { return s.ID === actor2; }); + father = V.cribs.find(function(s) { + return s.ID === actor2; + }); activeFather = 0; // activeFather = father? } } @@ -90,7 +122,7 @@ window.generateGenetics = (function() { if (mother.geneticQuirks.girlsOnly === 2) { gender = "XX"; } else if (V.seeDicksAffectsPregnancy === 1) { - gender = Math.floor(Math.random()*100) < V.seeDicks ? "XY" : "XX"; + gender = Math.floor(Math.random() * 100) < V.seeDicks ? "XY" : "XX"; } else if (V.adamPrinciple === 1) { if (father !== 0) { if (father.genes === "XX" && mother.genes === "XX") { @@ -124,10 +156,14 @@ window.generateGenetics = (function() { let motherName; if (activeMother.ID === -1) { motherName = activeMother.name; - if (activeMother.surname !== 0 && activeMother.surname !== "") { motherName += ` ${activeMother.surname}`; } + if (activeMother.surname !== 0 && activeMother.surname !== "") { + motherName += ` ${activeMother.surname}`; + } } else { motherName = activeMother.slaveName; - if (activeMother.slaveSurname !== 0 && activeMother.slaveSurname !== "") { motherName += ` ${activeMother.slaveSurname}`; } + if (activeMother.slaveSurname !== 0 && activeMother.slaveSurname !== "") { + motherName += ` ${activeMother.slaveSurname}`; + } } return motherName; } @@ -143,10 +179,14 @@ window.generateGenetics = (function() { if (father !== 0) { if (father.ID === -1) { fatherName = activeFather.name; - if (activeFather.surname !== 0 && activeFather.surname !== "") { fatherName += ` ${activeFather.surname}`; } + if (activeFather.surname !== 0 && activeFather.surname !== "") { + fatherName += ` ${activeFather.surname}`; + } } else { fatherName = activeFather.slaveName; - if (activeFather.slaveSurname !== 0 && activeFather.slaveSurname !== "") { fatherName += ` ${activeFather.slaveSurname}`; } + if (activeFather.slaveSurname !== 0 && activeFather.slaveSurname !== "") { + fatherName += ` ${activeFather.slaveSurname}`; + } } } else { switch (actor2) { @@ -219,7 +259,7 @@ window.generateGenetics = (function() { return race; } - //skin + // skin function setSkin(father, mother, actor2) { let fatherSkin = 0; let dadSkinIndex; @@ -311,13 +351,13 @@ window.generateGenetics = (function() { } else if (mother.origEye === "red" || mother.origEye === "pale red" || mother.origEye === "light red" || mother.origEye === "pale gray" || mother.origEye === "milky white") { eyeColor = fatherEye; } else if (fatherEye === "blue") { - if (jsRandom(1,4) === 2) { + if (jsRandom(1, 4) === 2) { eyeColor = mother.origEye; } else { eyeColor = fatherEye; } } else if (fatherEye === "blue") { - if (jsRandom(1,4) === 2) { + if (jsRandom(1, 4) === 2) { eyeColor = fatherEye; } else { eyeColor = mother.origEye; @@ -329,7 +369,7 @@ window.generateGenetics = (function() { eyeColor = mother.origEye; } } - //just in case something wrong gets through + // just in case something wrong gets through switch (eyeColor) { case "blind blue": eyeColor = "deep blue"; @@ -338,6 +378,7 @@ window.generateGenetics = (function() { case "implant": eyeColor = jsEither(["blue", "brown", "dark blue", "dark green", "green", "hazel", "light blue", "light green"]); break; + } return eyeColor; } @@ -369,7 +410,7 @@ window.generateGenetics = (function() { if (mother.geneticQuirks.heterochromia !== 0 && mother.geneticQuirks.heterochromia !== 1) { eyeColorArray.push(mother.geneticQuirks.heterochromia); } - //just in case something wrong gets through + // just in case something wrong gets through switch (hEyeColor) { case "blind blue": hEyeColor = ["deep blue"]; @@ -378,6 +419,7 @@ window.generateGenetics = (function() { case "implant": hEyeColor = jsEither(["blue", "green", "brown", "hazel", "light blue", "light green", "dark green", "dark blue"]); break; + } return jsEither(eyeColorArray); } @@ -415,7 +457,7 @@ window.generateGenetics = (function() { if (mother.origHColor === fatherHair) { hairColor = mother.origHColor; } else if (mother.origHColor === "white") { - hairColor = jsRandom(1,100) === 69 ? mother.origHColor : fatherHair; + hairColor = jsRandom(1, 100) === 69 ? mother.origHColor : fatherHair; } else if (mother.origHColor === "black") { hairColor = jsEither([fatherHair, mother.origHColor, mother.origHColor, mother.origHColor, mother.origHColor, mother.origHColor, mother.origHColor, mother.origHColor]); } else if (fatherHair === "black") { @@ -520,11 +562,11 @@ window.generateGenetics = (function() { } else { fetish = jsEither(["none", "none", "none", "none", "none", mother.fetish, mother.fetish]); } - if (fetish === "mindbroken") { fetish = "none"; } + if (fetish === "mindbroken") {fetish = "none";} return fetish; } - //intelligence + // intelligence function setIntelligence(father, mother, activeMother, actor2) { let smarts; if (mother.ID === -1) { @@ -576,7 +618,7 @@ window.generateGenetics = (function() { return Math.clamp(smarts, -100, 100); } - //face + // face function setFace(father, mother, activeMother, actor2, genes) { let face; if (genes.pFace > 0 && genes.uFace > 0) { @@ -648,7 +690,24 @@ window.generateGenetics = (function() { // genetic quirks function setGeneticQuirks(father, mother, sex) { - let quirks = {macromastia: 0, gigantomastia: 0, fertility: 0, hyperFertility: 0, superfetation: 0, gigantism: 0, dwarfism: 0, pFace: 0, uFace: 0, albinism: 0, heterochromia: 0, rearLipedema: 0, wellHung: 0, wGain: 0, wLoss: 0, androgyny: 0}; + let quirks = { + macromastia: 0, + gigantomastia: 0, + fertility: 0, + hyperFertility: 0, + superfetation: 0, + gigantism: 0, + dwarfism: 0, + pFace: 0, + uFace: 0, + albinism: 0, + heterochromia: 0, + rearLipedema: 0, + wellHung: 0, + wGain: 0, + wLoss: 0, + androgyny: 0 + }; let chance = 0; // fertility @@ -794,7 +853,7 @@ window.generateGenetics = (function() { } } - //perfect face + // perfect face if (father !== 0) { if (mother.geneticQuirks.pFace + father.geneticQuirks.pFace >= 4) { quirks.pFace = 2; @@ -805,7 +864,7 @@ window.generateGenetics = (function() { quirks.pFace = 1; } - //ugly face + // ugly face if (father !== 0) { if (mother.geneticQuirks.uFace + father.geneticQuirks.uFace >= 4) { quirks.uFace = 2; @@ -816,7 +875,7 @@ window.generateGenetics = (function() { quirks.uFace = 1; } - //albinism + // albinism if (father !== 0) { // Add treatment to force albinism if (mother.geneticQuirks.albinism === 2 && father.geneticQuirks.albinism === 2) { @@ -848,7 +907,7 @@ window.generateGenetics = (function() { } } - //heterochromia + // heterochromia if (father !== 0) { if (mother.geneticQuirks.heterochromia === 2 && father.geneticQuirks.heterochromia === 2) { if (jsRandom(1, 4) === 1) { @@ -879,7 +938,7 @@ window.generateGenetics = (function() { } } - //rear lipedema + // rear lipedema if (father !== 0) { if (mother.geneticQuirks.rearLipedema === 2 && father.geneticQuirks.rearLipedema === 2) { if (jsRandom(1, 4) >= 3) { @@ -911,8 +970,8 @@ window.generateGenetics = (function() { } } } - - //gigantomastia + + // Gigantomastia if (father !== 0) { if (mother.geneticQuirks.gigantomastia >= 2 && father.geneticQuirks.gigantomastia >= 2) { if (jsRandom(1, 4) === 1) { @@ -942,8 +1001,8 @@ window.generateGenetics = (function() { } } } - - //macromastia + + // Macromastia if (father !== 0) { if (mother.geneticQuirks.macromastia >= 2 && father.geneticQuirks.macromastia >= 2) { if (jsRandom(1, 4) === 1) { @@ -980,13 +1039,13 @@ window.generateGenetics = (function() { return generateGenetics; })(); -window.generateChild = function (mother, ova, destination) { +window.generateChild = function(mother, ova, destination) { let V = State.variables; - let genes = ova.genetics; //maybe just argument this? We'll see. + let genes = ova.genetics; // maybe just argument this? We'll see. let pregUpgrade = V.pregnancyMonitoringUpgrade; let child = {}; - if (!destination) { //does extra work for the incubator if defined, otherwise builds a simple object + if (!destination) { // does extra work for the incubator if defined, otherwise builds a simple object if (genes.gender === "XX") { child.genes = "XX"; child.slaveSurname = genes.surname; @@ -1189,7 +1248,11 @@ window.generateChild = function (mother, ova, destination) { child.fetish = genes.fetish; child.geneticQuirks = clone(genes.geneticQuirks); if (child.geneticQuirks.albinism === 2) { - child.albinismOverride = {skin: genes.skin, eyeColor: genes.eyeColor, hColor: genes.hColor}; + child.albinismOverride = { + skin: genes.skin, + eyeColor: genes.eyeColor, + hColor: genes.hColor + }; child.hColor = "white"; child.pubicHColor = child.hColor; child.underArmHColor = child.hColor; @@ -1250,6 +1313,7 @@ window.generateChild = function (mother, ova, destination) { } else { V.activeSlaveOneTimeMinAge = V.targetAge; V.activeSlaveOneTimeMaxAge = V.targetAge; + // eslint-disable-next-line camelcase V.one_time_age_overrides_pedo_mode = 1; V.ageAdjustOverride = 1; @@ -1472,19 +1536,11 @@ window.generateChild = function (mother, ova, destination) { child.birthWeek = 0; child.energy = 0; child.anus = 0; - if (child.vagina > 0) { child.vagina = 0; } - if (child.fetish !== "none") { child.fetishStrength = 20; } - if (child.dick > 0) { - child.foreskin = 1; - child.balls = 1; - child.scrotum = 1; - } - if (genes.faceShape !== undefined) { - child.faceShape = genes.faceShape; - } - if (mother.addict > 0) { - child.addict = Math.trunc(mother.addict / 2); - } + if (child.vagina > 0) {child.vagina = 0;} + if (child.fetish !== "none") {child.fetishStrength = 20;} + if (child.dick > 0) {child.foreskin = 1; child.balls = 1; child.scrotum = 1;} + if (genes.faceShape !== undefined) {child.faceShape = genes.faceShape;} + if (mother.addict > 0) {child.addict = Math.trunc(mother.addict / 2);} child.career = "a slave since birth"; child.birthName = child.slaveName; child.birthSurname = child.slaveSurname; diff --git a/src/js/generateNewSlaveJS.js b/src/js/generateNewSlaveJS.js index eea1a3df11d06081641e53ac5819d669beeec78a..d928bccf609fa592fc6501e699c33af75d36c239 100644 --- a/src/js/generateNewSlaveJS.js +++ b/src/js/generateNewSlaveJS.js @@ -1,8 +1,10 @@ -/* eslint-disable no-undef */ +/* eslint-disable camelcase */ window.GenerateNewSlave = (function() { "use strict"; - let V; let chance; - /** @type {App.Entity.SlaveState} */ + let V; + let chance; + /** + * @type {App.Entity.SlaveState} */ let slave; function GenerateNewSlave(sex) { @@ -111,7 +113,7 @@ window.GenerateNewSlave = (function() { function generateXXBodyProportions() { slave.height = Math.round(Height.random(slave)); - if (slave.height >= Height.mean(slave) * 170/162.5) { + if (slave.height >= Height.mean(slave) * 170 / 162.5) { slave.hips = jsEither([-1, 0, 0, 1, 1, 2, 2]); slave.shoulders = jsEither([-1, -1, 0, 0, 0, 1]); } else { @@ -139,7 +141,7 @@ window.GenerateNewSlave = (function() { function generateXYBodyProportions() { slave.height = Math.round(Height.random(slave)); if (slave.physicalAge <= 13) { - if (slave.height > Height.mean(slave) * 170/172.5) { + if (slave.height > Height.mean(slave) * 170 / 172.5) { slave.hips = jsEither([-2, -1, -1, 0, 1]); slave.shoulders = jsEither([-1, -1, 0, 0, 0, 1]); } else { @@ -147,7 +149,7 @@ window.GenerateNewSlave = (function() { slave.shoulders = jsEither([-2, -1, -1, 0, 0, 1]); } } else { - if (slave.height > Height.mean(slave) * 170/172.5) { + if (slave.height > Height.mean(slave) * 170 / 172.5) { slave.hips = jsEither([-2, -1, -1, 0, 1]); slave.shoulders = jsEither([-1, 0, 1, 1, 2, 2]); } else { @@ -209,7 +211,7 @@ window.GenerateNewSlave = (function() { if (slave.energy < jsRandom(1, 80)) { slave.vaginaLube = 0; - } else if ( slave.physicalAge > jsRandom(35, 60)) { + } else if (slave.physicalAge > jsRandom(35, 60)) { slave.vaginaLube = 0; } else { slave.vaginaLube = 1; @@ -927,7 +929,7 @@ window.GenerateNewSlave = (function() { } else if (slave.physicalAge <= 11) { slave.pregAdaptation = slave.physicalAge - 1; } else if (slave.physicalAge <= 14) { - slave.pregAdaptation = 4*(slave.physicalAge - 12) + 14; + slave.pregAdaptation = 4 * (slave.physicalAge - 12) + 14; } else if (slave.physicalAge <= 15) { slave.pregAdaptation = 28; } else if (slave.physicalAge <= 16) { @@ -945,7 +947,7 @@ window.GenerateNewSlave = (function() { } else if (slave.physicalAge <= 11) { slave.pregAdaptation = slave.physicalAge - 1; } else if (slave.physicalAge <= 15) { - slave.pregAdaptation = 2*(slave.physicalAge - 12) + 12; + slave.pregAdaptation = 2 * (slave.physicalAge - 12) + 12; } else { slave.pregAdaptation = 20; } @@ -980,7 +982,7 @@ window.GenerateNewSlave = (function() { } function generateXXTeeth() { - let femaleCrookedTeethGen = slave.intelligence+slave.intelligenceImplant; + let femaleCrookedTeethGen = slave.intelligence + slave.intelligenceImplant; if ("American" === slave.nationality) { femaleCrookedTeethGen += 20; } else if (["Andorran", "Antiguan", "Argentinian", "Aruban", "Australian", "Austrian", "Bahamian", "Bahraini", "Barbadian", "Belarusian", "Belgian", "Bermudian", "Brazilian", "British", "Bruneian", "Bulgarian", "Canadian", "Catalan", "Chilean", "a Cook Islander", "Croatian", "Curaçaoan", "Cypriot", "Czech", "Danish", "Dutch", "Emirati", "Estonian", "Finnish", "French", "German", "Greek", "Greenlandic", "Guamanian", "Hungarian", "Icelandic", "Irish", "Israeli", "Italian", "Japanese", "Kazakh", "Korean", "Kuwaiti", "Latvian", "a Liechtensteiner", "Lithuanian", "Luxembourgian", "Malaysian", "Maltese", "Mauritian", "Monégasque", "Montenegrin", "New Caledonian", "a New Zealander", "Niuean", "Norwegian", "Omani", "Palauan", "Panamanian", "Polish", "Portuguese", "Puerto Rican", "Qatari", "Romanian", "Russian", "Sammarinese", "Saudi", "Seychellois", "Singaporean", "Slovak", "Slovene", "Spanish", "Swedish", "Swiss", "Taiwanese", "Trinidadian", "Uruguayan", "Vatican"].includes(slave.nationality)) { @@ -1001,7 +1003,7 @@ window.GenerateNewSlave = (function() { } function generateXYTeeth() { - let maleCrookedTeethGen = slave.intelligence+slave.intelligenceImplant; + let maleCrookedTeethGen = slave.intelligence + slave.intelligenceImplant; if ("American" === slave.nationality) { maleCrookedTeethGen += 22; } else if (["Andorran", "Antiguan", "Argentinian", "Aruban", "Australian", "Austrian", "Bahamian", "Bahraini", "Barbadian", "Belarusian", "Belgian", "Bermudian", "Brazilian", "British", "Bruneian", "Bulgarian", "Canadian", "Catalan", "Chilean", "a Cook Islander", "Croatian", "Curaçaoan", "Cypriot", "Czech", "Danish", "Dutch", "Emirati", "Estonian", "Finnish", "French", "German", "Greek", "Greenlandic", "Guamanian", "Hungarian", "Icelandic", "Irish", "Israeli", "Italian", "Japanese", "Kazakh", "Korean", "Kuwaiti", "Latvian", "a Liechtensteiner", "Lithuanian", "Luxembourgian", "Malaysian", "Maltese", "Mauritian", "Monégasque", "Montenegrin", "New Caledonian", "a New Zealander", "Niuean", "Norwegian", "Omani", "Palauan", "Panamanian", "Polish", "Portuguese", "Puerto Rican", "Qatari", "Romanian", "Russian", "Sammarinese", "Saudi", "Seychellois", "Singaporean", "Slovak", "Slovene", "Spanish", "Swedish", "Swiss", "Taiwanese", "Trinidadian", "Uruguayan", "Vatican"].includes(slave.nationality)) { @@ -1217,7 +1219,7 @@ window.GenerateNewSlave = (function() { slave.visualAge = slave.actualAge; slave.physicalAge = slave.actualAge; slave.ovaryAge = slave.actualAge; - slave.age = slave.actualAge; /*compatibility*/ + slave.age = slave.actualAge; /* compatibility */ slave.pubertyAgeXX = V.fertilityAge; slave.pubertyAgeXY = V.potencyAge; } @@ -1226,14 +1228,15 @@ window.GenerateNewSlave = (function() { const gaussian = gaussianPair(); slave.intelligence = Intelligence.random(); if (V.AgePenalty === 1 && slave.actualAge <= 24) { - if (gaussian[0] < gaussian[1] + slave.intelligence/29 + (slave.actualAge - 24)/8 - 0.35) { + if (gaussian[0] < gaussian[1] + slave.intelligence / 29 + (slave.actualAge - 24) / 8 - 0.35) { slave.intelligenceImplant = 15; if (slave.intelligenceImplant > 0 && jsRandom(15, 150) < slave.intelligence) { slave.intelligenceImplant = 30; } } } else { - if (gaussian[0] < gaussian[1] + slave.intelligence/29 - 0.35) { /* 40.23% chance if intelligence is 0, 99.26% chance if intelligence is 100 */ + if (gaussian[0] < gaussian[1] + slave.intelligence / 29 - 0.35) { + /* 40.23% chance if intelligence is 0, 99.26% chance if intelligence is 100 */ slave.intelligenceImplant = 15; if (slave.intelligenceImplant > 0 && jsRandom(15, 150) < slave.intelligence) { slave.intelligenceImplant = 30; @@ -1409,13 +1412,13 @@ window.GenerateNewSlave = (function() { if (slave.weight < -10 && slave.boobs > 200) { slave.boobs -= 100; } else if (slave.weight > 190 && slave.boobs < 3000) { - slave.boobs += (jsRandom(3, 8)*100); + slave.boobs += (jsRandom(3, 8) * 100); } else if (slave.weight > 160 && slave.boobs < 1500) { - slave.boobs += (jsRandom(2, 6)*100); + slave.boobs += (jsRandom(2, 6) * 100); } else if (slave.weight > 130 && slave.boobs < 1500) { - slave.boobs += (jsRandom(1, 4)*100); + slave.boobs += (jsRandom(1, 4) * 100); } else if (slave.weight > 95 && slave.boobs < 1200) { - slave.boobs += (jsRandom(1, 3)*100); + slave.boobs += (jsRandom(1, 3) * 100); } else if (slave.weight > 30 && slave.boobs < 1000) { slave.boobs += 100; } @@ -1482,35 +1485,35 @@ window.GenerateNewSlave = (function() { const rolled = jsEither(disList); switch (rolled) { case "hearNot": - if ((jsRandom(1, 100)-(disableCount*2)) > 90) { + if ((jsRandom(1, 100) - (disableCount * 2)) > 90) { slave.hears = -2; } disList.delete("hearNot"); disableCount++; break; case "seeNot": - if ((jsRandom(1, 100)-(disableCount*2)) > 90) { + if ((jsRandom(1, 100) - (disableCount * 2)) > 90) { slave.eyes = -2; } disList.delete("seeNot"); disableCount++; break; case "speakNot": - if ((jsRandom(1, 100)-(disableCount*2)) > 90) { + if ((jsRandom(1, 100) - (disableCount * 2)) > 90) { slave.voice = 0; } disList.delete("speakNot"); disableCount++; break; case "smellNot": - if ((jsRandom(1, 100)-(disableCount*2)) > 90) { + if ((jsRandom(1, 100) - (disableCount * 2)) > 90) { slave.smells = -1; } disList.delete("smellNot"); disableCount++; break; case "tasteNot": - if ((jsRandom(1, 100)-(disableCount*2)) > 90) { + if ((jsRandom(1, 100) - (disableCount * 2)) > 90) { slave.tastes = -1; } disList.delete("tasteNot"); @@ -1525,7 +1528,11 @@ window.GenerateNewSlave = (function() { function generateGeneticQuirkTweaks() { if (slave.geneticQuirks.albinism === 2) { - slave.albinismOverride = {skin: slave.skin, eyeColor: slave.eyeColor, hColor: slave.hColor}; + slave.albinismOverride = { + skin: slave.skin, + eyeColor: slave.eyeColor, + hColor: slave.hColor + }; slave.hColor = "white"; slave.eyeColor = "red"; switch (slave.race) { diff --git a/src/js/hTagMacroJS.js b/src/js/hTagMacroJS.js index a0908716ab2f36f3a701760f96851d23201c3b35..be89c63fff6baddf9def7050ddf7f381a4a9d392 100644 --- a/src/js/hTagMacroJS.js +++ b/src/js/hTagMacroJS.js @@ -1,4 +1,3 @@ -/* eslint-disable no-undef */ /* * <<htag>> macro * A simple macro which allows to create wrapping html elements with dynamic IDs. @@ -19,7 +18,8 @@ Macro.add('htag', { const payload = this.payload[0].contents.replace(/(^\n+|\n+$)/, ''); let htag = 'div'; let attributes; - function munge (val, key) { + + function munge(val, key) { return `${key }="${ val }"`; } @@ -32,7 +32,9 @@ Macro.add('htag', { else attributes = `id="${ String(this.args[0]).trim() }"`; if (Config.debug) - this.debugView.modes({block: true}); + this.debugView.modes({ + block: true + }); jQuery(`<${ htag } ${ attributes } />`) .wiki(payload) diff --git a/src/js/heroCreator.js b/src/js/heroCreator.js index 51fc8409a74ea4bb6ec8e3854dfac567913cb6b3..1539fecb5f492203adaaca8f0e0bfd473ee99032 100644 --- a/src/js/heroCreator.js +++ b/src/js/heroCreator.js @@ -1,10 +1,9 @@ -/* eslint-disable no-undef */ /** * @param {App.Entity.SlaveState} heroSlave * @param {App.Entity.SlaveState} baseHeroSlave * @return {App.Entity.SlaveState} */ -App.Utils.getHeroSlave = function (heroSlave, baseHeroSlave) { +App.Utils.getHeroSlave = function(heroSlave, baseHeroSlave) { function isObject(o) { return (o !== undefined && typeof o === 'object' && !Array.isArray(o)); } diff --git a/src/js/itemAvailability.js b/src/js/itemAvailability.js index 76505432686551847b17fed3b504e22284ecde93..e7c07a12666a2f575993554907eb1203eb0b66fa 100644 --- a/src/js/itemAvailability.js +++ b/src/js/itemAvailability.js @@ -1,4 +1,3 @@ -/* eslint-disable no-undef */ /* intended to condense the clothing/toy/etc availability checks into something less asinine */ /** @@ -12,7 +11,8 @@ window.isItemAccessible = function(string) { if (V.cheatMode === 1) { return true; } - switch (string) { /* no breaks needed because we always return */ + switch (string) { + /* no breaks needed because we always return */ case "attractive lingerie for a pregnant woman": return (V.arcologies[0].FSRepopulationFocus > 0 || V.clothesBoughtMaternityLingerie === 1); case "a bunny outfit": @@ -76,9 +76,9 @@ window.isItemAccessible = function(string) { return (V.clothesBoughtCareer === 1 || V.PC.career === "servant"); case "a ball gown": case "a gothic lolita dress": - //case 'a halter top dress': - //case 'a mini dress': - //case 'a slave gown': + // case 'a halter top dress': + // case 'a mini dress': + // case 'a slave gown': return (V.clothesBoughtDresses === 1); case "a cybersuit": case "a latex catsuit": @@ -132,7 +132,8 @@ window.isItemAccessible = function(string) { return (V.arcologies[0].FSGenderFundamentalist > 0 || V.clothesBoughtBunny === 1); case "ancient Egyptian": return (V.arcologies[0].FSEgyptianRevivalist > 0 || V.clothesBoughtEgypt === 1); - case "pasties": /* an option in saChoosesOwnClothes.tw, but everything else (e.g. descriptions, artwork, option in wardrobeUse.tw) is missing or not hooked up correctly */ + case "pasties": + /* an option in saChoosesOwnClothes.tw, but everything else (e.g. descriptions, artwork, option in wardrobeUse.tw) is missing or not hooked up correctly */ return false; case "massive dildo gag": return (V.toysBoughtGags === 1); diff --git a/src/js/nurseryWidgets.js b/src/js/nurseryWidgets.js new file mode 100644 index 0000000000000000000000000000000000000000..92bff88e24a4ed978dacf9ecdca00a8b818e3f01 --- /dev/null +++ b/src/js/nurseryWidgets.js @@ -0,0 +1,7 @@ +App.Facilities.Nursery.ChildSummary = function(child) { + const V = State.variables; + let r = ``; + r += `${child} will stay in ${V.nurseryName} for another ${child.weeksLeft} weeks. `; + r += SlaveSummary(child); + return r; +}; diff --git a/src/js/optionsMacro.js b/src/js/optionsMacro.js index 8f20091d84b6f360183a058ccc1756ad38a5495c..54c9e134d33fd9db6611a8288e94e747c496e376 100644 --- a/src/js/optionsMacro.js +++ b/src/js/optionsMacro.js @@ -1,6 +1,5 @@ +/* eslint-disable camelcase */ /* eslint-disable no-empty */ -/* eslint-disable no-console */ -/* eslint-disable no-undef */ /* Use like: <<options $varname "New Passage (defaults to current passage)">> A title @@ -23,18 +22,18 @@ Macro.add('options', { 'optiondefault', 'optionif'], handler : function() { try { - var currentOption = this.payload[0].args[0]; - var currentOptionIsNumber = typeof currentOption === "number"; - var variable = null; - var title = this.payload[0].contents || ''; - var passageName = this.payload[0].args[1] || passage(); - var found = false; - var found_index = 0; - var comment = null; - var hasMultipleOptionsWithSameValue = false; - var description = ""; - var hasCurrentOption = this.payload[0].args.full && - this.payload[0].args.full !== '""' && this.payload[0].args.full !== "''"; + let currentOption = this.payload[0].args[0]; + let currentOptionIsNumber = typeof currentOption === "number"; + let variable = null; + let title = this.payload[0].contents || ''; + let passageName = this.payload[0].args[1] || passage(); + let found = false; + let found_index = 0; + let comment = null; + let hasMultipleOptionsWithSameValue = false; + let description = ""; + let hasCurrentOption = this.payload[0].args.full && + this.payload[0].args.full !== '""' && this.payload[0].args.full !== "''"; /* Check if we have a first argument - if we do, it should be a variable like $foo @@ -43,10 +42,11 @@ Macro.add('options', { if (currentOption === undefined) currentOption = false; if (this.payload[0].args.full.startsWith("State.temporary.")) { - variable = "_" + this.payload[0].args.full.split(' ',1)[0].substring("State.temporary.".length); + variable = "_" + this.payload[0].args.full.split(' ', 1)[0].substring("State.temporary.".length); } else if (this.payload[0].args.full.startsWith("State.variables.")) { - variable = "$" + this.payload[0].args.full.split(' ',1)[0].substring("State.variables.".length); + variable = "$" + this.payload[0].args.full.split(' ', 1)[0].substring("State.variables.".length); } else { + // eslint-disable-next-line no-console console.log(this.payload[0].args.full); throw new Error("First parameter to 'options' must be a variable"); } @@ -93,9 +93,7 @@ Macro.add('options', { found = true; found_index = i; } - } else if (this.payload[i].name === 'comment') { - } else if (this.payload[i].name === 'optionif') { - } else { + } else if (this.payload[i].name === 'comment') {} else if (this.payload[i].name === 'optionif') {} else { throw new Error("Only valid tag is 'option' inside 'options'"); } } @@ -114,17 +112,17 @@ Macro.add('options', { } } - var showSelectedOption = true; //this.payload.length !== 3 || !description; + let showSelectedOption = true; // this.payload.length !== 3 || !description; /* Now print out the list of options */ - var output = ""; - var optionIfIsFalse = false; + let output = ""; + let optionIfIsFalse = false; for (let i = 1, len = this.payload.length; i < len; ++i) { if (this.payload[i].name === "optionif") { if (this.payload[i].args.length === 0) { optionIfIsFalse = false; /* No options means to turn off optionif */ } else if (this.payload[i].args.length === 1) { // Evaluate it and see if is false - if (typeof(this.payload[i].args[0]) !== 'boolean') { + if (typeof (this.payload[i].args[0]) !== 'boolean') { throw new Error("optionif requires true or false for the first (and only) parameter"); } optionIfIsFalse = !this.payload[i].args[0]; @@ -136,25 +134,32 @@ Macro.add('options', { if (optionIfIsFalse) { continue; } else if (this.payload[i].name.startsWith('option')) { - var args = this.payload[i].args; - var hasComparitor = this.payload[i].name !== "option" && this.payload[i].name !== "optiondefault"; - var argText = args[hasComparitor ? 2 : 1] || ""; + let args = this.payload[i].args; + let hasComparitor = this.payload[i].name !== "option" && this.payload[i].name !== "optiondefault"; + let argText = args[hasComparitor ? 2 : 1] || ""; if (args.length === 0) { output += this.payload[i].contents.trim(); } else { - var extraComment = args[hasComparitor ? 4: 3]; + let extraComment = args[hasComparitor ? 4 : 3]; extraComment = extraComment ? ' ' + extraComment : ''; // We use a very crude heuristic for styling 'Enable' // and 'Disable' buttons differently. const isEnableOption = argText && (argText.startsWith("Enable") || argText === "Yes" || argText.startsWith("Allow")); const isDisableOption = argText && (argText.startsWith("Disable") || argText === "No" || argText.startsWith("Deny")); - var className = "optionMacroOption " + (isEnableOption ? "optionMacroEnable" : isDisableOption ? "optionMacroDisable" : ""); + let className = "optionMacroOption "; + if (isEnableOption === "optionMacroEnable") { + className += isDisableOption; + } else { + if (isDisableOption) { + className += "optionMacroDisable"; + } + } if (found_index !== i || hasMultipleOptionsWithSameValue) { - var onClickChange = args[hasComparitor ? 3 : 2]; + let onClickChange = args[hasComparitor ? 3 : 2]; onClickChange = onClickChange ? ', ' + onClickChange : ''; - output += '<span class="' + className + '">[[' + argText + extraComment + '|' + passageName + "][" + variable + " = " + JSON.stringify(args[hasComparitor ? 1 : 0]) + onClickChange + "]]" + "</span>"; + output += `<span class=${className}>[[${argText}${extraComment}|${passageName}][${variable}=${JSON.stringify(args[hasComparitor ? 1 : 0])}${onClickChange}]]</span>`; } else if (showSelectedOption) { - output +='<span class="optionMacroSelected ' + className + '">' + argText + extraComment + '</span>'; + output += `<span class=${optionMacroSelected}${className}>${argText}${extraComment}</span>`; } } } else if (this.payload[i].name === 'comment') { @@ -162,13 +167,11 @@ Macro.add('options', { } } jQuery(this.output).wiki( - '<span class="optionMacro ' + (currentOptionIsNumber ? 'optionMacroNumber' : '') + '">' + - '<span class="optionDescription">' + title + ' ' + description + "</span>" + - '<span class="optionValue">' + output + "</span>" + - (comment ? '<span class="optionComment">//' + comment + "//</span>" : '') + - '</span>'); - } - catch (ex) { + `<span class=optionMacro ${currentOptionIsNumber ? 'optionMacroNumber' : ``}>` + + `<span class=optionDescription> ${title} ${description} </span>` + + `<span class=optionValue> ${output} </span> ${comment ? `<span class=optionComment>// ${comment} //</span>` : ``}` + + `</span>`); + } catch (ex) { return this.error('bad options expression: ' + ex.message); } } diff --git a/src/js/pregJS.js b/src/js/pregJS.js index 8b4d7eb1d511814346e5309ed7e4d556e5fa9fbf..641ef7329c818484e4baec887d273b81f071fc89 100644 --- a/src/js/pregJS.js +++ b/src/js/pregJS.js @@ -1,11 +1,9 @@ -/* eslint-disable no-empty */ -/* eslint-disable no-undef */ /* Major props to the anons who worked together to forge the Super Pregnancy Project. Let your legacy go unforgotten.*/ window.getPregBellySize = function(s) { - var targetLen; - var gestastionWeek = s.preg; - var fetuses = s.pregType; - var phi = 1.618; + let targetLen; + let gestastionWeek = s.preg; + let fetuses = s.pregType; + let phi = 1.618; if (gestastionWeek <= 32) { targetLen = ((0.00006396 * Math.pow(gestastionWeek, 4)) - (0.005501 * Math.pow(gestastionWeek, 3)) + (0.161 * Math.pow(gestastionWeek, 2)) - (0.76 * gestastionWeek) + 0.208); @@ -15,11 +13,14 @@ window.getPregBellySize = function(s) { targetLen = ((-0.00003266 * Math.pow(gestastionWeek, 2)) + (0.076 * gestastionWeek) + 43.843); } - var bellySize = ((4 / 3) * (Math.PI) * (phi / 2) * (Math.pow((targetLen / 2), 3)) * fetuses); + let bellySize = ((4 / 3) * (Math.PI) * (phi / 2) * (Math.pow((targetLen / 2), 3)) * fetuses); return bellySize; }; -/** @param {App.Entity.SlaveState} slave */ +/** + * @param {App.Entity.SlaveState} slave + * @returns {string} + */ window.bellyAdjective = function(slave) { slave = slave || State.variables.activeSlave; if (slave.belly >= 1500) { @@ -27,25 +28,25 @@ window.bellyAdjective = function(slave) { if (slave.preg > slave.pregData.normalBirth/4) { return 'unfathomably distended, brimming with life'; } else { - return 'unfathomable'; + return `unfathomable`; } } else if (slave.belly >= 750000) { if (slave.preg > slave.pregData.normalBirth/4) { return 'monolithic bulging'; } else { - return 'monolithic'; + return `monolithic`; } } else if (slave.belly >= 600000) { if (slave.preg > slave.pregData.normalBirth/4) { return 'titanic bulging'; } else { - return 'titanic'; + return `titanic`; } } else if (slave.belly >= 450000) { if (slave.preg > slave.pregData.normalBirth/4) { return 'gigantic bulgy'; } else { - return 'gigantic'; + return `gigantic`; } } else if (slave.belly >= 300000) { return 'massive'; @@ -56,10 +57,8 @@ window.bellyAdjective = function(slave) { } else if (slave.belly >= 10000) { return 'big'; } else { - return 'swollen'; + return `swollen`; } - } else { - return ''; } }; @@ -67,12 +66,12 @@ window.bellyAdjective = function(slave) { window.setPregType = function(actor) { /* IMHO rework is possible. Can be more interesting to play, if this code will take in account more body conditions - age, fat, food, hormone levels, etc. */ - var ovum = jsRandom(actor.pregData.normalOvaMin, actor.pregData.normalOvaMax); //for default human profile it's always 1. - var fertilityStack = 0; // adds an increasing bonus roll for stacked fertility drugs + let ovum = jsRandom(actor.pregData.normalOvaMin, actor.pregData.normalOvaMax); // for default human profile it's always 1. + let fertilityStack = 0; // adds an increasing bonus roll for stacked fertility drugs /* Suggestion for better animal pregnancy support - usage of another variable then ovum for fertility drugs bonus, and then adding actor.pregData.drugsEffect multiplier to it before adding to ovum. Example: - var bonus = 0; + let bonus = 0; ... (code below where ovum changed to bonus) @@ -83,7 +82,7 @@ window.setPregType = function(actor) { if (actor.broodmother < 1) { // Broodmothers should be not processed here. Necessary now. if (typeof actor.readyOva === "number" && actor.readyOva !== 0) { - ovum = actor.readyOva; //just single override; for delayed impregnation cases + ovum = actor.readyOva; // just single override; for delayed impregnation cases } else if (actor.ID === -1) { if (actor.geneticQuirks.fertility === 2 && actor.geneticQuirks.hyperFertility === 2) { // Do not mix with sperm if (actor.fertDrugs === 1) { @@ -291,7 +290,7 @@ window.setPregType = function(actor) { if (actor.drugs === "super fertility drugs") { ovum += jsRandom(fertilityStack/2, fertilityStack*2); } else { - ovum += jsRandom(fertilityStack/4, fertilityStack); + ovum += jsRandom(fertilityStack / 4, fertilityStack); } if (actor.ovaImplant === "sympathy") { ovum *= 2; @@ -322,7 +321,7 @@ window.setPregType = function(actor) { ovum += jsEither([0, 0, 0, 0, 1]); fertilityStack++; } else { - ovum += jsEither([0, 0, 0, 0, 0, 0, 0, 0, 0, 1]); //base chance for twins + ovum += jsEither([0, 0, 0, 0, 0, 0, 0, 0, 0, 1]); // base chance for twins } if (actor.ovaImplant === "fertility") { ovum += jsEither([0, 0, 0, 0, 0, 0, 0, 0, 0, 1]); @@ -400,13 +399,14 @@ window.knockMeUp = function(target, chance, hole, fatherID, displayOverride) { const V = State.variables; let pronouns; let He; - let r = ""; + let r = ``; if (target.ID !== -1) { pronouns = getPronouns(target); He = capFirstChar(pronouns.pronoun); } if (V.seePreg !== 0) { - if (jsRandom(0, 99) < (chance + (V.reproductionFormula*((target.pregSource <= 0) ? ((target.ID === -1) ? 0 : 10) : 20)))) { + // eslint-disable-next-line no-nested-ternary + if (jsRandom(0, 99) < (chance + (V.reproductionFormula * ((target.pregSource <= 0) ? ((target.ID === -1) ? 0 : 10) : 20)))) { if (target.mpreg === hole) { if (target.pregWeek <= 0) { target.preg = 1; @@ -420,11 +420,11 @@ window.knockMeUp = function(target, chance, hole, fatherID, displayOverride) { WombImpregnate(target, target.pregType, target.pregSource, 1); if (V.menstruation === 1) { - } - else if (!displayOverride) { + // + } else if (!displayOverride) { target.pregKnown = 1; if (target.ID === -1) { - /* r += "@@.lime;You have gotten pregnant.@@"; */ + /* r += "<span class="lime">You have gotten pregnant.</span>"; */ } else { r += `<span class="lime">${He} has become pregnant.</span>`; } @@ -444,11 +444,11 @@ window.knockMeUp = function(target, chance, hole, fatherID, displayOverride) { WombImpregnate(target, target.pregType, target.pregSource, 1); if (V.menstruation === 1) { - } - else if (!displayOverride) { + // + } else if (!displayOverride) { target.pregKnown = 1; if (target.ID === -1) { - /* r += "@@.lime;You have gotten pregnant.@@"; */ + /* r += "<span class="lime">You have gotten pregnant.</span>"; */ } else { r += `<span class="lime">${He} has become pregnant.</span>`; } @@ -475,11 +475,11 @@ window.knockMeUp = function(target, chance, hole, fatherID, displayOverride) { return r; }; -window.getIncubatorReserved = function(/*slaves*/) { +window.getIncubatorReserved = function(/* slaves */) { return FetusGlobalReserveCount("incubator"); }; -window.getNurseryReserved = function(/*slaves*/) { +window.getNurseryReserved = function(/* slaves */) { return FetusGlobalReserveCount("nursery"); }; @@ -490,12 +490,16 @@ window.findFather = function(fatherID) { father = V.slaves[V.slaveIndices[fatherID]]; if (father === undefined) { if (V.incubator > 0) { - father = V.tanks.find(function(s) { return s.ID === fatherID; }); + father = V.tanks.find(function(s) { + return s.ID === fatherID; + }); } } if (father === undefined) { if (V.nursery > 0) { - father = V.cribs.find(function(s) { return s.ID === fatherID; }); + father = V.cribs.find(function(s) { + return s.ID === fatherID; + }); } } @@ -534,7 +538,10 @@ window.adjustFatherProperty = function(actor, property, newValue) { */ /* not to be used until that last part is defined. It may become slave.boobWomb.volume or some shit */ -/** @param {App.Entity.SlaveState} slave */ +/** + * @param {App.Entity.SlaveState} slave + * @returns {number} + */ window.getBaseBoobs = function(slave) { - return slave.boobs-slave.boobsImplant-slave.boobsMilk-slave.boobsWombVolume; + return slave.boobs - slave.boobsImplant - slave.boobsMilk - slave.boobsWombVolume; }; diff --git a/src/js/quickListJS.js b/src/js/quickListJS.js index 60ad59a54442e5d5155b8b0f844f6c24a97dee38..6d90ef8373ada8fbd8a48b22491138a659782ece 100644 --- a/src/js/quickListJS.js +++ b/src/js/quickListJS.js @@ -1,10 +1,10 @@ -/* eslint-disable no-undef */ window.sortDomObjects = function(objects, attrName, reverse = 0) { reverse = (reverse) ? -1 : 1; + function sortingByAttr(a, b) { - var aVal = a.getAttribute(attrName); - var bVal = b.getAttribute(attrName); - var aInt = parseInt(aVal); + let aVal = a.getAttribute(attrName); + let bVal = b.getAttribute(attrName); + let aInt = parseInt(aVal); if (!isNaN(aInt)) return ((parseInt(bVal) - aInt) * reverse); else if (bVal > aVal) @@ -15,14 +15,14 @@ window.sortDomObjects = function(objects, attrName, reverse = 0) { }; window.sortButtonsByDevotion = function() { - var $sortedButtons = $('#qlWrapper button').remove(); + let $sortedButtons = $('#qlWrapper button').remove(); $sortedButtons = sortDomObjects($sortedButtons, 'data-devotion'); $($sortedButtons).appendTo($('#qlWrapper')); quickListBuildLinks(); }; window.sortButtonsByTrust = function() { - var $sortedButtons = $('#qlWrapper button').remove(); + let $sortedButtons = $('#qlWrapper button').remove(); $sortedButtons = sortDomObjects($sortedButtons, 'data-trust'); $($sortedButtons).appendTo($('#qlWrapper')); quickListBuildLinks(); @@ -30,11 +30,12 @@ window.sortButtonsByTrust = function() { window.quickListBuildLinks = function() { $("[data-scroll-to]").click(function() { - var $this = $(this), $toElement = $this.attr('data-scroll-to'); + let $this = $(this), + $toElement = $this.attr('data-scroll-to'); // note the * 1 enforces $offset to be an integer, without // it we scroll to True, which goes nowhere fast. - var $offset = $this.attr('data-scroll-offset') * 1 || 0; - var $speed = $this.attr('data-scroll-speed') * 1 || 500; + let $offset = $this.attr('data-scroll-offset') * 1 || 0; + let $speed = $this.attr('data-scroll-speed') * 1 || 500; // Use javascript scrollTop animation for in page navigation. $('html, body').animate({ scrollTop: $($toElement).offset().top + $offset @@ -43,31 +44,31 @@ window.quickListBuildLinks = function() { }; window.sortIncubatorPossiblesByName = function() { - var $sortedIncubatorPossibles = $('#qlIncubator div.possible').detach(); + let $sortedIncubatorPossibles = $('#qlIncubator div.possible').detach(); $sortedIncubatorPossibles = sortDomObjects($sortedIncubatorPossibles, 'data-name'); $($sortedIncubatorPossibles).appendTo($('#qlIncubator')); }; window.sortIncubatorPossiblesByPregnancyWeek = function() { - var $sortedIncubatorPossibles = $('#qlIncubator div.possible').detach(); + let $sortedIncubatorPossibles = $('#qlIncubator div.possible').detach(); $sortedIncubatorPossibles = sortDomObjects($sortedIncubatorPossibles, 'data-preg-week'); $($sortedIncubatorPossibles).appendTo($('#qlIncubator')); }; window.sortIncubatorPossiblesByPregnancyCount = function() { - var $sortedIncubatorPossibles = $('#qlIncubator div.possible').detach(); + let $sortedIncubatorPossibles = $('#qlIncubator div.possible').detach(); $sortedIncubatorPossibles = sortDomObjects($sortedIncubatorPossibles, 'data-preg-count'); $($sortedIncubatorPossibles).appendTo($('#qlIncubator')); }; window.sortIncubatorPossiblesByReservedSpots = function() { - var $sortedIncubatorPossibles = $('#qlIncubator div.possible').detach(); + let $sortedIncubatorPossibles = $('#qlIncubator div.possible').detach(); $sortedIncubatorPossibles = sortDomObjects($sortedIncubatorPossibles, 'data-reserved-spots'); $($sortedIncubatorPossibles).appendTo($('#qlIncubator')); }; window.sortIncubatorPossiblesByPreviousSort = function() { - var sort = State.variables.sortIncubatorList; + let sort = State.variables.sortIncubatorList; if ('unsorted' !== sort) { if ('Name' === sort) { sortIncubatorPossiblesByName(); @@ -82,31 +83,31 @@ window.sortIncubatorPossiblesByPreviousSort = function() { }; window.sortNurseryPossiblesByName = function() { - var $sortedNurseryPossibles = $('#qlNursery div.possible').detach(); + let $sortedNurseryPossibles = $('#qlNursery div.possible').detach(); $sortedNurseryPossibles = sortDomObjects($sortedNurseryPossibles, 'data-name'); $($sortedNurseryPossibles).appendTo($('#qlNursery')); }; window.sortNurseryPossiblesByPregnancyWeek = function() { - var $sortedNurseryPossibles = $('#qlNursery div.possible').detach(); + let $sortedNurseryPossibles = $('#qlNursery div.possible').detach(); $sortedNurseryPossibles = sortDomObjects($sortedNurseryPossibles, 'data-preg-week'); $($sortedNurseryPossibles).appendTo($('#qlNursery')); }; window.sortNurseryPossiblesByPregnancyCount = function() { - var $sortedNurseryPossibles = $('#qlNursery div.possible').detach(); + let $sortedNurseryPossibles = $('#qlNursery div.possible').detach(); $sortedNurseryPossibles = sortDomObjects($sortedNurseryPossibles, 'data-preg-count'); $($sortedNurseryPossibles).appendTo($('#qlNursery')); }; window.sortNurseryPossiblesByReservedSpots = function() { - var $sortedNurseryPossibles = $('#qlNursery div.possible').detach(); + let $sortedNurseryPossibles = $('#qlNursery div.possible').detach(); $sortedNurseryPossibles = sortDomObjects($sortedNurseryPossibles, 'data-reserved-spots'); $($sortedNurseryPossibles).appendTo($('#qlNursery')); }; window.sortNurseryPossiblesByPreviousSort = function() { - var sort = State.variables.sortNurseryList; + let sort = State.variables.sortNurseryList; if ('unsorted' !== sort) { if ('Name' === sort) { sortNurseryPossiblesByName(); diff --git a/src/js/rbuttonJS.js b/src/js/rbuttonJS.js index dfc4bbf63676b7ee9d8e3677e6402756f641c9b5..b74200cf4d6c02b309548077699c21d3dd76b367 100644 --- a/src/js/rbuttonJS.js +++ b/src/js/rbuttonJS.js @@ -1,4 +1,3 @@ -/* eslint-disable no-undef */ /* This is modified radiobutton macro, for automatic checked state setup*/ /* Usage (be sure to use quotes around parameters): @@ -13,8 +12,8 @@ Macro.add('rbutton', { handler() { if (this.args.length < 2) { const errors = []; - if (this.args.length < 1) { errors.push('variable name'); } - if (this.args.length < 2) { errors.push('checked value'); } + if (this.args.length < 1) {errors.push('variable name');} + if (this.args.length < 2) {errors.push('checked value');} return this.error(`no ${errors.join(' or ')} specified`); } @@ -35,8 +34,8 @@ Macro.add('rbutton', { const checkValue = this.args[1]; const el = document.createElement('input'); - var replaceID = ""; - var replaceText = ""; + let replaceID = ""; + let replaceText = ""; if (typeof this.args[2] === 'string') { replaceID = this.args[2]; } @@ -71,8 +70,9 @@ Macro.add('rbutton', { Wikifier.setValue(varName, checkValue); if (replaceID.length > 0 && replaceText.length > 0) { - var replaceEl = document.getElementById(replaceID); - //alert (replaceEl); + + let replaceEl = document.getElementById(replaceID); + // alert (replaceEl); if (replaceEl !== null) { replaceEl.innerHTML = replaceText; } @@ -80,10 +80,11 @@ Macro.add('rbutton', { } }) .ready(function() { - //alert ("DOM finished"); + // alert ("DOM finished"); if (el.checked && replaceID.length > 0 && replaceText.length > 0) { - var replaceEl = document.getElementById(replaceID); - //alert (replaceEl); + + let replaceEl = document.getElementById(replaceID); + // alert (replaceEl); if (replaceEl !== null) { replaceEl.innerHTML = replaceText; } diff --git a/src/js/removeActiveSlave.js b/src/js/removeActiveSlave.js index e5c5fc2060a1f9fd1f38cb31c435fda3704fcb4f..d271a6b8d8eb05f3e9548199359f85d5897d3206 100644 --- a/src/js/removeActiveSlave.js +++ b/src/js/removeActiveSlave.js @@ -125,7 +125,7 @@ window.removeActiveSlave = function removeActiveSlave() { } if (Array.isArray(V.personalAttention)) { - const _rasi = V.personalAttention.findIndex(function(s) { return s.ID === AS_ID; }); + const _rasi = V.personalAttention.findIndex(function(s) {return s.ID === AS_ID;}); if (_rasi !== -1) { V.personalAttention.deleteAt(_rasi); if (V.personalAttention.length === 0) { @@ -195,23 +195,27 @@ window.removeActiveSlave = function removeActiveSlave() { } } - const _geneIndex = V.genePool.findIndex(function(s) { return s.ID === AS_ID; }); + const _geneIndex = V.genePool.findIndex(function(s) {return s.ID === AS_ID;}); if (_geneIndex !== -1) { let keep = false; if (V.traitor !== 0) { - if (isImpregnatedBy(V.traitor, V.activeSlave) || V.traitor.ID === AS_ID) { /* did we impregnate the traitor, or are we the traitor? */ + if (isImpregnatedBy(V.traitor, V.activeSlave) || V.traitor.ID === AS_ID) { + /* did we impregnate the traitor, or are we the traitor? */ keep = true; } } if (V.boomerangSlave !== 0) { - if (isImpregnatedBy(V.boomerangSlave, V.activeSlave) || V.boomerangSlave.ID === AS_ID) { /* did we impregnate the boomerang, or are we the boomerang? */ + if (isImpregnatedBy(V.boomerangSlave, V.activeSlave) || V.boomerangSlave.ID === AS_ID) { + /* did we impregnate the boomerang, or are we the boomerang? */ keep = true; } } - if (isImpregnatedBy(V.PC, V.activeSlave)) { /* did we impregnate the PC */ + if (isImpregnatedBy(V.PC, V.activeSlave)) { + /* did we impregnate the PC */ keep = true; } - if (!keep) { /* avoid going through this loop if possible */ + if (!keep) { + /* avoid going through this loop if possible */ keep = V.slaves.some(slave => { /* have we impregnated a slave that is not ourselves? */ return (slave.ID !== AS_ID && isImpregnatedBy(slave, V.activeSlave)); @@ -230,7 +234,8 @@ window.removeActiveSlave = function removeActiveSlave() { vagina: V.activeSlave.vagina, ID: V.missingParentID }; - if (V.traitor.ID === V.activeSlave.ID) { /* To link developing fetuses to their parent */ + if (V.traitor.ID === V.activeSlave.ID) { + /* To link developing fetuses to their parent */ V.traitor.missingParentTag = V.missingParentID; } else if (V.boomerangSlave.ID === V.activeSlave.ID) { V.boomerangSlave.missingParentTag = V.missingParentID; @@ -328,13 +333,15 @@ window.removeNonNGPSlave = function removeNonNGPSlave(removedSlave) { } }); - const _geneIndex = V.genePool.findIndex(function(s) { return s.ID === ID; }); + const _geneIndex = V.genePool.findIndex(function(s) {return s.ID === ID;}); if (_geneIndex !== -1) { let keep = false; - if (isImpregnatedBy(V.PC, removedSlave)) { /* did we impregnate the PC */ + if (isImpregnatedBy(V.PC, removedSlave)) { + /* did we impregnate the PC */ keep = true; } - if (!keep) { /* avoid going through this loop if possible */ + if (!keep) { + /* avoid going through this loop if possible */ keep = V.slaves.some(slave => { /* have we impregnated a slave that is not ourselves? */ return (slave.ID !== ID && isImpregnatedBy(slave, removedSlave)); diff --git a/src/js/rulesAssistant.js b/src/js/rulesAssistant.js index 3e5f00e1fed25307841e426c16248445b6e40221..9e9d855940e5b4e661588062d043cffb422a58ef 100644 --- a/src/js/rulesAssistant.js +++ b/src/js/rulesAssistant.js @@ -2,7 +2,7 @@ * @param {App.Entity.SlaveState} slave * @param {Object[]} rules * @returns {boolean} -*/ + */ window.hasSurgeryRule = function(slave, rules) { return rules.some( rule => ruleApplied(slave, rule) && rule.set.autoSurgery > 0); @@ -13,7 +13,7 @@ window.hasSurgeryRule = function(slave, rules) { * @param {Object[]} rules * @param {string} what * @returns {boolean} -*/ + */ window.hasRuleFor = function(slave, rules, what) { return rules.some( rule => ruleApplied(slave, rule) && rule[what] !== "no default setting"); @@ -23,7 +23,7 @@ window.hasRuleFor = function(slave, rules, what) { * @param {App.Entity.SlaveState} slave * @param {Object[]} rules * @returns {boolean} -*/ + */ window.hasHColorRule = function(slave, rules) { return hasRuleFor(slave, rules, "hColor"); }; @@ -51,7 +51,7 @@ window.hasEyeColorRule = function(slave, rules) { * @param {App.Entity.SlaveState} slave * @param {Object[]} rules * @returns {boolean} -*/ + */ window.lastPregRule = function(slave, rules) { return rules.some(rule => ruleApplied(slave, rule) && rule.set.preg === -1); @@ -84,7 +84,7 @@ window.mergeRules = function mergeRules(rules) { * @param {App.Entity.SlaveState} slave * @param {Object} rule * @returns {boolean} -*/ + */ window.ruleApplied = function(slave, rule) { return slave.currentRules.includes(rule.ID); }; @@ -94,7 +94,7 @@ window.ruleApplied = function(slave, rule) { * @param {App.Entity.SlaveState} slave * @param {Object} rule * @returns {string} -*/ + */ window.RAFacilityRemove = function RAFacilityRemove(slave, rule) { const V = State.variables; let r = ""; @@ -131,7 +131,7 @@ window.RAFacilityRemove = function RAFacilityRemove(slave, rule) { case "work as farmhand": if (slave.assignment === rule.setAssignment) { r += `<br>${slave.slaveName} has been removed from ${V.farmyardName} and has been assigned to ${rule.removalAssignment}.`; - assignJob(slave. rule.removalAssignment); + assignJob(slave.rule.removalAssignment); } break; @@ -253,6 +253,8 @@ window.emptyDefaultRule = function emptyDefaultRule() { selectedSlaves: [], excludedSlaves: [], }, + /* eslint-disable */ + // TODO: rename properties in snake_case to camelCase? set: { releaseRules: "no default setting", toyHole: "no default setting", @@ -381,6 +383,7 @@ window.emptyDefaultRule = function emptyDefaultRule() { skinColor: "no default setting", inflationType: "no default setting", } + /* eslint-enable */ }; return rule; }; @@ -388,7 +391,9 @@ window.emptyDefaultRule = function emptyDefaultRule() { /** * Saves the slave, silently fires the RA, saves the slave's after-RA state, and then reverts the slave. * Call and then check potential change against $slaveAfterRA to see if the RA would revert it. - * @param {App.Entity.SlaveState} slave */ + * @param {App.Entity.SlaveState} slave + * + */ window.RulesDeconfliction = function RulesDeconfliction(slave) { const before = clone(slave); DefaultRules(slave); diff --git a/src/js/rulesAssistantOptions.js b/src/js/rulesAssistantOptions.js index 9c388cf8876f3560c60897e5ac3a210f94679e69..bcfb6fd9668bf2f47a1cbee4ac5bbb9242cab34f 100644 --- a/src/js/rulesAssistantOptions.js +++ b/src/js/rulesAssistantOptions.js @@ -1,5 +1,5 @@ +/* eslint-disable camelcase */ /* eslint-disable no-unused-vars */ -/* eslint-disable no-undef */ // rewrite of the rules assistant options page in javascript // uses an object-oriented widget pattern // wrapped in a closure so as not to pollute the global namespace @@ -26,7 +26,7 @@ window.rulesAssistantOptions = (function() { const root = new Root(element); } - function returnP(e) { return e.keyCode === 13; } + function returnP(e) {return e.keyCode === 13;} function newRule(root) { const rule = emptyDefaultRule(); @@ -49,7 +49,7 @@ window.rulesAssistantOptions = (function() { if (V.defaultRules.length === 1) return; // nothing to swap with const idx = V.defaultRules.findIndex(rule => rule.ID === current_rule.ID); if (idx === 0) return; // no lower rule - arraySwap(V.defaultRules, idx, idx-1); + arraySwap(V.defaultRules, idx, idx - 1); reload(root); } @@ -57,7 +57,7 @@ window.rulesAssistantOptions = (function() { if (V.defaultRules.length === 1) return; // nothing to swap with const idx = V.defaultRules.findIndex(rule => rule.ID === current_rule.ID); if (idx === V.defaultRules.length - 1) return; // no higher rule - arraySwap(V.defaultRules, idx, idx+1); + arraySwap(V.defaultRules, idx, idx + 1); reload(root); } @@ -77,7 +77,7 @@ window.rulesAssistantOptions = (function() { const parse = { integer(string) { let n = parseInt(string, 10); - return isNaN(n)? 0: n; + return isNaN(n) ? 0 : n; }, boobs(string) { return Math.clamp(parse.integer(string), 0, 48000); @@ -125,7 +125,7 @@ window.rulesAssistantOptions = (function() { } class Section extends Element { - constructor(header, hidden=false) { + constructor(header, hidden = false) { super(header); this.hidey = this.element.querySelector("div"); if (hidden) this.toggle_hidey(); @@ -150,7 +150,7 @@ window.rulesAssistantOptions = (function() { } toggle_hidey() { - switch(this.hidey.style.display) { + switch (this.hidey.style.display) { case "none": this.hidey.style.display = "initial"; break; @@ -166,13 +166,13 @@ window.rulesAssistantOptions = (function() { // value display can optionally be an editable text input field // it can be "bound" to a variable by setting its "onchange" method class EditorWithShortcuts extends Element { - constructor(prefix, data=[], editor=false, ...args) { + constructor(prefix, data = [], editor = false, ...args) { super(`${prefix }: `, editor, ...args); this.selectedItem = null; data.forEach(item => this.appendChild(new ListItem(...item))); } - createEditor(...args) { return null; } + createEditor(...args) {return null;} render(prefix, editor, ...args) { const elem = document.createElement("div"); @@ -204,12 +204,10 @@ window.rulesAssistantOptions = (function() { this.value.innerHTML = `${what}`; } - getData(what) { - return (this.value.tagName === "INPUT" ? this.parse(this.value.value): this.selectedItem.data); - } + getData(what) {return (this.value.tagName === "INPUT" ? this.parse(this.value.value) : this.selectedItem.data);} // customizable input field parser / sanity checker - parse(what) { return what; } + parse(what) {return what;} propagateChange() { if (this.onchange instanceof Function) @@ -221,7 +219,7 @@ window.rulesAssistantOptions = (function() { class ListItem extends Element { constructor(displayvalue, data) { super(displayvalue); - this.data = data !== undefined ? data: displayvalue; + this.data = data !== undefined ? data : displayvalue; this.selected = false; } @@ -257,12 +255,8 @@ window.rulesAssistantOptions = (function() { res.setAttribute("type", "text"); res.classList.add("rajs-value"); // // call the variable binding when the input field is no longer being edited, and when the enter key is pressed - res.onblur = () => { - this.inputEdited(); - }; - res.onkeypress = (e) => { - if (returnP(e)) this.inputEdited(); - }; + res.onblur = () => { this.inputEdited(); }; + res.onkeypress = (e) => { if (returnP(e)) this.inputEdited(); }; return res; } } @@ -279,18 +273,12 @@ window.rulesAssistantOptions = (function() { res.setAttribute("min", min); res.setAttribute("max", max); res.classList.add("rajs-value"); // - res.onblur = () => { - this.inputEdited(); - }; - res.onkeypress = (e) => { - if (returnP(e)) this.inputEdited(); - }; + res.onblur = () => { this.inputEdited(); }; + res.onkeypress = (e) => { if (returnP(e)) this.inputEdited(); }; return res; } - parse(what) { - return what === "" ? this.nullValue : parseInt(what); - } + parse(what) {return what === "" ? this.nullValue : parseInt(what);} } // a way to organize lists with too many elements in subsections @@ -319,9 +307,9 @@ window.rulesAssistantOptions = (function() { // similar to list, but is just a collection of buttons class Options extends Element { - constructor(elements=[]) { + constructor(elements = []) { super(); - elements.forEach(element => { this.appendChild(element); }); + elements.forEach(element => {this.appendChild(element);}); } render() { @@ -363,11 +351,11 @@ window.rulesAssistantOptions = (function() { ); } - onchange() { return; } + onchange() {return;} } class ButtonItem extends Element { - constructor(label, setvalue, selected=false) { + constructor(label, setvalue, selected = false) { super(label, selected); this.selected = selected; this.setvalue = setvalue ? setvalue : label; @@ -407,7 +395,9 @@ window.rulesAssistantOptions = (function() { render() { let element = document.getElementById("importfield"); - if (element !== null) { return element; } + if (element !== null) { + return element; + } const container = document.createElement("div"); container.id = "importfield"; const textarea = document.createElement("textarea"); @@ -441,7 +431,7 @@ window.rulesAssistantOptions = (function() { class Root extends Element { constructor(element) { super(element); - if(V.defaultRules.length === 0) { + if (V.defaultRules.length === 0) { const paragraph = document.createElement("p"); paragraph.innerHTML = "<strong>No rules</strong>"; this.appendChild(new Element(paragraph)); @@ -586,7 +576,7 @@ window.rulesAssistantOptions = (function() { this.appendChild(this.fnlist); this.fneditor = null; - switch(current_rule.condition.function) { + switch (current_rule.condition.function) { case false: case true: break; @@ -667,11 +657,11 @@ window.rulesAssistantOptions = (function() { this.show_custom_editor(CustomEditor, current_rule.condition.data); } else if (this.betweenP(value)) { current_rule.condition.function = "between"; - current_rule.condition.data = { attribute: value, value: [null, null] }; + current_rule.condition.data = {attribute: value, value: [null, null]}; this.show_custom_editor(RangeEditor, current_rule.condition.function, current_rule.condition.data); } else if (this.belongsP(value)) { current_rule.condition.function = "belongs"; - current_rule.condition.data = { attribute: value, value: [] }; + current_rule.condition.data = {attribute: value, value: []}; this.show_custom_editor(ItemEditor, current_rule.condition.function, current_rule.condition.data); } } @@ -707,7 +697,7 @@ window.rulesAssistantOptions = (function() { const min = document.createElement("input"); min.setAttribute("type", "text"); min.value = `${ data.value[0]}`; - min.onkeypress = e => { if (returnP(e)) this.setmin(min.value); }; + min.onkeypress = e => {if (returnP(e)) this.setmin(min.value);}; min.onblur = e => this.setmin(min.value); this.min = min; elem.appendChild(min); @@ -721,7 +711,7 @@ window.rulesAssistantOptions = (function() { const max = document.createElement("input"); max.setAttribute("type", "text"); max.value = `${ data.value[1]}`; - max.onkeypress = e => { if (returnP(e)) this.setmax(max.value); }; + max.onkeypress = e => {if (returnP(e)) this.setmax(max.value);}; max.onblur = e => this.setmax(max.value); this.max = max; elem.appendChild(max); @@ -769,7 +759,7 @@ window.rulesAssistantOptions = (function() { "intelligence": "From moronic to brilliant: [-100, 100]", "accent": "No accent: 0, Nice accent: 1, Bad accent: 2, Can't speak language: 3 and above", "waist": "Masculine waist: (95, ∞), Ugly waist: (40, 95], Unattractive waist: (10, 40], Average waist: [-10, 10], Feminine waist: [-40, -10), Wasp waist: [-95, -40), Absurdly narrow: (-∞, -95)", - }[attribute] || " "); + } [attribute] || " "); } } @@ -780,7 +770,7 @@ window.rulesAssistantOptions = (function() { const input = document.createElement("input"); input.setAttribute("type", "text"); input.value = JSON.stringify(data.value); - input.onkeypress = e => { if (returnP(e)) this.setValue(input); }; + input.onkeypress = e => {if (returnP(e)) this.setValue(input);}; input.onblur = e => this.setValue(input); this.input = input; elem.appendChild(input); @@ -861,7 +851,7 @@ window.rulesAssistantOptions = (function() { "Nursery": "work as a nanny", "Clinic": "get treatment in the clinic", "Cellblock": "be confined in the cellblock", - }[what]; + } [what]; } } @@ -908,9 +898,7 @@ window.rulesAssistantOptions = (function() { current_rule.condition.selectedSlaves.includes(slave.ID)))); } - onchange() { - current_rule.condition.selectedSlaves = this.getSelection(); - } + onchange() {current_rule.condition.selectedSlaves = this.getSelection();} } class SlaveExclusion extends ButtonList { @@ -922,9 +910,7 @@ window.rulesAssistantOptions = (function() { current_rule.condition.excludedSlaves.includes(slave.ID)))); } - onchange() { - current_rule.condition.excludedSlaves = this.getSelection(); - } + onchange() {current_rule.condition.excludedSlaves = this.getSelection();} } // parent section for effect editing @@ -1234,8 +1220,8 @@ window.rulesAssistantOptions = (function() { ["Toga (FS)", "a toga"], ["Western clothing (FS)", "Western clothing"], ]; - spclothes.forEach(pair => { if (isItemAccessible(pair[1])) nclothes.push(pair); }); - fsnclothes.forEach(pair => { if (isItemAccessible(pair[1])) nclothes.push(pair); }); + spclothes.forEach(pair => {if (isItemAccessible(pair[1])) nclothes.push(pair);}); + fsnclothes.forEach(pair => {if (isItemAccessible(pair[1])) nclothes.push(pair);}); const nice = new ListSubSection(this, "Nice", nclothes); this.appendChild(nice); @@ -1249,7 +1235,7 @@ window.rulesAssistantOptions = (function() { const fshclothes = [ ["Chains (FS)", "chains"], ]; - fshclothes.forEach(pair => { if (isItemAccessible(pair[1])) hclothes.push(pair); }); + fshclothes.forEach(pair => {if (isItemAccessible(pair[1])) hclothes.push(pair);}); const harsh = new ListSubSection(this, "Harsh", hclothes); this.appendChild(harsh); @@ -1282,7 +1268,7 @@ window.rulesAssistantOptions = (function() { ["Bowtie collar", "bowtie"], ["Ancient Egyptian", "ancient Egyptian"], ]; - fsncollars.forEach(pair => { if (isItemAccessible(pair[1])) ncollars.push(pair); }); + fsncollars.forEach(pair => {if (isItemAccessible(pair[1])) ncollars.push(pair);}); const nice = new ListSubSection(this, "Nice", ncollars); this.appendChild(nice); @@ -1312,9 +1298,7 @@ window.rulesAssistantOptions = (function() { class CorsetList extends List { constructor() { const bellies = []; - setup.bellyAccessories.forEach(acc => { - if (acc.fs === undefined && acc.rs === undefined) - bellies.push([acc.name, acc.value]); + setup.bellyAccessories.forEach(acc => {if (acc.fs === undefined && acc.rs === undefined)bellies.push([acc.name, acc.value]); else if (acc.fs === "repopulation" && V.arcologies[0].FSRepopulationFocus !== "unset") bellies.push([`${acc.name } (FS)`, acc.value]); else if (acc.rs === "boughtBelly" && V.clothesBoughtBelly === 1) @@ -1356,9 +1340,7 @@ window.rulesAssistantOptions = (function() { class VagAccVirginsList extends List { constructor() { const accs = []; - setup.vaginalAccessories.forEach(acc => { - if (acc.fs === undefined && acc.rs === undefined) - accs.push([acc.name, acc.value]); + setup.vaginalAccessories.forEach(acc => {if (acc.fs === undefined && acc.rs === undefined)accs.push([acc.name, acc.value]); else if (acc.rs === "buyBigDildos" && V.toysBoughtDildos === 1) accs.push([`${acc.name } (Purchased)`, acc.value]); }); @@ -1371,9 +1353,7 @@ window.rulesAssistantOptions = (function() { class VagAccAVirginsList extends List { constructor() { const accs = []; - setup.vaginalAccessories.forEach(acc => { - if (acc.fs === undefined && acc.rs === undefined) - accs.push([acc.name, acc.value]); + setup.vaginalAccessories.forEach(acc => {if (acc.fs === undefined && acc.rs === undefined)accs.push([acc.name, acc.value]); else if (acc.rs === "buyBigDildos" && V.toysBoughtDildos === 1) accs.push([`${acc.name } (Purchased)`, acc.value]); }); @@ -1386,9 +1366,7 @@ window.rulesAssistantOptions = (function() { class VagAccOtherList extends List { constructor() { const accs = []; - setup.vaginalAccessories.forEach(acc => { - if (acc.fs === undefined && acc.rs === undefined) - accs.push([acc.name, acc.value]); + setup.vaginalAccessories.forEach(acc => {if (acc.fs === undefined && acc.rs === undefined)accs.push([acc.name, acc.value]); else if (acc.rs === "buyBigDildos" && V.toysBoughtDildos === 1) accs.push([`${acc.name } (Purchased)`, acc.value]); }); @@ -1401,9 +1379,7 @@ window.rulesAssistantOptions = (function() { class VaginalAttachmentsList extends List { constructor() { const accs = []; - setup.vaginalAttachments.forEach(acc => { - if (acc.fs === undefined && acc.rs === undefined) - accs.push([acc.name, acc.value]); + setup.vaginalAttachments.forEach(acc => {if (acc.fs === undefined && acc.rs === undefined)accs.push([acc.name, acc.value]); else if (acc.rs === "buyVaginalAttachments" && V.toysBoughtVaginalAttachments === 1) accs.push([`${acc.name } (Purchased)`, acc.value]); }); @@ -1458,9 +1434,7 @@ window.rulesAssistantOptions = (function() { class ButtplugsVirginsList extends List { constructor() { const accs = []; - setup.buttplugs.forEach(acc => { - if (acc.fs === undefined && acc.rs === undefined) - accs.push([acc.name, acc.value]); + setup.buttplugs.forEach(acc => {if (acc.fs === undefined && acc.rs === undefined)accs.push([acc.name, acc.value]); else if (acc.rs === "buyBigPlugs" && V.toysBoughtButtPlugs === 1) accs.push([`${acc.name } (Purchased)`, acc.value]); }); @@ -1473,9 +1447,7 @@ window.rulesAssistantOptions = (function() { class ButtplugsOtherList extends List { constructor() { const accs = []; - setup.buttplugs.forEach(acc => { - if (acc.fs === undefined && acc.rs === undefined) - accs.push([acc.name, acc.value]); + setup.buttplugs.forEach(acc => {if (acc.fs === undefined && acc.rs === undefined)accs.push([acc.name, acc.value]); else if (acc.rs === "buyBigPlugs" && V.toysBoughtButtPlugs === 1) accs.push([`${acc.name } (Purchased)`, acc.value]); }); @@ -1488,9 +1460,7 @@ window.rulesAssistantOptions = (function() { class ButtplugAttachmentsList extends List { constructor() { const accs = []; - setup.buttplugAttachments.forEach(acc => { - if (acc.fs === undefined && acc.rs === undefined) - accs.push([acc.name, acc.value]); + setup.buttplugAttachments.forEach(acc => {if (acc.fs === undefined && acc.rs === undefined)accs.push([acc.name, acc.value]); else if (acc.rs === "buyTails" && V.toysBoughtButtPlugTails === 1) accs.push([`${acc.name } (Purchased)`, acc.value]); }); @@ -1583,9 +1553,8 @@ window.rulesAssistantOptions = (function() { } nds() { - [this.breasts, this.butts, this.lips, this.dicks, this.balls].forEach(i => { - i.setValue("no default change"); - i.propagateChange(); + [this.breasts, this.butts, this.lips, this.dicks, this.balls].forEach(i => {i.setValue("no default change"); + i.propagateChange(); }); } @@ -1626,9 +1595,7 @@ window.rulesAssistantOptions = (function() { } none() { - this.sublists.forEach(i => { - i.setValue(0); - i.propagateChange(); + this.sublists.forEach(i => {i.setValue(0); i.propagateChange(); }); } } @@ -1965,9 +1932,7 @@ window.rulesAssistantOptions = (function() { ]; super("Diet base", pairs); this.setValue(this.value2string(current_rule.set.dietCum, current_rule.set.dietMilk)); - this.onchange = (value) => { - current_rule.set.dietCum = value.cum; - current_rule.set.dietMilk = value.milk; + this.onchange = (value) => { current_rule.set.dietCum = value.cum; current_rule.set.dietMilk = value.milk; this.setValue(this.value2string(current_rule.set.dietCum, current_rule.set.dietMilk)); }; } @@ -2181,7 +2146,7 @@ window.rulesAssistantOptions = (function() { class RelationshipList extends List { constructor() { - const pairs =[ + const pairs = [ ["No default setting", "no default setting"], ["Permissive", "permissive"], ["Just friends", "just friends"], @@ -2210,7 +2175,7 @@ window.rulesAssistantOptions = (function() { constructor() { const pairs = [ ["No default setting", "no default setting"], - /*["No broadcasting", -1], **This has changed, it would now use .pornFeed** */ + /* ["No broadcasting", -1], **This has changed, it would now use .pornFeed** */ ["No subsidy", 0], ["1000", 1000], ["2000", 2000], @@ -2296,9 +2261,7 @@ window.rulesAssistantOptions = (function() { "orange", "amber", "red" - ].forEach(i => items.push(new OptionsItem(i, item => { - this.value = item.label; - this.parent.setValue(); + ].forEach(i => items.push(new OptionsItem(i, item => {this.value = item.label; this.parent.setValue(); }))); super(items); } @@ -2322,10 +2285,7 @@ window.rulesAssistantOptions = (function() { "bright", "teary", "vacant" - ].forEach(i => items.push(new OptionsItem(i, item => { - this.value = item.label; - this.parent.setValue(); - }))); + ].forEach(i => items.push(new OptionsItem(i, item => {this.value = item.label; this.parent.setValue();}))); super(items); } } diff --git a/src/js/rulesAutosurgery.js b/src/js/rulesAutosurgery.js index 5a670f0b3218267af6ae077fe4edabdac61758e6..6cc77c4bfc933687327546a1629a77fc70fe2e29 100644 --- a/src/js/rulesAutosurgery.js +++ b/src/js/rulesAutosurgery.js @@ -1,3 +1,4 @@ +/* eslint-disable camelcase */ window.rulesAutosurgery = (function() { "use strict"; let V; @@ -114,8 +115,8 @@ window.rulesAutosurgery = (function() { thisSurgery = autoSurgerySelector( slave, V.defaultRules - .filter(x => ruleApplied(slave, x) && x.set.autoSurgery === 1) - .map(x => x.set)); + .filter(x => ruleApplied(slave, x) && x.set.autoSurgery === 1) + .map(x => x.set)); if ((thisSurgery.surgery_hips !== "no default setting") && (thisSurgery.surgery_butt !== "no default setting")) { if (slave.hips < -1) { if (thisSurgery.surgery_butt > 2) { @@ -130,7 +131,7 @@ window.rulesAutosurgery = (function() { thisSurgery.surgery_butt = 8; } } else if (slave.hips > 1) { - // true + // true } else { if (thisSurgery.surgery_butt > 6) { thisSurgery.surgery_butt = 6; @@ -382,7 +383,7 @@ window.rulesAutosurgery = (function() { surgeries.push("undo vasectomy"); V.surgeryType = "vasectomy undo"; if (V.PC.medicine >= 100) { - slave.health -=5; + slave.health -= 5; } else { slave.health -= 10; } @@ -394,15 +395,15 @@ window.rulesAutosurgery = (function() { if (slave.faceImplant <= 15 && slave.face <= 95 && thisSurgery.surgery_cosmetic > 0) { surgeries.push("a nicer face"); if (slave.faceShape === "masculine") slave.faceShape = "androgynous"; - slave.faceImplant += 25-5*Math.trunc(V.PC.medicine/50)-5*V.surgeryUpgrade; - slave.face = Math.clamp(slave.face+20, -100, 100); + slave.faceImplant += 25 - 5 * Math.trunc(V.PC.medicine / 50) - 5 * V.surgeryUpgrade; + slave.face = Math.clamp(slave.face + 20, -100, 100); cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); if (V.PC.medicine >= 100) slave.health -= 5; else slave.health -= 10; } else if (slave.faceImplant <= 15 && slave.ageImplant !== 1 && slave.visualAge >= 25 && thisSurgery.surgery_cosmetic > 0) { surgeries.push("an age lift"); slave.ageImplant = 1; - slave.faceImplant += 25-5*Math.trunc(V.PC.medicine/50)-5*V.surgeryUpgrade; + slave.faceImplant += 25 - 5 * Math.trunc(V.PC.medicine / 50) - 5 * V.surgeryUpgrade; if (slave.visualAge > 80) slave.visualAge -= 40; else if (slave.visualAge >= 70) slave.visualAge -= 30; else if (slave.visualAge > 50) slave.visualAge -= 20; @@ -471,8 +472,8 @@ window.rulesAutosurgery = (function() { } else if (slave.faceImplant <= 45 && slave.face <= 95 && thisSurgery.surgery_cosmetic === 2) { surgeries.push("a nicer face"); if (slave.faceShape === "masculine") slave.faceShape = "androgynous"; - slave.faceImplant += 25-5*Math.trunc(V.PC.medicine/50)-5*V.surgeryUpgrade; - slave.face = Math.clamp(slave.face+20, -100, 100); + slave.faceImplant += 25 - 5 * Math.trunc(V.PC.medicine / 50) - 5 * V.surgeryUpgrade; + slave.face = Math.clamp(slave.face + 20, -100, 100); cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); if (V.PC.medicine >= 100) slave.health -= 5; else slave.health -= 10; @@ -490,7 +491,7 @@ window.rulesAutosurgery = (function() { } else { slave.visualAge -= 5; } - slave.faceImplant += 25-5*Math.trunc(V.PC.medicine/50)-5*V.surgeryUpgrade; + slave.faceImplant += 25 - 5 * Math.trunc(V.PC.medicine / 50) - 5 * V.surgeryUpgrade; cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); if (V.PC.medicine >= 100) slave.health -= 5; else slave.health -= 10; @@ -519,7 +520,7 @@ window.rulesAutosurgery = (function() { else slave.health -= 10; } else if (slave.waist >= -95 && V.seeExtreme === 1 && thisSurgery.surgery_cosmetic === 2) { surgeries.push("a narrower waist"); - slave.waist = Math.clamp(slave.waist-20, -100, 100); + slave.waist = Math.clamp(slave.waist - 20, -100, 100); cashX(forceNeg(V.surgeryCost), "slaveSurgery", slave); if (V.PC.medicine >= 100) slave.health -= 5; else slave.health -= 10; @@ -588,7 +589,9 @@ window.rulesAutosurgery = (function() { r += `${V.assistantName === "your personal assistant" ? "Your personal assistant" : V.assistantName}, ordered to apply surgery, gives ${slave.slaveName} <span class="lime">${surgeriesDisplay}.</span>`; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function bellyIn(slave) { // less hacky version of calling surgery degradation silently if (slave.devotion > 50) { diff --git a/src/js/sexActsJS.js b/src/js/sexActsJS.js index 02b13a6ba2b5a3d0f010c7ecca8c7b8aefbe71d4..e509a760fdb4c79d684891f1dd614546cb75e9f3 100644 --- a/src/js/sexActsJS.js +++ b/src/js/sexActsJS.js @@ -7,7 +7,7 @@ window.AnalVCheck = function AnalVCheck(times = 1) { const slave = V.activeSlave; const pronouns = getPronouns(slave); const he = pronouns.pronoun; - //him = pronouns.object, + // him = pronouns.object, const his = pronouns.possessive; // hers = pronouns.possessivePronoun, // himself = pronouns.objectReflexive, @@ -59,6 +59,7 @@ window.AnalVCheck = function AnalVCheck(times = 1) { window.VaginalVCheck = function VaginalVCheck(times = 1) { const V = State.variables; const slave = V.activeSlave; + /* eslint-disable */ const pronouns = getPronouns(slave); const he = pronouns.pronoun; const him = pronouns.object; @@ -68,6 +69,7 @@ window.VaginalVCheck = function VaginalVCheck(times = 1) { const boy = pronouns.noun; const He = capFirstChar(he); const His = capFirstChar(his); + /* eslint-enable */ let r = ``; if (canDoVaginal(slave) && slave.vagina === 0) { r += `<span class="lime">This breaks in ${slave.slaveName}'s virgin pussy.</span> `; @@ -115,6 +117,7 @@ window.VaginalVCheck = function VaginalVCheck(times = 1) { window.BothVCheck = function BothVCheck(analTimes = 1, bothTimes = 1) { const V = State.variables; const slave = V.activeSlave; + /* eslint-disable */ const pronouns = getPronouns(slave); const he = pronouns.pronoun; const him = pronouns.object; @@ -124,6 +127,7 @@ window.BothVCheck = function BothVCheck(analTimes = 1, bothTimes = 1) { const boy = pronouns.noun; const He = capFirstChar(he); const His = capFirstChar(his); + /* eslint-enable */ let r = ``; if (canDoVaginal(slave)) { if (slave.vagina === 0) { @@ -258,6 +262,7 @@ window.SimpleVCheck = function SimpleVCheck(times) { window.PartnerVCheck = function PartnerVCheck(analTimes = 1, bothTimes = 1) { const V = State.variables; const partner = V.slaves[V.partner]; + /* eslint-disable */ const pronouns = getPronouns(partner); const he = pronouns.pronoun; const him = pronouns.object; @@ -267,6 +272,7 @@ window.PartnerVCheck = function PartnerVCheck(analTimes = 1, bothTimes = 1) { const boy = pronouns.noun; const He = capFirstChar(he); const His = capFirstChar(his); + /* eslint-enable */ let r = ``; if (V.partner < 0 || V.partner >= V.slaves.length) { @@ -319,7 +325,10 @@ window.PartnerVCheck = function PartnerVCheck(analTimes = 1, bothTimes = 1) { count is how many times to increment either the Vaginal, Anal, or Oral counts, depending on availability of slave. If count is left undefined it will assume it to be 1. Intended to be a simple "I want to fuck x and not have to code a bunch of logic for it". - @param {App.Entity.SlaveState} slave */ + * @param {App.Entity.SlaveState} slave + * @param {number} fuckCount + * @returns {string} + */ window.SimpleSexAct = function SimpleSexAct(slave, fuckCount = 1) { const V = State.variables; let fuckTarget = 0; @@ -356,6 +365,7 @@ window.SimpleSexAct = function SimpleSexAct(slave, fuckCount = 1) { Intended to be a simple "x got fucked y times and I don't want to keep coding it". Pregnancy chance is handled in saLongTermEffects.tw. @param {App.Entity.SlaveState} slave + @param {number} fuckCount */ window.SimpleSlaveFucking = function SimpleSlaveFucking(slave, fuckCount = 1) { const V = State.variables; @@ -386,6 +396,8 @@ window.SimpleSlaveFucking = function SimpleSlaveFucking(slave, fuckCount = 1) { Intended to be a simple "x got fucked y times by z and I don't want to keep coding it". @param {App.Entity.SlaveState} subslave @param {App.Entity.SlaveState} domslave + @param {number} fuckCount + @returns {string} */ window.SimpleSlaveSlaveFucking = function SimpleSlaveSlaveFucking(subslave, domslave, fuckCount = 1) { const V = State.variables; @@ -393,7 +405,7 @@ window.SimpleSlaveSlaveFucking = function SimpleSlaveSlaveFucking(subslave, doms let r = ""; for (let j = 0; j < fuckCount; j++) { - //there is a reason randomization happens inside cycle - to spread fuck around, otherwise cycle isn't even needed + // there is a reason randomization happens inside cycle - to spread fuck around, otherwise cycle isn't even needed fuckTarget = jsRandom(1, 100); if (subslave.nipples === "fuckable" && canPenetrate(domslave) && fuckTarget > 80) { if (passage() === "SA serve your other slaves") { @@ -437,7 +449,7 @@ window.SimpleSlaveSlaveFucking = function SimpleSlaveSlaveFucking(subslave, doms r += knockMeUp(subslave, 3, 0, domslave.ID, 1); } } else if (canDoAnal(subslave) && subslave.anus > 0 && canPenetrate(domslave) && fuckTarget > 10) { - //i think would impregnate from anal here even without .mpreg? same in original widget too + // i think would impregnate from anal here even without .mpreg? same in original widget too if (canImpreg(subslave, domslave) && subslave.mpreg === 1) { r += knockMeUp(subslave, 3, 1, domslave.ID, 1); } @@ -467,13 +479,19 @@ window.SimpleSlaveSlaveFucking = function SimpleSlaveSlaveFucking(subslave, doms return r; }; -/** @param {App.Entity.SlaveState} slave */ +/** + * @param {App.Entity.SlaveState} slave + * @param {number} count + */ window.SimpleVaginaFuck = function SimpleVaginaFuck(slave, count = 1) { State.variables.vaginalTotal += count; slave.counter.vaginal += count; }; -/** @param {App.Entity.SlaveState} slave */ +/** + * @param {App.Entity.SlaveState} slave + * @param {number} count + */ window.SimpleAssFuck = function SimpleAssFuck(slave, count = 1) { State.variables.analTotal += count; slave.counter.anal += count; diff --git a/src/js/slaveCostJS.js b/src/js/slaveCostJS.js index fab2f5565cb5e40e66f094377ab9af6f2f1b61f3..b23a773c607ae3734bd9bb1e444a4bf976a55c86 100644 --- a/src/js/slaveCostJS.js +++ b/src/js/slaveCostJS.js @@ -1,4 +1,3 @@ -/* eslint-disable no-undef */ window.Beauty = (function() { "use strict"; let V; @@ -69,64 +68,69 @@ window.Beauty = (function() { } calcMultipliersBeauty(slave); - beauty = Math.max(1, Math.trunc(0.5*beauty)); + beauty = Math.max(1, Math.trunc(0.5 * beauty)); return beauty; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcInitBeauty(slave) { - beauty -= slave.waist/20; - beauty -= slave.muscles/30; - beauty += slave.lips/10; + beauty -= slave.waist / 20; + beauty -= slave.muscles / 30; + beauty += slave.lips / 10; beauty += slave.clit; - beauty += (slave.height-160)/10; - beauty += 2*slave.hips; + beauty += (slave.height - 160) / 10; + beauty += 2 * slave.hips; if (slave.anus > 3) { - beauty -= 10 + (slave.anus*2); /* -20 */ + beauty -= 10 + (slave.anus * 2); /* -20 */ } if (slave.vagina > 3) { - beauty -= 10 + (slave.vagina*2); /* -20 */ + beauty -= 10 + (slave.vagina * 2); /* -20 */ } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcFaceBeauty(slave) { - beauty += slave.face/5; + beauty += slave.face / 5; switch (slave.faceShape) { case "masculine": if (arcology.FSGenderRadicalist !== "unset") { - beauty -= (2 - (arcology.FSGenderRadicalist/25))*(slave.face/30); + beauty -= (2 - (arcology.FSGenderRadicalist / 25)) * (slave.face / 30); } else if (arcology.FSGenderFundamentalist !== "unset") { - beauty -= (2 + (arcology.FSGenderFundamentalist/25))*(slave.face/30); + beauty -= (2 + (arcology.FSGenderFundamentalist / 25)) * (slave.face / 30); } else { - beauty -= 2*(slave.face/30); + beauty -= 2 * (slave.face / 30); } break; case "androgynous": if (arcology.FSGenderRadicalist !== "unset") { - beauty += 2 - ((1 - (arcology.FSGenderRadicalist/25))*(slave.face/30)); + beauty += 2 - ((1 - (arcology.FSGenderRadicalist / 25)) * (slave.face / 30)); } else if (arcology.FSGenderFundamentalist !== "unset") { - beauty += 2 - ((1 + (arcology.FSGenderFundamentalist/25))*(slave.face/30)); + beauty += 2 - ((1 + (arcology.FSGenderFundamentalist / 25)) * (slave.face / 30)); } else { - beauty += 2 - (slave.face/30); + beauty += 2 - (slave.face / 30); } break; case "exotic": - beauty += 2*(slave.face/30); + beauty += 2 * (slave.face / 30); break; case "sensual": - beauty += 2 + (slave.face/30); + beauty += 2 + (slave.face / 30); break; case "cute": - beauty += 8/3; - break; - default: + beauty += 8 / 3; break; + } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcTeethBeauty(slave) { switch (slave.teeth) { case "crooked": @@ -151,15 +155,17 @@ window.Beauty = (function() { case "mixed": beauty -= 1; break; - default: - break; + } } - function calcModBeauty(/* slave */) { + function calcModBeauty( + /* slave + */ + ) { if (arcology.FSTransformationFetishist > 20 || arcology.FSDegradationist > 20) { if (V.modScore > 15 || (V.piercingScore > 8 && V.tatScore > 5)) { - beauty += 8 + (V.modScore*0.25); + beauty += 8 + (V.modScore * 0.25); } else if (V.modScore > 7) { beauty += V.modScore - 7; } @@ -175,12 +181,14 @@ window.Beauty = (function() { } else if (V.modScore > 15 || (V.piercingScore > 8 && V.tatScore > 5)) { beauty += 11; } else { - beauty += 7 + (0.5*(V.modScore - 7)); + beauty += 7 + (0.5 * (V.modScore - 7)); } } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcCosmeticsBeauty(slave) { if (slave.brand !== 0) { if (V.rep > 10000) { @@ -225,89 +233,93 @@ window.Beauty = (function() { } } break; - default: - break; + } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcFSNotFuckdollBeauty(slave) { if (arcology.FSSupremacist !== "unset") { if (slave.race === arcology.FSSupremacistRace) { - beauty += (arcology.FSSupremacist/3) + (arcology.FSSupremacistLawME*10); + beauty += (arcology.FSSupremacist / 3) + (arcology.FSSupremacistLawME * 10); } } if (arcology.FSSubjugationist !== "unset") { if (slave.race === arcology.FSSubjugationistRace) { - beauty -= (arcology.FSSubjugationist/2) - (arcology.FSSubjugationistLawME*10); + beauty -= (arcology.FSSubjugationist / 2) - (arcology.FSSubjugationistLawME * 10); } } if (arcology.FSDegradationist !== "unset") { - beauty -= (arcology.FSDegradationist/10)*((slave.intelligence + slave.intelligenceImplant)/20); + beauty -= (arcology.FSDegradationist / 10) * ((slave.intelligence + slave.intelligenceImplant) / 20); } if (arcology.FSGenderFundamentalistLawBimbo === 1) { - beauty -= (slave.intelligence + slave.intelligenceImplant)/2; + beauty -= (slave.intelligence + slave.intelligenceImplant) / 2; } if (arcology.FSYouthPreferentialist !== "unset") { - beauty += (30 - slave.visualAge)/(30 - V.minimumSlaveAge)*((arcology.FSYouthPreferentialist/2) + (arcology.FSYouthPreferentialistLaw*10)); /* max 60 */ + beauty += (30 - slave.visualAge) / (30 - V.minimumSlaveAge) * ((arcology.FSYouthPreferentialist / 2) + (arcology.FSYouthPreferentialistLaw * 10)); /* max 60 */ } else if (arcology.FSMaturityPreferentialist !== "unset") { if (V.retirementAge > 30) { - beauty += (30 - slave.visualAge)/(30 - V.retirementAge)*((arcology.FSMaturityPreferentialist/2) + (arcology.FSMaturityPreferentialistLaw*10)); /* max 60, problems if retirementAge is 30 or under */ + beauty += (30 - slave.visualAge) / (30 - V.retirementAge) * ((arcology.FSMaturityPreferentialist / 2) + (arcology.FSMaturityPreferentialistLaw * 10)); /* max 60, problems if retirementAge is 30 or under */ } } - if (arcology.FSBodyPurist > 20) { /* bonus for virgin slaves */ + if (arcology.FSBodyPurist > 20) { + /* bonus for virgin slaves */ if (slave.vagina === 0 && slave.counter.vaginal === 0) { - beauty += 30*(arcology.FSBodyPurist/100); + beauty += 30 * (arcology.FSBodyPurist / 100); } if (slave.anus === 0 && slave.counter.anal === 0) { - beauty += 30*(arcology.FSBodyPurist/100); + beauty += 30 * (arcology.FSBodyPurist / 100); } } if (arcology.FSEdoRevivalist !== "unset") { if (slave.nationality === "Japanese" || slave.nationality === "Edo Revivalist") { - beauty += arcology.FSEdoRevivalist/2; + beauty += arcology.FSEdoRevivalist / 2; } else if (slave.race === "asian") { - beauty += arcology.FSEdoRevivalist/5; + beauty += arcology.FSEdoRevivalist / 5; } else { - beauty -= arcology.FSEdoRevivalist/4; + beauty -= arcology.FSEdoRevivalist / 4; } if (V.language === "Japanese" && canTalk(slave)) { if (slave.accent > 1) { - beauty -= arcology.FSEdoRevivalist/2; + beauty -= arcology.FSEdoRevivalist / 2; } else if (slave.accent > 0) { - beauty -= arcology.FSEdoRevivalist/5; + beauty -= arcology.FSEdoRevivalist / 5; } else { - beauty += arcology.FSEdoRevivalist/10; + beauty += arcology.FSEdoRevivalist / 10; } } } else if (arcology.FSChineseRevivalist !== "unset") { if (slave.nationality === "Chinese" || slave.nationality === "Ancient Chinese Revivalist") { - beauty += arcology.FSChineseRevivalist/2; + beauty += arcology.FSChineseRevivalist / 2; } else if (slave.race === "asian") { - beauty += arcology.FSChineseRevivalist/5; + beauty += arcology.FSChineseRevivalist / 5; } else { - beauty -= arcology.FSChineseRevivalist/4; + beauty -= arcology.FSChineseRevivalist / 4; } if (V.language === "Chinese" && canTalk(slave)) { if (slave.accent > 1) { - beauty -= arcology.FSChineseRevivalist/2; + beauty -= arcology.FSChineseRevivalist / 2; } else if (slave.accent > 0) { - beauty -= arcology.FSChineseRevivalist/5; + beauty -= arcology.FSChineseRevivalist / 5; } else { - beauty += arcology.FSChineseRevivalist/10; + beauty += arcology.FSChineseRevivalist / 10; } } } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcMiscNotFuckdollBeauty(slave) { - beauty += Math.min(slave.health, 100)/5; + beauty += Math.min(slave.health, 100) / 5; beauty += slave.voice; - beauty += (slave.intelligence + slave.intelligenceImplant)/10; - beauty += slave.skill.entertainment/10; - beauty += slave.skill.whoring/10; - beauty -= 3*slave.visualAge; + beauty += (slave.intelligence + slave.intelligenceImplant) / 10; + beauty += slave.skill.entertainment / 10; + beauty += slave.skill.whoring / 10; + beauty -= 3 * slave.visualAge; if (setup.entertainmentCareers.includes(slave.career)) { beauty += 20; } else if (V.week - slave.weekAcquired >= 20 && slave.skill.entertainment >= 100) { @@ -320,15 +332,17 @@ window.Beauty = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcDickBeauty(slave) { if (arcology.FSAssetExpansionist > 20 && arcology.FSGenderFundamentalist === "unset") { if (slave.dick >= 20) { - beauty += 17 + (slave.dick*(arcology.FSAssetExpansionist/500)); /* 23 */ + beauty += 17 + (slave.dick * (arcology.FSAssetExpansionist / 500)); /* 23 */ } else if (slave.dick >= 10) { - beauty += 10 + (slave.dick*(arcology.FSAssetExpansionist/300)); /* 16.3 */ + beauty += 10 + (slave.dick * (arcology.FSAssetExpansionist / 300)); /* 16.3 */ } else if (slave.dick > 6) { - beauty += slave.dick*(1 + (arcology.FSAssetExpansionist/100)); /* 10 */ + beauty += slave.dick * (1 + (arcology.FSAssetExpansionist / 100)); /* 10 */ } } else if (arcology.FSGenderFundamentalist !== "unset") { if (slave.dick > 0) { @@ -336,43 +350,45 @@ window.Beauty = (function() { } } else if (arcology.FSGenderRadicalist !== "unset") { if (slave.dick > 20) { - beauty += 20 + (slave.dick*(arcology.FSGenderRadicalist/400)); /* 27.5 */ + beauty += 20 + (slave.dick * (arcology.FSGenderRadicalist / 400)); /* 27.5 */ } else if (slave.dick >= 10) { - beauty += 10 + (slave.dick*(arcology.FSGenderRadicalist/200)); /* 20 */ + beauty += 10 + (slave.dick * (arcology.FSGenderRadicalist / 200)); /* 20 */ } else if (slave.dick > 0) { - beauty += slave.dick*(1 + (arcology.FSGenderRadicalist/100)); /* 10 */ + beauty += slave.dick * (1 + (arcology.FSGenderRadicalist / 100)); /* 10 */ } } else { - beauty -= 2*slave.dick; + beauty -= 2 * slave.dick; } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcBallsBeauty(slave) { if (arcology.FSAssetExpansionist > 20 && arcology.FSGenderFundamentalist === "unset") { if (slave.balls > 100) { - beauty += 41 + (slave.balls*(arcology.FSAssetExpansionist/500)); /* 66 */ + beauty += 41 + (slave.balls * (arcology.FSAssetExpansionist / 500)); /* 66 */ } else if (slave.balls > 80) { - beauty += 16 + (slave.balls*(arcology.FSAssetExpansionist/400)); /* 41 */ + beauty += 16 + (slave.balls * (arcology.FSAssetExpansionist / 400)); /* 41 */ } else if (slave.balls > 60) { - beauty += 6 + (slave.balls*(arcology.FSAssetExpansionist/800)); /* 16 */ + beauty += 6 + (slave.balls * (arcology.FSAssetExpansionist / 800)); /* 16 */ } else if (slave.balls > 10) { - beauty += slave.balls*((arcology.FSAssetExpansionist/1000)); /* 6 */ + beauty += slave.balls * ((arcology.FSAssetExpansionist / 1000)); /* 6 */ } } else if (arcology.FSGenderFundamentalist !== "unset") { if (slave.scrotum > 0) { - beauty -= slave.balls*(1 + (arcology.FSGenderFundamentalist/200)); + beauty -= slave.balls * (1 + (arcology.FSGenderFundamentalist / 200)); } } else if (arcology.FSGenderRadicalist !== "unset") { if (slave.scrotum > 0) { if (slave.balls > 100) { - beauty += 40 + (slave.balls*(arcology.FSGenderRadicalist/2000)); /* 46.25 */ + beauty += 40 + (slave.balls * (arcology.FSGenderRadicalist / 2000)); /* 46.25 */ } else if (slave.balls > 60) { - beauty += 30 + (slave.balls*(arcology.FSGenderRadicalist/1000)); /* 40 */ + beauty += 30 + (slave.balls * (arcology.FSGenderRadicalist / 1000)); /* 40 */ } else if (slave.balls > 10) { - beauty += 15 + (slave.balls*(arcology.FSGenderRadicalist/400)); /* 30 */ + beauty += 15 + (slave.balls * (arcology.FSGenderRadicalist / 400)); /* 30 */ } else { - beauty += slave.balls*(1 + (arcology.FSGenderRadicalist/200)); /* 15 */ + beauty += slave.balls * (1 + (arcology.FSGenderRadicalist / 200)); /* 15 */ } } } else { @@ -380,68 +396,75 @@ window.Beauty = (function() { beauty -= slave.balls; } } - if (arcology.FSRestart !== "unset") { /* Eugenics does not like slaves having working balls */ + if (arcology.FSRestart !== "unset") { + /* Eugenics does not like slaves having working balls */ if (slave.ballType === "human") { - beauty -= slave.balls*(1 + (arcology.FSRestart/100)); + beauty -= slave.balls * (1 + (arcology.FSRestart / 100)); } } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcButtBeauty(slave) { if (slave.butt <= 10) { - beauty += 1.5*slave.butt; /* max 15 */ + beauty += 1.5 * slave.butt; /* max 15 */ } else { - beauty += 15 + (slave.butt/4); /* max 20 */ + beauty += 15 + (slave.butt / 4); /* max 20 */ } if ((arcology.FSTransformationFetishist > 20 && arcology.FSSlimnessEnthusiast === "unset") || arcology.FSAssetExpansionist > 20) { if (slave.butt <= 2) { - beauty += 2*(slave.butt - 1); /* 2 */ + beauty += 2 * (slave.butt - 1); /* 2 */ } else if (slave.butt <= 4) { - beauty += 2 + 1.5*(slave.butt - 2); /* 5 */ + beauty += 2 + 1.5 * (slave.butt - 2); /* 5 */ } else if (slave.butt <= 10) { - beauty += 5 + 1*(slave.butt - 4); /* 11 */ + beauty += 5 + 1 * (slave.butt - 4); /* 11 */ } else { - beauty += 7 + 0.5*(slave.butt - 5); /* 14.5 */ + beauty += 7 + 0.5 * (slave.butt - 5); /* 14.5 */ } /* maybe buff butts? */ } else if (arcology.FSSlimnessEnthusiast > 20) { if (slave.butt <= 3) { - beauty += 12 + 3*(slave.butt - 1); /* 18 buff if asses get buffed */ + beauty += 12 + 3 * (slave.butt - 1); /* 18 buff if asses get buffed */ } else if (slave.butt <= 5) { beauty += 9; } else { - beauty -= 10 + 3*slave.butt; /* -70 */ + beauty -= 10 + 3 * slave.butt; /* -70 */ } } else { if (slave.butt <= 2) { - beauty += 2*(slave.butt-1); /* 2 */ + beauty += 2 * (slave.butt - 1); /* 2 */ } else if (slave.butt <= 4) { - beauty += 2 + (1.5*(slave.butt - 2)); /* 5 */ + beauty += 2 + (1.5 * (slave.butt - 2)); /* 5 */ } else if (slave.butt <= 8) { - beauty += 2 + (1.5*(slave.butt - 2)); /* 11 */ + beauty += 2 + (1.5 * (slave.butt - 2)); /* 11 */ } else { beauty += 9; } } - if (arcology.FSTransformationFetishist > 20) { /* the cost of using AE's values */ + if (arcology.FSTransformationFetishist > 20) { + /* the cost of using AE's values */ if (arcology.FSSlimnessEnthusiast !== "unset") { if (slave.butt >= 3) { - if (slave.buttImplant/slave.butt < 0.25) { - beauty -= 2*(slave.butt - 1) + 10; + if (slave.buttImplant / slave.butt < 0.25) { + beauty -= 2 * (slave.butt - 1) + 10; } } } else { if (slave.butt >= 6) { - if (slave.buttImplant/slave.butt < 0.50) { - beauty -= (1.5*slave.butt) + 6; /* will get nasty at huge sizes */ + if (slave.buttImplant / slave.butt < 0.50) { + beauty -= (1.5 * slave.butt) + 6; /* will get nasty at huge sizes */ } } } } } - /** @param {App.Entity.SlaveState} slave */ - function calcHipsBeauty(slave) { /* butts in general may need buffs */ + /** + * @param {App.Entity.SlaveState} slave + */ + function calcHipsBeauty(slave) { + /* butts in general may need buffs */ switch (slave.hips) { case -2: if (slave.butt > 2) { @@ -505,42 +528,43 @@ window.Beauty = (function() { beauty += 1; } break; - default: - break; + } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcBoobsBeauty(slave) { if ((arcology.FSTransformationFetishist > 20 && arcology.FSSlimnessEnthusiast === "unset") || arcology.FSAssetExpansionist > 20) { if (slave.boobs <= 750) { - beauty += -4 + 0.01*(slave.boobs); /* 3.5 */ + beauty += -4 + 0.01 * (slave.boobs); /* 3.5 */ } else if (slave.boobs <= 2050) { - beauty += 3.5 + 0.0175*(slave.boobs - 750); /* 26.25 */ + beauty += 3.5 + 0.0175 * (slave.boobs - 750); /* 26.25 */ } else if (slave.boobs <= 3000) { - beauty += 26.25 + 0.025*(slave.boobs - 2050); /* 50 */ + beauty += 26.25 + 0.025 * (slave.boobs - 2050); /* 50 */ } else if (slave.boobs <= 25000) { - beauty += 50 + 0.005*(slave.boobs - 3000); /* 160 - this might need to be lowered. Maybe drop the 50? Otherwise break it down more. */ + beauty += 50 + 0.005 * (slave.boobs - 3000); /* 160 - this might need to be lowered. Maybe drop the 50? Otherwise break it down more. */ } else { - beauty += 160 + 0.001*(slave.boobs - 25000); /* 185 */ + beauty += 160 + 0.001 * (slave.boobs - 25000); /* 185 */ } } else if (arcology.FSSlimnessEnthusiast > 20) { if (slave.boobs <= 500) { - beauty += 0.08*(slave.boobs); /* 40 - buff me to be in line with higher end asset exp */ + beauty += 0.08 * (slave.boobs); /* 40 - buff me to be in line with higher end asset exp */ } else if (slave.boobs <= 1000) { beauty += 10; } else if (slave.boobs <= 3000) { beauty += 5; } else { - beauty -= 5 + 0.005*(slave.boobs - 3000); /* -110 */ + beauty -= 5 + 0.005 * (slave.boobs - 3000); /* -110 */ } } else { if (slave.boobs <= 1200) { - beauty += 0.02*(slave.boobs - 200); /* 20 */ + beauty += 0.02 * (slave.boobs - 200); /* 20 */ } else if (slave.boobs <= 2400) { - beauty += 20 + (0.01*(slave.boobs - 1200)); /* 32 */ + beauty += 20 + (0.01 * (slave.boobs - 1200)); /* 32 */ } else if (slave.boobs <= 3600) { - beauty += 32 + (0.005*(slave.boobs - 2400)); /* 38 */ + beauty += 32 + (0.005 * (slave.boobs - 2400)); /* 38 */ } else if (slave.boobs <= 10000) { beauty += 38; } else if (slave.boobs <= 25000) { @@ -549,44 +573,45 @@ window.Beauty = (function() { beauty += 20; } } - if (arcology.FSTransformationFetishist > 20) { /* the cost of using AE's values */ + if (arcology.FSTransformationFetishist > 20) { + /* the cost of using AE's values */ if (arcology.FSSlimnessEnthusiast !== "unset") { if (slave.boobs >= 400) { if (slave.boobs >= 10000) { - if (slave.boobsImplant/slave.boobs < 0.75) { - beauty -= (0.05*slave.boobs) + 10; + if (slave.boobsImplant / slave.boobs < 0.75) { + beauty -= (0.05 * slave.boobs) + 10; } } else if (slave.boobs >= 2000) { - if (slave.boobsImplant/slave.boobs < 0.50) { - beauty -= (0.05*slave.boobs) + 10; + if (slave.boobsImplant / slave.boobs < 0.50) { + beauty -= (0.05 * slave.boobs) + 10; } } else if (slave.boobs >= 1000) { - if (slave.boobsImplant/slave.boobs < 0.25) { - beauty -= (0.05*slave.boobs) + 10; + if (slave.boobsImplant / slave.boobs < 0.25) { + beauty -= (0.05 * slave.boobs) + 10; } } else { - if (slave.boobsImplant/slave.boobs < 0.10) { - beauty -= (0.05*slave.boobs) + 10; + if (slave.boobsImplant / slave.boobs < 0.10) { + beauty -= (0.05 * slave.boobs) + 10; } } } } else { if (slave.boobs >= 600) { if (slave.boobs >= 10000) { - if (slave.boobsImplant/slave.boobs < 0.75) { - beauty -= 30 + (0.005*slave.boobs); /* will get nasty at huge sizes */ + if (slave.boobsImplant / slave.boobs < 0.75) { + beauty -= 30 + (0.005 * slave.boobs); /* will get nasty at huge sizes */ } } else if (slave.boobs >= 2000) { - if (slave.boobsImplant/slave.boobs < 0.50) { - beauty -= 30 + (0.005*slave.boobs); /* will get nasty at huge sizes */ + if (slave.boobsImplant / slave.boobs < 0.50) { + beauty -= 30 + (0.005 * slave.boobs); /* will get nasty at huge sizes */ } } else if (slave.boobs >= 1000) { - if (slave.boobsImplant/slave.boobs < 0.25) { - beauty -= 30 + (0.005*slave.boobs); /* will get nasty at huge sizes */ + if (slave.boobsImplant / slave.boobs < 0.25) { + beauty -= 30 + (0.005 * slave.boobs); /* will get nasty at huge sizes */ } } else { - if (slave.boobsImplant/slave.boobs < 0.10) { - beauty -= 30 + (0.005*slave.boobs); /* will get nasty at huge sizes */ + if (slave.boobsImplant / slave.boobs < 0.10) { + beauty -= 30 + (0.005 * slave.boobs); /* will get nasty at huge sizes */ } } } @@ -613,97 +638,103 @@ window.Beauty = (function() { beauty -= 2; } else if (slave.nipples === "fuckable") { if (arcology.FSTransformationFetishist !== "unset") { - beauty += arcology.FSTransformationFetishist/10; + beauty += arcology.FSTransformationFetishist / 10; } } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcWeightBeauty(slave) { if (arcology.FSHedonisticDecadence > 20) { if (slave.weight < -95) { - beauty += -70 + (slave.weight/10); /* -80 */ + beauty += -70 + (slave.weight / 10); /* -80 */ } else if (slave.weight < -30) { - beauty += -30 + (slave.weight/3); /* -61 */ + beauty += -30 + (slave.weight / 3); /* -61 */ } else if (slave.weight < -10) { beauty += (slave.weight); /* -30 */ } else if (slave.weight <= 10) { /* no effect */ } else if (slave.weight <= 30) { - beauty += (slave.weight/2); /* 15 */ + beauty += (slave.weight / 2); /* 15 */ } else if (slave.weight <= 95) { - beauty += 15 + (slave.weight/7); /* 28.5 */ + beauty += 15 + (slave.weight / 7); /* 28.5 */ } else if (slave.weight <= 130) { - beauty += 28 + (slave.weight/10); /* 41 */ + beauty += 28 + (slave.weight / 10); /* 41 */ } else if (slave.weight <= 160) { - beauty += 42 + (slave.weight/20); /* 50 */ + beauty += 42 + (slave.weight / 20); /* 50 */ } else if (slave.weight <= 190) { - beauty += 50 - (slave.weight/25); /* 42.5 */ + beauty += 50 - (slave.weight / 25); /* 42.5 */ } else { - beauty += 40 - (slave.weight/20); /* 30 */ + beauty += 40 - (slave.weight / 20); /* 30 */ } } else { if (slave.weight > 130) { - beauty -= Math.abs(slave.weight)/5; + beauty -= Math.abs(slave.weight) / 5; } else if (slave.hips === 3) { if (slave.weight < -10) { - beauty -= Math.abs(slave.weight)/10; + beauty -= Math.abs(slave.weight) / 10; } } else if (slave.hips === 2) { if (slave.weight > 95) { - beauty -= Math.abs(slave.weight)/15; + beauty -= Math.abs(slave.weight) / 15; } else if (slave.weight < -30) { - beauty -= Math.abs(slave.weight)/10; + beauty -= Math.abs(slave.weight) / 10; } } else if (slave.hips === -2) { if (slave.weight < -95 || slave.weight > 30) { - beauty -= Math.abs(slave.weight)/10; + beauty -= Math.abs(slave.weight) / 10; } } else { if (Math.abs(slave.weight) > 30) { - beauty -= Math.abs(slave.weight)/10; + beauty -= Math.abs(slave.weight) / 10; } } } if (arcology.FSPhysicalIdealist !== "unset") { if (arcology.FSPhysicalIdealistStrongFat === 1) { if (slave.weight > 10 && slave.weight <= 130) { - beauty += slave.weight*(arcology.FSPhysicalIdealist/200); /* 65 */ + beauty += slave.weight * (arcology.FSPhysicalIdealist / 200); /* 65 */ } else { - beauty -= Math.abs(slave.weight)/2; + beauty -= Math.abs(slave.weight) / 2; } } } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcMusclesBeauty(slave) { if (arcology.FSPhysicalIdealist !== "unset") { if (arcology.FSPhysicalIdealistLaw === 1) { if (Math.abs(slave.weight) <= 30 && slave.health >= 20 && slave.muscles >= 20 && slave.muscles <= 50) { - beauty += (slave.muscles + (Math.min(slave.health, 300)/5))*(arcology.FSPhysicalIdealist/100); + beauty += (slave.muscles + (Math.min(slave.health, 300) / 5)) * (arcology.FSPhysicalIdealist / 100); } else { beauty -= 30; } } else { if (slave.muscles > 30 || slave.muscles <= -5) { - beauty += slave.muscles*(arcology.FSPhysicalIdealist/120); /* +-83 */ + beauty += slave.muscles * (arcology.FSPhysicalIdealist / 120); /* +-83 */ } } } else if (arcology.FSHedonisticDecadence !== "unset") { if (slave.muscles < -10) { - beauty += Math.abs(slave.muscles)*(arcology.FSHedonisticDecadence/160); /* 62.5 */ + beauty += Math.abs(slave.muscles) * (arcology.FSHedonisticDecadence / 160); /* 62.5 */ } else if (slave.muscles > 5) { if (arcology.FSHedonisticDecadenceStrongFat === 1) { - beauty += slave.muscles*(arcology.FSHedonisticDecadence/200); /* 50 */ + beauty += slave.muscles * (arcology.FSHedonisticDecadence / 200); /* 50 */ } else { - beauty -= slave.muscles*(arcology.FSHedonisticDecadence/200); /* -50 */ + beauty -= slave.muscles * (arcology.FSHedonisticDecadence / 200); /* -50 */ } } } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcBodyHairBeauty(slave) { if (slave.physicalAge < 11) { beauty += 4; @@ -722,8 +753,7 @@ window.Beauty = (function() { beauty -= 2; } break; - default: - break; + } switch (slave.pubicHStyle) { case "hairless": @@ -752,159 +782,174 @@ window.Beauty = (function() { beauty -= 6; } break; - default: - break; + } } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcImplantBeauty(slave) { if (arcology.FSTransformationFetishist !== "unset") { if (Math.abs(slave.shouldersImplant) > 1) { - beauty += (arcology.FSTransformationFetishist/20) + Math.abs(slave.shouldersImplant); + beauty += (arcology.FSTransformationFetishist / 20) + Math.abs(slave.shouldersImplant); } if (Math.abs(slave.hipsImplant) > 1) { - beauty += (arcology.FSTransformationFetishist/20) + Math.abs(slave.hipsImplant); + beauty += (arcology.FSTransformationFetishist / 20) + Math.abs(slave.hipsImplant); } if (slave.race !== slave.origRace) { - beauty += arcology.FSTransformationFetishist/20; + beauty += arcology.FSTransformationFetishist / 20; } if (slave.faceImplant > 95 && slave.face > 40) { - beauty += arcology.FSTransformationFetishist/4; + beauty += arcology.FSTransformationFetishist / 4; } } else if (arcology.FSBodyPurist !== "unset") { if (slave.faceImplant > 5) { - beauty -= (arcology.FSBodyPurist/100)*(slave.faceImplant/10); + beauty -= (arcology.FSBodyPurist / 100) * (slave.faceImplant / 10); } if (slave.race !== slave.origRace) { - beauty -= arcology.FSBodyPurist/5; + beauty -= arcology.FSBodyPurist / 5; } } else { if (slave.faceImplant > 30) { - beauty -= (slave.faceImplant - 30)/10; + beauty -= (slave.faceImplant - 30) / 10; } } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcRepopulationPregBeauty(slave) { - if (slave.preg > slave.pregData.normalBirth/1.33) { /* limited huge boost for full term */ + if (slave.preg > slave.pregData.normalBirth / 1.33) { + /* limited huge boost for full term */ if (slave.broodmother > 0) { - beauty += 0.4*(slave.broodmother*arcology.FSRepopulationFocus); /* 40-80 limited due to constant presence. Also good breeders, but subpar mothers */ + beauty += 0.4 * (slave.broodmother * arcology.FSRepopulationFocus); /* 40-80 limited due to constant presence. Also good breeders, but subpar mothers */ } else if (slave.bellyPreg >= 600000) { - beauty += 1.5*arcology.FSRepopulationFocus; /* 150 */ + beauty += 1.5 * arcology.FSRepopulationFocus; /* 150 */ } else if (slave.bellyPreg >= 300000) { beauty += arcology.FSRepopulationFocus; /* 100 */ } else if (slave.bellyPreg >= 120000) { - beauty += 0.9*arcology.FSRepopulationFocus; /* 90 */ + beauty += 0.9 * arcology.FSRepopulationFocus; /* 90 */ } else { - beauty += 0.8*arcology.FSRepopulationFocus; /* 80 */ + beauty += 0.8 * arcology.FSRepopulationFocus; /* 80 */ } - } else if (slave.preg > slave.pregData.normalBirth/2) { + } else if (slave.preg > slave.pregData.normalBirth / 2) { if (slave.pregType >= 20) { - beauty += 10*(arcology.FSRepopulationFocus/40); /* 25 */ + beauty += 10 * (arcology.FSRepopulationFocus / 40); /* 25 */ } else if (slave.pregType >= 10) { - beauty += 9*(arcology.FSRepopulationFocus/40); /* 22.5 */ + beauty += 9 * (arcology.FSRepopulationFocus / 40); /* 22.5 */ } else { - beauty += 8*(arcology.FSRepopulationFocus/40); /* 20 */ + beauty += 8 * (arcology.FSRepopulationFocus / 40); /* 20 */ } - } else if (slave.preg > slave.pregData.normalBirth/4) { + } else if (slave.preg > slave.pregData.normalBirth / 4) { if (slave.pregType >= 20) { - beauty += arcology.FSRepopulationFocus/5; /* 20 */ + beauty += arcology.FSRepopulationFocus / 5; /* 20 */ } else if (slave.pregType >= 10) { - beauty += arcology.FSRepopulationFocus/6.25; /* 16 */ + beauty += arcology.FSRepopulationFocus / 6.25; /* 16 */ } else { - beauty += arcology.FSRepopulationFocus/10; /* 10 */ + beauty += arcology.FSRepopulationFocus / 10; /* 10 */ } } else if (slave.pregWeek < 0) { - beauty += arcology.FSRepopulationFocus/10; /* 10 */ + beauty += arcology.FSRepopulationFocus / 10; /* 10 */ } else if (slave.preg > 0 && slave.collar === "preg biometrics") { - beauty += arcology.FSRepopulationFocus/12; /* 8.33 */ + beauty += arcology.FSRepopulationFocus / 12; /* 8.33 */ } else { - beauty -= arcology.FSRepopulationFocus/2.5; /* -40 */ + beauty -= arcology.FSRepopulationFocus / 2.5; /* -40 */ } if (slave.counter.births > 50) { - beauty += arcology.FSRepopulationFocus/1.5; /* 66.6 */ + beauty += arcology.FSRepopulationFocus / 1.5; /* 66.6 */ } else { - beauty += slave.counter.births*(arcology.FSRepopulationFocus/75); + beauty += slave.counter.births * (arcology.FSRepopulationFocus / 75); } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcTrendyPregBeauty(slave) { - if (slave.preg > slave.pregData.normalBirth/1.33) { /* limited huge boost for full term */ + if (slave.preg > slave.pregData.normalBirth / 1.33) { + /* limited huge boost for full term */ beauty += 20; } else if (slave.bellyPreg >= 1500) { beauty += 10; } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcRestartPregBeauty(slave) { if (slave.breedingMark === 1 && V.propOutcome === 1) { - if (slave.preg > slave.pregData.normalBirth/8 && slave.pregSource === -1) { + if (slave.preg > slave.pregData.normalBirth / 8 && slave.pregSource === -1) { beauty += arcology.FSRestart; /* 100 */ } } else { - if (slave.preg > slave.pregData.normalBirth/1.33) { + if (slave.preg > slave.pregData.normalBirth / 1.33) { if (slave.bellyPreg >= 600000) { - beauty -= 2.5*arcology.FSRestart; /* -250 */ + beauty -= 2.5 * arcology.FSRestart; /* -250 */ } else if (slave.bellyPreg >= 300000) { - beauty -= 1.25*arcology.FSRestart; /* -125 */ + beauty -= 1.25 * arcology.FSRestart; /* -125 */ } else if (slave.bellyPreg >= 120000) { beauty -= arcology.FSRestart; /* -100 */ } else { - beauty -= 0.75*arcology.FSRestart; /* -75 */ + beauty -= 0.75 * arcology.FSRestart; /* -75 */ } - } else if (slave.preg > slave.pregData.normalBirth/2) { + } else if (slave.preg > slave.pregData.normalBirth / 2) { if (slave.pregType >= 20) { - beauty -= arcology.FSRestart/1.5; /* -66.6 */ + beauty -= arcology.FSRestart / 1.5; /* -66.6 */ } else if (slave.pregType >= 10) { - beauty -= arcology.FSRestart/2; /* -50 */ + beauty -= arcology.FSRestart / 2; /* -50 */ } else { - beauty -= arcology.FSRestart/3; /* -33.3 */ + beauty -= arcology.FSRestart / 3; /* -33.3 */ } - } else if (slave.preg > slave.pregData.normalBirth/4) { + } else if (slave.preg > slave.pregData.normalBirth / 4) { if (slave.pregType >= 20) { - beauty -= 3*(arcology.FSRestart/8); /* -37.5 */ + beauty -= 3 * (arcology.FSRestart / 8); /* -37.5 */ } else if (slave.pregType >= 10) { - beauty -= arcology.FSRestart/4; /* -25 */ + beauty -= arcology.FSRestart / 4; /* -25 */ } else { - beauty -= arcology.FSRestart/8; /* -12.5 */ + beauty -= arcology.FSRestart / 8; /* -12.5 */ } } else if (slave.preg === -2) { - beauty += arcology.FSRestart/7; /* 14.2 */ + beauty += arcology.FSRestart / 7; /* 14.2 */ } else if (slave.preg < 1) { - beauty += arcology.FSRestart/5; /* 20 */ + beauty += arcology.FSRestart / 5; /* 20 */ } if (slave.counter.births > 50) { beauty -= arcology.FSRestart; /* -100 */ } else { - beauty -= slave.counter.births*(arcology.FSRestart/50); + beauty -= slave.counter.births * (arcology.FSRestart / 50); } } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcTrendyMilfBeauty(slave) { if (slave.counter.births > 50) { beauty += 6; } else { - beauty += Math.ceil(slave.counter.births/10); + beauty += Math.ceil(slave.counter.births / 10); } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcFutaLawBeauty(slave) { switch (arcology.FSGenderRadicalistLawFuta) { case 1: - if (slave.dick > 0 && slave.vagina > -1) { /* herms */ + if (slave.dick > 0 && slave.vagina > -1) { + /* herms */ calcFutaLawTrueFutaBeauty(slave); } break; case 2: - if (canAchieveErection(slave) && slave.balls > 0 && slave.scrotum > 0) { /* erection! */ + if (canAchieveErection(slave) && slave.balls > 0 && slave.scrotum > 0) { + /* erection! */ calcFutaLawBigDickBeauty(slave); } break; @@ -918,12 +963,13 @@ window.Beauty = (function() { } } break; - default: - break; + } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcFutaLawTrueFutaBeauty(slave) { if (slave.dick <= 10) { beauty += slave.dick; @@ -934,7 +980,9 @@ window.Beauty = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcFutaLawBigDickBeauty(slave) { beauty += slave.dick; if (slave.balls > 120) { @@ -956,18 +1004,20 @@ window.Beauty = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcFutaLawBigBootyBeauty(slave) { if (slave.hips >= 1) { - beauty += 4*(slave.hips - 1); /* 8 */ + beauty += 4 * (slave.hips - 1); /* 8 */ if (arcology.FSSlimnessEnthusiast !== "unset") { - beauty += 4*(slave.hips - 1); /* 8 */ /* offsets the malus for big butts */ + beauty += 4 * (slave.hips - 1); /* 8 */ /* offsets the malus for big butts */ } } if (slave.skill.anal > 60 && slave.anus >= 2) { - beauty += 2*(slave.anus-2); /* 6 */ + beauty += 2 * (slave.anus - 2); /* 6 */ if (arcology.FSSlimnessEnthusiast !== "unset") { - beauty += 2*(slave.anus-2); /* 6 */ /* offsets the malus for big butts */ + beauty += 2 * (slave.anus - 2); /* 6 */ /* offsets the malus for big butts */ } } if (slave.butt >= 5) { @@ -975,9 +1025,12 @@ window.Beauty = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcFutaLawFemboyBeauty(slave) { - if (arcology.FSSlimnessEnthusiast === "unset") { /* balance with slimness */ + if (arcology.FSSlimnessEnthusiast === "unset") { + /* balance with slimness */ beauty += 20; if (slave.boobs < 300) { beauty += 12; @@ -993,8 +1046,9 @@ window.Beauty = (function() { if (slave.balls <= 2) { beauty += 8; } - if (slave.faceShape === "cute" && slave.face > 0) { /* uggos need not apply, maybe a small boost for other faceShapes */ - beauty += ((arcology.FSGenderRadicalist/25)*(slave.face/30)) - 2; /* gives a slightly better boost than androgynous does with gendrad boost, 15.3 */ + if (slave.faceShape === "cute" && slave.face > 0) { + /* uggos need not apply, maybe a small boost for other faceShapes */ + beauty += ((arcology.FSGenderRadicalist / 25) * (slave.face / 30)) - 2; /* gives a slightly better boost than androgynous does with gendrad boost, 15.3 */ } if (slave.nipples === "tiny") { beauty += 5; @@ -1005,24 +1059,28 @@ window.Beauty = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcBodyProportionBeauty(slave) { if (arcology.FSGenderFundamentalist !== "unset") { if (slave.shoulders > slave.hips) { - if (slave.boobs <= 2000*(slave.shoulders - slave.hips)) { - beauty -= (slave.shoulders - slave.hips)*(1 + (arcology.FSGenderFundamentalist/200)); + if (slave.boobs <= 2000 * (slave.shoulders - slave.hips)) { + beauty -= (slave.shoulders - slave.hips) * (1 + (arcology.FSGenderFundamentalist / 200)); } } } else if (arcology.FSGenderRadicalist === "unset") { if (slave.shoulders > slave.hips) { - if (slave.boobs <= 2000*(slave.shoulders - slave.hips)) { + if (slave.boobs <= 2000 * (slave.shoulders - slave.hips)) { beauty -= slave.shoulders - slave.hips; } } } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcVoiceBeauty(slave) { if (canTalk(slave)) { if (slave.accent >= 3) { @@ -1035,7 +1093,9 @@ window.Beauty = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcLimbsBeauty(slave) { switch (slave.amp) { case 1: @@ -1046,12 +1106,13 @@ window.Beauty = (function() { case -4: beauty -= 2; break; - default: - break; + } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcPubertyBeauty(slave) { if (slave.pubertyXX === 1) { beauty += 5; @@ -1064,12 +1125,14 @@ window.Beauty = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcFSMiscBeauty(slave) { if (arcology.FSTransformationFetishist > 20) { if (slave.lips > 70) { - if (slave.lipsImplant/slave.lips < 0.5) { - beauty -= ((slave.lips/10) + (arcology.FSTransformationFetishist/20)); + if (slave.lipsImplant / slave.lips < 0.5) { + beauty -= ((slave.lips / 10) + (arcology.FSTransformationFetishist / 20)); } } if (slave.hips === 3) { @@ -1091,14 +1154,14 @@ window.Beauty = (function() { } if (arcology.FSHedonisticDecadenceLaw2 === 1) { if (slave.boobs >= 2000 && slave.butt >= 5 && slave.weight > 95) { - beauty += 5 + (arcology.FSHedonisticDecadence/20); /* 10 */ + beauty += 5 + (arcology.FSHedonisticDecadence / 20); /* 10 */ } else { - beauty -= 15 + (arcology.FSHedonisticDecadence/20); /* -20 */ + beauty -= 15 + (arcology.FSHedonisticDecadence / 20); /* -20 */ } } if (arcology.FSChattelReligionistCreed === 1) { if (V.nicaeaAssignment === slave.assignment) { - beauty += 2*V.nicaeaPower; + beauty += 2 * V.nicaeaPower; } } if (arcology.FSChattelReligionist > 40 && arcology.FSBodyPurist === "unset") { @@ -1115,36 +1178,44 @@ window.Beauty = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcPurityBeauty(slave) { if (isPure(slave)) { V.pure = V.pure++ || 1; if (arcology.FSBodyPurist !== "unset") { - beauty += arcology.FSBodyPurist/5; + beauty += arcology.FSBodyPurist / 5; } if (arcology.FSTransformationFetishist === "unset") { beauty += 2; } } else if (arcology.FSTransformationFetishist !== "unset") { - beauty += arcology.FSTransformationFetishist/40; + beauty += arcology.FSTransformationFetishist / 40; } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcPhysiqueBeauty(slave) { let physiquePass = 0; if (slave.boobs < 500 && slave.butt < 3) { if (slave.muscles <= 30 && arcology.FSPhysicalIdealist === "unset" && slave.weight <= 10 && arcology.FSHedonisticDecadence === "unset") { physiquePass = 1; - } else if (arcology.FSPhysicalIdealist !== "unset") { /* no muscle malus for muscle loving societies */ - if (arcology.FSPhysicalIdealistStrongFat === 1 && slave.weight <= 30) { /* reduced weight malus for fat loving societies */ + } else if (arcology.FSPhysicalIdealist !== "unset") { + /* no muscle malus for muscle loving societies */ + if (arcology.FSPhysicalIdealistStrongFat === 1 && slave.weight <= 30) { + /* reduced weight malus for fat loving societies */ physiquePass = 1; } else if (slave.weight <= 10) { physiquePass = 1; } - } else if (arcology.FSHedonisticDecadence !== "unset" && slave.weight <= 30) { /* reduced weight malus for fat loving societies */ - if (arcology.FSHedonisticDecadenceStrongFat === 1) { /* no muscle malus for muscle loving societies */ + } else if (arcology.FSHedonisticDecadence !== "unset" && slave.weight <= 30) { + /* reduced weight malus for fat loving societies */ + if (arcology.FSHedonisticDecadenceStrongFat === 1) { + /* no muscle malus for muscle loving societies */ physiquePass = 1; } else if (slave.muscles <= 30) { physiquePass = 1; @@ -1154,9 +1225,9 @@ window.Beauty = (function() { if (physiquePass === 1) { beauty += 40; if (arcology.FSSlimnessEnthusiast > 20) { - beauty += arcology.FSSlimnessEnthusiast/20; + beauty += arcology.FSSlimnessEnthusiast / 20; if (canTalk(slave) && slave.voice === 3) { - beauty += arcology.FSSlimnessEnthusiast/40; + beauty += arcology.FSSlimnessEnthusiast / 40; } } } else if (isStacked(slave)) { @@ -1164,31 +1235,37 @@ window.Beauty = (function() { beauty += 1; } if (arcology.FSAssetExpansionist > 20) { - beauty += arcology.FSAssetExpansionist/20; + beauty += arcology.FSAssetExpansionist / 20; if (canTalk(slave) && slave.voice === 3) { - beauty += arcology.FSAssetExpansionist/40; + beauty += arcology.FSAssetExpansionist / 40; } } } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcSlimBeauty(slave) { if (slimPass(slave) === 1) { - beauty += 40 + (arcology.FSSlimnessEnthusiast/20); /* 45 */ + beauty += 40 + (arcology.FSSlimnessEnthusiast / 20); /* 45 */ } else { - beauty -= arcology.FSSlimnessEnthusiast/20; + beauty -= arcology.FSSlimnessEnthusiast / 20; } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcGenderLawBeauty(slave) { V.genderLawPass = 1; - if (arcology.FSPhysicalIdealist === "unset" && arcology.FSHedonisticDecadenceStrongFat === 0 && slave.muscles > 30) { /* muscle check */ + if (arcology.FSPhysicalIdealist === "unset" && arcology.FSHedonisticDecadenceStrongFat === 0 && slave.muscles > 30) { + /* muscle check */ V.genderLawPass = 0; } - if (arcology.FSHedonisticDecadence !== "unset" || arcology.FSPhysicalIdealistStrongFat === 1) { /* weight check */ + if (arcology.FSHedonisticDecadence !== "unset" || arcology.FSPhysicalIdealistStrongFat === 1) { + /* weight check */ if (slave.weight > 130 || slave.weight <= -30) { V.genderLawPass = 0; } @@ -1209,15 +1286,17 @@ window.Beauty = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcMultipliersBeauty(slave) { calcBellyBeauty(slave); if (slave.geneticQuirks.albinism === 2) { - beauty += 0.1*beauty; + beauty += 0.1 * beauty; } if (slave.breedingMark === 1) { if (V.propOutcome === 1) { - beauty = 2*beauty; + beauty = 2 * beauty; } else { beauty += 2; } @@ -1230,7 +1309,9 @@ window.Beauty = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcBellyBeauty(slave) { if (slave.bellySag > 0) { if (slave.belly < 100) { @@ -1241,86 +1322,92 @@ window.Beauty = (function() { } if (slave.bellyPreg >= 500 && arcology.FSRepopulationFocus === "unset" && arcology.FSRestart === "unset") { if (arcology.FSRepopulationFocusPregPolicy === 1) { - beauty = 0.9*beauty; + beauty = 0.9 * beauty; } else if (arcology.FSGenderRadicalist !== "unset") { if (slave.mpreg === 1) { - beauty = 0.9*beauty; + beauty = 0.9 * beauty; } else { - beauty = 0.7*beauty; + beauty = 0.7 * beauty; } } else if (arcology.FSGenderFundamentalist === "unset") { - beauty = 0.8*beauty; + beauty = 0.8 * beauty; } else { - beauty = 0.7*beauty; + beauty = 0.7 * beauty; } } if (slave.bellyImplant >= 1500) { if (arcology.FSTransformationFetishist > 20) { - beauty += Math.min(Math.trunc(slave.bellyImplant/1000), 50); /* 50 */ + beauty += Math.min(Math.trunc(slave.bellyImplant / 1000), 50); /* 50 */ } else if (arcology.FSRepopulationFocus > 60) { if ((slave.ovaries === 0 && slave.mpreg === 0) || slave.preg < -1) { beauty += 20; } } else { - if (slave.bellyImplant >= 750000) { /* multipliers */ - beauty = 0.2*beauty; + if (slave.bellyImplant >= 750000) { + /* multipliers */ + beauty = 0.2 * beauty; } else if (slave.bellyImplant >= 450000) { - beauty = 0.5*beauty; + beauty = 0.5 * beauty; } else if (slave.bellyImplant >= 300000) { - beauty = 0.7*beauty; + beauty = 0.7 * beauty; } else if (slave.bellyImplant >= 100000) { - beauty = 0.8*beauty; + beauty = 0.8 * beauty; } else if (slave.bellyImplant >= 50000) { - beauty = 0.85*beauty; + beauty = 0.85 * beauty; } else { - beauty = 0.9*beauty; + beauty = 0.9 * beauty; } } } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcAgeBeauty(slave) { if (slave.physicalAge === V.minimumSlaveAge) { beauty += 1; if (slave.physicalAge === V.fertilityAge && canGetPregnant(slave) && (arcology.FSRepopulationFocus !== "unset" || arcology.FSGenderFundamentalist !== "unset") && arcology.FSRestart === "unset") { if (slave.birthWeek === 0) { - beauty += 1.6*beauty; + beauty += 1.6 * beauty; } else if (slave.birthWeek < 4) { - beauty += 0.2*beauty; + beauty += 0.2 * beauty; } } else { if (slave.birthWeek === 0) { - beauty += 0.8*beauty; + beauty += 0.8 * beauty; } else if (slave.birthWeek < 4) { - beauty += 0.1*beauty; + beauty += 0.1 * beauty; } } } else if (slave.physicalAge === V.fertilityAge && canGetPregnant(slave) && (arcology.FSRepopulationFocus !== "unset" || arcology.FSGenderFundamentalist !== "unset") && arcology.FSRestart === "unset") { beauty += 1; if (slave.birthWeek === 0) { - beauty += 0.8*beauty; + beauty += 0.8 * beauty; } else if (slave.birthWeek < 4) { - beauty += 0.1*beauty; + beauty += 0.1 * beauty; } } } - /** @param {App.Entity.SlaveState} slave */ - function calcPrestigeBeauty(slave) { /* multipliers */ + /** + * @param {App.Entity.SlaveState} slave + */ + function calcPrestigeBeauty(slave) { + /* multipliers */ if (slave.prestige >= 3) { - beauty += 2*beauty; + beauty += 2 * beauty; } else if (slave.prestige === 2) { - beauty += 0.5*beauty; + beauty += 0.5 * beauty; } else if (slave.prestige === 1) { - beauty += 0.25*beauty; + beauty += 0.25 * beauty; } if (slave.pornPrestige === 3) { beauty += beauty; } else if (slave.pornPrestige === 2) { - beauty += 0.5*beauty; + beauty += 0.5 * beauty; } else if (slave.pornPrestige === 1) { - beauty += 0.1*beauty; + beauty += 0.1 * beauty; } } @@ -1352,13 +1439,13 @@ window.FResult = (function() { if (!slave.fuckdoll) { calcNotFuckdoll(slave); } else { - result += slave.fuckdoll/10; + result += slave.fuckdoll / 10; } result += Math.max(0, slave.aphrodisiacs) * 2; if (slave.inflationType === "aphrodisiac") { - result += slave.inflation*4; + result += slave.inflation * 4; } if (slave.lactation > 0) { @@ -1373,13 +1460,13 @@ window.FResult = (function() { calcAge(slave); } if (slave.fetish === "mindbroken") { - result = Math.trunc(result*0.4); + result = Math.trunc(result * 0.4); } else { - result = Math.trunc(result*0.7); + result = Math.trunc(result * 0.7); } if (slave.pregWeek < 0) { - result -= Math.trunc(result*slave.pregWeek/10); + result -= Math.trunc(result * slave.pregWeek / 10); } // reduced the most just after birth calcAmputation(slave); @@ -1397,9 +1484,11 @@ window.FResult = (function() { return result; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcUseWeights(slave) { - result = (3 - slave.anus)+(slave.muscles/30); + result = (3 - slave.anus) + (slave.muscles / 30); if (slave.muscles < -95) { result -= 5; } else if (slave.muscles < -30) { @@ -1409,35 +1498,39 @@ window.FResult = (function() { const uses = V.oralUseWeight + V.vaginalUseWeight + V.analUseWeight; if (uses <= 0) return; - result += (6+slave.tonguePiercing) * (V.oralUseWeight/uses) * (slave.skill.oral/30); + result += (6 + slave.tonguePiercing) * (V.oralUseWeight / uses) * (slave.skill.oral / 30); if (slave.sexualFlaw === "cum addict") { - result += (V.oralUseWeight/uses) * (slave.skill.oral/30); + result += (V.oralUseWeight / uses) * (slave.skill.oral / 30); } if (canDoVaginal(slave)) { - result += 6 * (V.vaginalUseWeight/uses) * (slave.skill.vaginal/30); + result += 6 * (V.vaginalUseWeight / uses) * (slave.skill.vaginal / 30); result += (3 - slave.vagina); result += slave.vaginaLube; } if (canDoAnal(slave)) { - result += 6 * (V.analUseWeight/uses) * (slave.skill.anal/30); + result += 6 * (V.analUseWeight / uses) * (slave.skill.anal / 30); if (slave.sexualFlaw === "anal addict") { - result += (V.analUseWeight/uses) * (slave.skill.anal/30); + result += (V.analUseWeight / uses) * (slave.skill.anal / 30); } if (slave.inflationType === "aphrodisiac") { - result += (V.analUseWeight/uses) * (slave.inflation * 3); + result += (V.analUseWeight / uses) * (slave.inflation * 3); } } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcFuckableTits(slave) { result += 2; if (slave.fetish === "boobs") { - result += Math.trunc(slave.fetishStrength/20); + result += Math.trunc(slave.fetishStrength / 20); } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcWorksWithRelatives(slave) { V.slaves.forEach(islave => { if (isParentP(slave, islave) && sameAssignmentP(slave, islave)) { @@ -1451,7 +1544,9 @@ window.FResult = (function() { }); } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcWorksWithRelativesVanilla(slave) { const fre = getSlave(slave.relationTarget); if (fre !== undefined && sameAssignmentP(slave, fre)) { @@ -1460,7 +1555,9 @@ window.FResult = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcWorksWithRelationship(slave) { const fre = V.slaves.findIndex(s => { return haveRelationshipP(slave, s) && sameAssignmentP(slave, s); @@ -1468,13 +1565,17 @@ window.FResult = (function() { if (fre !== -1) result += 1; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcWorksWithRival(slave) { const en = getSlave(slave.rivalryTarget); if (en !== undefined && sameAssignmentP(slave, en)) result -= 1; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcHInjectionsDiet(slave) { if (slave.drugs === "male hormone injections" || slave.drugs === "female hormone injections") { result -= 10; @@ -1490,7 +1591,9 @@ window.FResult = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcPreg(slave) { if (V.arcologies[0].FSRepopulationFocus > 20) { if (slave.belly >= 1500) result += 2; @@ -1513,27 +1616,31 @@ window.FResult = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcRace(slave) { if (V.arcologies[0].FSSupremacist !== "unset" && supremeRaceP(slave)) { - result -= (V.arcologies[0].FSSupremacist/5) + (V.arcologies[0].FSSupremacistLawME*10); + result -= (V.arcologies[0].FSSupremacist / 5) + (V.arcologies[0].FSSupremacistLawME * 10); } if (V.arcologies[0].FSSubjugationist !== "unset" && inferiorRaceP(slave)) { - result += (V.arcologies[0].FSSubjugationist/10) + (V.arcologies[0].FSSubjugationistLawME); + result += (V.arcologies[0].FSSubjugationist / 10) + (V.arcologies[0].FSSubjugationistLawME); } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcSexAttributes(slave) { if (slave.clitPiercing > 2) result += 1; if (slave.tail === "sex") result += 1; if (slave.fetishKnown === 1 && slave.fetishStrength > 60 && slave.fetish !== "none") { - result += slave.fetishStrength/5; + result += slave.fetishStrength / 5; } if (slave.attrKnown === 1) { - result += Math.trunc(slave.attrXX/20); - result += Math.trunc(slave.attrXY/20); + result += Math.trunc(slave.attrXX / 20); + result += Math.trunc(slave.attrXY / 20); if (slave.energy > 95) result += 3; else if (slave.energy > 80) result += 2; else if (slave.energy > 60) result += 1; @@ -1546,7 +1653,9 @@ window.FResult = (function() { if (slave.behavioralQuirk !== "none") result += 2; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcCareer(slave) { if (setup.whoreCareers.includes(slave.career)) { result += 1; @@ -1555,7 +1664,9 @@ window.FResult = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcSight(slave) { if (!canSee(slave)) result -= 3; else if (slave.eyes <= -1) { @@ -1569,7 +1680,9 @@ window.FResult = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcHearing(slave) { if (!canHear(slave)) result -= 2; else if (slave.hears <= -1) { @@ -1581,7 +1694,9 @@ window.FResult = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcEgyptianBonus(slave) { if (V.racialVarieties === undefined) V.racialVarieties = []; if (!V.racialVarieties.includes(slave.race)) { @@ -1589,30 +1704,36 @@ window.FResult = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcYouthBonus(slave) { if (slave.visualAge < 30) { if (slave.actualAge > 30) { result += 5; } // experienced for her apparent age if (slave.physicalAge > 30) { - result -= slave.physicalAge/2; + result -= slave.physicalAge / 2; } // too old :( } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcMatureBonus(slave) { if (slave.visualAge >= 30 && slave.actualAge >= 30 && slave.physicalAge < slave.visualAge) { result += Math.min((slave.physicalAge - slave.visualAge) * 2, 20); } // looks and acts mature, but has a body that just won't quit } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcNotFuckdoll(slave) { if (V.familyTesting === 1 && totalRelatives(slave) > 0) { calcWorksWithRelatives(slave); - } else if (!V.familyTesting && slave.relation !==0) { + } else if (!V.familyTesting && slave.relation !== 0) { calcWorksWithRelativesVanilla(slave); } if (slave.relationship > 0) calcWorksWithRelationship(slave); @@ -1634,27 +1755,31 @@ window.FResult = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcAge(slave) { if ((V.arcologies[0].FSRepopulationFocus !== "unset" || V.arcologies[0].FSGenderFundamentalist !== "unset") && slave.physicalAge === V.minimumSlaveAge && slave.physicalAge === V.fertilityAge && canGetPregnant(slave)) { result += 1; if (slave.birthWeek === 0) result += result; - else if (slave.birthWeek < 4) result += 0.2*result; + else if (slave.birthWeek < 4) result += 0.2 * result; } else if (slave.physicalAge === V.minimumSlaveAge) { result += 1; - if (slave.birthWeek === 0 ) result += 0.5*result; - else if (slave.birthWeek < 4) result += 0.1*result; + if (slave.birthWeek === 0) result += 0.5 * result; + else if (slave.birthWeek < 4) result += 0.1 * result; } else if (slave.physicalAge === V.fertilityAge && canGetPregnant(slave) && (V.arcologies[0].FSRepopulationFocus !== "unset" || V.arcologies[0].FSGenderFundamentalist !== "unset")) { result += 1; if (slave.birthWeek === 0) { - result += 0.5*result; + result += 0.5 * result; } else if (slave.birthWeek < 4) { - result += 0.1*result; + result += 0.1 * result; } } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcAmputation(slave) { switch (slave.amp) { case 0: @@ -1669,7 +1794,9 @@ window.FResult = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcHedonismWeight(slave) { if (slave.weight < 10) { result -= 2; @@ -1682,7 +1809,10 @@ window.FResult = (function() { window.slaveCost = (function() { "use strict"; - let V; let arcology; let multiplier; let cost; + let V; + let arcology; + let multiplier; + let cost; /** * @param {App.Entity.SlaveState} slave @@ -1694,7 +1824,7 @@ window.slaveCost = (function() { V = State.variables; arcology = V.arcologies[0]; multiplier = V.slaveCostFactor; - cost = Beauty(slave)*FResult(slave); + cost = Beauty(slave) * FResult(slave); calcGenitalsCost(slave); calcDevotionTrustCost(slave); @@ -1718,7 +1848,9 @@ window.slaveCost = (function() { return cost; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcGenitalsCost(slave) { if (slave.vagina === 0) { multiplier += 0.1; @@ -1750,30 +1882,34 @@ window.slaveCost = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcDevotionTrustCost(slave) { if (V.specialSlavesPriceOverride === 1) { if (slave.devotion > 50) { - multiplier += slave.devotion/200; + multiplier += slave.devotion / 200; } if (slave.trust > 50) { - multiplier += slave.trust/200; + multiplier += slave.trust / 200; } } else { - multiplier += slave.devotion/200; + multiplier += slave.devotion / 200; if (slave.devotion < -20) { if (slave.trust > 0) { - multiplier -= slave.trust/200; + multiplier -= slave.trust / 200; } } else { if (slave.trust > 0) { - multiplier += slave.trust/200; + multiplier += slave.trust / 200; } } } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcPreferencesCost(slave) { if (slave.behavioralFlaw !== "none") { multiplier -= 0.1; @@ -1793,7 +1929,7 @@ window.slaveCost = (function() { if (slave.fetish === "mindbroken") { multiplier -= 0.3; } else if (slave.fetish !== "none") { - multiplier += slave.fetishStrength/1000; + multiplier += slave.fetishStrength / 1000; } } else { multiplier -= 0.1; @@ -1805,7 +1941,9 @@ window.slaveCost = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcPregCost(slave) { if (slave.mpreg === 1) { multiplier += 0.2; @@ -1817,7 +1955,7 @@ window.slaveCost = (function() { multiplier += 1; } else if (slave.bellyPreg >= 120000) { multiplier += 0.5; - } else if (slave.preg > slave.pregData.normalBirth/4) { + } else if (slave.preg > slave.pregData.normalBirth / 4) { multiplier += 0.1; } } else if (arcology.FSRestartSMR === 1) { @@ -1827,7 +1965,7 @@ window.slaveCost = (function() { multiplier -= 2.5; } else if (slave.bellyPreg >= 30000) { multiplier -= 1.5; - } else if (slave.preg > slave.pregData.normalBirth/4) { + } else if (slave.preg > slave.pregData.normalBirth / 4) { multiplier -= 1.0; } } else { @@ -1843,10 +1981,12 @@ window.slaveCost = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcPrestigeCost(slave) { if (slave.prestige > 0) { - multiplier += 0.7*slave.prestige; + multiplier += 0.7 * slave.prestige; } if (slave.pornPrestige === 3) { multiplier += 1.5; @@ -1857,7 +1997,9 @@ window.slaveCost = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcFSCost(slave) { if (arcology.FSSupremacistLawME !== 0) { if (slave.race !== arcology.FSSupremacistRace) { @@ -1912,7 +2054,9 @@ window.slaveCost = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcAgeCost(slave) { if (slave.physicalAge === V.minimumSlaveAge && slave.physicalAge === V.fertilityAge && canGetPregnant(slave) && (arcology.FSRepopulationFocus !== "unset" || arcology.FSGenderFundamentalist !== "unset")) { if (slave.birthWeek === 0) { @@ -1935,7 +2079,9 @@ window.slaveCost = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcCareersCost(slave) { if (slave.career !== 0) { if (slave.career === "a slave") { @@ -1976,7 +2122,7 @@ window.slaveCost = (function() { multiplier += 0.05; } } - if (V.week-slave.weekAcquired >= 20 && slave.skill.entertainment >= 100) { + if (V.week - slave.weekAcquired >= 20 && slave.skill.entertainment >= 100) { if (!setup.entertainmentCareers.includes(slave.career)) { multiplier += 0.05; } @@ -2033,10 +2179,14 @@ window.slaveCost = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcMiscCost(slave) { - const totalInt = Math.clamp(slave.intelligence + slave.intelligenceImplant, -130, 130); /* make absolutely certain we do not use +-131 in the next line */ - multiplier += Math.floor((Math.asin(totalInt/131))*50)/50; + const totalInt = Math.clamp(slave.intelligence + slave.intelligenceImplant, -130, 130); + /* make absolutely certain we do not use +-131 in the next line + */ + multiplier += Math.floor((Math.asin(totalInt / 131)) * 50) / 50; if (slave.pubertyXY === 0 && slave.physicalAge >= V.potencyAge && slave.genes === "XY" && arcology.FSGenderRadicalist === "unset") { multiplier += 0.5; } @@ -2058,66 +2208,70 @@ window.slaveCost = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcIndentureCost(slave) { if (slave.indenture > -1) { - multiplier -= 0.1*slave.indentureRestrictions; - multiplier -= (260-slave.indenture)/260; + multiplier -= 0.1 * slave.indentureRestrictions; + multiplier -= (260 - slave.indenture) / 260; } else if (V.seeAge === 1) { - if (slave.actualAge >= (V.retirementAge-5) && V.PhysicalRetirementAgePolicy !== 1) { - multiplier *= (V.retirementAge-slave.actualAge)/5; + if (slave.actualAge >= (V.retirementAge - 5) && V.PhysicalRetirementAgePolicy !== 1) { + multiplier *= (V.retirementAge - slave.actualAge) / 5; } - if (slave.physicalAge >= (V.retirementAge-5) && V.PhysicalRetirementAgePolicy === 1) { - multiplier *= (V.retirementAge-slave.actualAge)/5; + if (slave.physicalAge >= (V.retirementAge - 5) && V.PhysicalRetirementAgePolicy === 1) { + multiplier *= (V.retirementAge - slave.actualAge) / 5; } } } function calcCost(/* slave */) { - cost *= multiplier*50; + cost *= multiplier * 50; cost = Number(cost) || 0; if (cost < V.minimumSlaveCost) { cost = V.minimumSlaveCost; } else if (cost <= 100000) { /* do nothing */ } else if (cost <= 200000) { - cost -= (cost-100000)*0.1; + cost -= (cost - 100000) * 0.1; } else if (cost <= 300000) { - cost -= 10000 + ((cost-200000)*0.2); + cost -= 10000 + ((cost - 200000) * 0.2); } else if (cost <= 400000) { - cost -= 30000 + ((cost-300000)*0.3); + cost -= 30000 + ((cost - 300000) * 0.3); } else if (cost <= 500000) { - cost -= 60000 + ((cost-400000)*0.4); + cost -= 60000 + ((cost - 400000) * 0.4); } else { - cost -= 100000 + ((cost-500000)*0.5); + cost -= 100000 + ((cost - 500000) * 0.5); } if (cost < 1000) { cost = 1000; } - cost = 500*Math.trunc(cost/500); + cost = 500 * Math.trunc(cost / 500); } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function calcStartingSlaveCost(slave) { let startingSlaveMultiplier = 0; if (slave.devotion > 20) { - startingSlaveMultiplier += (0.000117*(slave.devotion-20)*(slave.devotion-20))+(0.003167*(slave.devotion-20)); + startingSlaveMultiplier += (0.000117 * (slave.devotion - 20) * (slave.devotion - 20)) + (0.003167 * (slave.devotion - 20)); } if (slave.skill.whoring) { - startingSlaveMultiplier += 0.00001*slave.skill.whore*slave.skill.whore; + startingSlaveMultiplier += 0.00001 * slave.skill.whore * slave.skill.whore; } if (slave.skill.entertainment) { - startingSlaveMultiplier += 0.00001*slave.skill.entertainment*slave.skill.entertainment; + startingSlaveMultiplier += 0.00001 * slave.skill.entertainment * slave.skill.entertainment; } if (slave.skill.vaginal) { - startingSlaveMultiplier += 0.00001*slave.skill.vaginal*slave.skill.vaginal; + startingSlaveMultiplier += 0.00001 * slave.skill.vaginal * slave.skill.vaginal; } if (slave.skill.anal) { - startingSlaveMultiplier += 0.00001*slave.skill.anal*slave.skill.anal; + startingSlaveMultiplier += 0.00001 * slave.skill.anal * slave.skill.anal; } if (slave.skill.oral) { - startingSlaveMultiplier += 0.00001*slave.skill.oral*slave.skill.oral; + startingSlaveMultiplier += 0.00001 * slave.skill.oral * slave.skill.oral; } if (slave.skill.combat) { startingSlaveMultiplier += 0.1; @@ -2127,25 +2281,24 @@ window.slaveCost = (function() { } if (startingSlaveMultiplier) { if (slave.actualAge > 25) { - startingSlaveMultiplier -= startingSlaveMultiplier*(slave.actualAge-25)*0.05; + startingSlaveMultiplier -= startingSlaveMultiplier * (slave.actualAge - 25) * 0.05; } } startingSlaveMultiplier = Math.clamp(startingSlaveMultiplier, 0, 10); - cost += cost*startingSlaveMultiplier; - cost = 500*Math.trunc(cost/500); + cost += cost * startingSlaveMultiplier; + cost = 500 * Math.trunc(cost / 500); if (V.PC.career === "slaver") { - cost = cost/2; + cost = cost / 2; } } return slaveCost; })(); -window.startingSlaveCost = /** * @param {App.Entity.SlaveState} slave * @returns {number} */ -function startingSlaveCost(slave) { +window.startingSlaveCost = function startingSlaveCost(slave) { return slaveCost(slave, true); }; diff --git a/src/js/slaveGenerationJS.js b/src/js/slaveGenerationJS.js index f9359ebaf05f3f8120460158166ca28249fe4271..4bed7f0d77090ad0574725420b3a2a95abb3240c 100644 --- a/src/js/slaveGenerationJS.js +++ b/src/js/slaveGenerationJS.js @@ -1,8 +1,14 @@ -window.nationalityToRace = /** @param {App.Entity.SlaveState} slave */ function nationalityToRace(slave) { +/** + * @param {App.Entity.SlaveState} slave + */ +window.nationalityToRace = function nationalityToRace(slave) { slave.race = hashChoice(setup.raceSelector[slave.nationality] || setup.raceSelector[""]); }; -window.raceToNationality = /** @param {App.Entity.SlaveState} slave */ function raceToNationality(slave) { +/** + * @param {App.Entity.SlaveState} slave + */ +window.raceToNationality = function raceToNationality(slave) { /* consider this placeholder until raceNationalities gets fixed up */ const V = State.variables; slave.nationality = hashChoice(V.nationalities); @@ -22,7 +28,7 @@ window.generateName = function generateName(nationality, race, male, filter) { const lookup = (male ? setup.malenamePoolSelector : setup.namePoolSelector); const result = jsEither( (lookup[`${nationality }.${ race}`] || lookup[nationality] || - (male ? setup.whiteAmericanMaleNames : setup.whiteAmericanSlaveNames)).filter(filter)); + (male ? setup.whiteAmericanMaleNames : setup.whiteAmericanSlaveNames)).filter(filter)); /* fallback for males without specific male name sets: return female name */ if (male && !result) { return generateName(nationality, race, false); @@ -34,8 +40,8 @@ window.generateSurname = function generateSurname(nationality, race, male, filte filter = filter || _.stubTrue; /* default: allow all */ const result = jsEither( (setup.surnamePoolSelector[`${nationality }.${ race}`] || - setup.surnamePoolSelector[nationality] || - setup.whiteAmericanSlaveSurnames).filter(filter)); + setup.surnamePoolSelector[nationality] || + setup.whiteAmericanSlaveSurnames).filter(filter)); if (male) { /* see if we have male equivalent of that surname, and return that if so */ const maleLookup = setup.maleSurnamePoolSelector[`${nationality }.${ race}`] || setup.maleSurnamePoolSelector[nationality]; @@ -53,7 +59,10 @@ window.isMaleName = function isMaleName(name, nationality, race) { return names && names.includes(name); }; -window.nationalityToName = /** @param {App.Entity.SlaveState} slave */ function nationalityToName(slave) { +/** + * @param {App.Entity.SlaveState} slave + */ +window.nationalityToName = function nationalityToName(slave) { const V = State.variables; const male = (slave.genes === "XY"); @@ -67,22 +76,30 @@ window.nationalityToName = /** @param {App.Entity.SlaveState} slave */ function slave.slaveSurname = slave.birthSurname; if (V.useFSNames === 1) { if (V.arcologies[0].FSChattelReligionist > 20) { - slave.slaveName = jsEither(setup.chattelReligionistSlaveNames); slave.slaveSurname = 0; + slave.slaveName = jsEither(setup.chattelReligionistSlaveNames); + slave.slaveSurname = 0; } else if (V.arcologies[0].FSRomanRevivalist > 20) { - slave.slaveName = jsEither(setup.romanSlaveNames); slave.slaveSurname = jsEither(setup.romanSlaveSurnames); + slave.slaveName = jsEither(setup.romanSlaveNames); + slave.slaveSurname = jsEither(setup.romanSlaveSurnames); } else if (V.arcologies[0].FSAztecRevivalist > 20) { - slave.slaveName = jsEither(setup.aztecSlaveNames); slave.slaveSurname = 0; + slave.slaveName = jsEither(setup.aztecSlaveNames); + slave.slaveSurname = 0; } else if (V.arcologies[0].FSEgyptianRevivalist > 20) { - slave.slaveName = jsEither(setup.ancientEgyptianSlaveNames); slave.slaveSurname = 0; + slave.slaveName = jsEither(setup.ancientEgyptianSlaveNames); + slave.slaveSurname = 0; } else if (V.arcologies[0].FSEdoRevivalist > 20) { - slave.slaveName = jsEither(setup.edoSlaveNames); slave.slaveSurname = jsEither(setup.edoSlaveSurnames); + slave.slaveName = jsEither(setup.edoSlaveNames); + slave.slaveSurname = jsEither(setup.edoSlaveSurnames); } else if (V.arcologies[0].FSDegradationist !== "unset") { DegradingName(slave); } } }; -window.nationalityToAccent = /** @param {App.Entity.SlaveState} slave */ function nationalityToAccent(slave) { +/** + * @param {App.Entity.SlaveState} slave + */ +window.nationalityToAccent = function nationalityToAccent(slave) { const V = State.variables; const naturalAccent = jsEither([0, 1, 1, 2, 2, 2, 3, 3, 3, 3]); @@ -1294,7 +1311,10 @@ window.checkForGingering = function checkForGingering() { const His = capFirstChar(his); /* reset in case gingered slaves were viewed but not purchased (no newSlaveIntro) */ - V.gingering = 0; V.gingeringDetected = 0; V.gingeringDetection = 0; V.toSearch = V.activeSlave.origin; + V.gingering = 0; + V.gingeringDetected = 0; + V.gingeringDetection = 0; + V.toSearch = V.activeSlave.origin; if (V.applyLaw === 1 && V.HonestySMR === 1) { /* SMR prohibits gingering and is enforced for this slave - do nothing */ } else if (V.activeSlave.indenture > 0) { @@ -1334,7 +1354,8 @@ window.checkForGingering = function checkForGingering() { } if (V.gingering !== 0) { if (V.PC.slaving >= 100) { - V.gingeringDetected = 1; V.gingeringDetection = "slaver"; + V.gingeringDetected = 1; + V.gingeringDetection = "slaver"; switch (V.gingering) { case "antidepressant": r += `${He} is acting dazed and unfocused. ${He}'s obviously been given antidepressants to make ${him} appear less fearful, and will be considerably less trusting than ${he} seems.`; @@ -1361,9 +1382,11 @@ window.checkForGingering = function checkForGingering() { } else { /* not slaver */ if (V.PC.warfare >= 100 && jsRandom(1, 2) === 1) { - V.gingeringDetected = 1; V.gingeringDetection = "mercenary"; + V.gingeringDetected = 1; + V.gingeringDetection = "mercenary"; } else if (V.PC.rumor === "force" && jsRandom(1, 2) === 1) { - V.gingeringDetected = 1; V.gingeringDetection = "force"; + V.gingeringDetected = 1; + V.gingeringDetection = "force"; } else if (jsRandom(1, 3) === 1) { V.gingeringDetected = 1; } @@ -1410,14 +1433,19 @@ window.removeGingering = function removeGingering() { const V = State.variables; if (V.gingering !== 0 && V.beforeGingering !== 0 && V.activeSlave !== 0 && V.beforeGingering.ID === V.activeSlave.ID) { /* extra checks to ensure gingering state is not left over from a different slave that was inspected but not purchased */ - V.activeSlave = V.beforeGingering; V.beforeGingering = 0; + V.activeSlave = V.beforeGingering; + V.beforeGingering = 0; } else { - /* clear left over state from a different slave without modifying activeSlave */ - V.gingering = 0; V.beforeGingering = 0; + /* clear left over state from a different slave without modifying activeSlave + */ + V.gingering = 0; + V.beforeGingering = 0; } }; -window.randomizeAttraction = /** @param {App.Entity.SlaveState} slave*/ function randomizeAttraction(slave) { +/** + * @param {App.Entity.SlaveState} slave*/ +window.randomizeAttraction = function randomizeAttraction(slave) { const sexuality = jsRandom(0, 100); let attraction = Math.clamp(slave.energy * 2, 60, 180); @@ -1456,7 +1484,9 @@ window.BaseSlave = function BaseSlave() { return new App.Entity.SlaveState(); }; -window.generatePronouns = /** @param {App.Entity.SlaveState} slave*/ function generatePronouns(slave) { +/** + * @param {App.Entity.SlaveState} slave*/ +window.generatePronouns = function generatePronouns(slave) { if (slave.fuckdoll > 0) { slave.pronoun = "it"; slave.possessivePronoun = "its"; diff --git a/src/js/slaveStatsChecker.js b/src/js/slaveStatsChecker.js index 6381032237a4fbe06a9d0374a27e8fb43b545629..fc9e637560ebaaf65a625f3892d35dd9e04b4307 100644 --- a/src/js/slaveStatsChecker.js +++ b/src/js/slaveStatsChecker.js @@ -1,4 +1,3 @@ -/* eslint-disable no-undef */ window.SlaveStatsChecker = (function() { return { checkForLisp: hasLisp, @@ -16,7 +15,10 @@ window.SlaveStatsChecker = (function() { } /* call as SlaveStatsChecker.modScore() */ - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @returns {number} // I think + */ function modScore(slave) { const V = State.variables; V.piercingScore = piercingScore(slave); @@ -25,58 +27,64 @@ window.SlaveStatsChecker = (function() { } /* helper function, not callable */ - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @returns {number} + */ function piercingScore(slave) { let score = 0; if (slave.earPiercing > 0) { - score += slave.earPiercing*0.75 - 0.5; + score += slave.earPiercing * 0.75 - 0.5; } if (slave.nosePiercing > 0) { - score += slave.nosePiercing*0.75 - 0.5; + score += slave.nosePiercing * 0.75 - 0.5; } if (slave.eyebrowPiercing > 0) { - score += slave.eyebrowPiercing*0.75 - 0.5; + score += slave.eyebrowPiercing * 0.75 - 0.5; } if (slave.navelPiercing > 0) { - score += slave.navelPiercing*0.75 - 0.5; + score += slave.navelPiercing * 0.75 - 0.5; } if (slave.corsetPiercing > 0) { - score += slave.corsetPiercing*0.75 + 0.5; + score += slave.corsetPiercing * 0.75 + 0.5; } if (slave.nipplesPiercing > 0) { - score += slave.nipplesPiercing*0.75 - 0.25; + score += slave.nipplesPiercing * 0.75 - 0.25; } if (slave.areolaePiercing > 0) { - score += slave.areolaePiercing*0.75 + 0.5; + score += slave.areolaePiercing * 0.75 + 0.5; } if (slave.lipsPiercing > 0) { - score += slave.lipsPiercing*0.75 - 0.25; + score += slave.lipsPiercing * 0.75 - 0.25; } - if (slave.tonguePiercing > 0 ) { - score += slave.tonguePiercing*0.75 - 0.25; + if (slave.tonguePiercing > 0) { + score += slave.tonguePiercing * 0.75 - 0.25; } if (slave.clitPiercing === 3) /* smart piercing */ { score += 1.25; } else if (slave.clitPiercing > 0) { - score += slave.clitPiercing*0.75 - 0.25; + score += slave.clitPiercing * 0.75 - 0.25; } if (slave.vaginaPiercing > 0) { - score += slave.vaginaPiercing*0.75 - 0.25; + score += slave.vaginaPiercing * 0.75 - 0.25; } if (slave.dickPiercing > 0) { - score += slave.dickPiercing*0.75 - 0.25; + score += slave.dickPiercing * 0.75 - 0.25; } if (slave.anusPiercing > 0) { - score += slave.anusPiercing*0.75 - 0.25; + score += slave.anusPiercing * 0.75 - 0.25; } return score; } /* helper function, not callable */ - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @returns {number} + */ function tatScore(slave) { let score = 0; @@ -111,13 +119,13 @@ window.SlaveStatsChecker = (function() { score += 1; } if (slave.bellyTat !== 0) { - if ((slave.preg > slave.pregData.normalBirth/1.33 && slave.pregType >= 20) || slave.belly >= 300000) { + if ((slave.preg > slave.pregData.normalBirth / 1.33 && slave.pregType >= 20) || slave.belly >= 300000) { score += 0.75; - } else if ((slave.preg > slave.pregData.normalBirth/2 && slave.pregType >= 20) || (slave.preg > slave.pregData.normalBirth/1.33 && slave.pregType >= 10) || slave.belly >= 150000) { + } else if ((slave.preg > slave.pregData.normalBirth / 2 && slave.pregType >= 20) || (slave.preg > slave.pregData.normalBirth / 1.33 && slave.pregType >= 10) || slave.belly >= 150000) { score += 1; } else if (slave.belly >= 10000 || slave.bellyImplant >= 8000) { score += 1; - } else if ((slave.preg >= slave.pregData.normalBirth/4 && slave.pregType >= 20) || (slave.preg > slave.pregData.normalBirth/4 && slave.pregType >= 10) || slave.belly >= 5000) { + } else if ((slave.preg >= slave.pregData.normalBirth / 4 && slave.pregType >= 20) || (slave.preg > slave.pregData.normalBirth / 4 && slave.pregType >= 10) || slave.belly >= 5000) { score += 0.5; } else if (slave.belly >= 1500) { score += 0.25; @@ -137,7 +145,10 @@ window.SlaveStatsChecker = (function() { } /* call as SlaveStatsChecker.isModded() */ - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ function isModded(slave) { const tattoos = tatScore(slave); const piercings = piercingScore(slave); @@ -147,7 +158,10 @@ window.SlaveStatsChecker = (function() { } /* call as SlaveStatsChecker.isUnmodded() */ - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ function isUnmodded(slave) { const tattoos = tatScore(slave); const piercings = piercingScore(slave); @@ -156,7 +170,11 @@ window.SlaveStatsChecker = (function() { } }()); -window.isSlim = /** @param {App.Entity.SlaveState} slave */ function(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.isSlim = function(slave) { let slim = false; const ArcologyZero = State.variables.arcologies[0]; @@ -184,7 +202,11 @@ window.isSlim = /** @param {App.Entity.SlaveState} slave */ function(slave) { return slim; }; -window.slimPass = /** @param {App.Entity.SlaveState} slave */ function(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {number} + */ +window.slimPass = function(slave) { let slimPass = 0; const ArcologyZero = State.variables.arcologies[0]; @@ -209,35 +231,67 @@ window.slimPass = /** @param {App.Entity.SlaveState} slave */ function(slave) { return slimPass; }; -window.isStacked = /** @param {App.Entity.SlaveState} slave */ function(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.isStacked = function(slave) { return (slave.butt > 4) && (slave.boobs > 800); }; -window.isXY = /** @param {App.Entity.SlaveState} slave */ function(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.isXY = function(slave) { return (slave.dick > 0); }; -window.isYoung = /** @param {App.Entity.SlaveState} slave */ function(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.isYoung = function(slave) { return (slave.visualAge < 30); }; -window.isPreg = /** @param {App.Entity.SlaveState} slave */ function(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.isPreg = function(slave) { return ((slave.bellyPreg >= 5000) || (slave.bellyImplant >= 5000)); }; -window.isNotPreg = /** @param {App.Entity.SlaveState} slave */ function(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.isNotPreg = function(slave) { return (!isPreg(slave) && (slave.belly < 100) && (slave.weight < 30) && !setup.fakeBellies.includes(slave.bellyAccessory)); }; -window.isPure = /** @param {App.Entity.SlaveState} slave */ function(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.isPure = function(slave) { return ((slave.boobsImplant === 0) && (slave.buttImplant === 0) && (slave.waist >= -95) && (slave.lipsImplant === 0) && (slave.faceImplant < 30) && (slave.bellyImplant === -1) && (Math.abs(slave.shouldersImplant) < 2) && (Math.abs(slave.hipsImplant) < 2)); }; -window.isSurgicallyImproved = /** @param {App.Entity.SlaveState} slave */ function(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.isSurgicallyImproved = function(slave) { return ((slave.boobsImplant > 0) && (slave.buttImplant > 0) && (slave.waist < -10) && (slave.lipsImplant > 0)); }; -window.isFullyPotent = /** @param {App.Entity.SlaveState} slave */ function(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.isFullyPotent = function(slave) { if (!slave) { return null; } else if (slave.dick > 0 && slave.balls > 0 && slave.ballType !== "sterile" && slave.hormoneBalance < 100 && slave.drugs !== "hormone blockers") { @@ -246,7 +300,11 @@ window.isFullyPotent = /** @param {App.Entity.SlaveState} slave */ function(slav return false; }; -window.canGetPregnant = /** @param {App.Entity.SlaveState} slave */ function(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.canGetPregnant = function(slave) { if (!slave) { return null; } else if (slave.preg === -1) { /* contraceptives check */ @@ -255,28 +313,36 @@ window.canGetPregnant = /** @param {App.Entity.SlaveState} slave */ function(sla return false; } else if ((slave.ovaries === 1) && (canDoVaginal(slave))) { return true; - } else if ((slave.mpreg === 1) && (canDoAnal(slave))) { /* pregmod */ + } else if ((slave.mpreg === 1) && (canDoAnal(slave))) { + /* pregmod */ return true; } return false; }; /** contraceptives (.preg === -1) do not negate this function - * @param {App.Entity.SlaveState} slave */ + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ window.isFertile = function(slave) { if (!slave) { return null; } - if (slave.womb.length > 0 && slave.geneticQuirks.superfetation < 2) { /* currently pregnant without superfetation */ + if (slave.womb.length > 0 && slave.geneticQuirks.superfetation < 2) { + /* currently pregnant without superfetation */ return false; - } else if (slave.broodmother > 0) { /* currently broodmother */ + } else if (slave.broodmother > 0) { + /* currently broodmother */ return false; - } else if (slave.preg < -1) { /* sterile */ + } else if (slave.preg < -1) { + /* sterile */ return false; - } else if (slave.pregWeek < 0) { /* postpartum */ + } else if (slave.pregWeek < 0) { + /* postpartum */ return false; - } else if (slave.pubertyXX === 0) { /* pregmod start */ + } else if (slave.pubertyXX === 0) { + /* pregmod start */ return false; } else if (slave.ovaryAge >= 47) { return false; @@ -302,7 +368,11 @@ window.isFertile = function(slave) { return false; }; -window.canAchieveErection = /** @param {App.Entity.SlaveState} slave */ function(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.canAchieveErection = function(slave) { if (!slave) { return null; } else if (slave.dick < 7 && slave.dick > 0 && slave.drugs !== "hormone blockers" && (slave.balls > 0 ? slave.hormoneBalance < 100 : slave.hormoneBalance <= -100) && slave.ballType !== "sterile") { @@ -311,7 +381,11 @@ window.canAchieveErection = /** @param {App.Entity.SlaveState} slave */ function return false; }; -window.canPenetrate = /** @param {App.Entity.SlaveState} slave */ function(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.canPenetrate = function(slave) { if (!slave) { return null; } else if (!canAchieveErection(slave)) { @@ -324,35 +398,55 @@ window.canPenetrate = /** @param {App.Entity.SlaveState} slave */ function(slave return true; }; -window.canSee = /** @param {App.Entity.SlaveState} slave */ function(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.canSee = function(slave) { if (!slave) { return null; } return (slave.eyes > -2); }; -window.canHear = /** @param {App.Entity.SlaveState} slave */ function(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.canHear = function(slave) { if (!slave) { return null; } return ((slave.hears > -2) && (slave.earwear !== "deafening ear plugs")); }; -window.canSmell = /** @param {App.Entity.SlaveState} slave */ function(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.canSmell = function(slave) { if (!slave) { return null; } return (slave.smells > -1); }; -window.canTaste = /** @param {App.Entity.SlaveState} slave */ function(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.canTaste = function(slave) { if (!slave) { return null; } return (slave.tastes > -1); }; -window.canWalk = /** @param {App.Entity.SlaveState} slave */ function(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.canWalk = function(slave) { if (!slave) { return null; } else if (slave.amp === 1) { @@ -381,7 +475,11 @@ window.canWalk = /** @param {App.Entity.SlaveState} slave */ function(slave) { return false; }; -window.canTalk = /** @param {App.Entity.SlaveState} slave */ function(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.canTalk = function(slave) { if (!slave) { return null; } else if (slave.accent > 2) { @@ -402,7 +500,11 @@ window.canTalk = /** @param {App.Entity.SlaveState} slave */ function(slave) { return true; }; -window.canDoAnal = /** @param {App.Entity.SlaveState} slave */ function(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.canDoAnal = function(slave) { if (!slave) { return null; } else if (slave.chastityAnus === 1) { @@ -411,7 +513,11 @@ window.canDoAnal = /** @param {App.Entity.SlaveState} slave */ function(slave) { return true; }; -window.canDoVaginal = /** @param {App.Entity.SlaveState} slave */ function(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.canDoVaginal = function(slave) { if (!slave) { return null; } else if (slave.vagina < 0) { @@ -422,78 +528,102 @@ window.canDoVaginal = /** @param {App.Entity.SlaveState} slave */ function(slave return true; }; -window.tooFatSlave = /** @param {App.Entity.SlaveState} slave */ function(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.tooFatSlave = function(slave) { if (!slave) { return null; - } else if (slave.weight > 190+(slave.muscles/5) && slave.physicalAge >= 18) { + } else if (slave.weight > 190 + (slave.muscles / 5) && slave.physicalAge >= 18) { return true; - } else if (slave.weight > 130+(slave.muscles/20) && slave.physicalAge <= 3) { + } else if (slave.weight > 130 + (slave.muscles / 20) && slave.physicalAge <= 3) { return true; - } else if (slave.weight > 160+(slave.muscles/15) && slave.physicalAge <= 12) { + } else if (slave.weight > 160 + (slave.muscles / 15) && slave.physicalAge <= 12) { return true; - } else if (slave.weight > 185+(slave.muscles/10) && slave.physicalAge < 18) { + } else if (slave.weight > 185 + (slave.muscles / 10) && slave.physicalAge < 18) { return true; } return false; }; -window.tooBigBreasts = /** @param {App.Entity.SlaveState} slave */ function(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.tooBigBreasts = function(slave) { if (!slave) { return null; - } else if (slave.boobs > 30000+(slave.muscles*100) && slave.physicalAge >= 18) { + } else if (slave.boobs > 30000 + (slave.muscles * 100) && slave.physicalAge >= 18) { return true; - } else if (slave.boobs > 5000+(slave.muscles*10) && slave.physicalAge <= 3) { + } else if (slave.boobs > 5000 + (slave.muscles * 10) && slave.physicalAge <= 3) { return true; - } else if (slave.boobs > 10000+(slave.muscles*20) && slave.physicalAge <= 12) { + } else if (slave.boobs > 10000 + (slave.muscles * 20) && slave.physicalAge <= 12) { return true; - } else if (slave.boobs > 20000+(slave.muscles*50) && slave.physicalAge < 18) { + } else if (slave.boobs > 20000 + (slave.muscles * 50) && slave.physicalAge < 18) { return true; } return false; }; -window.tooBigBelly = /** @param {App.Entity.SlaveState} slave */ function(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.tooBigBelly = function(slave) { if (!slave) { return null; - } else if (slave.belly >= 450000+(slave.muscles*2000) && slave.physicalAge >= 18) { + } else if (slave.belly >= 450000 + (slave.muscles * 2000) && slave.physicalAge >= 18) { return true; - } else if (slave.belly >= 350000+(slave.muscles*1000) && slave.physicalAge >= 13) { + } else if (slave.belly >= 350000 + (slave.muscles * 1000) && slave.physicalAge >= 13) { return true; - } else if (slave.belly >= 30000+(slave.muscles*500) && slave.physicalAge <= 3) { + } else if (slave.belly >= 30000 + (slave.muscles * 500) && slave.physicalAge <= 3) { return true; - } else if (slave.belly >= 150000+(slave.muscles*800) && slave.physicalAge <= 12) { + } else if (slave.belly >= 150000 + (slave.muscles * 800) && slave.physicalAge <= 12) { return true; } return false; }; -window.tooBigBalls = /** @param {App.Entity.SlaveState} slave */ function(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.tooBigBalls = function(slave) { if (!slave) { return null; - } else if (slave.balls >= 30+(slave.muscles*.3) && slave.physicalAge <= 3) { + } else if (slave.balls >= 30 + (slave.muscles * .3) && slave.physicalAge <= 3) { return true; - } else if (slave.balls >= 60+(slave.muscles*.5) && slave.physicalAge <= 12) { + } else if (slave.balls >= 60 + (slave.muscles * .5) && slave.physicalAge <= 12) { return true; - } else if (slave.balls >= 90+(slave.muscles*.7)) { + } else if (slave.balls >= 90 + (slave.muscles * .7)) { return true; } return false; }; -window.tooBigDick = /** @param {App.Entity.SlaveState} slave */ function(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.tooBigDick = function(slave) { if (!slave) { return null; - } else if (slave.dick >= 20+(slave.muscles*.1) && slave.physicalAge <= 3 && slave.dick !== 0) { + } else if (slave.dick >= 20 + (slave.muscles * .1) && slave.physicalAge <= 3 && slave.dick !== 0) { return true; - } else if (slave.dick >= 45+(slave.muscles*.3) && slave.physicalAge <= 12) { + } else if (slave.dick >= 45 + (slave.muscles * .3) && slave.physicalAge <= 12) { return true; - } else if (slave.dick >= 68+(slave.muscles*.4)) { + } else if (slave.dick >= 68 + (slave.muscles * .4)) { return true; } return false; }; -window.tooBigButt = /** @param {App.Entity.SlaveState} slave */ function(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.tooBigButt = function(slave) { if (!slave) { return null; } else if (slave.butt > 10 && slave.physicalAge <= 3) { @@ -504,8 +634,14 @@ window.tooBigButt = /** @param {App.Entity.SlaveState} slave */ function(slave) return false; }; -window.isVegetable = /** @param {App.Entity.SlaveState} slave */ function(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.isVegetable = function(slave) { slave = slave || State.variables.activeSlave; - if (!slave) { return false; } + if (!slave) { + return false; + } return (slave.fetish === "mindbroken"); }; diff --git a/src/js/slaveSummaryWidgets.js b/src/js/slaveSummaryWidgets.js index e4cd0bf6b6cff293dc96fdfd31d5a42fde119df2..fb4151ed2509c2d60d939e042862210d804b9fb8 100644 --- a/src/js/slaveSummaryWidgets.js +++ b/src/js/slaveSummaryWidgets.js @@ -1,6 +1,8 @@ -/* eslint-disable no-unused-vars */ -/* eslint-disable no-undef */ -window.clearSummaryCache = /** @param {App.Entity.SlaveState | number} slave */ function clearSummaryCache(slave) { +/* eslint-disable camelcase */ +/** + * @param {App.Entity.SlaveState | number} slave + */ +window.clearSummaryCache = function clearSummaryCache(slave) { if (!slave) { setup.summaryCache = {}; } else if (slave instanceof Object && slave.ID !== Infinity && slave.ID !== -Infinity) { @@ -10,13 +12,17 @@ window.clearSummaryCache = /** @param {App.Entity.SlaveState | number} slave */ } }; -window.SlaveSummary = /** @param {App.Entity.SlaveState} slave */ function SlaveSummary(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {object} + */ +window.SlaveSummary = function SlaveSummary(slave) { const V = State.variables; if (V.useSummaryCache) { if (setup.summaryCache[slave.ID] === undefined) { setup.summaryCache[slave.ID] = SlaveSummaryUncached(slave); } - //this.output.appendChild(setup.summaryCache[State.temporary.Slave.ID].cloneNode(true)) + // this.output.appendChild(setup.summaryCache[State.temporary.Slave.ID].cloneNode(true)) return setup.summaryCache[slave.ID]; } return SlaveSummaryUncached(slave); @@ -179,13 +185,13 @@ window.SlaveSummaryUncached = (function() { } r += `</span>`; } else if (V.abbreviateHormoneBalance === 2) { - r += `<span class="`; + r += `<span class=`; if (slave.hormoneBalance <= -21) { r += `deepskyblue`; } else { r += `pink`; } - r += `"> `; + r += `> `; if (slave.hormoneBalance < -400) { r += `Overwhelmingly masculine`; } else if (slave.hormoneBalance <= -300) { @@ -326,7 +332,9 @@ window.SlaveSummaryUncached = (function() { return r; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_devotion(slave) { if (slave.fetish === "mindbroken") { r += `<span class="red">MB</span>`; @@ -378,7 +386,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_devotion(slave) { if (slave.fetish === "mindbroken") { r += `<span class="red">Mindbroken.</span>`; @@ -430,7 +440,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_rules(slave) { switch (slave.livingRules) { case "luxurious": @@ -523,7 +535,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_rules(slave) { r += `Living standard: ${slave.livingRules}. `; if (canTalk(slave)) { @@ -535,7 +549,9 @@ window.SlaveSummaryUncached = (function() { r += `Release rules: ${slave.releaseRules}. `; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_weight(slave) { if (slave.weight < -95) { r += `<strong><span class="red">W---${V.summaryStats? `[${slave.weight}]` : ''}</span></strong>`; @@ -585,7 +601,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_weight(slave) { if (slave.weight < -95) { r += `<span class="red">Emaciated${V.summaryStats ? `[${slave.weight}]`: ''}.</span>`; @@ -635,7 +653,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_diet(slave) { r += `<span class="teal">`; switch (slave.diet) { @@ -669,8 +689,7 @@ window.SlaveSummaryUncached = (function() { case "fertility": r += `<strong>Di:F+</strong>`; break; - default: - break; + } r += `</span> `; r += `<span class="cyan">`; @@ -688,7 +707,9 @@ window.SlaveSummaryUncached = (function() { r += `</span> `; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_diet(slave) { r += `<span class="teal">`; switch (slave.diet) { @@ -722,8 +743,7 @@ window.SlaveSummaryUncached = (function() { case "fertility": r += `Fertility.`; break; - default: - break; + } r += `</span> `; if (slave.dietCum === 2) { @@ -740,7 +760,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_health(slave) { if (slave.health < -20) { r += `<strong><span class="red">H${V.summaryStats? `[${slave.health}]` : ''}</span></strong>`; @@ -752,7 +774,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_health(slave) { if (slave.health < -90) { r += `<span class="red">On the edge of death${V.summaryStats? `[${slave.health}]` : ''}.</span>`; @@ -772,7 +796,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_drugs(slave) { r += `<span class="tan">`; switch (slave.drugs) { @@ -875,8 +901,7 @@ window.SlaveSummaryUncached = (function() { case "growth stimulants": r += `<strong>Dr:groStim</strong>`; break; - default: - break; + } r += `</span> `; r += `<span class="lightgreen">`; @@ -956,7 +981,9 @@ window.SlaveSummaryUncached = (function() { r += `</span> `; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_drugs(slave) { if ((slave.drugs !== "no drugs") && (slave.drugs !== "none")) { r += `<span class="tan">On ${slave.drugs}.</span> `; @@ -1064,7 +1091,9 @@ window.SlaveSummaryUncached = (function() { r += `</span> `; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_race(slave) { switch (slave.race) { case "white": @@ -1110,7 +1139,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_race(slave) { switch (slave.race) { case "white": @@ -1156,7 +1187,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_nationality(slave) { r += `<span class="tan">`; switch (slave.nationality) { @@ -1831,7 +1864,9 @@ window.SlaveSummaryUncached = (function() { r += `</span> `; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_nationality(slave) { r += `<span class="tan">`; switch (slave.nationality) { @@ -1867,7 +1902,9 @@ window.SlaveSummaryUncached = (function() { r += `</span> `; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_skin(slave) { r += `<span class="pink">`; switch (slave.skin) { @@ -1928,7 +1965,9 @@ window.SlaveSummaryUncached = (function() { r += `</span> `; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_genitals(slave) { if (slave.dick > 0) { r += `<span class="pink">`; @@ -1987,7 +2026,9 @@ window.SlaveSummaryUncached = (function() { r += `</span> `; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_genitals(slave) { if (slave.dick > 0) { r += `<span class="pink">`; @@ -2046,7 +2087,9 @@ window.SlaveSummaryUncached = (function() { r += `</span> `; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_age(slave) { r += `<span class="pink">`; if (V.showAgeDetail === 1) { @@ -2073,7 +2116,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_face(slave) { if (slave.face < -95) { r += `<span class="red">Face---${V.summaryStats? `[${slave.face}]` : ''}</span>`; @@ -2093,7 +2138,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_eyes(slave) { if (slave.eyes === -2) { r += `<span class="red">Blind</span>`; @@ -2103,7 +2150,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_ears(slave) { if (slave.hears === -2) { r += `<span class="red">Deaf</span>`; @@ -2113,7 +2162,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_lips(slave) { if (slave.lips > 95) { r += `Facepussy`; @@ -2131,7 +2182,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_teeth(slave) { if (slave.teeth === "crooked") { r += `<span class="yellow">Cr Teeth</span>`; @@ -2153,7 +2206,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_muscles(slave) { if (slave.muscles > 95) { r += `Musc++${V.summaryStats? `[${slave.muscles}]`: ''}`; @@ -2181,7 +2236,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_limbs(slave) { if (slave.amp !== 0) { if (slave.amp === -1) { @@ -2208,7 +2265,9 @@ window.SlaveSummaryUncached = (function() { r += `</span> `; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_voice(slave) { if (slave.voice === 0) { r += `<span class="red">Mute</span>`; @@ -2226,7 +2285,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_tits_ass(slave) { r += `<span class="pink">`; if ((slave.boobs >= 12000) && (slave.butt > 9)) { @@ -2259,7 +2320,9 @@ window.SlaveSummaryUncached = (function() { r += `</span> `; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_hips(slave) { r += `<span class="red">`; if (slave.hips < -1) { @@ -2298,7 +2361,9 @@ window.SlaveSummaryUncached = (function() { r += `</span> `; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_waist(slave) { if (slave.waist > 95) { r += `<span class="red">Wst---${V.summaryStats? `[${slave.waist}]` : ''}</span>`; @@ -2318,7 +2383,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_implants(slave) { r += `<span class="pink">`; if ((slave.boobsImplant === 0) && (slave.buttImplant === 0) && (slave.waist >= -95) && (slave.lipsImplant === 0) && (slave.faceImplant <= 5) && (slave.bellyImplant === -1)) { @@ -2329,7 +2396,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_lactation(slave) { if (slave.lactation === 1) { r += `Lact`; @@ -2339,7 +2408,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_mods(slave) { V.modScore = SlaveStatsChecker.modScore(slave); if (slave.corsetPiercing === 0 && V.piercingScore < 3 && V.tatScore < 2) { @@ -2357,7 +2428,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_age(slave) { r += `<span class="pink">`; if (V.showAgeDetail === 1) { @@ -2408,7 +2481,9 @@ window.SlaveSummaryUncached = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_face(slave) { if (slave.face < -95) { r += `<span class="red">Very ugly${V.summaryStats? `[${slave.face}]`: ''}</span>`; @@ -2428,7 +2503,9 @@ window.SlaveSummaryUncached = (function() { r += ` ${slave.faceShape} face. `; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_eyes(slave) { if (slave.eyes <= -2) { r += `<span class="red">Blind.</span>`; @@ -2438,7 +2515,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_ears(slave) { if (slave.hears <= -2) { r += `<span class="red">Deaf.</span>`; @@ -2448,7 +2527,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_lips(slave) { if (slave.lips > 95) { r += `Facepussy${V.summaryStats? `[${slave.lips}]`: ''}.`; @@ -2466,7 +2547,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_teeth(slave) { if (slave.teeth === "crooked") { r += `<span class="yellow">Crooked teeth.</span>`; @@ -2488,7 +2571,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_muscles(slave) { if (slave.muscles > 95) { r += `Hugely muscular${V.summaryStats? `[${slave.muscles}]` : ''}.`; @@ -2516,7 +2601,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_limbs(slave) { if (slave.amp !== 0) { if (slave.amp === -1) { @@ -2543,7 +2630,9 @@ window.SlaveSummaryUncached = (function() { r += `</span> `; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_voice(slave) { if (slave.voice === 0) { r += `<span class="red">Mute.</span>`; @@ -2561,7 +2650,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_tits_ass(slave) { r += `<span class="pink">`; if ((slave.boobs >= 12000) && (slave.butt > 9)) { @@ -2594,7 +2685,9 @@ window.SlaveSummaryUncached = (function() { r += `</span> `; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_hips(slave) { r += `<span class="red">`; if (slave.hips < -1) { @@ -2633,7 +2726,9 @@ window.SlaveSummaryUncached = (function() { r += `</span> `; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_waist(slave) { if (slave.waist > 95) { r += `<span class="red">Masculine waist${V.summaryStats? `[${slave.waist}]`: ''}.</span>`; @@ -2653,7 +2748,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_implants(slave) { r += `<span class="pink">`; if ((slave.boobsImplant !== 0) || (slave.buttImplant !== 0) || (slave.lipsImplant !== 0) || (slave.bellyImplant !== -1)) { @@ -2666,7 +2763,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_lactation(slave) { if (slave.lactation === 1) { r += `Lactating naturally.`; @@ -2676,7 +2775,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_mods(slave) { V.modScore = SlaveStatsChecker.modScore(slave); if (slave.corsetPiercing === 0 && V.piercingScore < 3 && V.tatScore < 2) { @@ -2691,7 +2792,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_intelligence(slave) { const intelligence = slave.intelligence + slave.intelligenceImplant; if (slave.fetish === "mindbroken") { @@ -2750,7 +2853,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_sex_skills(slave) { let _SSkills = slave.skill.anal + slave.skill.oral; r += `<span class="aquamarine">`; @@ -2807,7 +2912,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_prestige(slave) { if (slave.prestige > 0) { r += `<span class="green">`; @@ -2822,7 +2929,9 @@ window.SlaveSummaryUncached = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_porn_prestige(slave) { if (slave.pornPrestige > 0) { r += `<span class="green">`; @@ -2837,7 +2946,9 @@ window.SlaveSummaryUncached = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_intelligence(slave) { const intelligence = slave.intelligence + slave.intelligenceImplant; if (slave.fetish === "mindbroken") { @@ -2896,7 +3007,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_sex_skills(slave) { let _SSkills = (slave.skill.anal + slave.skill.oral); r += `<span class="aquamarine">`; @@ -2939,7 +3052,9 @@ window.SlaveSummaryUncached = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_prestige(slave) { if (slave.prestige > 0) { r += `<span class="green">`; @@ -2954,7 +3069,9 @@ window.SlaveSummaryUncached = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_porn_prestige(slave) { if (slave.pornPrestige > 0) { r += `<span class="green">`; @@ -2969,7 +3086,9 @@ window.SlaveSummaryUncached = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_fetish(slave) { r += `<span class="lightcoral">`; switch (slave.fetish) { @@ -3064,7 +3183,9 @@ window.SlaveSummaryUncached = (function() { r += `</span> `; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_attraction(slave) { if (slave.attrXY <= 5) { r += `<span class="red">XY---${V.summaryStats? `[${slave.attrXY}]`: ''}</span>`; @@ -3122,7 +3243,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_smart_fetish(slave) { if (slave.fetishKnown === 1) { if (slave.clitSetting === "off") { @@ -3198,14 +3321,15 @@ window.SlaveSummaryUncached = (function() { case "none": r += `SP:none`; break; - default: - break; + } } r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_smart_attraction(slave) { if (slave.attrKnown === 1) { if (slave.clitSetting === "women") { @@ -3247,7 +3371,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_behavior_flaw(slave) { r += `<span class="red">`; switch (slave.behavioralFlaw) { @@ -3285,7 +3411,9 @@ window.SlaveSummaryUncached = (function() { r += `</span> `; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_sex_flaw(slave) { switch (slave.sexualFlaw) { case "hates oral": @@ -3349,7 +3477,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_behavior_quirk(slave) { r += `<span class="green">`; switch (slave.behavioralQuirk) { @@ -3387,7 +3517,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_sex_quirk(slave) { switch (slave.sexualQuirk) { case "gagfuck queen": @@ -3424,7 +3556,9 @@ window.SlaveSummaryUncached = (function() { r += `</span> `; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_fetish(slave) { r += `<span class="lightcoral">`; switch (slave.fetish) { @@ -3516,7 +3650,9 @@ window.SlaveSummaryUncached = (function() { r += `</span> `; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_attraction(slave) { if (slave.attrXY <= 5) { r += `<span class="red">Disgusted by men${V.summaryStats? `[${slave.attrXY}]` : ''},</span> `; @@ -3572,7 +3708,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_smart_fetish(slave) { if (slave.fetishKnown === 1) { if (slave.clitSetting === "off") { @@ -3645,14 +3783,15 @@ window.SlaveSummaryUncached = (function() { case "none": r += `SP: none.`; break; - default: - break; + } } r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_smart_attraction(slave) { if (slave.attrKnown === 1) { if ((slave.attrXX < 100) && (slave.clitSetting === "women")) { @@ -3670,7 +3809,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_behavior_flaw(slave) { r += `<span class="red">`; switch (slave.behavioralFlaw) { @@ -3708,7 +3849,9 @@ window.SlaveSummaryUncached = (function() { r += `</span> `; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_sex_flaw(slave) { switch (slave.sexualFlaw) { case "hates oral": @@ -3772,7 +3915,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_behavior_quirk(slave) { r += `<span class="green">`; switch (slave.behavioralQuirk) { @@ -3810,7 +3955,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_sex_quirk(slave) { switch (slave.sexualQuirk) { case "gagfuck queen": @@ -3847,7 +3994,9 @@ window.SlaveSummaryUncached = (function() { r += `</span> `; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_extended_family(slave) { let handled = 0; if (slave.mother > 0) { @@ -3965,7 +4114,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_legacy_family(slave) { if (slave.relation !== 0) { const _ssj = V.slaves.findIndex(function(s) { @@ -3997,14 +4148,18 @@ window.SlaveSummaryUncached = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_clone(slave) { if (slave.clone !== 0) { r += ` Clone`; } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function short_rival(slave) { if (slave.rivalry !== 0) { r += ` `; @@ -4025,7 +4180,9 @@ window.SlaveSummaryUncached = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_extended_family(slave) { let handled = 0; if (slave.mother > 0) { @@ -4156,7 +4313,9 @@ window.SlaveSummaryUncached = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_legacy_family(slave) { if (slave.relation !== 0) { const _ssj = V.slaves.findIndex(function(s) { @@ -4196,14 +4355,18 @@ window.SlaveSummaryUncached = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_clone(slave) { if (slave.clone !== 0) { r += ` <span class="skyblue">Clone of ${slave.clone}.</span>`; } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_rival(slave) { if (slave.rivalry !== 0) { r += ` `; @@ -4223,7 +4386,9 @@ window.SlaveSummaryUncached = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_clothes(slave) { switch (slave.clothes) { case "attractive lingerie": @@ -4551,7 +4716,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_collar(slave) { switch (slave.collar) { case "uncomfortable leather": @@ -4616,14 +4783,15 @@ window.SlaveSummaryUncached = (function() { break; case "porcelain mask": r += `Porcelain mask.`; - break; - default: - break; + break + } r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_belly(slave) { switch (slave.bellyAccessory) { case "shapewear": @@ -4647,13 +4815,14 @@ window.SlaveSummaryUncached = (function() { case "an extreme corset": r += `Extreme corsetage.`; break; - default: - break; + } r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_legs(slave) { if (slave.legAccessory === "short stockings") { r += `Short stockings.`; @@ -4663,7 +4832,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_shoes(slave) { if (slave.shoes === "heels") { r += `Heels.`; @@ -4681,7 +4852,9 @@ window.SlaveSummaryUncached = (function() { r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_chastity(slave) { if (slave.chastityAnus === 1 && slave.chastityPenis === 1 && slave.chastityVagina === 1) { r += `Full chastity.`; @@ -4698,7 +4871,9 @@ window.SlaveSummaryUncached = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_vaginal_acc(slave) { if (slave.vaginalAttachment !== "vibrator") { switch (slave.vaginalAccessory) { @@ -4726,8 +4901,7 @@ window.SlaveSummaryUncached = (function() { case "long, huge dildo": r += `Long and wide vaginal dildo.`; break; - default: - break; + } } r += " "; @@ -4736,14 +4910,15 @@ window.SlaveSummaryUncached = (function() { case "vibrator": r += `Vibrating dildo.`; break; - default: - break; + } r += " "; } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_dick_acc(slave) { switch (slave.dickAccessory) { case "sock": @@ -4755,13 +4930,14 @@ window.SlaveSummaryUncached = (function() { case "smart bullet vibrator": r += `Smart frenulum bullet vibrator.`; break; - default: - break; + } r += " "; } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function long_buttplug(slave) { switch (slave.buttplug) { case "plug": @@ -4782,8 +4958,7 @@ window.SlaveSummaryUncached = (function() { case "long, huge plug": r += `Enormous buttplug.`; break; - default: - break; + } r += " "; switch (slave.buttplugAttachment) { @@ -4796,12 +4971,13 @@ window.SlaveSummaryUncached = (function() { case "fox tail": r += `Attached fox tail. `; break; - default: - break; + } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function rules_assistant(slave) { if (slave.useRulesAssistant === 0) { r += `<span class="lightgreen">RA-Exempt</span> `; @@ -4810,7 +4986,9 @@ window.SlaveSummaryUncached = (function() { } } - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + */ function origins(slave) { r += `<br>`; if (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) { @@ -4956,7 +5134,9 @@ App.UI.slaveSummaryList = function(passageName) { const V = State.variables; const _indexed = 0; - /** @type {App.Entity.SlaveState[]} */ + /** + * @type {App.Entity.SlaveState[]} + */ const slaves = V.slaves; V.assignTo = passageName; // would be passed to the "Assign" passage @@ -4982,6 +5162,10 @@ App.UI.slaveSummaryList = function(passageName) { * Usage: << htag id tag >> ... << /htag>> * Usage: << htag attributes >> ... << /htag>> * Usage: << htag attributes tag >> ... << /htag>> + * @param {string} text + * @param {object} attributes + * @param {string} tag + * @returns {string} */ function htag(text, attributes, tag) { const payload = text.replace(/(^\n+|\n+$)/, ""); @@ -5163,7 +5347,7 @@ App.UI.slaveSummaryList = function(passageName) { const _slaveName = SlaveFullName(_Slave); - const _tableCount = 0; + // const _tableCount = 0; let slaveImagePrinted = (V.seeImages === 1) && (V.seeSummaryImages === 1); res.push(`<div id="slave_${ _Slave.ID }" style="clear:both">`); @@ -5200,17 +5384,17 @@ App.UI.slaveSummaryList = function(passageName) { case "Main": if ((_Slave.choosesOwnClothes === 1) && (_Slave.clothes === "choosing her own clothes")) { const _oldDevotion = _Slave.devotion; - const _chosenClothes = saChoosesOwnClothes(_Slave); + // const _chosenClothes = saChoosesOwnClothes(_Slave); slaves[_ssi].devotion = _oldDevotion; _Slave = slaves[_ssi]; /* restore devotion value so repeatedly changing clothes isn't an exploit */ } res.push(dividerAndImage(_Slave)); - if (App.Data.Facilities.headGirlSuite.manager.assignment === _Slave.assignment) res.push('<strong>@@.lightcoral;HG@@</strong> '); - else if (App.Data.Facilities.penthouse.manager.assignment === _Slave.assignment) res.push('<strong>@@.lightcoral;RC@@</strong> '); - else if (App.Data.Facilities.armory.manager.assignment === _Slave.assignment) res.push('<strong>@@.lightcoral;BG@@</strong> '); + if (App.Data.Facilities.headGirlSuite.manager.assignment === _Slave.assignment) res.push('<strong><span class="lightcoral">HG</span></strong> '); + else if (App.Data.Facilities.penthouse.manager.assignment === _Slave.assignment) res.push('<strong><span class="lightcoral">RC</span></strong> '); + else if (App.Data.Facilities.armory.manager.assignment === _Slave.assignment) res.push('<strong><span class="lightcoral">BG</span></strong> '); if (Array.isArray(V.personalAttention) && V.personalAttention.findIndex(s => s.ID === _Slave.ID) !== -1) { - res.push('<strong>@@.lightcoral; PA@@</strong> '); + res.push('<strong><span class="lightcoral"> PA</span></strong> '); } res.push(this.passageLink(_slaveName, 'Slave Interact', `$activeSlave = $slaves[${_ssi}]`)); /* lists their names */ break; @@ -5235,9 +5419,9 @@ App.UI.slaveSummaryList = function(passageName) { case "New Game Plus": res.push(dividerAndImage(_Slave)); if (V.SlaveSummaryFiler === "assignable") { - res.push(`__''@@.pink;${_Slave.slaveName}@@''__`); + res.push(`__''<span class="pink">${_Slave.slaveName}</span>''__`); } else { - res.push(`__''@@.pink;${_Slave.slaveName}@@''__`); + res.push(`__''<span class="pink">${_Slave.slaveName}</span>''__`); } break; case "Rules Slave Select": @@ -5264,8 +5448,7 @@ App.UI.slaveSummaryList = function(passageName) { res.push(dividerAndImage(_Slave)); res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); break; - default: - break; + } SlaveStatClamp(_Slave); @@ -5276,9 +5459,9 @@ App.UI.slaveSummaryList = function(passageName) { res.push(' will '); if ((_Slave.assignment === "rest") && (_Slave.health >= -20)) { - res.push("<strong><u><span class=lawngreen>rest</span></u></strong>"); + res.push(`<strong><u><span class="lawngreen">rest</span></u></strong>`); } else if ((_Slave.assignment === "stay confined") && ((_Slave.devotion > 20) || ((_Slave.trust < -20) && (_Slave.devotion >= -20)) || ((_Slave.trust < -50) && (_Slave.devotion >= -50)))) { - res.push("<strong><u><span class=lawngreen>stay confined.</span></u></strong>"); + res.push(`<strong><u><span class="lawngreen">stay confined.</span></u></strong>`); if (_Slave.sentence > 0) { res.push(` (${_Slave.sentence} weeks)`); } @@ -5335,7 +5518,7 @@ App.UI.slaveSummaryList = function(passageName) { } else if (slaveSelect !== undefined) { if (slaveSelect.facility.manager.slaveHasExperience(_Slave)) { res.push(`<br>${ V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1}` ? ' ' : ''); - res.push('@@.lime;Has applicable career experience.@@'); + res.push('<span class="lime">Has applicable career experience.</span>'); } } switch (passageName) { @@ -5344,7 +5527,7 @@ App.UI.slaveSummaryList = function(passageName) { case "Recruiter Select": if (setup.recruiterCareers.includes(_Slave.career) || (_Slave.skill.recruiter >= V.masteredXP)) { res.push(`<br>${ V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1}` ? ' ' : ''); - res.push('@@.lime;Has applicable career experience.@@'); + res.push('<span class="lime">Has applicable career experience.</span>'); } break; case "New Game Plus": @@ -5369,8 +5552,7 @@ App.UI.slaveSummaryList = function(passageName) { res.push(`<br>${ V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1}` ? ' ' : ''); res.push(`[[Make her the main course|Dinner Party Execution][$activeSlave = $slaves[${_ssi}]]]`); break; - default: - break; + } } return res.join(""); diff --git a/src/js/spanMacroJS.js b/src/js/spanMacroJS.js index 19eb0a5bef19ee032a69f1dae269961c8c182db6..43bf342a50f17dc2a59d0fe327c1c02de533a6c6 100644 --- a/src/js/spanMacroJS.js +++ b/src/js/spanMacroJS.js @@ -1,4 +1,3 @@ -/* eslint-disable no-undef */ /* * <<span>> macro * A minimal macro which allows to create <span> elements with dynamic IDs. @@ -6,15 +5,15 @@ * Usage: <<span $variable>>...<</span>> */ Macro.add('span', { - skipArgs : true, - tags : null, + skipArgs: true, + tags: null, handler() { const payload = this.payload[0].contents.replace(/(^\n+|\n+$)/, ''); let statement = this.args.raw.trim(); let result; - if(statement.length === 0) { + if (statement.length === 0) { return this.error('invalid syntax, format: <<span id>>'); } diff --git a/src/js/storyJS.js b/src/js/storyJS.js index 0bcdee8db806bfdfb8a74599ff41833724872771..9d0e5a88cdc3ba26238ffc83123083d006e92c4e 100644 --- a/src/js/storyJS.js +++ b/src/js/storyJS.js @@ -3,19 +3,23 @@ window.variableAsNumber = function(x, defaultValue, minValue, maxValue) { x = Number(x); - if (x !== x) {// NaN - return defaultValue || 0;// In case the default value was not supplied. + if (x !== x) { // NaN + return defaultValue || 0; // In case the default value was not supplied. } - if (x < minValue) {// Works even if minValue is undefined. + if (x < minValue) { // Works even if minValue is undefined. return minValue; } - if (x > maxValue) {// Works even if maxValue is undefined. + if (x > maxValue) { // Works even if maxValue is undefined. return maxValue; } return x; }; -window.isSexuallyPure = /** @param {App.Entity.SlaveState} slave */ function (slave) { +/** + * @param {App.Entity.SlaveState} slave + * @return {boolean} + */ +window.isSexuallyPure = function(slave) { if (!slave) { return null; } @@ -60,6 +64,7 @@ window.filterInPlace = function(arr, callback, thisArg) { /** pregmod: are slave2's sperm compatible with slave1's eggs? * @param {App.Entity.SlaveState} slave1 * @param {App.Entity.SlaveState} slave2 + * @returns {boolean} */ window.canBreed = function(slave1, slave2) { if (!slave1 || !slave2) { @@ -73,6 +78,7 @@ window.canBreed = function(slave1, slave2) { * both slaves must not be in chastity; slave2 need not achieve erection * @param {App.Entity.SlaveState} slave1 * @param {App.Entity.SlaveState} slave2 + * @returns {boolean} */ window.canImpreg = function(slave1, slave2) { if (!slave1 || !slave2) { @@ -82,7 +88,8 @@ window.canImpreg = function(slave1, slave2) { } else if (slave2.ID === -1) { if (slave1.eggType !== "human") { return false; - } else if (!canGetPregnant(slave1)) { /* includes chastity checks */ + } else if (!canGetPregnant(slave1)) { + /* includes chastity checks */ return false; } else { return true; @@ -91,7 +98,8 @@ window.canImpreg = function(slave1, slave2) { return false; } else if (slave2.chastityPenis === 1) { return false; - } else if (slave2.pubertyXY === 0) { /* pregmod start */ + } else if (slave2.pubertyXY === 0) { + /* pregmod start */ return false; } else if (slave2.vasectomy === 1) { return false; @@ -105,7 +113,8 @@ window.canImpreg = function(slave1, slave2) { } } else if (!canBreed(slave1, slave2)) { return false; /* pregmod end */ - } else if (!canGetPregnant(slave1)) { /* includes chastity checks */ + } else if (!canGetPregnant(slave1)) { + /* includes chastity checks */ return false; } else { return true; @@ -115,9 +124,11 @@ window.canImpreg = function(slave1, slave2) { window.isPlayerFertile = function(PC) { if (!PC) { return null; - } else if (PC.preg !== 0) { /* currently pregnant, sterile, menopausal or on contraceptives */ + } else if (PC.preg !== 0) { + /* currently pregnant, sterile, menopausal or on contraceptives */ return false; - } else if (PC.pregWeek < 0) { /* postpartum */ + } else if (PC.pregWeek < 0) { + /* postpartum */ return false; } else if (PC.vagina === 1) { return true; @@ -126,7 +137,11 @@ window.isPlayerFertile = function(PC) { } }; -window.relationTargetWord = /** @param {App.Entity.SlaveState} slave */ function (slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {null | string} + */ +window.relationTargetWord = function(slave) { if (!slave) { return null; } else if (slave.relation === "daughter") { @@ -137,7 +152,11 @@ window.relationTargetWord = /** @param {App.Entity.SlaveState} slave */ function return slave.relation; }; -window.milkAmount = /** @param {App.Entity.SlaveState} slave */ function (slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {number} + */ +window.milkAmount = function(slave) { let milk; let calcs; if (!slave) { @@ -183,7 +202,11 @@ window.milkAmount = /** @param {App.Entity.SlaveState} slave */ function (slave) return milk; }; -window.cumAmount = /** @param {App.Entity.SlaveState} slave */ function (slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {number} + */ +window.cumAmount = function(slave) { let cum = 0; let calcs = 0; if (!slave) { @@ -229,7 +252,7 @@ window.cumAmount = /** @param {App.Entity.SlaveState} slave */ function (slave) return cum; }; -window.lispReplace = function (text) { +window.lispReplace = function(text) { text = text.replace(/Sh/g, "Th"); text = text.replace(/SS/g, "Th"); text = text.replace(/Ss/g, "Th"); @@ -312,28 +335,44 @@ window.lispReplace = function (text) { return text; }; -window.repGainSacrifice = /** @param {App.Entity.SlaveState} slave */ function (slave, arcology) { +/** + * @param {App.Entity.SlaveState} slave + * @param {object} arcology // I think + * @returns {number} + */ +window.repGainSacrifice = function(slave, arcology) { slave = slave || State.variables.activeSlave; arcology = arcology || State.variables.arcologies[0]; if (!slave || !arcology || arcology.FSAztecRevivalist === "unset" || arcology.FSAztecRevivalist <= 0) { return 0; } return Math.ceil( - (Math.min(100, Math.pow(1.0926, State.variables.week - slave.weekAcquired)) + slave.prestige * 30) - * arcology.FSAztecRevivalist / 100 / ((State.variables.slavesSacrificedThisWeek || 0) + 1)); + (Math.min(100, Math.pow(1.0926, State.variables.week - slave.weekAcquired)) + slave.prestige * 30) * arcology.FSAztecRevivalist / 100 / ((State.variables.slavesSacrificedThisWeek || 0) + 1)); }; -window.bodyguardSuccessorEligible = /** @param {App.Entity.SlaveState} slave */ function (slave) { - if (!slave) { return false; } +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.bodyguardSuccessorEligible = function(slave) { + if (!slave) { + return false; + } return (slave.devotion > 50 && slave.muscles >= 0 && slave.weight < 100 && slave.boobs < 8000 && slave.butt < 10 && slave.belly < 5000 && slave.balls < 10 && slave.dick < 10 && slave.preg < 20 && slave.fuckdoll === 0 && slave.fetish !== "mindbroken" && canWalk(slave)); }; window.ngUpdateGenePool = function(genePool) { const transferredSlaveIds = (State.variables.slaves || []) - .filter(function(s) { return s.ID >= 1200000; }) - .map(function(s) { return s.ID - 1200000; }); + .filter(function(s) { + return s.ID >= 1200000; + }) + .map(function(s) { + return s.ID - 1200000; + }); return (genePool || []) - .filter(function(s) { return transferredSlaveIds.indexOf(s.ID) >= 0; }) + .filter(function(s) { + return transferredSlaveIds.indexOf(s.ID) >= 0; + }) .map(function(s) { const result = jQuery.extend(true, {}, s); result.ID += 1200000; @@ -345,11 +384,11 @@ window.ngUpdateMissingTable = function(missingTable) { const newTable = {}; (State.variables.slaves || []) - .forEach(s => ([s.pregSource+1200000, s.mother+1200000, s.father+1200000] + .forEach(s => ([s.pregSource + 1200000, s.mother + 1200000, s.father + 1200000] .filter(i => (i in missingTable)) .forEach(i => { - newTable[i-1200000] = missingTable[i]; - newTable[i-1200000].ID -= 1200000; + newTable[i - 1200000] = missingTable[i]; + newTable[i - 1200000].ID -= 1200000; }))); return newTable; @@ -362,28 +401,32 @@ window.toJson = function(obj) { return jsontext; }; -window.nippleColor = /** @param {App.Entity.SlaveState} slave */ function (slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {string} + */ +window.nippleColor = function(slave) { slave = slave || State.variables.activeSlave; if (skinToneLevel(slave.skin) < 8) { - if (slave.preg > slave.pregData.normalBirth/4 || (slave.counter.birthsTotal > 0 && slave.lactation > 0)) { + if (slave.preg > slave.pregData.normalBirth / 4 || (slave.counter.birthsTotal > 0 && slave.lactation > 0)) { return "brown"; } else { return "pink"; } } else if (skinToneLevel(slave.skin) < 14) { - if (slave.preg > slave.pregData.normalBirth/4 || (slave.counter.birthsTotal > 0 && slave.lactation > 0)) { + if (slave.preg > slave.pregData.normalBirth / 4 || (slave.counter.birthsTotal > 0 && slave.lactation > 0)) { return "dark brown"; } else { return "pink"; } } else if (skinToneLevel(slave.skin) > 20) { - if (slave.preg > slave.pregData.normalBirth/4 || (slave.counter.birthsTotal > 0 && slave.lactation > 0)) { + if (slave.preg > slave.pregData.normalBirth / 4 || (slave.counter.birthsTotal > 0 && slave.lactation > 0)) { return "black"; } else { return "dark brown"; } } else { - if (slave.preg > slave.pregData.normalBirth/4 || (slave.counter.birthsTotal > 0 && slave.lactation > 0)) { + if (slave.preg > slave.pregData.normalBirth / 4 || (slave.counter.birthsTotal > 0 && slave.lactation > 0)) { return "dark brown"; } else { return "brown"; @@ -391,7 +434,12 @@ window.nippleColor = /** @param {App.Entity.SlaveState} slave */ function (slave } }; -window.overpowerCheck = /** @param {App.Entity.SlaveState} slave */ function (slave, PC) { +/** + * @param {App.Entity.SlaveState} slave + * @param {object} PC + * @returns {number} + */ +window.overpowerCheck = function(slave, PC) { let strength; if (State.variables.arcologies[0].FSPhysicalIdealist !== "unset") { @@ -433,6 +481,7 @@ window.impregnatedBy = function(slave) { * returns true if mother was impregnated by father * @param {App.Entity.SlaveState} mother * @param {App.Entity.SlaveState} father + * @returns {boolean} */ window.isImpregnatedBy = function(mother, father) { return impregnatedBy(mother).includes(father.ID); @@ -443,10 +492,15 @@ window.jsAlert = function(obj) { }; window.jsConsoleInfo = function(obj) { + // eslint-disable-next-line no-console console.info(obj); }; -window.SoftenBehavioralFlaw = /** @param {App.Entity.SlaveState} slave */ function SoftenBehavioralFlaw(slave) { +/** + * @param {App.Entity.SlaveState} slave + * + */ +window.SoftenBehavioralFlaw = function SoftenBehavioralFlaw(slave) { switch (slave.behavioralFlaw) { case "arrogant": slave.behavioralQuirk = "confident"; @@ -475,13 +529,16 @@ window.SoftenBehavioralFlaw = /** @param {App.Entity.SlaveState} slave */ functi case "liberated": slave.behavioralQuirk = "advocate"; break; - default: - break; + } slave.behavioralFlaw = "none"; }; -window.SoftenSexualFlaw = /** @param {App.Entity.SlaveState} slave */ function SoftenSexualFlaw(slave) { +/** + * @param {App.Entity.SlaveState} slave + * + */ +window.SoftenSexualFlaw = function SoftenSexualFlaw(slave) { switch (slave.sexualFlaw) { case "hates oral": slave.sexualQuirk = "gagfuck queen"; @@ -510,8 +567,7 @@ window.SoftenSexualFlaw = /** @param {App.Entity.SlaveState} slave */ function S case "judgemental": slave.sexualQuirk = "size queen"; break; - default: - break; + } slave.sexualFlaw = "none"; }; @@ -610,10 +666,10 @@ window.printTrinkets = function printTrinkets() { case "a Daughters of Liberty brassard": case "a shot-torn flag of the failed nation whose militants attacked the Free City": return desc; - // manual replacement + // manual replacement case "a thank-you note from a MILF tourist whom you made feel welcome in the arcology": return "several thank-you notes from MILF tourists whom you made feel welcome in the arcology"; - // replacement by groups + // replacement by groups default: r = desc; if (desc.endsWith("citizen")) { // will not reduce spam from different future societies diff --git a/src/js/summaryWidgets.js b/src/js/summaryWidgets.js index 0f67a230aad70e21456b6b89a8b416e3db3e2380..c0dc4cf8e091aaeee22ffdeee7c00d9cbec7c34e 100644 --- a/src/js/summaryWidgets.js +++ b/src/js/summaryWidgets.js @@ -1,11 +1,8 @@ -/* eslint-disable no-undef */ -/* eslint-disable no-unused-vars */ /** * @param {App.Entity.SlaveState} slave */ window.SlaveStatClamp = function SlaveStatClamp(slave) { slave.energy = Math.clamp(slave.energy, 0, 100); - const V = State.variables; if (slave.devotion > 100) { if (slave.trust < -95) { diff --git a/src/js/temp.js b/src/js/temp.js new file mode 100644 index 0000000000000000000000000000000000000000..b45ceed56fd7336a7e74e3153d7e44d32c05935d --- /dev/null +++ b/src/js/temp.js @@ -0,0 +1,3099 @@ +/* eslint-disable no-unused-vars */ +/* temporary container until the entire thing is complete. No point in not deploying the working functions, you know? */ + +window.primeSlave = function(activeSlave, seed) { + + /* will be moved up once this becomes a single, contained function. */ + const V = State.variables; + const pronouns = getPronouns(activeSlave); + const he = pronouns.pronoun, + him = pronouns.object, + his = pronouns.possessive, + hers = pronouns.possessivePronoun, + himself = pronouns.objectReflexive, + boy = pronouns.noun; + const He = capFirstChar(he), + His = capFirstChar(his); + let _target = ""; + let t = ""; + let race = (V.seeRace ? activeSlave.race : ""); + + if (V.partner !== "relationship" || activeSlave.relationship === 1 || activeSlave.relationship === 2 || activeSlave.releaseRules === "restrictive") { + t += `${activeSlave.slaveName} `; + t += walkPasts(activeSlave, seed); + /* WALKPASTS END */ + } + /* TIME TOGETHER EXCEPTION ENDS */ + + return t; +}; + +window.rivalSlave = function(activeSlave, seed) { + const V = State.variables; + const pronouns = getPronouns(activeSlave); + const he = pronouns.pronoun, + him = pronouns.object, + his = pronouns.possessive, + hers = pronouns.possessivePronoun, + himself = pronouns.objectReflexive, + boy = pronouns.noun; + const He = capFirstChar(he), + His = capFirstChar(his); + let _partnerSlave = getSlave(activeSlave.rivalryTarget); + let t = ""; + let _target = ""; + + if (_partnerSlave !== undefined) { + /* potential problem point */ + // let race2 = (V.seeRace ? _partnerSlave.race : ""); + + t += " Meanwhile, "; + if (activeSlave.rivalry >= 3) { + t += `${_partnerSlave.slaveName}, whom ${he} hates, `; + } else if (activeSlave.rivalry >= 2) { + t += `${his} rival ${_partnerSlave.slaveName} `; + } else { + t += `${_partnerSlave.slaveName}, whom ${he} dislikes, `; + } + t += walkPasts(_partnerSlave, 100 - seed); + + _partnerSlave = null; + V.target = "FRival"; /* potentially removed later */ + } + + return t; +}; + +window.loverSlave = function(activeSlave) { + + /* will be moved up once this becomes a single, contained function. */ + let _target = ""; + let t = ""; + let V = State.variables; + let race; + if (V.seeRace === 1) { + race = activeSlave.race; + } else { + race = ""; + } + let name = activeSlave.slaveName; + const pronouns = getPronouns(activeSlave); + const he = pronouns.pronoun, + him = pronouns.object, + his = pronouns.possessive, + hers = pronouns.possessivePronoun, + himself = pronouns.objectReflexive, + boy = pronouns.noun; + const He = capFirstChar(he), + His = capFirstChar(his); + + let _partnerSlave = getSlave(activeSlave.relationshipTarget); + let _fuckSeed = jsRandom(1, 100); + let _seed = jsRandom(1, 100); + let _fuckSpot; + + if (_partnerSlave !== undefined) { + + let pronouns2 = getPronouns(_partnerSlave); + let he2 = pronouns2.pronoun, + him2 = pronouns2.object, + his2 = pronouns2.possessive, + hers2 = pronouns2.possessivePronoun, + himself2 = pronouns2.objectReflexive, + boy2 = pronouns2.noun; + let He2 = capFirstChar(he2), + His2 = capFirstChar(his2); + let race2; + if (V.seeRace === 1) { + race2 = _partnerSlave.race; + } else { + race2 = ""; + } + let partnerName = _partnerSlave.slaveName; + let activeSlaveRel; + if (activeSlave.relationship <= 3) { + activeSlaveRel = "friend with benefits"; + } else if (activeSlave.relationship <= 4) { + activeSlaveRel = "lover"; + } else { + activeSlaveRel = "slave wife"; + } + + t += `${name} and ${partnerName} are `; + if (!isSlaveAvailable(_partnerSlave)) { + if (_partnerSlave.assignment === "work in the dairy" && V.DairyRestraintsSetting >= 2) { + t += `trying their best to maintain their relationship with ${partnerName} being part of ${V.dairyName}.`; + } else if (_partnerSlave.assignment === "be your agent") { + t += `catching up with each other over a video call. Running an arcology in your stead comes with its perks.`; + } else if (_partnerSlave.assignment === "be confined in the arcade") { + t += `trying their best to maintain their relationship with ${partnerName} being nothing more than a hole in ${V.arcadeName}.`; + } + } else if (_seed >= 66) { + /* SEXY TIMES */ + + if (_partnerSlave.ID === V.HeadGirl.ID && V.HGSuite === 1) { + _fuckSpot = `in ${partnerName}'s suite`; + } else if (activeSlave.livingRules === "luxurious") { + _fuckSpot = `in the nice little room they share`; + } else { + _fuckSpot = `out in the open in the slave dormitory`; + } + + if ((activeSlave.fetish === "dom" || activeSlave.fetish === "sadist") && canPenetrate(activeSlave) && (_partnerSlave.fetish === "dom" || _partnerSlave.fetish === "sadist") && canPenetrate(_partnerSlave)) { + t += `double penetrating another slave. They're face to face over their sub's shoulders, `; + if (canSee(activeSlave) && canSee(_partnerSlave)) { + t += `looking into each other's eyes `; + } else { + t += `locking lips `; + } + t += `with every appearance of enjoyment and love, since for them rubbing dicks inside another slave's pussy is what constitutes healthy sexual activity. ${partnerName} is on the bottom, and holds their victim atop ${him2} with ${partnerName}'s cock already hilted in her cunt so ${name} can force ${himself} inside as well. They enjoy the overstimulated girl's struggles.`; + } else if (activeSlave.energy > 95) { + t += `having loud sex ${_fuckSpot}. ${name} is such a sexual addict that ${he} wants it all the time, and ${partnerName} does ${his2} best to help ${his} ${activeSlaveRel} get off. `; + if (canPenetrate(activeSlave) && _fuckSeed > 50) { + if (canDoVaginal(_partnerSlave)) { + if (_partnerSlave.vagina === 0 && _partnerSlave.amp !== 1) { + t += `${name} has ${his} cock between ${partnerName}'s legs and is enjoying an enthusiastic thigh job.`; + } else if (_partnerSlave.vagina === 0) { + t += `${name} has ${his} cock between ${partnerName}'s labia and is enthusiastically teasing ${his} virgin lover.`; + } else if (_fuckSeed > 90 && _partnerSlave.amp !== 1) { + t += `${name} has ${partnerName} on ${his2} knees and is enthusiastically fucking ${his2} pussy doggy style.`; + } else if (_fuckSeed > 80 && activeSlave.amp !== 1) { + t += `${name} has ${partnerName} pushed against the wall is is fucking ${his2} pussy from behind.`; + } else if (_fuckSeed > 70) { + t += `${partnerName} has ${name} on ${his2} back and is enthusiastically bouncing on ${his2} dick.`; + } else if (_fuckSeed > 60) { + t += `${name} has ${partnerName} on ${his2} back and is enthusiastically fucking ${his2} pussy in the missionary position.`; + } else { + t += `${name} is enthusiastically fucking ${partnerName}'s pussy.`; + } + } else if (canDoAnal(_partnerSlave)) { + if (_partnerSlave.anus === 0) { + t += `${name} has ${his} cock sandwiched between ${partnerName}'s buttcheeks and is enthusiastically hotdogging ${his2} rear.`; + } else if (_fuckSeed > 90 && _partnerSlave.amp !== 1) { + t += `${name} has ${partnerName} on ${his2} knees and is enthusiastically fucking ${his2} ass doggy style.`; + } else if (_fuckSeed > 80 && activeSlave.amp !== 1) { + t += `${name} has ${partnerName} pushed against the wall is is fucking ${his2} ass from behind.`; + } else if (_fuckSeed > 70) { + t += `${partnerName} has ${name} on ${his} back and is enthusiastically bouncing on ${his} dick.`; + } else if (_fuckSeed > 60) { + t += `${name} has ${partnerName} on ${his2} stomach and is enthusiastically fucking ${his2} ass.`; + } else { + t += `${name} is enthusiastically fucking ${partnerName}'s ass.`; + } + } else if (_partnerSlave.boobs > 800) { + t += `${name} has ${partnerName} on ${his2} back and is enthusiastically fucking ${his2} tits.`; + } else { + t += `${name} has ${partnerName}'s face to ${his} crotch and is enthusiastically pounding ${his2} throat.`; + } + } else if (activeSlave.dick > 0 && _fuckSeed > 50) { + t += `${partnerName} has ${his2} lips wrapped around ${name}'s dick and is enthusiastically giving ${him} a blowjob.`; + } else if (canDoVaginal(activeSlave) && _fuckSeed > 30) { + if (canPenetrate(_partnerSlave) && activeSlave.vagina > 0) { + t += `${partnerName} is enthusiastically fucking ${name}'s pussy.`; + } else if (canDoVaginal(_partnerSlave)) { + t += `They're scissoring enthusiastically and playing with each other's breasts.`; + } else { + t += `${partnerName} is enthusiastically eating out ${name}'s pussy.`; + } + } else if (canDoAnal(activeSlave) && activeSlave.anus > 0 && _fuckSeed > 10) { + if (canPenetrate(_partnerSlave)) { + t += `${partnerName} is enthusiastically fucking ${name}'s ass.`; + } else if (_partnerSlave.amp !== 1) { + t += `${partnerName} is enthusiastically fisting ${name}'s ass.`; + } else { + t += `${partnerName} is enthusiastically pounding ${name}'s ass with a dildo.`; + } + } else { + t += `${partnerName} is enthusiastically using ${his2} tongue to bring ${name} to orgasm.`; + } + } else if (activeSlave.fetishStrength > 60 && activeSlave.fetishKnown === 1 && activeSlave.fetish !== "none") { + switch (activeSlave.fetish) { + case "boobs": + if (_fuckSeed > 60 && (activeSlave.lactation > 0 || _partnerSlave.lactation > 0)) { + t += `snuggling rather sexually ${_fuckSpot}. `; + if (_fuckSeed > 80 && _partnerSlave.lactation > 0) { + t += `${name} loves how milky ${partnerName}'s tits are and has ${his} lips wrapped around a nipple. `; + if (_partnerSlave.amp !== 1) { + t += `${partnerName} is left to moan lustfully and tweak ${his2} free nipple until ${his2} ${activeSlaveRel} has drank ${his} fill.`; + } else { + t += `${partnerName} is left to moan lustfully and squirm with desire until ${his2} ${activeSlaveRel} has drank ${his} fill and moves to ${his2} other nipple.`; + } + } else { + t += `${name} loves having ${his} breasts suckled and has ${partnerName}'s lips wrapped around a nipple. `; + if (activeSlave.amp !== 1) { + t += `${partnerName} is held close until ${his2} ${activeSlaveRel} has been completely emptied.`; + } else { + t += `${partnerName} knows that ${his2} ${activeSlaveRel} can't milk ${himself} and appreciates the act.`; + } + } + } else if (_fuckSeed > 30 && ((canPenetrate(activeSlave) && _partnerSlave.nipples === "fuckable") || (canPenetrate(_partnerSlave) && activeSlave.nipples === "fuckable"))) { + t += `having loud sex ${_fuckSpot}. ${name} loves `; + if (_fuckSeed > 45 && (canPenetrate(activeSlave) && _partnerSlave.nipples === "fuckable")) { + t += `taking advantage of ${partnerName}'s fuckable tits. The motion running through ${partnerName}'s breasts as ${he} humps is hypnotic.`; + } else { + t += `how well ${partnerName}'s cock feels in ${his} fuckable tits. The motion running through ${name}'s breasts as ${his} ${activeSlaveRel} fucks ${him} is hypnotic.`; + } + } else { + t += `snuggling rather sexually ${_fuckSpot}. ${name} loves having `; + if (activeSlave.boobs >= _partnerSlave.boobs) { + t += `${his} breasts touched and massaged, so ${partnerName} looks after ${his2} ${activeSlaveRel}'s tits. `; + if (_partnerSlave.amp === 1) { + t += `Since ${partnerName} is an amputee, ${name} has ${him2} propped on ${his} belly so ${he} can easily suckle and nuzzle.`; + } else { + t += `They're spooning in bed with ${partnerName} forming the large spoon so ${he2} can reach around and play with ${name}'s boobs.`; + } + } else { + t += `a nice pair of breasts to enjoy, so ${he} focuses ${his} attention on ${partnerName}'s larger bosom. `; + if (activeSlave.amp === 1) { + t += `Since ${name} is an amputee, ${partnerName} has ${him} propped on ${his2} belly so ${he} can make ${himself} comfortable in ${his2} bust.`; + } else if (_partnerSlave.amp !== 1) { + t += `They're spooning in bed with ${partnerName} forming the large spoon so ${he2} can reach around and play with ${name}'s boobs.`; + } else { + t += `Since they are both limbless, they've helped each other into a position where each can easily suckle and nuzzle the other's boobs.`; + } + } + } + break; + case "buttslut": + t += `having loud buttsex ${_fuckSpot}. ${name} is such an anal addict that ${he} wants it all the time, and ${partnerName} does ${his2} best to keep ${his2} ${activeSlaveRel} satisfied. `; + if (activeSlave.anus > 0 && canDoAnal(activeSlave)) { + t += `${name} is `; + if (activeSlave.amp !== 1) { + t += `down on ${his} knees in front of ${partnerName}, taking `; + } else { + t += `ass up in front of ${partnerName}, taking `; + } + if (canPenetrate(_partnerSlave)) { + t += `${his2} cock up the butt. `; + if (activeSlave.anus > 1) { + if (_partnerSlave.dick > 4) { + t += `${name} is clearly enjoying getting buttfucked by a cock big enough to make ${him} feel tight again.`; + } else if (_partnerSlave.dick > 2) { + t += `${name}'s loose ass takes ${partnerName}'s cock easily.`; + } else { + t += `${name} can barely tell ${partnerName}'s little dick is even there, but it's the thought that counts.`; + } + } else { + if (_partnerSlave.dick > 4) { + t += `${name} is panting and writhing with the pain of taking ${his} ${activeSlaveRel}'s massive dick. ${partnerName} is doing ${his2} best to be gentle.`; + } else if (_partnerSlave.dick > 2) { + t += `${name} is writhing with the mixed pain and pleasure of having ${his} tight ass stretched by ${his} ${activeSlaveRel}'s nice cock.`; + } else { + t += `${name}'s tight anus and ${partnerName}'s little dick work well together; ${name} can take it easily, and ${partnerName} gets to fuck a hole that's tight, even for ${him2}.`; + } + } + } else if (_partnerSlave.dick > 1) { + if (_partnerSlave.amp === 1) { + t += `a rimjob, since ${his} ${activeSlaveRel} is armless and `; + } else { + t += `a finger fuck, since ${his} ${activeSlaveRel} is `; + } + if (_partnerSlave.dick > 6) { + t += `too big to fit.`; + } else { + t += `impotent.`; + } + if (_partnerSlave.amp !== 1) { + if (activeSlave.anus > 2) { + t += ` Or rather, a fist fuck, since that's what it takes to satisfy ${his2} ${activeSlaveRel}'s gaping hole.`; + } else if (activeSlave.anus > 1) { + t += ` ${partnerName} is using three fingers to stretch ${his2} ${activeSlaveRel}'s asshole.`; + } else { + t += ` ${partnerName} is using two fingers to gently fuck ${his2} ${activeSlaveRel}'s tight anus.`; + } + } + } else if (_partnerSlave.clit > 3) { + t += `${his2} clit up the butt. `; + if (activeSlave.anus > 1) { + t += `${name} can barely tell ${partnerName}'s unorthodox phallus is in there, but it's the thought that counts.`; + } else { + t += `${name}'s tight anus and ${partnerName}'s clitdick work well together; ${name} can take it easily, and ${partnerName} gets to fuck a hole that hugs ${his2} sensitive rod tight.`; + } + } else { + t += `a strap-on up the butt, doggy style. ${partnerName} is using a `; + if (activeSlave.anus > 2) { + t += `massive fake phallus to satisfy ${his} ${activeSlaveRel}'s gaping hole.`; + } else if (activeSlave.anus > 1) { + t += `decent-sized fake phallus to stretch ${his} ${activeSlaveRel}'s asshole.`; + } else { + t += `small fake phallus to gently fuck ${his} ${activeSlaveRel}'s tight anus.`; + } + } + } else if (canDoAnal(activeSlave)) { + t += `Since ${name} is an anal virgin, ${partnerName} is rimming ${his2} ${activeSlaveRel}, who is clearly enjoying ${himself}.`; + } else { + t += `Since ${name}'s butthole is off-limits, ${partnerName} is simply toying with the overstimulated ${boy}'s rear.`; + } + break; + case "cumslut": + t += `sharing oral pleasure ${_fuckSpot}. ${name} is such an oral addict that ${he} wants it all the time, and ${partnerName} certainly doesn't mind all the loving oral attention. `; + if (((activeSlave.chastityPenis !== 1 && activeSlave.dick > 0) || canDoVaginal(activeSlave)) && ((_partnerSlave.chastityPenis !== 1 && _partnerSlave.dick > 0) || canDoVaginal(_partnerSlave))) { + t += `They're lying down to 69 comfortably, `; + if (_partnerSlave.chastityPenis !== 1 && _partnerSlave.dick > 0) { + if (canPenetrate(_partnerSlave)) { + t += `with ${name} hungrily sucking ${his} ${activeSlaveRel}'s turgid cock.`; + } else if (_partnerSlave.dick > 7 && activeSlave.amp !== 1) { + t += `with ${name} hungrily sucking ${his} ${activeSlaveRel}'s fat cock. ${He} is milking the oversized beast as best ${he} can in an effort to draw out a nice, big load of ${his2} cum.`; + } else if (_partnerSlave.anus > 0 && canDoAnal(_partnerSlave) && _partnerSlave.prostate > 0 && activeSlave.amp !== 1) { + t += `with ${name} hungrily sucking ${his} ${activeSlaveRel}'s limp cock. ${He} has a finger up poor impotent ${partnerName}'s butt to stimulate ${his2} prostate so ${he2} can cum for ${him}.`; + } else if (_partnerSlave.scrotum > 0 && activeSlave.amp !== 1) { + t += `with ${name} hungrily sucking ${his} ${activeSlaveRel}'s limp cock. ${He} is massaging ${his2} balls so ${he2} can cum for ${him}.`; + } else if (activeSlave.amp !== 1) { + t += `with ${name} hungrily sucking ${his} ${activeSlaveRel}'s limp cock. ${He} has a finger massaging poor impotent ${partnerName}'s perineum in the hope of stimulating ${him2} so ${he2} can cum for ${him}.`; + } else { + t += `with ${name} hungrily sucking ${his} ${activeSlaveRel}'s limp cock in the hopes ${he} can coax something out.`; + } + } else if (_partnerSlave.balls > 0) { + t += `with ${name} hungrily sucking the little hole on ${his} ${activeSlaveRel}'s crotch that ${he2} squirts cum from.`; + } else { + t += `and ${name} is sating ${his} oral fixation for the moment by eagerly polishing ${his} ${activeSlaveRel}'s pearl.`; + } + } else if ((_partnerSlave.chastityPenis !== 1 && _partnerSlave.dick > 0) || canDoVaginal(_partnerSlave)) { + t += `${name} has ${his} face to ${partnerName}'s crotch and is `; + if (_partnerSlave.chastityPenis !== 1 && _partnerSlave.dick > 0) { + if (canPenetrate(_partnerSlave)) { + t += `hungrily sucking ${his} ${activeSlaveRel}'s turgid cock.`; + } else if (_partnerSlave.dick > 7 && activeSlave.amp !== 1) { + t += `hungrily sucking ${his} ${activeSlaveRel}'s fat cock. ${He} is milking the oversized beast as best ${he} can in an effort to draw out a nice, big load of ${his2} cum.`; + } else if (_partnerSlave.anus > 0 && canDoAnal(_partnerSlave) && _partnerSlave.prostate > 0 && activeSlave.amp !== 1) { + t += `hungrily sucking ${his} ${activeSlaveRel}'s limp cock. ${He} has a finger up poor impotent ${partnerName}'s butt to stimulate ${his2} prostate so ${he2} can cum for ${him}.`; + } else if (_partnerSlave.scrotum > 0 && activeSlave.amp !== 1) { + t += `hungrily sucking ${his} ${activeSlaveRel}'s limp cock. ${He} is massaging ${his2} balls so ${he2} can cum for ${him}.`; + } else if (activeSlave.amp !== 1) { + t += `hungrily sucking ${his} ${activeSlaveRel}'s limp cock. ${He} has a finger massaging poor impotent ${partnerName}'s perineum in the hope of stimulating ${him2} so ${he2} can cum for ${him}.`; + } else { + t += `hungrily sucking ${his} ${activeSlaveRel}'s limp cock in the hopes ${he} can coax something out.`; + } + } else if (_partnerSlave.balls > 0) { + t += `hungrily sucking the little hole on ${his} ${activeSlaveRel}'s crotch that ${he2} squirts cum from.`; + } else { + t += `is sating ${his} oral fixation for the moment by eagerly polishing ${his} ${activeSlaveRel}'s pearl.`; + } + } else if (_partnerSlave.balls > 0) { + t += `${name} is eagerly lapping up ${his} ${activeSlaveRel}'s most recent load of cum.`; + } else if (activeSlave.balls > 0) { + t += `${name} is locking lips with ${his} ${activeSlaveRel} after ${he2} just finished licking up all ${his} cum to share it with ${him}.`; + } else { + t += `They have locked lips and are enthusiastically making out.`; + } + break; + case "submissive": + t += `wrestling ${_fuckSpot}. ${name} is such a submissive that ${he} wants to be forced to sexual gratify ${partnerName} all the time, so ${he2} does ${his2} best to give ${his2} ${activeSlaveRel} the constant domination ${he} loves. `; + if (canPenetrate(_partnerSlave) && _fuckSeed > 50) { + if (canDoVaginal(activeSlave)) { + if (activeSlave.vagina === 0) { + t += `${partnerName} is rubbing the length of ${his2} erection along ${name}'s virgin pussy and forcing ${him} to reveal just how bad ${he} wants it.`; + } else if (_fuckSeed > 90 && activeSlave.amp !== 1) { + t += `${partnerName} has ${name} on ${his} knees and is forcibly fucking ${his} pussy doggy style while raining loving insults down on ${his2} bitch of a ${activeSlaveRel}.`; + } else if (_fuckSeed > 80 && activeSlave.amp !== 1 && _partnerSlave.amp !== 1) { + t += `${partnerName} has ${name} pushed against the wall and is fucking ${his} pussy from behind while raining loving insults down on ${his2} bitch of a ${activeSlaveRel}.`; + } else if (_fuckSeed > 70) { + t += `${partnerName} is on ${his2} back and forcing ${name} to ride ${his2} dick while raining loving insults down on ${his2} bitch of a ${activeSlaveRel}.`; + } else if (_fuckSeed > 60 && activeSlave.belly < 500) { + t += `${partnerName} has ${name} on ${his} back and trapped in a mating press, right where a bitch of a ${activeSlaveRel} belongs.`; + } else { + t += `${partnerName} is forcing ${himself2} into ${name}'s pussy while raining loving insults down on ${his2} bitch of a ${activeSlaveRel}.`; + } + } else if (canDoAnal(activeSlave)) { + if (activeSlave.anus === 0) { + t += `${partnerName} is circling the tip of ${his2} erection around ${name}'s virgin butthole and forcing ${him} to reveal just how bad ${he} wants it.`; + } else if (_fuckSeed > 90 && activeSlave.amp !== 1) { + t += `${partnerName} has ${name} on ${his} knees and is forcibly fucking ${his} ass doggy style while raining loving insults down on ${his2} bitch of a ${activeSlaveRel}.`; + } else if (_fuckSeed > 80 && activeSlave.amp !== 1 && _partnerSlave.amp !== 1) { + t += `${partnerName} has ${name} pushed against the wall and is fucking ${his} ass from behind while raining loving insults down on ${his2} bitch of a ${activeSlaveRel}.`; + } else if (_fuckSeed > 70) { + t += `${partnerName} is on ${his2} back and forcing ${name} to ride ${his2} dick anally while raining loving insults down on ${his2} bitch of a ${activeSlaveRel}.`; + } else if (_fuckSeed > 60) { + t += `${partnerName} has ${name} pushed face first into the ground has ${him} trapped beneath ${his2} weight while ${he2} fucks ${his2} ass.`; + } else { + t += `${partnerName} is forcing ${himself2} into ${name}'s ass while raining loving insults down on ${his2} bitch of a ${activeSlaveRel}.`; + } + } else if (activeSlave.boobs > 800) { + t += `${partnerName} has ${name} on ${his} back and is forcibly fucking ${his} tits.`; + } else { + t += `${partnerName} has ${name}'s face to ${his2} crotch and is forcibly pounding ${his} throat.`; + } + } else if (_partnerSlave.dick > 0 && _fuckSeed > 50) { + t += `${name} has ${his} lips wrapped around ${partnerName}'s dick and is taking a deepthroating from ${him2}.`; + } else if (canDoVaginal(_partnerSlave) && _fuckSeed > 30) { + if (canPenetrate(activeSlave)) { + if (_partnerSlave.vagina === 0 && _partnerSlave.amp !== 1) { + t += `${partnerName} has a foot on ${name}'s turgid cock and is slowly and methodically keeping ${him} just short of release while ${he} begs for ${him2} to continue.`; + } else if (_partnerSlave.vagina === 0) { + t += `${partnerName} is rubbing ${his2} virgin pussy along the length of ${name}'s erection and is forcing ${him} to reveal just how badly ${he} wants to stick it in ${him2}. Of course, that's not going to happen and ${name} knows it.`; + } else if (_fuckSeed > 45 && activeSlave.amp !== 1) { + t += `${partnerName} is forcing ${name} to hold ${him2} aloft as ${he2} gets fucked by ${his2} bitch of a ${activeSlaveRel}.`; + } else if (_fuckSeed > 40 && activeSlave.amp !== 1 && _partnerSlave.amp !== 1) { + t += `${partnerName} has ${name} pinned against the wall and is taking ${his} dick in ${his2} pussy by force.`; + } else if (_fuckSeed > 35) { + t += `${partnerName} has ${name} on ${his} back and is riding ${his} dick while raining loving insults down on ${his2} bitch of a ${activeSlaveRel}.`; + } else { + t += `${partnerName} has ${name} on ${his} back and is forcibly taking ${his} dick in reverse missionary while raining loving insults down on ${his2} bitch of a ${activeSlaveRel}.`; + } + } else if (canDoVaginal(activeSlave)) { + t += `${partnerName} is scissoring ${name} while raining loving insults down on ${his2} bitch of a ${activeSlaveRel}.`; + } else { + t += `${partnerName} is eating out ${name}'s pussy while ${he2} rains loving insults down on ${his2} bitch of a ${activeSlaveRel}.`; + } + } else if (canDoAnal(_partnerSlave) && _fuckSeed > 10) { + if (canPenetrate(activeSlave)) { + if (_partnerSlave.anus === 0 && _partnerSlave.amp !== 1) { + t += `${partnerName} has a foot on ${name}'s turgid cock and is slowly and methodically keeping ${him} just short of release while ${he} begs for ${him2} to continue.`; + } else if (_partnerSlave.vagina === 0) { + t += `${partnerName} is rubbing ${his2} virgin butthole around the tip of ${name}'s erection and is forcing ${him} to reveal just how badly ${he} wants to stick it in ${him2}. Of course, that's not going to happen and ${name} knows it.`; + } else if (_fuckSeed > 20 && activeSlave.amp !== 1) { + t += `${partnerName} is forcing ${name} to hold ${him2} aloft as ${he2} gets anally fucked by ${his2} bitch of a ${activeSlaveRel}.`; + } else if (_fuckSeed > 10 && activeSlave.amp !== 1 && _partnerSlave.amp !== 1) { + t += `${partnerName} has ${name} pinned against the wall behind ${him2} and is anally taking ${his} dick by force.`; + } else { + t += `${partnerName} has ${name} on ${his} back and is anally riding ${his} dick while raining loving insults down on ${his2} bitch of a ${activeSlaveRel}.`; + } + } else if (_partnerSlave.amp !== 1) { + t += `${partnerName} is fisting ${name}'s ass while raining loving insults down on ${his2} bitch of a ${activeSlaveRel}.`; + } else { + t += `${partnerName} is pounding ${name}'s ass with a dildo while raining loving insults down on ${his2} bitch of a ${activeSlaveRel}.`; + } + } else { + t += `${partnerName} is forcing ${name} to use ${his} tongue to bring ${him2} to orgasm.`; + } + break; + case "dom": + t += `wrestling ${_fuckSpot}. ${name} is so dominant with other slaves that ${he} prefers to take what ${he} wants, and ${partnerName} does ${his2} best to give ${his2} ${activeSlaveRel} the fight ${he} loves. `; + if (canPenetrate(activeSlave) && _fuckSeed > 50) { + if (canDoVaginal(_partnerSlave)) { + if (_partnerSlave.vagina === 0) { + t += `${name} has ${partnerName} pinned to the ground with ${his} dick lined up with {his2} virgin pussy. ${partnerName} is struggling and pleading with ${him} not to take it like this.`; + } else if (_fuckSeed > 90 && activeSlave.amp !== 1) { + t += `${name} has ${partnerName} on ${his} knees and is forcibly fucking ${his2} pussy doggy style while {he2} struggles to get away.`; + } else if (_fuckSeed > 80 && activeSlave.amp !== 1 && _partnerSlave.amp !== 1) { + t += `${name} has ${partnerName} pushed against the wall is is fucking ${his} pussy from behind while {he2} struggles to get away.`; + } else if (_fuckSeed > 70 && activeSlave.amp !== 1) { + t += `${name} is on ${his} back and forcing ${partnerName} to ride ${his} dick while keeping a firm hold on ${his2} hips.`; + } else if (_fuckSeed > 60 && _partnerSlave.belly < 500) { + t += `${name} has ${partnerName} on ${his2} back and trapped in a mating press. ${partnerName} is struggling and begging ${him} not to get ${him2} pregnant.`; + } else { + t += `${name} is forcing ${himself} into ${partnerName}'s pussy while {he2} struggles to get away.`; + } + } else if (canDoAnal(_partnerSlave)) { + if (_partnerSlave.anus === 0) { + t += `${name} is circling the tip of ${his} erection around ${partnerName}'s virgin butthole. ${partnerName} is struggling and pleading with ${him} not to take it like this.`; + } else if (_fuckSeed > 90 && activeSlave.amp !== 1) { + t += `${name} has ${partnerName} on ${his2} knees and is forcibly fucking ${his2} ass doggy style while {he2} struggles to get away.`; + } else if (_fuckSeed > 80 && activeSlave.amp !== 1 && _partnerSlave.amp !== 1) { + t += `${name} has ${partnerName} pushed against the wall and is fucking ${his2} ass from behind while {he2} struggles to get away.`; + } else if (_fuckSeed > 70 && activeSlave.amp !== 1) { + t += `${name} is on ${his} back and forcing ${partnerName} to ride ${his} dick anally while keeping a firm hold on ${his2} hips.`; + } else if (_fuckSeed > 60) { + t += `${name} has ${partnerName} pushed face first into the ground has ${him2} trapped beneath ${his} weight while ${he} fucks ${his2} ass.`; + } else { + t += `${name} is forcing ${himself} into ${partnerName}'s ass while {he2} struggles to get away.`; + } + } else if (_partnerSlave.boobs > 800) { + t += `${name} has ${partnerName} on ${his2} back and is forcibly fucking ${his2} tits.`; + } else { + t += `${name} has ${partnerName}'s face to ${his} crotch and is forcibly pounding ${his2} throat.`; + } + } else if (activeSlave.dick > 0 && _fuckSeed > 50) { + t += `${name} is deepthroating ${partnerName} as ${he2} struggles to breath.`; + } else if (canDoVaginal(activeSlave) && _fuckSeed > 30) { + if (canPenetrate(_partnerSlave) && activeSlave.vagina !== 0) { + if (_fuckSeed > 45 && _partnerSlave.amp !== 1) { + t += `${name} is forcing ${partnerName} to hold ${him} aloft as ${he} enjoys a good vaginal pounding from an unwilling partner.`; + } else if (_fuckSeed > 40 && activeSlave.amp !== 1 && _partnerSlave.amp !== 1) { + t += `${name} has ${partnerName} pinned against the wall and is taking ${his2} dick in ${his} pussy by force.`; + } else if (_fuckSeed > 35) { + t += `${name} has ${partnerName} on ${his2} back and is riding ${his2} dick while ${he2} tries to buck ${him} off.`; + } else { + t += `${name} has ${partnerName} on ${his2} back and is forcibly taking ${his} dick in reverse missionary while ${he2} struggles to not cum in ${his2} rapist.`; + } + } else if (canDoVaginal(activeSlave) && activeSlave.vagina !== 0) { + t += `${name} is scissoring the struggling ${partnerName}.`; + } else { + t += `${name} is straddling ${partnerName}'s face and forcing ${him2} to eat ${him} out.`; + } + } else if (canDoAnal(activeSlave) && canPenetrate(_partnerSlave) && _fuckSeed > 10 && activeSlave.anus !== 0) { + if (_fuckSeed > 20 && activeSlave.amp !== 1) { + t += `${name} is forcing ${partnerName} to hold ${him} aloft as ${he} enjoys a good anal pounding from an unwilling partner.`; + } else if (_fuckSeed > 10 && activeSlave.amp !== 1 && _partnerSlave.amp !== 1) { + t += `${name} has ${partnerName} pinned against the wall and is taking ${his2} dick in ${his} ass by force.`; + } else { + t += `${name} has ${partnerName} on ${his2} back and is anally riding ${his2} dick while ${he2} tries to buck ${him} off.`; + } + } else { + t += `${name} is on top of ${partnerName} getting oral, though it's more of a rough facefuck as ${name} forces `; + if (canPenetrate(activeSlave)) { + t += `${his} cock `; + } else if (activeSlave.clit > 3) { + t += `${his} clit `; + } else { + t += `a strap-on `; + } + t += `down ${partnerName}'s throat.`; + } + break; + case "sadist": + t += `playing pain games ${_fuckSpot}. ${name} loves hurting other slaves, even ${his} friends, and ${partnerName} submits to ${his} agonizing ministrations as often as ${name} can cajole or force ${him2} into it. `; + if (activeSlave.amp !== 1) { + t += `${name} has ${partnerName} over ${his} knee and is methodically tanning ${his2}'s ${race2} ass.`; + } else { + t += `${name} has ${partnerName} on the ground and is methodically striking ${his2}'s ${race2} ass with a switch held by mouth. Even without limbs, ${name} finds a way.`; + } + break; + case "masochist": + t += `playing pain games ${_fuckSpot}. ${name} loves being hurt, so ${partnerName} frequently indulges ${him} with spanking, slapping, pinching, and more exotic forms of abuse. `; + if (activeSlave.amp !== 1) { + t += `${partnerName} has ${name} over ${his2} knee and is methodically tanning ${his} ${race} ass.`; + } else { + t += `${partnerName} has ${name} on the ground and is methodically striking ${his} ${race} ass with a switch held by mouth. Having a limbless ${activeSlaveRel} won't deter ${name} from getting worked over the way ${he} craves.`; + } + break; + case "humiliation": + t += `having open and visible sex `; + if (activeSlave.livingRules === "luxurious") { + t += `in the doorway of the nice little room they share.`; + } else if (activeSlave.ID === V.HeadGirl.ID && V.HGSuite === 1) { + t += `in ${name}'s suite.`; + } else { + t += `out in the hallway near the slave dormitory.`; + } + t += ` ${name} pretends to hate fucking where other slaves can see ${him}, but ${partnerName} knows ${his2} ${activeSlaveRel} gets off on the mild humiliation. ${partnerName} `; + if (((canDoVaginal(activeSlave) && activeSlave.vagina > 0) || (canDoAnal(activeSlave) && activeSlave.anus > 0)) && _fuckSeed > 50) { + t += `has ${his2} back propped up against a door frame and ${name} in ${his2} lap, so ${he} can blush at any passing slave as ${he} shyly rides ${partnerName}'s `; + if (_partnerSlave.dick > 0 && canPenetrate(_partnerSlave)) { + t += `cock `; + } else { + t += `strap-on `; + } + if (activeSlave.vagina > 0 && canDoVaginal(activeSlave) && (_fuckSeed > 60 || !canDoAnal(activeSlave) || activeSlave.anus === 0)) { + t += `in ${his} pussy.`; + } else { + t += `up ${his} ass.`; + } + } else if (activeSlave.dick === 1 && _partnerSlave.amp !== 1 && _fuckSeed > 40) { + t += `jacking off ${name}'s pathetically tiny cock out in the open so ${he} can blush and shiver as passing slaves see how embarrassingly small ${he} is.`; + } else if (activeSlave.dick === 1 && _partnerSlave.amp !== 1 && _fuckSeed > 20) { + t += `having ${name} give ${him2} oral out in the open so ${he} can blush and shiver as passing slaves see what a slut ${he} is.`; + } else { + t += `is giving ${name} oral out in the open so ${he} can blush and shiver as passing slaves see ${his} climax.`; + } + break; + case "pregnancy": + t += `having intimate sex ${_fuckSpot}. ${name}'s `; + if (activeSlave.belly >= 5000) { + t += `middle is heavily rounded, `; + } else if (activeSlave.belly >= 1500) { + t += `middle is quite swollen, `; + } else { + t += `urge to breed is raging, `; + } + t += ` and ${partnerName} does ${his2} best to keep ${his2} ${activeSlaveRel} satisfied. `; + if (canPenetrate(activeSlave) && _fuckSeed > 70) { + if (canDoVaginal(_partnerSlave) && _partnerSlave.vagina > 0 && _fuckSeed > 90) { + if (_partnerSlave.belly >= 5000) { + t += `${partnerName} is `; + if (_partnerSlave.bellyPreg >= 1500) { + t += `heavily pregnant `; + } else { + t += `hugely gravid `; + } + t += `${himself2} `; + if (activeSlave.belly >= 5000) { + if (activeSlave.amp !== 1 && _partnerSlave.amp !== 1) { + t += `so ${name} has ${him2} on all fours as ${he} fucks ${him2} from behind while resting ${his} belly on ${his} love's back.`; + } else { + t += `so ${he2} is intertwined as best ${he2} can with ${name} as their combined bellies push into each other.`; + } + } else { + t += `so ${he2} has ${name} on ${his} back so that ${he2} can ride ${him} while `; + if (activeSlave.amp !== 1) { + t += `letting ${him} fondle ${his2} bouncing belly.`; + } else { + t += `giving ${him} a face full of belly.`; + } + } + } else if (_partnerSlave.belly === 0) { + t += `${partnerName} is pinned on ${his2} back by ${name}`; + if (activeSlave.belly >= 5000) { + t += `'s belly as ${he} tries ${his} hardest to plant a child in ${him2}.`; + } else { + t += ` in a mating press as ${he} tries ${his} hardest to plant a child in ${him2}.`; + } + } else { + if (activeSlave.belly >= 5000) { + t += `${partnerName} has ${name} on ${his} back so that ${he2} can ride ${him} while lavishing attention on ${his} beloved stomach.`; + } else { + t += `${name} has ${partnerName} on ${his2} back so that ${he} can fuck ${him2} while lavishing attention on ${his2} bulging stomach.`; + } + } + } else if (canDoAnal(_partnerSlave) && _partnerSlave.anus > 0 && _fuckSeed > 80) { + if (_partnerSlave.belly >= 5000) { + t += `${partnerName} is `; + if (_partnerSlave.bellyPreg >= 1500) { + t += `heavily pregnant `; + } else { + t += `hugely gravid `; + } + t += `${himself2} `; + if (activeSlave.belly >= 5000) { + if (activeSlave.amp !== 1 && _partnerSlave.amp !== 1) { + t += `so ${name} has ${him2} on all fours as ${he} fucks ${his2} ass while resting ${his} belly on ${his2} back.`; + } else { + t += `so ${he2} is intertwined as best as ${he2} can for anal sex with ${name} as ${his} belly pushes into ${his2} back.`; + } + } else { + t += `so ${he2} has ${name} on ${his} back so that ${he2} can anally ride ${him} while `; + if (activeSlave.amp !== 1) { + t += `letting ${him} fondle ${his2} bouncing belly.`; + } else { + t += `giving ${him} a face full of belly.`; + } + } + } else if (_partnerSlave.belly === 0) { + if (activeSlave.belly >= 5000) { + t += `${partnerName} has ${name} on ${his} back so that ${he2} can anally ride ${him} while teasing ${his} belly with ${his2} rear.`; + } else { + t += `${partnerName} is pinned on ${his2} stomach by ${name} as ${he} tries ${his} hardest to impregnate an anus.`; + } + } else { + if (activeSlave.belly >= 5000) { + t += `${partnerName} has ${name} on ${his} back so that ${he2} can ride ${him} anally while teasing ${his} prized stomach.`; + } else { + t += `${name} has ${partnerName} on ${his2} back so that ${he} can fuck ${him2} anally while teasing ${his2} bulging stomach.`; + } + } + } else if (_partnerSlave.boobs >= 2000 && _partnerSlave.belly >= 10000 && _fuckSeed > 75) { + t += `${name} is savoring the sensation of ${his} cock between ${partnerName}'s breasts and belly.`; + } else { + if (activeSlave.belly >= 5000) { + t += `${name} is squirming under the sensations of ${partnerName}'s lips around ${his} dick and {his2} head against ${his} underbelly.`; + } else { + t += `${partnerName} is vigorously trying to calm ${name}'s libido by sucking load after load out of ${him}.`; + } + } + } else if (canDoVaginal(activeSlave) && _fuckSeed > 30) { + if (canPenetrate(_partnerSlave) && activeSlave.vagina > 0 && activeSlave.preg === 0 && activeSlave.ovaries === 1) { // impreg + if (_partnerSlave.belly >= 5000) { + t += `${partnerName} is `; + if (_partnerSlave.bellyPreg >= 1500) { + t += `heavily pregnant `; + } else { + t += `hugely gravid `; + } + t += `${himself2}, but ${name} can't complain about the swollen dome pushing against ${him} as ${he2} fervently tries to sate ${his} lust by putting a baby in ${him}.`; + } else { + t += `${partnerName} has ${name} pinned on ${his} back in a mating press as ${he2} fervently tries to sate ${his} lust by putting a baby in ${him}.`; + } + } else { + if (_fuckSeed > 50) { // vanilla + if (canPenetrate(_partnerSlave) && activeSlave.vagina !== 0) { + if (_partnerSlave.belly >= 5000) { + t += `${partnerName} is `; + if (_partnerSlave.bellyPreg >= 1500) { + t += `heavily pregnant `; + } else { + t += `hugely gravid `; + } + t += `${himself2} `; + if (activeSlave.belly >= 5000) { + t += `so ${he2} has ${name} on ${his} side so that ${he2} can fuck ${his} pussy as best ${he2} can with their mutual bellies in the way.`; + } else { + t += `so ${he2} has ${name} on ${his} back so that ${he2} can fuck ${his} pussy as best ${he2} can with ${his2} belly in the way.`; + } + } else if (activeSlave.belly >= 5000) { + t += `${name} is bouncing heavily on ${partnerName}'s erect dick as ${he2} struggles to support ${his} gravid figure.`; + } else { + t += `${partnerName} has ${name} pinned on ${his} back in a mating press as ${he2} dutifully blows another load deep in ${his} aching pussy.`; + } + } else if (_partnerSlave.dick > 0 && activeSlave.belly < 500) { + t += `${partnerName} is bringing ${his2} limp dick to orgasm and making sure each and every drop is ending up in ${name}'s pussy.`; + } else { + if (_partnerSlave.belly >= 5000) { + t += `${partnerName} is `; + if (_partnerSlave.bellyPreg >= 1500) { + t += `heavily pregnant `; + } else { + t += `hugely gravid `; + } + t += `${himself2} `; + if (activeSlave.belly >= 5000) { + t += `so ${he2} is stomach to stomach with ${name} and making out.`; + } else { + t += `so ${he2} is face to face with ${name} and making out.`; + } + } else if (activeSlave.belly >= 5000) { + t += `${partnerName} is teasing ${his2} lover's huge belly.`; + } else { + t += `${name} and ${partnerName} are both pretending to be hugely pregnant and cuddling each other.`; + } + } + } else if (canDoVaginal(_partnerSlave) && _fuckSeed > 40) { // scissor + if (_partnerSlave.belly >= 5000) { + t += `${partnerName} is `; + if (_partnerSlave.bellyPreg >= 1500) { + t += `heavily pregnant `; + } else { + t += `hugely gravid `; + } + t += `${himself2} `; + if (activeSlave.belly >= 5000) { + t += `so ${he2} and ${name} are trying their hardest to trib with their ever expanding bodies in the way.`; + } else { + t += `so ${name} is savoring the feeling of ${his2} navel tracing ${his} slit.`; + } + } else { + t += `${name} and ${partnerName} `; + if (activeSlave.vagina > 0 && _partnerSlave.vagina > 0) { + t += `are locked together and sharing a double-ended dildo.`; + } else { + t += `are enthusiastically tribbing.`; + } + } + } else { // oral + if (_partnerSlave.belly >= 5000) { + t += `${partnerName} is `; + if (_partnerSlave.bellyPreg >= 1500) { + t += `heavily pregnant `; + } else { + t += `hugely gravid `; + } + t += `${himself2} `; + if (activeSlave.belly >= 5000) { + if (activeSlave.dick > 0 && _fuckSeed > 25) { + t += `so ${he2} has to try ${his2} hardest to suck ${name}'s dick with ${his2} belly hindering ${his2} movements; something ${name} enjoys tremendously, second only to the feeling of ${his2} head brushing against ${his} underbelly.`; + } else { + t += `so ${he2} has to try ${his2} hardest to orally service ${name} with ${his2} belly in the way; something ${name} enjoys tremendously, second only to the feeling of ${his2} head brushing against ${his} underbelly.`; + } + } else { + if (activeSlave.dick > 0 && _fuckSeed > 25) { + t += `so ${he2} has to try ${his2} hardest to suck ${name}'s dick with ${his2} belly hindering ${his2} movements; something ${name} enjoys tremendously.`; + } else { + t += `so ${he2} has to try ${his2} hardest to orally service ${name} with ${his2} belly in the way; something ${name} enjoys tremendously.`; + } + } + } else if (activeSlave.belly >= 5000) { + if (activeSlave.dick > 0 && _fuckSeed > 25) { + t += `${partnerName} has ${name} pinned under ${his} own gravidity so ${he2} may leisurely suck ${his} dick while teasing ${him} by brushing against ${his} sensitive underbelly.`; + } else { + t += `${partnerName} has ${name} pinned under ${his} own gravidity so ${he2} may leisurely eat ${him} out while teasing ${him} by brushing against ${his} sensitive underbelly.`; + } + } else { + if (activeSlave.dick > 0 && _fuckSeed > 25) { + t += `${partnerName} is vigorously trying to calm ${name}'s libido by sucking load after load out of ${him}.`; + } else { + t += `${name} is squirming under the sensations of ${partnerName}'s tongue as ${he2} vigorously tries to calm ${his} libido.`; + } + } + } + } + } else if (canDoAnal(activeSlave) && canPenetrate(_partnerSlave) && _fuckSeed > 10) { + if (activeSlave.anus > 0 && activeSlave.preg === 0 && activeSlave.mpreg === 1) { // impreg + if (_partnerSlave.belly >= 5000) { + t += `${partnerName} is `; + if (_partnerSlave.bellyPreg >= 1500) { + t += `heavily pregnant `; + } else { + t += `hugely gravid `; + } + t += `${himself2}, but ${name} can't complain about the swollen dome pushing against ${his} back as ${he2} fervently tries to sate ${his} lust by putting a baby in ${him}.`; + } else { + t += `${partnerName} has ${name} pinned on ${his} stomach as ${he2} fervently tries to sate ${his} lust by putting a baby in ${him}.`; + } + } else if (activeSlave.anus === 0) { + if (_partnerSlave.belly >= 5000) { + t += `${partnerName} is `; + if (_partnerSlave.bellyPreg >= 1500) { + t += `heavily pregnant `; + } else { + t += `hugely gravid `; + } + t += `${himself2} `; + if (activeSlave.belly >= 5000) { + t += `so ${he2} is stomach to stomach with ${name} and making out.`; + } else { + t += `so ${he2} is face to face with ${name} and making out.`; + } + } else if (activeSlave.belly >= 5000) { + t += `${partnerName} is teasing ${his2} lover's huge belly.`; + } else { + t += `${name} and ${partnerName} are both pretending to be hugely pregnant and cuddling each other.`; + } + } else { + if (_partnerSlave.belly >= 5000) { + t += `${partnerName} is `; + if (_partnerSlave.bellyPreg >= 1500) { + t += `heavily pregnant `; + } else { + t += `hugely gravid `; + } + t += `${himself2} `; + if (activeSlave.belly >= 5000) { + t += `so ${he2} has ${name} on ${his} side so that ${he2} can fuck ${his} ass as best ${he2} can with their mutual bellies in the way.`; + } else { + t += `so ${he2} has ${name} on ${his} front so that ${he2} can fuck ${his} ass as best ${he2} can with ${his2} belly in the way.`; + } + } else if (activeSlave.belly >= 5000) { + t += `${name} is bouncing heavily on ${partnerName}'s erect dick as ${he2} struggles to anally satisfy ${his2} gravid partner.`; + } else { + t += `${partnerName} has ${name} pinned on ${his} front as ${he2} dutifully plows ${his} needy anus in an attempt to sate ${his} bottomless lust.`; + } + } + } else { // oral + if (_partnerSlave.belly >= 5000) { + t += `${partnerName} is `; + if (_partnerSlave.bellyPreg >= 1500) { + t += `heavily pregnant `; + } else { + t += `hugely gravid `; + } + t += `${himself2} `; + if (activeSlave.belly >= 5000) { + if (activeSlave.dick > 0 && _fuckSeed > 5) { + t += `so ${he2} has to try ${his2} hardest to suck ${name}'s dick with ${his2} belly hindering ${his2} movements; something ${name} enjoys tremendously, second only to the feeling of ${his2} head brushing against ${his} underbelly.`; + } else { + t += `so ${he2} has to try ${his2} hardest to orally service ${name} with ${his2} belly in the way; something ${name} enjoys tremendously, second only to the feeling of ${his2} head brushing against ${his} underbelly.`; + } + } else { + if (activeSlave.dick > 0 && _fuckSeed > 5) { + t += `so ${he2} has to try ${his2} hardest to suck ${name}'s dick with ${his2} belly hindering ${his2} movements; something ${name} enjoys tremendously.`; + } else { + t += `so ${he2} has to try ${his2} hardest to orally service ${name} with ${his2} belly in the way; something ${name} enjoys tremendously.`; + } + } + } else if (activeSlave.belly >= 5000) { + if (activeSlave.dick > 0 && _fuckSeed > 5) { + t += `${partnerName} has ${name} pinned under ${his} own gravidity so ${he2} may leisurely suck ${his} dick while teasing ${him} by brushing against ${his} sensitive underbelly.`; + } else { + t += `${partnerName} has ${name} pinned under ${his} own gravidity so ${he2} may leisurely eat ${him} out while teasing ${him} by brushing against ${his} sensitive underbelly.`; + } + } else { + if (activeSlave.dick > 0 && _fuckSeed > 5) { + t += `${partnerName} is vigorously trying to calm ${name}'s libido by sucking load after load out of ${him}.`; + } else { + t += `${name} is squirming under the sensations of ${partnerName}'s tongue as ${he2} vigorously tries to calm ${his} libido.`; + } + } + } + break; + default: + t += `having intimate sex ${_fuckSpot}.`; + break; + } + } else if (!activeSlave.need || activeSlave.energy < 20) { + t += `just spooning in bed. Since ${name} `; + if (activeSlave.energy < 20) { + t += `in sexually frigid, `; + } else { + t += `gets fucked at work, `; + } + t += `${partnerName} understands that what ${he} really wants from ${him2} is emotional intimacy. They're cuddling quietly, offering each other silent comfort and companionship.`; + } else if (canPenetrate(activeSlave) && (_partnerSlave.vagina > 0) && canDoVaginal(_partnerSlave) && _partnerSlave.amp !== 1 && (activeSlave.belly + _partnerSlave.belly < 10000)) { + if (_partnerSlave.ID === V.HeadGirl.ID && V.HGSuite === 1) { + t += `in bed `; + } else if (activeSlave.livingRules === "luxurious") { + t += `in bed `; + } else { + t += `on ${name}'s bedroll `; + } + t += `${_fuckSpot}, making love in the missionary position. ${partnerName} has ${his2} legs wrapped around ${name}'s waist and ${his2} arms hugging ${him} around the chest, and is `; + if (canSee(_partnerSlave)) { + t += `looking deep into ${his} eyes `; + } else { + t += `gazing longingly into ${his} face `; + } + t += `as ${he2} enjoys the wonderful feeling of ${his2} ${activeSlaveRel}'s cock in ${his2} womanhood.`; + } else if (activeSlave.clit > 2 && canDoVaginal(activeSlave) && _partnerSlave.vagina > 0 && canDoVaginal(_partnerSlave) && _partnerSlave.amp !== 1 && (activeSlave.belly + _partnerSlave.belly < 10000)) { + if (_partnerSlave.ID === V.HeadGirl.ID && V.HGSuite === 1) { + t += `in bed `; + } else if (activeSlave.livingRules === "luxurious") { + t += `in bed `; + } else { + t += `on ${name}'s bedroll `; + } + t += `${_fuckSpot}, making love in the missionary position. ${partnerName} has ${his2} legs wrapped around ${name}'s waist and ${his2} arms hugging ${him} around the chest, and is `; + if (canSee(_partnerSlave)) { + t += `looking deep into ${his} eyes `; + } else { + t += `gazing longingly into ${his} face `; + } + t += `as ${he2} enjoys the wonderful feeling of ${his2} ${activeSlaveRel}'s huge clit in ${his2} womanhood.`; + } else if (activeSlave.dick > 1 && canPenetrate(activeSlave) && canDoAnal(_partnerSlave) && _partnerSlave.anus > 0 && activeSlave.amp !== 1 && activeSlave.belly < 10000) { + if (_partnerSlave.ID === V.HeadGirl.ID && V.HGSuite === 1) { + t += `in bed `; + } else if (activeSlave.livingRules === "luxurious") { + t += `in bed `; + } else { + t += `on ${name}'s bedroll `; + } + t += `${_fuckSpot}, having gentle anal sex while spooning. ${name} is enjoying ${partnerName}'s ass, and is doing ${his} best to ensure ${his} ${activeSlaveRel} enjoys being buttfucked. ${He}'s nibbling ${his} ${activeSlaveRel}'s `; + if (_partnerSlave.earShape !== "none") { + t += `ears and `; + } + t += `neck, cupping a breast with one hand, and lightly stimulating ${him2} with the other.`; + } else if (activeSlave.clit > 2 && canDoAnal(_partnerSlave) && _partnerSlave.anus > 0 && _partnerSlave.amp !== 1 && activeSlave.amp !== 1) { + if (_partnerSlave.ID === V.HeadGirl.ID && V.HGSuite === 1) { + t += `in bed `; + } else if (activeSlave.livingRules === "luxurious") { + t += `in bed `; + } else { + t += `on ${name}'s bedroll `; + } + t += `${_fuckSpot}, managing to have clitoral-anal sex. ${partnerName} is face-down with ${his2} ass up, spreading ${his2} buttocks as wide as possible, giving ${his2} ${activeSlaveRel} the opportunity to squat over ${him2} and penetrate it with ${his} huge, erect clit. ${name} can't thrust much, but the shocking lewdness of the act is enough for both of them.`; + } else if (canPenetrate(activeSlave) && _partnerSlave.amp !== 1 && activeSlave.amp !== 1 && activeSlave.belly < 10000) { + if (_partnerSlave.ID === V.HeadGirl.ID && V.HGSuite === 1) { + t += `in bed `; + } else if (activeSlave.livingRules === "luxurious") { + t += `in bed `; + } else { + t += `on ${name}'s bedroll `; + } + t += `${_fuckSpot}, spooning while ${name} gently rubs ${his} cock between ${partnerName}'s thighs, pressed tightly together. Since ${partnerName} is a virgin, this is the closest they can come to penetrative intercourse, but ${name} is enjoying ${partnerName}'s body anyway, and is doing ${his} best to ensure ${his} ${activeSlaveRel} enjoys ${himself2}. ${He}'s nibbling ${his} ${activeSlaveRel}'s `; + if (_partnerSlave.earShape !== "none") { + t += `ears and `; + } + t += `neck, cupping a breast with one hand, and lightly stimulating ${him2} with the other.`; + } else if (activeSlave.clit > 2 && canDoVaginal(activeSlave) && _partnerSlave.amp !== 1 && activeSlave.amp !== 1) { + if (_partnerSlave.ID === V.HeadGirl.ID && V.HGSuite === 1) { + t += `in bed `; + } else if (activeSlave.livingRules === "luxurious") { + t += `in bed `; + } else { + t += `on ${name}'s bedroll `; + } + t += `${_fuckSpot}, with ${partnerName} down on ${his2} knees in front of ${name}. From behind ${partnerName} it looks like ${he2}'s giving ${his2} ${activeSlaveRel} a conventional, if enthusiastic, blowjob. Only on closer inspection does it become clear how unusual the oral is: ${name} has such a huge clit that ${his} ${activeSlaveRel} can suck ${him} off just like it were a penis.`; + } else if (_partnerSlave.vagina > 0 && canDoVaginal(_partnerSlave) && _partnerSlave.amp !== 1 && (activeSlave.belly + _partnerSlave.belly < 10000)) { + if (_partnerSlave.ID === V.HeadGirl.ID && V.HGSuite === 1) { + t += `in bed `; + } else if (activeSlave.livingRules === "luxurious") { + t += `in bed `; + } else { + t += `on ${name}'s bedroll `; + } + t += `${_fuckSpot}, making love in the missionary position. ${partnerName} has ${his2} legs wrapped around ${name}'s waist and ${his2} arms hugging ${him} around the chest, and is `; + if (canSee(_partnerSlave)) { + t += `looking deep into ${his} eyes `; + } else { + t += `gazing longingly into ${his} face `; + } + t += `as ${he2} enjoys the feeling of ${his2} ${activeSlaveRel} fucking ${him2} with a strap-on.`; + } else if (_partnerSlave.anus > 0 && canDoAnal(_partnerSlave) && activeSlave.amp !== 1 && activeSlave.belly < 10000) { + if (_partnerSlave.ID === V.HeadGirl.ID && V.HGSuite === 1) { + t += `in bed `; + } else if (activeSlave.livingRules === "luxurious") { + t += `in bed `; + } else { + t += `on ${name}'s bedroll `; + } + t += `${_fuckSpot}, having gentle anal sex while spooning. ${name} is enjoying penetrating ${partnerName}'s ass with a strap-on, and is doing ${his} best to ensure ${his} ${activeSlaveRel} enjoys being buttfucked. ${He}'s nibbling ${his} ${activeSlaveRel}'s `; + if (_partnerSlave.earShape !== "none") { + t += `ears and `; + } + t += `neck, cupping a breast with one hand, and lightly stimulating ${him} with the other.`; + } else if (_partnerSlave.amp !== 1 && activeSlave.amp !== 1) { + if (_partnerSlave.ID === V.HeadGirl.ID && V.HGSuite === 1) { + t += `in bed `; + } else if (activeSlave.livingRules === "luxurious") { + t += `in bed `; + } else { + t += `on ${name}'s bedroll `; + } + t += `${_fuckSpot}, enjoying some mutual masturbation.`; + } else if (_partnerSlave.amp === 1) { + t += `just cuddling `; + if (_partnerSlave.ID === V.HeadGirl.ID && V.HGSuite === 1) { + t += `in bed `; + } else if (activeSlave.livingRules === "luxurious") { + t += `in bed `; + } else { + t += `on ${name}'s bedroll `; + } + t += `${_fuckSpot}. ${name} is using ${partnerName}'s limbless torso as a pillow, which ${partnerName} seems to be enjoying, by ${his2} contented expression.`; + } else { + t += `just cuddling `; + if (_partnerSlave.ID === V.HeadGirl.ID && V.HGSuite === 1) { + t += `in bed `; + } else if (activeSlave.livingRules === "luxurious") { + t += `in bed `; + } else { + t += `on ${name}'s bedroll `; + } + t += `${_fuckSpot}. They're lying quietly, offering each other silent comfort and companionship.`; + } + } else if (_seed >= 33) { + /* CUDDLE TIME */ + if (activeSlave.energy > 95 && _fuckSeed > 70) { + t += `lying in bed together. ${partnerName} has somehow managed to exhaust ${his2} ${activeSlaveRel}, and the sexually sated nympho is curled up with ${his} head on ${partnerName}'s chest, snoring lightly. ${partnerName} is smiling fondly at ${him}.`; + } else if (activeSlave.fetish !== "none" && _fuckSeed > 50) { + switch (activeSlave.fetish) { + case "boobs": + t += `sleeping in bed together. ${name} is using ${partnerName}'s `; + if (_partnerSlave.boobs > 10000) { + t += `enormous breasts`; + } else if (_partnerSlave.boobs > 2000) { + t += `huge boobs`; + } else if (_partnerSlave.boobs > 300) { + t += `healthy tits`; + } else { + t += `flat chest`; + } + if (activeSlave.fetishKnown) { + t += `, which ${he} loves,`; + } + t += ` as a pillow.`; + break; + case "buttslut": + t += `sleeping in bed together. ${partnerName} is sleeping face-down so ${name} can use ${his2} `; + if (_partnerSlave.butt > 8) { + t += `massive rear`; + } else if (_partnerSlave.butt > 5) { + t += `huge posterior`; + } else if (_partnerSlave.butt > 2) { + t += `big butt`; + } else if (_partnerSlave.butt > 1) { + t += `trim behind`; + } else { + t += `skinny ass`; + } + if (activeSlave.fetishKnown) { + t += `, which ${he} loves,`; + } + t += ` as a pillow.`; + break; + case "cumslut": + t += `sleeping in bed together. ${name} is spooning ${his} ${activeSlaveRel}, ${his} head nestled alongside ${partnerName}'s, ${his} `; + if (activeSlave.lips > 95) { + t += `massive `; + } else if (activeSlave.lips > 70) { + t += `pillowlike `; + } else if (activeSlave.lips > 40) { + t += `plush `; + } else if (activeSlave.lips > 10) { + t += `pretty `; + } else { + t += `thin `; + } + t += `lips wet from kissing ${him2} to sleep.`; + break; + case "submissive": + case "masochist": + case "humiliation": + t += `sleeping in bed together. ${name} is being spooned by ${his} ${activeSlaveRel}, smiling peacefully at being held.`; + break; + case "dom": + case "sadist": + t += `sleeping in bed together. ${name} is spooning ${his} ${activeSlaveRel} possessively`; + if (activeSlave.amp !== 1) { + t += `, and even in ${his} sleep, has a proprietary hand on ${partnerName}'s `; + if (_partnerSlave.balls > 0) { + t += `balls`; + } else if (_partnerSlave.balls > 0) { + t += `soft cock`; + } else if (_partnerSlave.vagina > -1) { + t += `pussy`; + } else { + t += `body`; + } + } + t += `.`; + break; + case "pregnancy": + t += `sleeping in bed together. `; + if (activeSlave.belly >= 5000 && _partnerSlave.belly >= 5000) { + t += `They are pressed as close as they can be with their rounded middles in the way.`; + } else if (activeSlave.belly >= 5000) { + t += `${name} is spooning ${his} ${activeSlaveRel} possessively, ${his} rounded belly pushing into ${his2} back.`; + } else if (_partnerSlave.belly >= 5000) { + t += `${name} is spooning ${his} ${activeSlaveRel} possessively`; + if (activeSlave.amp !== 1) { + t += `, and even in ${his} sleep, has a proprietary hand on ${partnerName}'s belly`; + } + t += `.`; + } else { + t += `${name} is being spooned by ${his} ${activeSlaveRel}, smiling peacefully at being held.`; + } + break; + + } + } else if (_partnerSlave.dick > 6 && activeSlave.amp !== 1 && _fuckSeed > 30) { + t += `sleeping in bed together. ${name} is cuddled up close to ${partnerName}, and is cradling ${his} ${activeSlaveRel}'s enormous, soft cock with one hand.`; + } else if (activeSlave.height > _partnerSlave.height + 10) { + t += `sleeping in bed together, with the taller ${name} curled around ${his} little ${activeSlaveRel}.`; + } else if (_partnerSlave.height > activeSlave.height + 10) { + t += `sleeping in bed together, with the shorter ${name} curled under ${his} ${activeSlaveRel}.`; + } else if (activeSlave.amp === 1) { + t += `sleeping in bed together; ${partnerName} is using ${his2} limbless ${activeSlaveRel} as a pillow.`; + } else if (_partnerSlave.amp !== 1) { + t += `resting in bed together, holding hands in their sleep.`; + } else { + t += `sleeping quietly in bed together.`; + } + } else { + /* TOGETHER TIME */ + if (_fuckSeed > 75 && activeSlave.behavioralQuirk !== "none") { + switch (activeSlave.behavioralQuirk) { + case "confident": + t += `finishing up a meal together. ${name} `; + if (canTalk(activeSlave) && canHear(_partnerSlave)) { + t += `is concluding a story for ${his} ${activeSlaveRel}, ${his} clear confident voice ringing as ${he} relates a slight.`; + } else { + t += `is boasting to ${his} ${activeSlaveRel}, with ${partnerName} nodding in agreement.`; + } + break; + case "cutting": + t += `seeing to their chores together. ${name} `; + if (canTalk(activeSlave) && canHear(_partnerSlave)) { + t += `is making biting remarks about another one of your other slaves, with which ${his} ${activeSlaveRel} agrees tolerantly.`; + } else { + t += `is making ${his} thoughts about another one of your other slaves clear to ${his} ${activeSlaveRel}.`; + } + break; + case "funny": + if (canTalk(_partnerSlave) && canSee(_partnerSlave)) { + t += `seeing to their chores together. ${name} has just produced some unintentional slapstick humor, and ${his} ${activeSlaveRel} is giggling helplessly at ${his} antics.`; + } else { + t += `getting ready for bed. ${name} is making ${his} ${activeSlaveRel} giggle `; + if (canTalk(_partnerSlave)) { + t += `silently `; + } else { + t += `helplessly `; + } + t += `with ${his} antics.`; + } + break; + case "fitness": + t += `have just woken up. `; + if (activeSlave.amp !== 1) { + t += `${name} is doing ${his} morning crunches, and ${his} ${activeSlaveRel} is sleepily sitting on ${his} feet to help.`; + } else { + t += `${name} is doing ${his} morning exercises, and ${his} ${activeSlaveRel} is sleepily sitting nearby, providing moral support.`; + } + break; + case "insecure": + t += `have just woken up. ${name} is getting dressed when ${his} ${activeSlaveRel} `; + if ((canTalk(_partnerSlave) && canHear(activeSlave)) || (_partnerSlave.amp !== 1 && canSee(activeSlave))) { + t += `pays ${him} a compliment; ${name} blushes and gives ${partnerName} a kiss.`; + } else { + t += `demonstrates how much ${he2} adores ${his} body; ${name} blushes and gives ${partnerName} a kiss.`; + } + break; + case "sinful": + t += `have just woken up. ${name} appears to be praying, but to go by ${his} ${activeSlaveRel}'s `; + if (canTalk(activeSlave) && canHear(_partnerSlave)) { + t += `quiet mirth, ${he} seems to be substituting in some lewd words.`; + } else if (canSee(_partnerSlave)) { + t += `quiet mirth, ${he} seems to be adding in some lewd motions.`; + } else { + t += `blushing, ${he} seems to be substituting in the occasional lewd act.`; + } + break; + case "advocate": + if (canTalk(activeSlave)) { + t += `starting a meal together. A third, less well trained slave has asked ${name} an innocent question, and is getting enthusiastic slave dogma in return. ${His} ${activeSlaveRel} smiles tolerantly.`; + } else { + t += `have just woken up. ${name} is planning out how to better convince new slaves that they made the right choice. ${His} ${activeSlaveRel} just tolerantly goes about tidying up while giving the occasional idea.`; + } + break; + case "adores men": + if (canSee(activeSlave) && (canSee(_partnerSlave) || canHear(_partnerSlave))) { + t += `sharing a meal together. ${name} is making catcalls at passing boys, and ${his} ${activeSlaveRel} is nudging ${him} in the ribs every time {he2} catches it.`; + } else { + t += `getting ready for bed. ${name} is demonstrating just how much ${he} adores men to ${his} ${activeSlaveRel} while ${he2} nods `; + if (_partnerSlave.genes === "XX") { + t += `tolerantly.`; + } else { + t += `appreciatively.`; + } + } + break; + case "adores women": + if (canSee(activeSlave) && (canSee(_partnerSlave) || canHear(_partnerSlave))) { + t += `sharing a meal together. ${name} is making catcalls at passing girls, and ${his} ${activeSlaveRel} is nudging ${him} in the ribs every time {he2} catches it.`; + } else { + t += `getting ready for bed. ${name} is demonstrating just how much ${he} adores ladies to ${his} ${activeSlaveRel} while ${he2} nods `; + if (_partnerSlave.genes === "XY") { + t += `tolerantly.`; + } else { + t += `appreciatively.`; + } + } + break; + + } + } else if (_fuckSeed > 50) { + if ((activeSlave.actualAge >= _partnerSlave.actualAge + 10) && canTalk(_partnerSlave) && canHear(activeSlave)) { + t += `tidying up their room together. ${partnerName} is chattering about ${his2} day, while ${name} listens quietly, smiling fondly at ${his} ${activeSlaveRel}'s prattle.`; + } else if ((_partnerSlave.actualAge >= activeSlave.actualAge + 10) && canTalk(activeSlave) && canHear(_partnerSlave)) { + t += `tidying up their room together. ${name} is chattering about ${his} day, while ${partnerName} listens quietly, smiling fondly at ${his2} ${activeSlaveRel}'s prattle.`; + } else if (activeSlave.amp !== 1 && !canTalk(activeSlave) && canSee(_partnerSlave)) { + t += `getting ready for bed. ${name} is using gestures to tell ${his} ${activeSlaveRel} about ${his} day; ${partnerName} is very patient and does ${his2} best to follow.`; + } else if (canTalk(activeSlave) && canTalk(_partnerSlave) && canHear(activeSlave) && canHear(_partnerSlave)) { + t += `tidying up their room together. ${name} and ${partnerName} are chattering away over inconsequential things.`; + } else if (canSee(activeSlave) && canSee(_partnerSlave) && activeSlave.amp !== 1 && _partnerSlave.amp !== 1) { + t += `getting ready for bed. ${name} and ${partnerName} are rapidly gesturing to each other about their days.`; + } else { + t += `getting ready for bed. ${name} and ${his} ${activeSlaveRel}, ${partnerName}, are leaning against one another, just enjoying each other's warmth.`; + } + } else if (_fuckSeed > 25) { + t += `using some of their free time to `; + if (!canWalk(activeSlave) && canWalk(_partnerSlave)) { + if (canSee(activeSlave) && canSee(_partnerSlave)) { + t += `watch the weather; ${partnerName} helped ${his2} ${activeSlaveRel} to a window so ${he} could look out with ${him2}.`; + } else { + t += `get some fresh air; ${partnerName} helped ${his2} ${activeSlaveRel} to a balcony so ${he} could enjoy the breeze with ${him2}.`; + } + } else if (!canWalk(_partnerSlave) && canWalk(activeSlave)) { + if (canSee(activeSlave) && canSee(_partnerSlave)) { + t += `watch the weather; ${name} helped ${his} ${activeSlaveRel} to a window so ${he2} could look out with ${him}.`; + } else { + t += `get some fresh air; ${name} helped ${his} ${activeSlaveRel} to a balcony so ${he2} could enjoy the breeze with ${him}.`; + } + } else { + t += `rest on one of the penthouse balconies and enjoy the weather.`; + } + } else { + if (V.cockFeeder === 1) { + t += `taking in a meal together; they've chosen dispensers next to each other and are slurping away.`; + } else if (V.suppository === 1) { + t += `taking their drugs together; they've chosen fuckmachines next to each other and are `; + if (canTalk(activeSlave) && canTalk(_partnerSlave) && canHear(activeSlave) && canHear(_partnerSlave)) { + t += `chatting quietly as they're sodomized.`; + } else { + t += `enjoying their mutual sodomy.`; + } + } else { + t += `eating a quiet meal together.`; + } + } + } + /* CLOSE SEXY/CUDDLE/TOGETHER TIME */ + + V.target = "FRelation"; + } else { + t += ` Lover not found!`; + } + return t; +}; + +window.relatedSlave = function(activeSlave) { + const V = State.variables; + const pronouns = getPronouns(activeSlave); + const he = pronouns.pronoun, + him = pronouns.object, + his = pronouns.possessive, + hers = pronouns.possessivePronoun, + himself = pronouns.objectReflexive, + boy = pronouns.noun; + const He = capFirstChar(he), + His = capFirstChar(his); + let t = ""; + let activeSlaveRel; + let partnerSlave; + + let fuckseed = jsRandom(1, 100); + + if (V.partner === "relation") { + if (V.familyTesting === 1) { + partnerSlave = V.relation; + } else { + partnerSlave = getSlave(activeSlave.relationTarget); + } + } else { + activeSlaveRel = relationshipTerm(activeSlave); + partnerSlave = getSlave(activeSlave.relationshipTarget); + } + + if (partnerSlave !== undefined) { + /* potential problem point */ + + t += ` ${His} `; + if (V.partner === "relation") { + if (V.familyTesting === 1) { + t += `${V.relationType} `; + } else { + t += `${partnerSlave.relation} `; + } + } else { + t += `${activeSlaveRel} `; + } + t += `${partnerSlave.slaveName} `; + t += walkPasts(partnerSlave, fuckseed); + + V.target = "FRelation"; /* potentially removed later */ + } else { + t += ` Expected partner not found!`; + } + + return t; +}; + +window.walkPasts = function(slave, _seed) { + + /* will be moved up once this becomes a single, contained function. */ + const V = State.variables; + const pronouns = getPronouns(slave); + const he = pronouns.pronoun, + him = pronouns.object, + his = pronouns.possessive, + hers = pronouns.possessivePronoun, + himself = pronouns.objectReflexive, + boy = pronouns.noun; + const He = capFirstChar(he), + His = capFirstChar(his); + let _target = ""; + let t = ""; + let race = (V.seeRace ? slave.race : ""); + + switch (slave.assignment) { + case "be your agent": + t += `is shaping society in ${his} assigned arcology.`; + break; + case "live with your agent": + t += `is helping ${his} lover shape society in ${his} assigned arcology.`; + break; + case "work in the dairy": + if (V.dairyRestraintsSetting > 1) { + t += `is strapped to a milking machine in ${V.dairyName}, `; + if (slave.ovaries === 1 && V.dairyPregSetting > 0 && jsRandom(1, 2) === 2) { + if (isFertile(slave)) { + t += `and is wincing in pain as the machine forces another load of cum into ${his} womb. As you watch, ${his} ${race} stomach steadily swells with baby batter.`; + } else { + t += `giving you a good view of ${his} ${race} body and heavy belly on the feeds.`; + } + } else if (slave.lactation > 0) { + if (slave.balls > 0 && jsRandom(1, 2) === 1) { + if (slave.dick > 0) { + if (_seed > 50) { + t += `and is having ${his} cock sucked dry. As you watch, `; + if (slave.scrotum) { + t += `${his} balls tighten `; + } else { + t += `${he} begins to thrust harder `; + } + if (V.dairyStimulatorsSetting > 0) { + t += `as the phallus up ${his} butt `; + } else { + t += `as the suction to ${his} dick `; + } + t += `forces ${him} closer to yet another ejaculation.`; + } else { + t += `and is wincing in pain as the machine sucks ${his} sore cock, but you have a good view of ${his} ${race} body on the feeds.`; + } + } else { + if (_seed > 50) { + t += `and is having ${his} balls sucked dry. As you watch, `; + if (slave.scrotum) { + t += `${his} scrotum tightens `; + } else { + t += `${he} begins to thrust harder `; + } + if (V.dairyStimulatorsSetting) { + t += `as the phallus up ${his} butt `; + } else { + t += `as the suction against ${his} crotch `; + } + t += `forces ${him} closer to yet another leaking ejaculation.`; + } else { + t += `and is wincing in pain as the machine sucks ${his} empty balls, but you have a good view of ${his} ${race} body on the feeds.`; + } + } + } else { + if (_seed > 50) { + t += `and is having ${his} tits drained, but you have a good view of ${his} ${race} body on the feeds.`; + } else { + t += `and is recovering after having ${his} tits sucked dry, but you have a good view of ${his} ${race} body on the feeds.`; + } + } + } else if (slave.balls > 0) { + if (slave.dick > 0) { + if (_seed > 50) { + t += `and is having ${his} cock sucked dry. As you watch, `; + if (slave.scrotum) { + t += `${his} balls tighten `; + } else { + t += `${he} begins to thrust harder `; + } + if (V.dairyStimulatorsSetting > 0) { + t += `as the phallus up ${his} butt `; + } else { + t += `as the suction to ${his} dick `; + } + t += `forces ${him} closer to yet another ejaculation.`; + } else { + t += `and is wincing in pain as the machine sucks ${his} sore cock, but you have a good view of ${his} ${race} body on the feeds.`; + } + } else { + if (_seed > 50) { + t += `and is having ${his} balls sucked dry. As you watch, `; + if (slave.scrotum) { + t += `${his} scrotum tightens `; + } else { + t += `${he} begins to thrust harder `; + } + if (V.dairyStimulatorsSetting) { + t += `as the phallus up ${his} butt `; + } else { + t += `as the suction against ${his} crotch `; + } + t += `forces ${him} closer to yet another leaking ejaculation.`; + } else { + t += `and is wincing in pain as the machine sucks ${his} empty balls, but you have a good view of ${his} ${race} body on the feeds.`; + } + } + } else { + t += `and is massaging ${his} sore, milkless tits, but you have a good view of ${his} ${race} body on the feeds.`; + } + } else { + t += `is working in ${V.dairyName}, `; + if (slave.lactation > 0) { + if (slave.balls > 0 && jsRandom(1, 2) === 1) { + if (slave.dick > 0) { + if (_seed > 50) { + t += `and is having ${his} cock milked. As you watch, `; + if (slave.scrotum) { + t += `${his} balls tighten `; + } else { + t += `${he} begins to thrust harder `; + } + if (V.dairyStimulatorsSetting > 0) { + t += `as the phallus up ${his} butt `; + } else { + t += `as the suction to ${his} dick `; + } + t += `brings ${him} closer to a copious ejaculation.`; + } else { + t += `and is massaging ${his} sore swollen cock, but you have a good view of ${his} ${race} body on the feeds.`; + } + } else { + if (_seed > 50) { + t += `and is having ${his} balls drained. As you watch, `; + if (slave.scrotum) { + t += `${his} scrotum tightens `; + } else { + t += `${he} begins to thrust harder `; + } + if (V.dairyStimulatorsSetting) { + t += `as the phallus up ${his} butt `; + } else { + t += `as the suction against ${his} crotch `; + } + t += `brings ${him} closer to a copious squirting.`; + } else { + t += `and is massaging ${his} aching balls, but you have a good view of ${his} ${race} body on the feeds.`; + } + } + } else { + if (_seed > 50) { + t += `and is having ${his} tits milked, but you have a good view of ${his} ${race} body on the feeds.`; + } else { + t += `and is massaging ${his} sore tits, but you have a good view of ${his} ${race} body on the feeds.`; + } + } + } else if (slave.balls > 0) { + if (slave.dick > 0) { + if (_seed > 50) { + t += `and is having ${his} cock milked. As you watch, `; + if (slave.scrotum) { + t += `${his} balls tighten `; + } else { + t += `${he} begins to thrust harder `; + } + if (V.dairyStimulatorsSetting) { + t += `as the phallus up ${his} butt `; + } else { + t += `as the suction to ${his} dick `; + } + t += `brings ${him} closer to a copious ejaculation.`; + } else { + t += `and is massaging ${his} sore swollen cock, but you have a good view of ${his} ${race} body on the feeds.`; + } + } else { + if (_seed > 50) { + t += `and is having ${his} balls drained. As you watch, `; + if (slave.scrotum) { + t += `${his} scrotum tightens `; + } else { + t += `${he} begins to thrust harder `; + } + if (V.dairyStimulatorsSetting) { + t += `as the phallus up ${his} butt `; + } else { + t += `as the suction against ${his} crotch `; + } + t += `brings ${him} closer to a copious squirting.`; + } else { + t += `and is massaging ${his} aching balls, but you have a good view of ${his} ${race} body on the feeds.`; + } + } + } else { + t += `and is massaging ${his} sore, milkless tits, but you have a good view of ${his} ${race} body on the feeds.`; + } + } + break; + case "work in the brothel": + t += `is working in ${V.brothelName}, and is `; + if (Beauty(slave) > 100 && jsRandom(1, 2) === 1) { + if (_seed > 80) { + if (canDoAnal(slave) || canDoVaginal(slave)) { + t += `riding one customer's dick while ${he} gives another a blowjob.`; + } else { + t += `deep throating a pair of customer's dicks.`; + } + } else if (_seed > 60 && slave.amp !== 1) { + t += `sucking one customer's cock while giving another a handjob.`; + } else if (_seed > 40) { + t += `eating out one customer's cunt while another `; + if (canDoAnal(slave) || canDoVaginal(slave)) { + t += `uses a strap-on on ${him}.`; + } else { + t += `teases ${his} butt.`; + } + } else if (_seed > 20) { + if (canDoAnal(slave) || canDoVaginal(slave)) { + t += `getting pounded by `; + } else { + t += `amusing `; + } + t += `two women wearing strap-ons.`; + } else { + if (canDoAnal(slave) || canDoVaginal(slave)) { + t += `being double penetrated by `; + } else { + t += `using ${his} body to please `; + } + t += `a pair of customers.`; + } + } else if (_seed > 80) { + if (canDoAnal(slave) || canDoVaginal(slave)) { + t += `pleasing `; + } else { + t += `riding `; + } + t += `a customer's dick.`; + } else if (_seed > 60) { + t += `sucking a customer's cock.`; + } else if (_seed > 40) { + t += `pleasuring a customer's cunt.`; + } else if (_seed > 20) { + t += `getting pounded by a woman wearing a strap-on.`; + } else { + t += `being held down and `; + if (canDoAnal(slave)) { + t += `buttfucked `; + } else { + t += `raped `; + } + t += `by a customer.`; + } + t += ` You have a voyeuristic view of ${his} ${race} body on the feeds.`; + break; + case "serve in the club": + t += `is working in ${V.clubName}, `; + if (_seed > 50) { + t += `displaying ${his} ${race} body, keeping citizens company, and flirting with anyone who shows interest.`; + } else { + t += `or rather just off it, having taken a prominent citizen back to a discreet room so he can use ${his} ${race} body.`; + } + break; + case "work as a servant": + if (_seed > 50) { + t += `was scrubbing the penthouse floor, until another slave requested oral service.`; + } else { + t += `is scrubbing the penthouse floor.`; + } + break; + case "serve in the master suite": + if (slave.fuckdoll > 0) { + t += `waiting for use in ${V.masterSuiteName}, next to a display case full of other sex toys.`; + } else if (V.masterSuiteUpgradeLuxury === 1) { + if (_seed > 50) { + t += `is sitting on the big bed in ${V.masterSuiteName}, awaiting your return.`; + } else { + t += `is beautifying ${himself} in ${V.masterSuiteName} so ${he}'ll be pretty when you return.`; + } + } else if (V.masterSuiteUpgradeLuxury === 2) { + t += `is in ${V.masterSuiteName}'s fuckpit, `; + if (_seed > 80) { + t += `with a pair of ${his} fellow fucktoys industriously sucking on ${his} nipples.`; + } else if (_seed > 60) { + if ((slave.anus > 0 && canDoAnal(slave)) || (slave.vagina > 0 && canDoVaginal(slave))) { + t += `taking double penetration from `; + } else { + t += `being spitroasted by `; + } + t += `a pair of ${his} fellow fucktoys.`; + } else if (_seed > 40) { + if (canPenetrate(slave)) { + t += `with ${his} dick inside `; + } else if (slave.dick > 0 && slave.chastityPenis !== 1) { + t += `getting ${his} soft dick sucked by `; + } else if (canDoVaginal(slave) || canDoAnal(slave)) { + t += `getting eaten out by `; + } else { + t += `making out with `; + } + t += `a fellow fucktoy.`; + } else if (_seed > 20) { + if (slave.vagina > 0 && canDoVaginal(slave)) { + t += `getting pounded `; + } else if (slave.anus > 0 && canDoAnal(slave)) { + t += `getting ${his} ass pounded `; + } else if (canDoVaginal(slave) || canDoAnal(slave)) { + t += `getting eaten out `; + } else { + t += `getting deepthroated `; + } + t += `by a fellow fucktoy.`; + } else { + t += `performing oral sex on a fellow fucktoy.`; + } + } else { + if (slave.energy > 95) { + t += `is having enthusiastic sex with your other pets while waiting for you to ravish ${him}.`; + } else { + t += `is having idle sex with several of your other toys while they await your pleasure.`; + if (slave.fetishKnown === 1) { + switch (slave.fetish) { + case "buttslut": + if (canDoAnal(slave) && slave.anus > 0) { + t += `${He}'s happily taking a strap-on up ${his} asspussy.`; + } else { + t += `${He}'s happily got another slave between ${his} buttcheeks.`; + } + break; + case "cumslut": + t += `${He}'s happily performing oral on another slave.`; + break; + case "dom": + t += `${He}'s pinning another slave down while ${he} fucks her.`; + break; + case "submissive": + t += `${He}'s letting another slave have her way with ${him}.`; + break; + case "sadist": + if (slave.amp !== 1) { + t += `${He}'s spanking another slave with one hand and fingering her with the other.`; + } else { + t += `${He}'s painfully teasing another slave's nipple with ${his} teeth.`; + } + break; + case "masochist": + t += `Another slave is spanking ${him} while molesting everything she can.`; + break; + case "boobs": + t += `${He} has a slave sucking on each of ${his} nipples`; + if (slave.amp !== 1) { + t += ` while ${he} gives each a handjob.`; + } else { + t += `.`; + } + break; + case "pregnancy": + if (slave.belly >= 5000) { + t += `${He}'s sighing contentedly as ${his} rounded belly is sensually rubbed.`; + } else if (canPenetrate(slave)) { + t += `${He}'s happily roleplaying impregnating the slave ${he}'s fucking.`; + } else if ((slave.anus > 0 && canDoAnal(slave)) || (slave.vagina > 0 && canDoVaginal(slave))) { + t += `${He}'s happily roleplaying conceiving a child as ${he} gets fucked.`; + } else { + t += `${He}'s happily roleplaying being hugely pregnant.`; + } + break; + + } + } + } + } + break; + /* + case "guard you": + t += `is standing discreetly behind your left shoulder, watching for threats.`; + break + */ + case "stay confined": + t += `is confined, but you have a fine view of ${his} ${race} body on the feed from ${his} cell.`; + break; + case "be confined in the cellblock": + t += `is confined in ${V.cellblockName}, but you have a fine view of ${his} ${race} body on the feed from ${his} cell.`; + break; + case "be confined in the arcade": + case "work a glory hole": + t += `is confined in `; + if (slave.assignment === "be confined in the arcade") { + t += `${V.arcadeName}; `; + } else { + t += `a glory hole; `; + } + if (_seed > 80 && (canDoAnal(slave) || canDoVaginal(slave))) { + t += `${his} ass is held out at cock height, and a customer is using ${his} fuckhole.`; + } else if (_seed > 60) { + t += `${his} mouth is held open at cock height, and a customer is fucking ${his} throat.`; + } else if (_seed > 40) { + t += `a woman is abusing ${him} with a couple of dildos.`; + } else if (_seed > 20 && canDoAnal(slave)) { + t += `a customer is harshly using ${his} defenseless anus.`; + } else { + t += `a customer is cruelly spanking ${his} helpless butt.`; + } + break; + case "be the Madam": + t += `is managing ${V.brothelName}: ${he} is making sure all the customers are satisfied and all the whores are working hard.`; + break; + case "be your Concubine": + if (jsRandom(1, 2) === 1) { + t += `is looking after ${himself}; ${he} spends many hours every day on ${his} beauty regimen.`; + } else { + t += `is checking over the appearance of your harem, making sure everyone looks perfect.`; + } + break; + case "be the Wardeness": + t += `is looking after the cells: ${he} is `; + if (_seed > 50) { + t += `forcing a resistant slave to orally service ${him}.`; + } else { + t += `beating a rebellious slave across the buttocks.`; + } + break; + case "live with your Head Girl": + if (V.HeadGirl !== 0) { + t += `is getting the Head Girl's suite cleaned up while ${V.HeadGirl.slaveName} is out working.`; + } else { + t += `is making sure the Head Girl's suite is in order for your next Head Girl.`; + } + break; + case "be the Stewardess": + t += `is managing the house servants in ${V.servantsQuartersName}: ${he} overseeing the laboring house slaves and punishing any that step out of line.`; + break; + case "be the Schoolteacher": + t += `is teaching classes in ${V.schoolroomName}: ${he} is leading the slave students in rote recitation.`; + break; + case "be the Attendant": + t += `is seeing to girls in ${V.spaName}: ${he} is gently soaping an exhausted slave.`; + break; + case "be the DJ": + if (_seed > 50) { + t += `is right where ${he} belongs, in the DJ booth in ${V.clubName} ${he} leads. ${He}'s bouncing in time with the beat to show off ${his} `; + if (slave.boobs > 300) { + t += `tits.`; + } else { + t += `goods.`; + } + } else { + t += `is taking the lead on ${V.clubName}'s floor: ${he} greets new arrivals, flirts with them prettily, and subtly guides them towards choice sluts.`; + } + break; + case "be the Milkmaid": + t += `is working in ${V.dairyName}, looking after your stock.`; + break; + default: + /* WALKPASTS START HERE */ + if (slave.heels === 1 && !["flats", "none"].includes(slave.shoes)) { + t += `walks past your desk with the tiny swaying steps ${he} must take in order to walk on ${his} surgically altered legs. ${He} is on ${his} way to `; + } else if (["heels", "pumps"].includes(slave.shoes)) { + t += `walks past your desk with the swaying steps ${he} must take in ${his} high heels. ${He} is on ${his} way to `; + } else if (slave.shoes === "boots") { + t += `walks past your desk with the confident gait encouraged by ${his} high heeled boots. ${He} is on ${his} way to `; + } else if (slave.shoes === "extreme heels") { + t += `walks past your desk with the tiny swaying steps ${he} must take in ${his} ridiculous heels. ${He} is on ${his} way to `; + } else if (slave.heels === 1) { + t += `crawls past your desk on all fours, since ${he} has not been allowed the heels ${he} needs to walk upright. ${He} is on ${his} way to `; + } else if (slave.amp === 1) { + t += `is carried past your desk by one of your other slaves. ${He} is on ${his} way to `; + } else if (!canWalk(slave)) { + t += `is helped past your desk by one of your other slaves. ${He} is on ${his} way to `; + } else { + t += `walks past your desk on ${his} way to `; + } + if (slave.inflation > 0 && jsRandom(1, 100) > 70) { + if (slave.inflationMethod === 1) { + t += `gorge ${himself} with ${slave.inflationType}; `; + } else if (slave.inflationMethod === 2) { + t += `fill ${his} rear with `; + switch (slave.inflationType) { + case "water": + case "milk": + case "cum": + case "food": + t += `${slave.inflationType}; `; + break; + default: + t += `${slave.inflationType}s; `; + break; + } + } else if (slave.inflationMethod === 3) { + if (slave.inflationType === "milk") { + t += `suckle from ${his} assigned nipple until ${he} is sufficiently filled with milk; `; + } else { + t += `suck ${his} assigned dick until ${he} is sufficiently filled with cum; `; + } + } + } else { + switch (slave.assignment) { + case "rest": + if (_seed > 50) { + t += `bed; `; + } else { + t += `eat; `; + } + break; + case "get milked": + if (_seed > 50) { + if (slave.lactation) { + t += `milk ${his} overfull ${race} tits; `; + } else { + t += `empty ${his} aching balls; `; + } + } else { + if (slave.lactation) { + t += `drain ${his} milky ${race} udders; `; + } else { + t += `relieve ${his} heavy balls; `; + } + } + break; + case "whore": + if (_seed > 50) { + t += `sell ${his} ${race} body; `; + } else { + t += `ply ${his} trade as a whore; `; + } + break; + case "serve the public": + if (_seed > 50) { + t += `serve the public; `; + } else { + t += `be a public slut; `; + } + break; + case "rest in the spa": + t += `relax in ${V.spaName}; `; + break; + case "please you": + t += `wait next to you and wait for you to fuck ${him}; `; + break; + case "be a subordinate slave": + t += `service your other slaves; `; + break; + case "be a servant": + t += `clean up after your other slaves; `; + break; + case "learn in the schoolroom": + t += `attend classes `; + if (V.Schoolteacher === 0) { + t += `in ${V.schoolroomName}; `; + } else { + t += `under ${V.Schoolteacher.slaveName}, perhaps literally; `; + } + break; + case "be the Attendant": + t += `look after the slaves in ${V.spaName}; `; + break; + case "take classes": + t += `attend classes with ${V.assistantName}; `; + break; + case "be your Head Girl": + t += `oversee your other slaves; `; + break; + case "recruit girls": + t += `use ${his} connections to recruit slaves; `; + break; + default: + t += `${slave.assignment}; `; + break; + } + } /* end inflation blurb */ + if (slave.fetish === "mindbroken") { + t += `${he} does not even glance at you as ${he} goes mindlessly to ${his} next task.`; + } else if (slave.devotion < -50) { + t += `${he} directs a look of pure hatred at where you sit as ${he} passes.`; + } else if (slave.devotion < -20) { + t += `${he} cannot keep the loathing from ${his} face as ${he} passes.`; + } else if (slave.devotion <= 20) { + t += `${he} passes quickly, obviously hoping to avoid you.`; + } else if (slave.devotion <= 50) { + t += `${he} rushes by, hurrying to ${his} next task.`; + } else { + t += `as ${he} passes ${he} gives you a look of adoration.`; + } + break; + } + return t; +}; + +window.boobWatch = function(slave) { + + /* will be moved up once this becomes a single, contained function. */ + let t = ""; + let V = State.variables; + + let pronouns = getPronouns(slave); + let he = pronouns.pronoun, + him = pronouns.object, + his = pronouns.possessive, + hers = pronouns.possessivePronoun, + himself = pronouns.objectReflexive, + boy = pronouns.noun; + let He = capFirstChar(he), + His = capFirstChar(his); + + let breasts = (slave.boobs < 300) ? `flat chest` : `breasts`; + + t += `<<BoobsDescription>> `; + switch (slave.clothes) { + case "uncomfortable straps": + if (slave.boobs < 300) { + t += `The rings constantly rub against ${his} chest and force ${his} nipples to stick out.`; + } else { + t += `The strap over ${his} tits presses the soft flesh, and the ring around each nipple `; + if (slave.nipples === "fuckable") { + t += `forces them open.`; + } else { + t += `forces them to stick out.`; + } + } + break; + case "shibari ropes": + t += `The ropes binding ${his} chest `; + if (slave.boobs < 300) { + t += `shift slightly with every step, since ${he} lacks any breasts to hold them in place.`; + } else { + t += `dig into the soft flesh as ${he} moves.`; + } + break; + case "attractive lingerie for a pregnant women": + if (slave.boobs < 300) { + t += `The bulge of ${his} ${slave.nipples} nipples can be seen under the taut silk.`; + } else { + t += `${His} silken bra causes ${his} breasts to bulge around them.`; + } + break; + case "a maternity dress": + t += `${His} low cut dress `; + if (slave.boobs < 300) { + t += `was made with breasts in mind; every stop ${he} takes risks it sliding down and revealing ${his} ${slave.nipples} nipples.`; + } else { + t += `shows ample cleavage and is made to be easy to pull down.`; + } + break; + case "stretch pants and a crop-top": + if (slave.boobs < 300) { + t += `${His} flat chest makes the perfect canvas to read ${his} crop-top.`; + } else { + t += `${His} crop-top tightly clings to ${his} breasts and moves along with them. ${His} jiggling cleavage distracts from the writing on ${his} tits.`; + } + break; + case "restrictive latex": + if (slave.boobs < 300) { + t += `${His} lack of breasts draws your eyes straight to ${his} exposed nipples.`; + } else { + t += `${His} tits stick out through ${his} latex outfit.`; + } + break; + case "attractive lingerie": + t += `${His} pretty white lace bra has thoughtful cuts that tastefully let ${his} nipples stick through.`; + break; + case "kitty lingerie": + t += `${His} lingerie's cleavage window proudly displays ${his} `; + if (slave.boobs < 300) { + t += `flat chest.`; + } else { + t += `ample valley.`; + } + break; + case "a succubus outfit": + t += `${His} succubus outfit presents this sex demon's ${breasts}, inviting a damning fondle.`; + break; + case "a slutty maid outfit": + t += `${His} maid outfit covers ${his} ${breasts} with a thin white blouse designed to be easy to pull down.`; + break; + case "a nice maid outfit": + t += `${His} maid outfit covers ${his} ${breasts} demurely, offering the diverting task of pulling it off ${him}.`; + break; + case "a monokini": + t += `The straps of ${his} monokini cross in the center of ${his} chest, leaving the rest of ${his} ${breasts} naked.`; + break; + case "a cybersuit": + t += `${His} bodysuit is tight enough to show off `; + if (slave.boobs < 300) { + t += `just how flat ${he} is.`; + } else { + t += `every contour of ${his} chest.`; + } + break; + case "a string bikini": + t += `${His} string bikini covers only ${his} nipples, leaving the remainder of ${his} ${breasts} naked.`; + break; + case "a scalemail bikini": + t += `${His} scalemail bikini covers `; + if (slave.boobs < 300) { + t += `all of ${his} flat chest.`; + } else if (slave.boobs < 700) { + t += `${his} breasts entirely.`; + } else if (slave.boobs < 1500) { + t += `much of ${his} breasts, while still emphasizing them.`; + } else { + t += `the front of ${his} breasts.`; + } + break; + case "striped panties": + t += `${His} cute panties covers only ${his} crotch, leaving ${his} ${breasts} bare.`; + break; + case "clubslut netting": + t += `As ${he} moves, the weave of the netting over ${his} chest slips back and forth across ${his} nipples.`; + break; + case "a cheerleader outfit": + t += `As ${he} moves, `; + if (slave.boobs < 300) { + t += `the tight fabric rubs across ${his} obvious nipples.`; + } else { + t += `${his} chest threatens to fall out of ${his} cheerleader top.`; + } + break; + case "an apron": + t += `As ${he} moves, ${his} apron `; + if (slave.boobs < 300) { + t += `threatens to bounce off ${his} flat chest and expose ${his} nipples.`; + } else { + t += `provides excellent views of the sides of ${his} breasts.`; + } + break; + case "overalls": + t += `As ${he} moves, ${his} overalls `; + if (slave.boobs < 300) { + t += `threaten to slide off ${his} flat chest and expose ${his} nipples.`; + } else { + t += `provide excellent views of the sides of ${his} breasts.`; + } + break; + case "cutoffs and a t-shirt": + if (slave.boobs < 300) { + t += `${His} non-existent breasts are bare under ${his} t-shirt; not that you can really tell since they lack motion completely.`; + } else { + t += `${His} tits are bare under ${his} t-shirt, so movement gives delicious hints of their motion.`; + } + break; + case "spats and a tank top": + if (slave.boobs < 300) { + t += `${His} flat chest makes ${his} form-fitting tank top look as if it's clinging to a tube.`; + } else { + t += `${His} breasts bounce slightly under ${his} tank top as ${he} moves.`; + } + break; + case "a slutty outfit": + t += `For today's slutty outfit ${he}'s chosen a `; + if (jsRandom(1, 100) > 50) { + t += `handkerchief top that occasionally comes untied and `; + if (slave.boobs < 300) { + t += `reveals ${his} flat chest.`; + } else { + t += `spills ${his} breasts out naked.`; + } + } else { + t += `halter top cut so low that `; + if (slave.boobs < 300) { + t += `it occasionally slips down ${his} flat chest to reveal a nipple.`; + } else { + t += `${his} breasts occasionally pop out.`; + } + } + break; + case "a slave gown": + t += `${His} gorgeous dress has thoughtful cuts that tastefully bares ${his} ${(slave.boobs < 300) ? 'non-existent ' : ''}breasts.`; + break; + case "slutty business attire": + t += `${His} suit jacket and blouse are low enough to show off a lot of `; + if (slave.boobs < 300) { + t += `boob, or they would, had ${he} had any.`; + } else { + t += `boob.`; + } + break; + case "nice business attire": + t += `${His} suit jacket and blouse are businesslike, but they could be removed easily enough.`; + break; + case "a halter top dress": + t += `${His} beautiful halter top dress almost seems to be sculpted around ${his} body.`; + break; + case "a ball gown": + t += `${His} fabulous silken ball gown is tailored to accentuate the shape of ${his} ${breasts}.`; + break; + case "a slutty nurse outfit": + t += `${His} jacket presents ${his} ${(slave.boobs < 300) ? 'nipples' : 'breasts'} to be ogled.`; + break; + case "a schoolgirl outfit": + t += `${His} blouse lewdly displays ${his} `; + if (slave.boobs < 300) { + t += `${slave.nipples} nipples.`; + } else { + t += `breasts.`; + } + break; + case "a kimono": + t += `${His} kimono is clearly designed to accentuate ${his} ${breasts}.`; + break; + case "a hijab and abaya": + case "a niqab and abaya": + t += `${His} abaya covers ${his} ${breasts} totally.`; + break; + case "a thong": + case "a skimpy loincloth": + case "boyshorts": + case "cutoffs": + case "panties": + case "leather pants": + case "jeans": + case "sport shorts": + t += `Since ${he}'s wearing nothing but ${slave.clothing}, ${his} ${(slave.boobs < 300) ? 'non-existent ' : ''}breasts are delightfully naked.`; + break; + case "a hijab and blouse": + t += `${His} blouse and overshirt keep ${his} ${breasts} concealed.`; + break; + case "a huipil": + t += `${His} huipil `; + if (slave.boobs < 300) { + t += `daintily covers ${his} ${slave.nipples} nipples and flat chest.`; + } else { + t += `hugs the curves of ${his} breasts.`; + } + break; + case "battledress": + if (slave.boobs < 300) { + t += `As ${he} moves, you can occasionally spot ${his} lack of undergarments.`; + } else { + t += `${His} tank top and sports bra support rather than flatter ${his} breasts.`; + } + break; + case "a fallen nuns habit": + t += `${His} slutty nun outfit leaves ${his} ${(slave.boobs < 300) ? 'flat ' : ''}tits sinfully bare.`; + break; + case "a chattel habit": + t += `${His} chattel habit leaves ${his} ${(slave.boobs < 300) ? 'flat ' : ''}tits virtuously bare.`; + break; + case "a penitent nuns habit": + t += `${His} habit chafes ${his} nipples so harshly that it would probably be a relief to ${him} to have it stripped off ${him}.`; + break; + case "a comfortable bodysuit": + t += `${His} bodysuit is tight enough to show off `; + if (slave.boobs < 300) { + t += `just how flat ${he} is.`; + } else { + t += `every contour of ${his} chest.`; + } + break; + case "a latex catsuit": + t += `${His} latex catsuit is tight enough to show off `; + if (slave.boobs < 300) { + t += `just how flat ${he} is.`; + } else { + t += `every contour of ${his} chest.`; + } + break; + case "a military uniform": + case "a police uniform": + case "a schutzstaffel uniform": + case "a mounty outfit": + case "a red army uniform": + t += `${His} uniform tunic and shirt are formal, but they could be removed easily enough.`; + break; + case "battlearmor": + t += `${His} battlearmor will take some considerable effort to get out of.`; + break; + case "a nice nurse outfit": + t += `${His} nurse's outfit is functional, but they could be removed easily enough.`; + break; + case "a mini dress": + t += `${His} mini dress is tight enough to show off `; + if (slave.boobs < 300) { + t += `just how flat ${he} is.`; + } else { + t += `every contour of ${his} chest.`; + } + break; + case "a leotard": + if (slave.boobs < 300) { + t += `${His} leotard draws the eye straight to ${his} obvious nipples, since it lacks anything else to show off.`; + } else { + t += `${His} leotard is tight enough that it not only hugs ${his} breasts, but shows off ${his} nipples as well.`; + } + break; + case "a bunny outfit": + if (slave.boobs < 300) { + t += `With no breasts to speak of, ${his} strapless corset teddy manages to look rather slutty.`; + } else { + t += `${His} strapless corset teddy presents ${his} boobs while still managing to look a bit classy.`; + } + break; + case "harem gauze": + t += `${His} ${(slave.boobs < 300) ? 'non-existent ' : ''}breasts are clearly visible through the thin gauze that covers them.`; + break; + case "slutty jewelry": + if (slave.boobs < 300) { + t += `The light chain across ${his} non-existent breasts is the only thing on ${his} chest capable of moving separately from ${him}.`; + } else { + t += `The light chain under ${his} breasts accentuates their natural movement.`; + } + break; + + // needs improvement + case "a klan robe": + t += `${His} robe covers ${his} ${breasts} totally.`; + break; + case "a burqa": + t += `${His} burqa covers ${his} ${breasts} totally.`; + break; + case "a tube top and thong": + case "a tube top": + case "leather pants and a tube top": + t += `${His} tube top covers ${his} ${breasts} totally.`; + break; + case "a button-up shirt and panties": + case "a button-up shirt": + case "a t-shirt": + case "a t-shirt and thong": + case "an oversized t-shirt and boyshorts": + case "an oversized t-shirt": + case "a t-shirt and jeans": + case "sport shorts and a t-shirt": + case "a t-shirt and panties": + t += `${His} shirt covers ${his} ${breasts} totally.`; + break; + case "a bra": + case "a striped bra": + case "striped underwear": + case "a sports bra": + case "sport shorts and a sports bra": + t += `${His} bra covers ${his} ${breasts} totally.`; + break; + case "a tank-top": + case "a tank-top and panties": + t += `${His} tank-top covers ${his} ${breasts} totally.`; + break; + case "a sweater": + case "a sweater and panties": + case "a sweater and cutoffs": + t += `${His} sweater covers ${his} ${breasts} totally.`; + break; + case "a slutty klan robe": + t += `${His} robe partially covers ${his} ${breasts}.`; + break; + case "a nice pony outfit": + case "a slutty pony outfit": + t += `${His} pony outfit partially covers ${his} ${breasts}.`; + break; + case "leather pants and pasties": + case "panties and pasties": + t += `${His} pasties cover nothing more than ${his} nipples.`; + break; + case "a one-piece swimsuit": + t += `${His} swimsuit is tight enough to show off `; + if (slave.boobs < 300) { + t += `just how flat ${he} is.`; + } else { + t += `every contour of ${his} chest.`; + } + break; + case "a hanbok": + t += `${His} hanbok covers ${his} ${breasts} totally.`; + break; + case "a gothic lolita dress": + t += `${His} dress covers ${his} ${breasts} totally.`; + break; + case "a burkini": + t += `${His} burkini clings to the shape of ${his} ${breasts}.`; + break; + case "a slutty schutzstaffel uniform": + t += `${His} uniform tunic and shirt are formal, but they could be removed easily enough.`; + break; + case "a long qipao": + t += `${His} elegant qipao can be removed with minimal effort.`; + break; + case "a dirndl": + t += `${His} dirndl can be removed with minimal effort.`; + break; + case "lederhosen": + t += `${His} lederhosen might come off faster than it takes to put them on.`; + break; + case "a biyelgee costume": + t += `${His} costume could be removed with barely any effort.`; + break; + // ends needs work block + + case "no clothing": + if (slave.chastityAnus === 1 || slave.chastityVagina === 1 || slave.chastityPenis === 1) { + t += `Since ${he}'s wearing nothing but a chastity belt, ${his} ${(slave.boobs < 300) ? 'non-existent ' : ''}breasts are delightfully naked.`; + } else { + t += `${His} naked `; + if (slave.boobs < 300) { + t += `flat chest and exposed nipples`; + } else { + t += `breasts`; + } + t += ` catch your eye.`; + } + break; + default: // for outfits with exposed breasts that aren't worth having a unique description for + t += `${His} naked `; + if (slave.boobs < 300) { + t += `flat chest and exposed nipples`; + } else { + t += `breasts`; + } + t += ` catch your eye.`; + } + V.target = "FBoobs"; + return t; +}; + +window.buttWatch = function(slave) { + + /* will be moved up once this becomes a single, contained function. */ + let t = ""; + let V = State.variables; + + let pronouns = getPronouns(slave); + let he = pronouns.pronoun, + him = pronouns.object, + his = pronouns.possessive, + hers = pronouns.possessivePronoun, + himself = pronouns.objectReflexive, + boy = pronouns.noun; + let He = capFirstChar(he), + His = capFirstChar(his); + + V.target = "FButt"; + + t += `<<ButtDescription>> `; + switch (slave.clothes) { + case "a Fuckdoll suit": + t += `${His} suit is expressly designed to encourage use of ${his} rear hole.`; + break; + case "uncomfortable straps": + t += `A strap passes between ${his} `; + if (slave.amp !== 1) { + t += `legs, giving ${his} gait an awkward sway.`; + } else { + t += `leg stumps, pressing against ${his} genitals.`; + } + break; + case "shibari ropes": + if (slave.amp !== 1) { + t += `Ropes bind ${his} legs, giving ${his} gait an awkward sway.`; + } else { + t += `A rope passes between ${his} leg stumps, pressing against ${his} genitals.`; + } + break; + case "attractive lingerie for a pregnant woman": + t += `As ${he} moves, ${his} silken panties are very inviting.`; + break; + case "a maternity dress": + t += `${His} dress covers ${his} rear, but it will lift easily enough.`; + break; + case "stretch pants and a crop-top": + t += `${His} stretch pants tightly cling to ${his} rear as ${he} `; + if (slave.butt > 10) { + t += `moves. While the writing adorning it may catch your eye, the huge expanse of wobbling ass cleavage is far more distracting.`; + } else { + t += `moves; the writing on ${his} bottom gives you plenty of excuses to ogle it.`; + } + break; + case "restrictive latex": + t += `As some of the only islands in the sea of black latex, ${his} holes are eye-catching.`; + break; + case "a fallen nuns habit": + t += `${His} slutty nun outfit invites sin.`; + break; + case "a chattel habit": + t += `${His} chattel habit is designed for sex without being removed.`; + break; + case "a penitent nuns habit": + t += `${His} habit chafes ${him} so cruelly that it would probably be a relief to ${him} to have it pulled off, even if ${he}'s roughly fucked afterward.`; + break; + case "kitty lingerie": + t += `As ${he} moves, the strings of ${his} pretty kitty panties sway enticingly.`; + break; + case "attractive lingerie": + t += `As ${he} moves, ${his} lingerie delightfully hugs ${his} rear.`; + break; + case "a succubus outfit": + t += `${His} succubus outfit's tail holds ${his} skirt up high in back, inviting a damning fuck.`; + break; + case "a slutty maid outfit": + t += `${His} maid's skirt is cut extremely short, so that the slightest movement reveals a glimpse of ${his} ass.`; + break; + case "a nice maid outfit": + t += `${His} maid's skirt is cut conservatively, but will lift easily enough.`; + break; + case "a monokini": + t += `${His} monokini contours to the size and shape of ${his} bottom.`; + break; + case "an apron": + t += `${His} apron leaves ${his} buttocks totally exposed.`; + break; + case "overalls": + t += `${His} overalls fit snugly on ${his} bottom.`; + break; + case "a cybersuit": + t += `${His} bodysuit prominently displays the curves of ${his} butt.`; + break; + case "a string bikini": + t += `As ${he} moves, ${his} string lingerie leaves the entire line of ${his} hips naked and enticing.`; + break; + case "a scalemail bikini": + t += `As ${he} moves, ${his} scaly lingerie leaves almost the entire line of ${his} hips naked and enticing.`; + break; + case "striped panties": + case "a button-up shirt and panties": + case "a sweater and panties": + case "a tank-top and panties": + case "panties": + case "a t-shirt and panties": + case "panties and pasties": + case "striped underwear": + t += `${His} cute panties prominently display the curves of ${his} butt.`; + break; + case "boyshorts": + case "an oversized t-shirt and boyshorts": + t += `${His} boyshorts tightly cling to ${his} rear as ${he} `; + if (slave.butt > 5) { + t += `moves. It's filled out by so much ass you can't help but oggle.`; + } else { + t += `moves.`; + } + break; + case "clubslut netting": + t += `As ${he} moves, ${his} clubslut netting moves with ${him}, leaving nothing to the imagination.`; + break; + case "a cheerleader outfit": + t += `As ${he} moves, ${his} pleated cheerleader bounces up and down flirtatiously.`; + break; + case "cutoffs and a t-shirt": + t += `As ${he} moves, ${his} cutoffs hug ${his} butt.`; + break; + case "spats and a tank top": + t += `${His} spats show off every curve of ${his} ass.`; + break; + case "a slutty outfit": + t += `For today's slutty outfit ${he}'s chosen `; + if (jsRandom(1, 100) > 50 && slave.amp !== 1) { + t += `yoga pants so sheer that everything ${he}'s got is clearly visible.`; + } else { + t += `a miniskirt so brief that ${his} ass is hanging out the back, and a glimpse of ${his} goods is occasionally visible from the front.`; + } + break; + case "a slave gown": + if (slave.amp === 1) { + t += `${His} gorgeous dress is specially designed for ${his} limbless form, but without legs to support it, it can hardly conceal the outline of everything ${he} has.`; + } else { + t += `${His} gorgeous dress has a thoughtful cut that runs all the way from ${his} ankle to over ${his} hip, baring a leg all the way up.`; + } + break; + + case "a halter top dress": + t += `${His} beautiful halter top dress seems to be sculpted around ${his} bottom.`; + break; + case "a ball gown": + t += `${His} fabulous silken ball gown is tailored to fit ${him} and accentuates the shape of ${his} butt.`; + break; + case "a slutty nurse outfit": + t += `${His} tight skirt flatters ${his} ass.`; + break; + case "a schoolgirl outfit": + if (slave.anus === 0) { + t += `This schoolgirl clearly needs to lose ${his} anal virginity.`; + } else if (slave.vagina === 0) { + t += `This schoolgirl clearly takes it up the ass; that way, ${he} can remain a virgin, and be, like, totally pure and innocent.`; + } else { + t += `This schoolgirl clearly takes it up the ass.`; + } + break; + case "a kimono": + t += `${His} kimono demurely covers ${his} `; + if (slave.butt > 5) { + t += `behind, though it cannot conceal its massive shape.`; + } else { + t += `behind.`; + } + break; + + case "a hijab and abaya": + case "a niqab and abaya": + t += `${His} abaya totally conceals ${his} `; + if (slave.butt > 5) { + t += `behind, though it cannot conceal its large size.`; + } else { + t += `behind.`; + } + break; + case "a klan robe": + t += `${His} robe totally conceals ${his} `; + if (slave.butt > 5) { + t += `behind, though it cannot conceal its large size.`; + } else { + t += `behind.`; + } + break; + case "a burqa": + t += `${His} burqa totally conceals ${his} `; + if (slave.butt > 7) { + t += `behind, though it cannot conceal its absurd size.`; + } else { + t += `behind.`; + } + break; + case "a burkini": + if (slave.butt > 6) { + t += `${His} burkini finds itself accentuating the absurd size of ${his} behind.`; + } else { + t += `${His} burkini modestly covers ${his} behind.`; + } + break; + case "a hijab and blouse": + t += `${His} skirt modestly covers ${his} `; + if (slave.butt > 5) { + t += `behind, though it cannot conceal its large size.`; + } else { + t += `behind.`; + } + break; + case "cutoffs": + case "sport shorts and a t-shirt": + case "sport shorts": + case "a sweater and cutoffs": + case "sport shorts and a sports bra": + t += `${His} shorts hug the curves of ${his} hips and ass nicely.`; + break; + + case "a police uniform": + case "a t-shirt and jeans": + case "leather pants": + case "jeans": + case "leather pants and a tube top": + case "leather pants and pasties": + if (slave.butt > 1) { + t += `${His} pants are filled out with the curve of ${his} butt.`; + } else { + t += `${His} pants modestly cover ${his} butt.`; + } + break; + case "a nice pony outfit": + case "a slutty pony outfit": + t += `${His} leather outfit tightly hugs the curves of ${his} hips and ass.`; + break; + case "a skimpy loincloth": + t += `${His} loincloth only partially covers ${his} butt, giving frequent glimpses of the bare flesh beneath it.`; + break; + case "a gothic lolita dress": + t += `${His} dress can be lifted easily enough to get as ${his} rear.`; + break; + case "a hanbok": + t += `${His} hanbok can be lifted easily enough to get as ${his} `; + if (slave.butt > 7) { + t += `rear and its motion beneath the fabric certainly invites it.`; + } else { + t += `rear.`; + } + break; + case "a one-piece swimsuit": + t += `${His} swimsuit displays the delicious curves of ${his} butt and just begs you to run a hand across it.`; + break; + case "battledress": + t += `${His} fatigue trousers do not particularly flatter ${his} butt.`; + break; + case "nice business attire": + t += `${His} attractive skirt is nevertheless tight enough to show off ${his} derrière.`; + break; + case "slutty business attire": + t += `${His} skirt is so short it'll barely be necessary to lift it.`; + break; + case "a comfortable bodysuit": + t += `${His} bodysuit displays the curves of ${his} butt.`; + break; + case "a latex catsuit": + t += `${His} latex catsuit displays the curves of ${his} butt.`; + break; + case "a military uniform": + case "a red army uniform": + t += `${His} uniform skirt is nevertheless tight enough to show off ${his} derrière.`; + break; + case "a schutzstaffel uniform": + t += `${His} uniform trousers are nevertheless tight enough to show off ${his} derrière.`; + break; + case "a slutty schutzstaffel uniform": + t += `${His} uniform miniskirt is nevertheless tight enough to show off the enticing curves of ${his} butt.`; + break; + case "a long qipao": + t += `${His} elegant dress shows off all ${his} curves.`; + break; + case "battlearmor": + t += `${His} snug battlearmor is nevertheless tight enough to show off ${his} derrière.`; + break; + case "a mounty outfit": + t += `${His} uniform slacks are tight enough to show off ${his} derrière.`; + break; + case "a dirndl": + t += `${His} skirt shows off the soft curves ${his} derrière.`; + break; + case "lederhosen": + t += `${His} shorts tightly hug the crack of ${his} derrière.`; + break; + case "a biyelgee costume": + t += `${His} costume skirt's thin material shows off ${his} derrière.`; + break; + case "a nice nurse outfit": + t += `${His} nurse's trousers demurely cover ${his} behind.`; + break; + case "a mini dress": + t += `${His} mini dress displays the curves of ${his} butt.`; + break; + case "a leotard": + t += `${His} leotard leaves ${his} buttocks gloriously bare.`; + break; + case "a bunny outfit": + t += `${His} teddy covers ${his} rear, but in tight satin that flatters its curves.`; + break; + case "harem gauze": + t += `${His} hips are clearly visible through the thin gauze that covers it.`; + break; + case "a toga": + t += `${His} stellar behind is accented by the light material of ${his} toga.`; + break; + case "a huipil": + t += `${His} huipil is so short that ${his} butt is on display.`; + break; + case "slutty jewelry": + t += `${His} belt of light chain accentuates ${his} hips.`; + break; + case "a thong": + case "a tube top and thong": + case "a t-shirt and thong": + case "a slutty klan robe": + t += `${He}'s made an effort to keep ${his} thong out of ${his} crack, but it quickly slips back in with ${his} movements.`; + break; + case "an oversized t-shirt": + t += `${His} oversized t-shirt is covering ${his} rear, but it can be lifted easily enough.`; + break; + default: + // "a bra" "a button-up shirt" "a sweater" "a tank-top" "a tube top" "a striped bra" "a sports bra" "a t-shirt" + if (slave.chastityAnus && slave.chastityVagina) { + t += `${His} chastity protects ${his} holes from penetration.`; + V.target = "FondleButt"; + } else if (slave.chastityAnus) { + t += `${His} chastity belt protects ${his} rear from penetration.`; + V.target = "FondleButt"; + } else { + t += `You run your eye over ${his} naked hips.`; + } + } + return t; +}; + +window.anusWatch = function(slave) { + + /* will be moved up once this becomes a single, contained function. */ + let t = ""; + let V = State.variables; + + let pronouns = getPronouns(slave); + let he = pronouns.pronoun, + him = pronouns.object, + his = pronouns.possessive, + hers = pronouns.possessivePronoun, + himself = pronouns.objectReflexive, + boy = pronouns.noun; + let He = capFirstChar(he), + His = capFirstChar(his); + + V.target = "FAnus"; + + t += `<<AnusDescription>>`; + if (slave.chastityAnus === 0) { + t += ` `; + switch (slave.clothes) { + case "a Fuckdoll suit": + t += `${His} suit is expressly designed to encourage use of ${his} rear hole.`; + break; + case "uncomfortable straps": + t += `The ring over ${his} asshole beckons.`; + break; + case "shibari ropes": + t += `The rope between ${his} buttocks presses lewdly against ${his} anus as ${he} moves.`; + break; + case "restrictive latex": + t += `As one of the only islands in the sea of black latex, ${his} asshole is eye catching.`; + break; + case "a fallen nuns habit": + t += `${His} slutty nun outfit leaves ${his} butthole bare and available for anal sin.`; + break; + case "a chattel habit": + t += `${His} chattel habit covers ${his} anus with a strip of cloth, but it's designed to be lifted readily.`; + break; + case "a penitent nuns habit": + t += `${His} habit chafes ${his} rear end so cruelly that it would probably be a relief to ${him} to have it pulled up for a rough buttfuck.`; + break; + case "attractive lingerie": + if (slave.anus > 1 && slave.amp === 1) { + t += `${His} pretty g-string frequently fails to cover ${his} big butthole.`; + break; + } else if (slave.anus > 1) { + t += `As ${he} moves, ${his} pretty g-string frequently fails to cover ${his} big butthole.`; + break; + } else { + t += `As ${he} moves, ${his} pretty g-string draws your attention to ${his} ass.`; + } + break; + case "a succubus outfit": + t += `${His} succubus outfit's tail holds ${his} skirt up high in back, inviting a damning buttfuck.`; + break; + case "a nice maid outfit": + t += `${His} long maid's skirt will have to be gotten out of the way to permit access to ${his} ass.`; + break; + case "a slutty maid outfit": + t += `${His} short maid's skirt can be lifted to reveal ${his} bare buttocks.`; + break; + case "a slutty nurse outfit": + t += `${His} tight skirt flatters ${his} ass as ${he} moves.`; + break; + case "a schoolgirl outfit": + if (slave.anus === 0) { + t += `This schoolgirl clearly needs to lose ${his} anal virginity.`; + } else if (slave.vagina === 0) { + t += `This schoolgirl clearly takes it up the ass; that way, ${he} can remain a virgin, and be, like, totally pure and innocent.`; + } else { + t += `This schoolgirl clearly takes it up the ass.`; + } + break; + case "a kimono": + t += ` While ${his} kimono may demurely cover ${his} behind, you know ${his} asshole is bare under it.`; + break; + case "attractive lingerie for a pregnant woman": + t += `${His} silken panties are just begging to be torn off.`; + break; + case "a maternity dress": + t += `${His} dress could easily be slide up over ${his} butt to expose ${his} backdoor.`; + break; + case "stretch pants and a crop-top": + t += `${He} can easily be pantsed to reveal ${his} bare buttocks.`; + break; + case "a hijab and abaya": + case "a niqab and abaya": + t += `While ${his} abaya totally covers ${his} behind, it can be easily lifted to reveal ${his} asshole.`; + break; + case "a klan robe": + t += `While ${his} robe totally covers ${his} behind, it can be lifted to reveal ${his} asshole.`; + break; + case "a burqa": + t += `While ${his} burqa totally covers ${his} behind, it can be lifted to reveal ${his} asshole.`; + break; + case "an oversized t-shirt": + t += `${His} t-shirt may be oversized, but it does little to hide ${his} asshole.`; + break; + case "a tube top and thong": + case "a thong": + case "a t-shirt and thong": + if (slave.anus > 1 && slave.amp === 1) { + t += `${His} thong frequently fails to cover ${his} big butthole.`; + break; + } else if (slave.anus > 1) { + t += `As ${he} moves, ${his} thong frequently fails to cover ${his} big butthole.`; + break; + } else { + t += `As ${he} moves, ${his} thong draws your attention to ${his} ass.`; + } + break; + case "a bra": + case "a button-up shirt": + case "a sweater": + case "a tank-top": + case "a tube top": + case "a striped bra": + case "a slutty klan robe": + case "a sports bra": + case "a t-shirt": + t += `${His} outfit exposes ${his} bare butt and vulnerable asshole.`; + break; + case "an oversized t-shirt and boyshorts": + case "boyshorts": + t += `${His} boyshorts are tight enough to give hints of ${his} asshole.`; + break; + case "a button-up shirt and panties": + case "a sweater and panties": + case "a tank-top and panties": + case "panties": + case "a t-shirt and panties": + case "panties and pasties": + case "striped underwear": + t += `${His} tightly clinging panties can be pulled aside to reveal ${his} asshole.`; + break; + case "cutoffs": + case "sport shorts and a t-shirt": + case "sport shorts": + case "a sweater and cutoffs": + case "sport shorts and a sports bra": + t += `${His} shorts are practically begging to be pulled down to reveal ${his} naked butthole.`; + break; + case "a police uniform": + case "a t-shirt and jeans": + case "leather pants": + case "jeans": + case "leather pants and a tube top": + case "leather pants and pasties": + t += `${His} pants are practically begging to be pulled down to reveal ${his} naked butthole.`; + break; + case "a nice pony outfit": + case "a slutty pony outfit": + t += `${His} leather outfit is practically sculpted to fit ${his} ass, though would need to be undone to reach ${his} butthole.`; + break; + case "a skimpy loincloth": + t += `${His} loincloth gives hints of ${his} bare ass and asshole beneath it.`; + break; + case "a gothic lolita dress": + t += `${His} dress can be lifted easily to reveal ${his} asshole.`; + break; + case "a hanbok": + t += `${His} hanbok can be lifted easily to reveal ${his} asshole.`; + break; + case "a one-piece swimsuit": + t += `${His} swimsuit tightly clings to ${his} rear, but `; + if (slave.butt > 3) { + t += `${his} butt is too large to easily pull it aside and reach ${his} asshole.`; + } else { + t += `can be easily pulled aside to reveal ${his} asshole.`; + } + break; + case "a burkini": + t += `${His} burkini modestly covers ${his} rear.`; + break; + case "a hijab and blouse": + t += `${His} modest skirt can be easily lifted to reveal ${his} asshole.`; + break; + case "battledress": + t += `${His} fatigue trousers are not particularly flattering to ${his} butt but could be pulled down easily enough.`; + break; + case "a monokini": + t += `The bottom of ${his} monokini is practically sculpted to fit ${his} ass.`; + break; + case "a cybersuit": + t += `As ${his} buttocks work naturally with ${his} movement, ${his} tight bodysuit gives hints of ${his} asshole.`; + break; + case "a string bikini": + if (slave.anus > 1) { + t += `As ${he} moves, ${his} big butthole is clearly visible behind ${his} tiny g-string.`; + } else { + t += `As ${he} moves, ${his} tiny g-string draws your attention to ${his} ass.`; + } + break; + case "a scalemail bikini": + t += `${His} scalemail bottom draws attention to ${his} ass cheeks, while concealing ${his} rear hole.`; + break; + case "striped panties": + t += `${His} cute panties draw attention to ${his} ass cheeks, while concealing ${his} rear hole.`; + break; + case "clubslut netting": + t += `As ${he} moves, the hole in ${his} netting right over ${his} butthole looks inviting.`; + break; + case "a cheerleader outfit": + t += `As ${he} moves, ${his} short pleated cheerleader skirt shows off ${his} butt.`; + break; + case "cutoffs and a t-shirt": + t += `As ${he} moves, ${his} tight cutoffs flatter ${his} butt.`; + break; + case "spats and a tank top": + t += `${His} spats show off every curve of ${his} ass.`; + break; + case "a slutty outfit": + t += `For today's slutty outfit ${he}'s chosen `; + if (slave.butt > 5) { + t += `a leather skirt with zippers that permit ready access to ${his} butt.`; + } else { + t += `fishnets with a hole cut over ${his} asshole so ${he} can be sodomized without removing or damaging ${his} clothing.`; + } + break; + case "a slave gown": + t += `${His} gorgeous dress leaves little to the imagination; there's little doubt ${his} butt is bare beneath it.`; + break; + case "a halter top dress": + t += `${His} dress should slide up over ${his} butt to reveal ${his} backdoor.`; + break; + case "a ball gown": + t += `${His} ballgown and its petticoats could easily be flipped up to bare ${his} butt.`; + break; + case "slutty business attire": + t += `${His} short skirt will easily slide up to bare ${his} asshole.`; + break; + case "nice business attire": + t += `${His} conservative skirt can be slid up over ${his} hips to bare ${his} butthole.`; + break; + case "a comfortable bodysuit": + t += `${His} bodysuit demands attention for ${his} tightly clad backdoor.`; + break; + case "a latex catsuit": + t += `${His} latex catsuit's crotch zipper offers ready access to ${his} backdoor.`; + break; + case "a military uniform": + t += `${His} uniform skirt can be slid up over ${his} hips to bare ${his} butthole.`; + break; + case "a schutzstaffel uniform": + t += `${His} uniform's trousers can be easily slid down to expose ${his} butthole.`; + break; + case "a slutty schutzstaffel uniform": + t += `${His} uniform miniskirt can be easily slid up over ${his} hips to bare ${his} butthole.`; + break; + case "a red army uniform": + t += `${His} uniform skirt can be slid up over ${his} hips to bare ${his} butthole.`; + break; + case "a long qipao": + t += `${His} dress can be slid up over ${his} hips to bare ${his} butthole.`; + break; + case "battlearmor": + t += `${His} armor demands attention for ${his} tightly clad backdoor.`; + break; + case "a mounty outfit": + t += `${His} uniform slacks can be slipped off ${his} hips to bare ${his} butthole.`; + break; + case "a dirndl": + t += `${His} dress can be easily lifted to access ${his} bare ass.`; + break; + case "lederhosen": + t += `${His} tight shorts can be slipped off ${his} hips to bare ${his} butthole.`; + break; + case "a biyelgee costume": + t += `${His} costume can be easily lifted to access ${his} naked butt.`; + break; + case "a nice nurse outfit": + t += `${His} nurse's trousers can be easily slid down to expose ${his} butthole.`; + break; + case "a mini dress": + t += `${His} mini dress can be easily slid up to expose ${his} butthole.`; + break; + case "an apron": + t += `${His} apron leaves ${his} asshole completely exposed.`; + break; + case "overalls": + t += `${His} overalls totally cover ${his} asshole.`; + break; + case "a leotard": + t += `As ${his} buttocks work naturally with ${his} movement, ${his} tight leotard gives hints of ${his} asshole.`; + break; + case "a bunny outfit": + t += `${His} fluffy white cottontail draws attention to ${his} butt, inevitably bringing anal to mind.`; + break; + case "harem gauze": + t += `${His} ass is clearly visible through the thin gauze that covers it.`; + break; + case "a toga": + t += `${His} toga is so transparent it can't hide ${his} asscrack, which looks very seductive.`; + break; + case "a huipil": + t += `${His} huipil can be easily lifted to access ${his} naked butt.`; + break; + case "slutty jewelry": + t += `${His} belt of light chain threatens to dip into ${his} asscrack with each step.`; + break; + default: + if (slave.chastityVagina) { + t += `${His} chastity belt leaves ${his} ass available.`; + } else { + t += `You run your eye over ${his} naked ass.`; + } + } + } + + return t; +}; + + +window.lipWatch = function(slave) { + + /* will be moved up once this becomes a single, contained function. */ + let t = ""; + let V = State.variables; + + let pronouns = getPronouns(slave); + let he = pronouns.pronoun, + him = pronouns.object, + his = pronouns.possessive, + hers = pronouns.possessivePronoun, + himself = pronouns.objectReflexive, + boy = pronouns.noun; + let He = capFirstChar(he), + His = capFirstChar(his); + + t += `<<faceDescription>>`; + t += `<<mouthDescription>>`; + switch (slave.collar) { + case "a Fuckdoll suit": + t += `${His} suit is expressly designed to encourage use of ${his} face hole.`; + break; + case "uncomfortable leather": + t += `${His} uncomfortable leather collar makes ${him} swallow and lick ${his} lips periodically, making it look like ${he}'s offering oral even though ${he}'s just trying to relieve the discomfort.`; + break; + case "tight steel": + case "cruel retirement counter": + t += `${His} tight steel collar makes ${him} swallow and lick ${his} lips periodically, making it look like ${he}'s offering oral even though ${he}'s just trying to relieve the discomfort.`; + break; + case "preg biometrics": + t += `${His} collar reveals everything about ${his} womb, bringing eyes straight to ${his} belly before drawing them back to ${his} neck.`; + break; + case "dildo gag": + t += `${His} ring gag would make ${him} ready for oral service, as soon as the formidable dildo it secures down ${his} throat is removed.`; + break; + case "massive dildo gag": + t += `Your eyes are drawn to the distinct bulge in ${his} throat caused by the enormous dildo in it, though ${his} mouth would only be suitable for the largest of cocks right now.`; + break; + case "shock punishment": + t += `${His} shock collar rests threateningly at ${his} throat, ready to compel ${him} to do anything you wish.`; + break; + case "neck corset": + t += `${His} fitted neck corset keeps ${his} breaths shallow, and ${his} head posture rigidly upright.`; + break; + case "stylish leather": + t += `${His} stylish leather collar is at once a fashion statement, and a subtle indication of ${his} enslavement.`; + break; + case "satin choker": + t += `${His} elegant satin choker is at once a fashion statement, and a subtle indication of ${his} enslavement.`; + break; + case "silk ribbon": + t += `${His} delicate, fitted silken ribbon is at once a fashion statement, and a subtle indication of ${his} enslavement.`; + break; + case "heavy gold": + t += `${His} heavy gold collar draws attention to the sexual decadence of ${his} mouth.`; + break; + case "pretty jewelry": + case "nice retirement counter": + t += `${His} pretty necklace can hardly be called a collar, but it's just slavish enough to hint that the throat it rests on is available.`; + break; + case "bell collar": + t += `${His} little bell tinkles merrily whenever ${he} moves, dispelling any grace or gravity.`; + break; + case "leather with cowbell": + t += `${His} cowbell tinkles merrily whenever ${he} moves, instantly dispelling any grace or gravity.`; + break; + case "bowtie": + t += `${His} black bowtie contrasts with ${his} white collar, drawing the eye towards ${his} neck and face.`; + break; + case "ancient Egyptian": + t += `${His} wesekh glints richly as ${he} moves, sparkling with opulence and sensuality.`; + break; + case "ball gag": + t += `${His} ball gag uncomfortably holds ${his} jaw apart as it fills ${his} mouth.`; + break; + case "bit gag": + t += `${His} bit gag uncomfortably keeps ${him} from closing ${his} jaw; drool visibly pools along the corners of ${his} mouth, where the rod forces back ${his} cheeks.`; + break; + case "porcelain mask": + t += `${His} beautiful porcelain mask hides ${his} face and any unsightly facial features.`; + break; + default: + t += `${His} unadorned `; + if (V.PC.dick === 1) { + t += `throat is just waiting to be wrapped around a thick shaft.`; + } else { + t += `lips are just begging for a cunt to lavish attention on.`; + } + } + if (jsRandom(1, 3) === 1) { + V.target = "FKiss"; + } else { + V.target = "FLips"; + } + + return t; +}; diff --git a/src/js/textInput.js b/src/js/textInput.js index a7371b2983e0f4841ab2b31245e1b8ffb04b6ac8..ba89308e4e948ac2988088f88b358830d6795b08 100644 --- a/src/js/textInput.js +++ b/src/js/textInput.js @@ -1,4 +1,3 @@ -/* eslint-disable no-undef */ Macro.add("textinput", { // Signifies that the macro is a container macro. tags: null, diff --git a/src/js/textbox2.js b/src/js/textbox2.js index a372a788e562f4eb1b58ea6b8d58bfa9a29d5fe4..50022b705650e3dbfcbe180a82ba59c33fcb2618 100644 --- a/src/js/textbox2.js +++ b/src/js/textbox2.js @@ -72,6 +72,7 @@ Macro.add("textbox2", { State.setVar(t, valueToNumberIfSame(this.value)); }).on("blur", function() { State.setVar(t, valueToNumberIfSame(this.value)); + // eslint-disable-next-line eqeqeq if (this.value != a) { // If the value has actually changed, reload the page. Note != and not !== because types might be different gotoPassage(); } diff --git a/src/js/textboxJS.js b/src/js/textboxJS.js index cb5213593f77e0f4021a7174b771459b7c0be3c0..52adb138876e93d22bae1b08bc7cba80e03c86c2 100644 --- a/src/js/textboxJS.js +++ b/src/js/textboxJS.js @@ -1,6 +1,5 @@ -/* eslint-disable no-undef */ /* Nicked off greyelf, works for replace textboxes */ -window.setReplaceTextboxMaxLength = function (storyVarName, maxLength) { +window.setReplaceTextboxMaxLength = function(storyVarName, maxLength) { const textboxId = `#textbox-${ Util.slugify(storyVarName)}`; $(textboxId) .attr("maxlength", maxLength) @@ -12,9 +11,9 @@ window.setReplaceTextboxMaxLength = function (storyVarName, maxLength) { }; /* Nicked off TheMadExile, works for non-replace textboxes */ -window.setTextboxMaxLength = function (storyVarName, maxLength) { +window.setTextboxMaxLength = function(storyVarName, maxLength) { const textboxId = `#textbox-${ Util.slugify(storyVarName)}`; - postdisplay[`${textboxId }-maxlength`] = function (taskName) { + postdisplay[`${textboxId }-maxlength`] = function(taskName) { delete postdisplay[taskName]; $(textboxId) .attr("maxlength", maxLength) diff --git a/src/js/utilJS.js b/src/js/utilJS.js index e1aedf481903270dbd76020ca1de52cdaf9ca9a6..d3b1c2915198930e44d95ac7a96ae257e1011cc0 100644 --- a/src/js/utilJS.js +++ b/src/js/utilJS.js @@ -1,6 +1,4 @@ /* eslint-disable no-unused-vars */ -/* eslint-disable no-console */ -/* eslint-disable no-undef */ /* * Height.mean(nationality, race, genes, age) - returns the mean height for the given combination and age in years (>=2) * Height.mean(nationality, race, genes) - returns the mean adult height for the given combination @@ -68,7 +66,12 @@ window.Height = (function() { // Configuration method for the above values const _config = function(conf) { if (_.isUndefined(conf)) { - return {limitMult: [minMult, maxMult], limitHeight: [minHeight, maxHeight], skew: skew, spread: spread}; + return { + limitMult: [minMult, maxMult], + limitHeight: [minHeight, maxHeight], + skew: skew, + spread: spread + }; } if (_.isFinite(conf.skew)) { skew = Math.clamp(conf.skew, -1000, 1000); @@ -86,61 +89,451 @@ window.Height = (function() { minHeight = Math.min(conf.limitHeight[0], conf.limitHeight[1]); maxHeight = Math.max(conf.limitHeight[0], conf.limitHeight[1]); } - return {limitMult: [minMult, maxMult], limitHeight: [minHeight, maxHeight], skew: skew, spread: spread}; + return { + limitMult: [minMult, maxMult], + limitHeight: [minHeight, maxHeight], + skew: skew, + spread: spread + }; }; /* if you can find an average for an undefined, add it in! */ const xxMeanHeight = { - "Afghan": 155.08, "Albanian": 161.77, "Algerian": 159.09, "American.asian": 158.4, "American.black": 163.6, "American.latina": 158.9, "American.white": 165, "American": 163.54, - "Andorran": 162.90, "Angolan": 157.31, "Antiguan": 160.65, "Argentinian": 159.18, "Armenian": 158.09, "Aruban": 158, "Australian": 165.86, "Austrian": 164.62, "Azerbaijani": 158.25, - "Bahamian": 160.68, "Bahraini": 156.69, "Bangladeshi": 150.79, "Barbadian": 165.28, "Belarusian": 166.35, "Belgian": 165.49, "Belizean": 156.88, "Beninese": 156.16, "Bermudian": 160.69, - "Bhutanese": 153.63, "Bissau-Guinean": 158.24, "Bolivian": 153.89, "Bosnian": 165.85, "Brazilian": 160.86, "British": 164.40, "Bruneian": 153.98, "Bulgarian": 164.80, - "Burkinabé": 160.19, "Burmese": 154.37, "Burundian": 154.02, "Cambodian": 152.91, "Cameroonian": 158.82, "Canadian": 163.91, "Cape Verdean": 161.65, "Catalan": 163.4, - "Central African": 158.04, "Chadian": 160.17, "Chilean": 159.36, "Chinese": 159.71, "Colombian": 156.85, "Comorian": 155.58, "Congolese": 157.57, "a Cook Islander": 163.19, "Costa Rican": 156.37, - "Croatian": 165.63, "Cuban": 157.98, "Curaçaoan": 158, "Cypriot": 162.27, "Czech": 168.46, "Danish": 167.21, "Djiboutian": 156.11, "Dominican": 159.03, "Dominiquais": 164.34, "Dutch": 168.72, "East Timorese": 151.15, - "Ecuadorian": 154.23, "Egyptian": 157.33, "Emirati": 158.68, "Equatoguinean": 157.33, "Eritrean": 156.39, "Estonian": 168.67, "Ethiopian": 155.71, "Fijian": 161.69, "Filipina": 149.60, - "Finnish": 165.90, "French Guianan": 157, "French Polynesian": 164.52, "French": 164.88, "Gabonese": 158.84, "Gambian": 160.93, "Georgian": 162.98, "German": 165.86, "Ghanan": 157.91, - "Greek": 164.87, "Greenlandic": 161.55, "Grenadian": 164.51, "Guamanian": 153.7, "Guatemalan": 149.39, "Guinean": 157.80, "Guyanese": 157.92, "Haitian": 158.72, "Honduran": 153.84, "Hungarian": 163.66, - "I-Kiribati": 157.00, "Icelandic": 165.95, "Indian": 152.59, "Indonesian": 152.80, "Iranian": 159.67, "Iraqi": 158.67, "Irish": 165.11, "Israeli": 161.80, "Italian": 164.61, "Ivorian": 158.07, - "Jamaican": 163.12, "Japanese": 158.31, "Jordanian": 158.83, "Kazakh": 158.58, "Kenyan": 158.16, "Kittitian": 159.20, "Korean": 160.65, "Kosovan": 165.7, "Kurdish": 165, "Kuwaiti": 159.43, - "Kyrgyz": 159.35, "Laotian": 151.28, "Latvian": 169.80, "Lebanese": 162.43, "Liberian": 157.3, "Libyan": 162.08, "a Liechtensteiner": 164.3, "Lithuanian": 166.61, "Luxembourgian": 164.43, - "Macedonian": 159.75, "Malagasy": 151.18, "Malawian": 154.40, "Malaysian": 156.30, "Maldivian": 155.02, "Malian": 160.47, "Maltese": 160.85, "Marshallese": 151.31, "Mauritanian": 157.72, - "Mauritian": 157.24, "Mexican": 156.85, "Micronesian": 156.09, "Moldovan": 163.24, "Monégasque": 164.61, "Mongolian": 158.22, "Montenegrin": 164.86, "Moroccan": 157.82, "Mosotho": 155.71, - "Motswana": 161.38, "Mozambican": 153.96, "Namibian": 158.78, "Nauruan": 153.98, "Nepalese": 150.86, "New Caledonian": 158.0, "a New Zealander": 164.94, "Ni-Vanuatu": 158.17, "Nicaraguan": 154.39, "Nigerian": 156.32, - "Nigerien": 158.25, "Niuean": 164.80, "Norwegian": 165.56, "Omani": 157.19, "Pakistani": 153.84, "Palauan": 156.22, "Palestinian": 158.75, "Panamanian": 155.47, "Papua New Guinean": 154.87, - "Paraguayan": 159.86, "Peruvian": 152.93, "Polish": 164.59, "Portuguese": 163.04, "Puerto Rican": 159.20, "Qatari": 159.38, "Romanian": 162.73, "Russian": 165.27, "Rwandan": 154.79, "Sahrawi": 157.82, - "Saint Lucian": 162.31, "Salvadoran": 154.55, "Sammarinese": 164.61, "Samoan": 161.97, "São Toméan": 158.91, "Saudi": 155.88, "Scottish": 163, "Senegalese": 162.52, "Serbian": 167.69, - "Seychellois": 162.08, "Sierra Leonean": 156.60, "Singaporean": 160.32, "Slovak": 167.47, "Slovene": 166.05, "a Solomon Islander": 154.42, "Somali": 156.06, "South African": 158.03, - "South Sudanese": 169.0, "Spanish": 163.40, "Sri Lankan": 154.56, "Sudanese": 156.04, "Surinamese": 160.66, "Swazi": 158.64, "Swedish": 165.70, "Swiss": 163.45, "Syrian": 158.65, "Taiwanese": 161.45, - "Tajik": 157.33, "Tanzanian": 156.6, "Thai": 157.87, "Tibetan": 158.75, "Togolese": 158.30, "Tongan": 165.52, "Trinidadian": 160.64, "Tunisian": 160.35, "Turkish": 160.50, "Turkmen": 161.73, - "Tuvaluan": 158.10, "Ugandan": 156.72, "Ukrainian": 166.34, "Uruguayan": 162.13, "Uzbek": 157.82, "Vatican": 162.5, "Venezuelan": 157.44, "Vietnamese": 153.59, "Vincentian": 160.70, "Yemeni": 153.97, - "Zairian": 155.25, "Zambian": 155.82, "Zimbabwean": 158.22, + "Afghan": 155.08, + "Albanian": 161.77, + "Algerian": 159.09, + "American.asian": 158.4, + "American.black": 163.6, + "American.latina": 158.9, + "American.white": 165, + "American": 163.54, + "Andorran": 162.90, + "Angolan": 157.31, + "Antiguan": 160.65, + "Argentinian": 159.18, + "Armenian": 158.09, + "Aruban": 158, + "Australian": 165.86, + "Austrian": 164.62, + "Azerbaijani": 158.25, + "Bahamian": 160.68, + "Bahraini": 156.69, + "Bangladeshi": 150.79, + "Barbadian": 165.28, + "Belarusian": 166.35, + "Belgian": 165.49, + "Belizean": 156.88, + "Beninese": 156.16, + "Bermudian": 160.69, + "Bhutanese": 153.63, + "Bissau-Guinean": 158.24, + "Bolivian": 153.89, + "Bosnian": 165.85, + "Brazilian": 160.86, + "British": 164.40, + "Bruneian": 153.98, + "Bulgarian": 164.80, + "Burkinabé": 160.19, + "Burmese": 154.37, + "Burundian": 154.02, + "Cambodian": 152.91, + "Cameroonian": 158.82, + "Canadian": 163.91, + "Cape Verdean": 161.65, + "Catalan": 163.4, + "Central African": 158.04, + "Chadian": 160.17, + "Chilean": 159.36, + "Chinese": 159.71, + "Colombian": 156.85, + "Comorian": 155.58, + "Congolese": 157.57, + "a Cook Islander": 163.19, + "Costa Rican": 156.37, + "Croatian": 165.63, + "Cuban": 157.98, + "Curaçaoan": 158, + "Cypriot": 162.27, + "Czech": 168.46, + "Danish": 167.21, + "Djiboutian": 156.11, + "Dominican": 159.03, + "Dominiquais": 164.34, + "Dutch": 168.72, + "East Timorese": 151.15, + "Ecuadorian": 154.23, + "Egyptian": 157.33, + "Emirati": 158.68, + "Equatoguinean": 157.33, + "Eritrean": 156.39, + "Estonian": 168.67, + "Ethiopian": 155.71, + "Fijian": 161.69, + "Filipina": 149.60, + "Finnish": 165.90, + "French Guianan": 157, + "French Polynesian": 164.52, + "French": 164.88, + "Gabonese": 158.84, + "Gambian": 160.93, + "Georgian": 162.98, + "German": 165.86, + "Ghanan": 157.91, + "Greek": 164.87, + "Greenlandic": 161.55, + "Grenadian": 164.51, + "Guamanian": 153.7, + "Guatemalan": 149.39, + "Guinean": 157.80, + "Guyanese": 157.92, + "Haitian": 158.72, + "Honduran": 153.84, + "Hungarian": 163.66, + "I-Kiribati": 157.00, + "Icelandic": 165.95, + "Indian": 152.59, + "Indonesian": 152.80, + "Iranian": 159.67, + "Iraqi": 158.67, + "Irish": 165.11, + "Israeli": 161.80, + "Italian": 164.61, + "Ivorian": 158.07, + "Jamaican": 163.12, + "Japanese": 158.31, + "Jordanian": 158.83, + "Kazakh": 158.58, + "Kenyan": 158.16, + "Kittitian": 159.20, + "Korean": 160.65, + "Kosovan": 165.7, + "Kurdish": 165, + "Kuwaiti": 159.43, + "Kyrgyz": 159.35, + "Laotian": 151.28, + "Latvian": 169.80, + "Lebanese": 162.43, + "Liberian": 157.3, + "Libyan": 162.08, + "a Liechtensteiner": 164.3, + "Lithuanian": 166.61, + "Luxembourgian": 164.43, + "Macedonian": 159.75, + "Malagasy": 151.18, + "Malawian": 154.40, + "Malaysian": 156.30, + "Maldivian": 155.02, + "Malian": 160.47, + "Maltese": 160.85, + "Marshallese": 151.31, + "Mauritanian": 157.72, + "Mauritian": 157.24, + "Mexican": 156.85, + "Micronesian": 156.09, + "Moldovan": 163.24, + "Monégasque": 164.61, + "Mongolian": 158.22, + "Montenegrin": 164.86, + "Moroccan": 157.82, + "Mosotho": 155.71, + "Motswana": 161.38, + "Mozambican": 153.96, + "Namibian": 158.78, + "Nauruan": 153.98, + "Nepalese": 150.86, + "New Caledonian": 158.0, + "a New Zealander": 164.94, + "Ni-Vanuatu": 158.17, + "Nicaraguan": 154.39, + "Nigerian": 156.32, + "Nigerien": 158.25, + "Niuean": 164.80, + "Norwegian": 165.56, + "Omani": 157.19, + "Pakistani": 153.84, + "Palauan": 156.22, + "Palestinian": 158.75, + "Panamanian": 155.47, + "Papua New Guinean": 154.87, + "Paraguayan": 159.86, + "Peruvian": 152.93, + "Polish": 164.59, + "Portuguese": 163.04, + "Puerto Rican": 159.20, + "Qatari": 159.38, + "Romanian": 162.73, + "Russian": 165.27, + "Rwandan": 154.79, + "Sahrawi": 157.82, + "Saint Lucian": 162.31, + "Salvadoran": 154.55, + "Sammarinese": 164.61, + "Samoan": 161.97, + "São Toméan": 158.91, + "Saudi": 155.88, + "Scottish": 163, + "Senegalese": 162.52, + "Serbian": 167.69, + "Seychellois": 162.08, + "Sierra Leonean": 156.60, + "Singaporean": 160.32, + "Slovak": 167.47, + "Slovene": 166.05, + "a Solomon Islander": 154.42, + "Somali": 156.06, + "South African": 158.03, + "South Sudanese": 169.0, + "Spanish": 163.40, + "Sri Lankan": 154.56, + "Sudanese": 156.04, + "Surinamese": 160.66, + "Swazi": 158.64, + "Swedish": 165.70, + "Swiss": 163.45, + "Syrian": 158.65, + "Taiwanese": 161.45, + "Tajik": 157.33, + "Tanzanian": 156.6, + "Thai": 157.87, + "Tibetan": 158.75, + "Togolese": 158.30, + "Tongan": 165.52, + "Trinidadian": 160.64, + "Tunisian": 160.35, + "Turkish": 160.50, + "Turkmen": 161.73, + "Tuvaluan": 158.10, + "Ugandan": 156.72, + "Ukrainian": 166.34, + "Uruguayan": 162.13, + "Uzbek": 157.82, + "Vatican": 162.5, + "Venezuelan": 157.44, + "Vietnamese": 153.59, + "Vincentian": 160.70, + "Yemeni": 153.97, + "Zairian": 155.25, + "Zambian": 155.82, + "Zimbabwean": 158.22, "": 159.65, // default }; const xyMeanHeight = { - "Afghan": 165.26, "Albanian": 173.39, "Algerian": 170.07, "American.asian": 172.5, "American.black": 177.4, "American.latina": 172.5, "American.white": 178.2, "American": 177.13, - "Andorran": 176.06, "Angolan": 167.31, "Antiguan": 164.8, "Argentinian": 174.62, "Armenian": 172.00, "Aruban": 165.1, "Australian": 179.20, "Austrian": 177.41, "Azerbaijani": 169.75, - "Bahamian": 172.75, "Bahraini": 167.74, "Bangladeshi": 163.81, "Barbadian": 175.92, "Belarusian": 178.44, "Belgian": 181.70, "Belizean": 168.73, "Beninese": 167.06, "Bermudian": 172.69, - "Bhutanese": 165.31, "Bissau-Guinean": 167.90, "Bolivian": 166.85, "Bosnian": 180.87, "Brazilian": 173.55, "British": 177.49, "Bruneian": 165.01, "Bulgarian": 178.24, "Burkinabé": 169.33, - "Burmese": 164.67, "Burundian": 166.64, "Cambodian": 163.33, "Cameroonian": 167.82, "Canadian": 178.09, "Cape Verdean": 173.22, "Catalan": 175.8, "Central African": 166.67, - "Chadian": 170.44, "Chilean": 171.81, "Chinese": 171.83, "Colombian": 169.50, "Comorian": 166.19, "Congolese": 167.45, "a Cook Islander": 174.77, "Costa Rican": 168.93, "Croatian": 180.78, - "Cuban": 172.00, "Curaçaoan": 165.1, "Cypriot": 174.99, "Czech": 180.10, "Danish": 181.39, "Djiboutian": 166.57, "Dominican": 172.75, "Dominiquais": 176.31, "Dutch": 182.54, "East Timorese": 159.79, "Ecuadorian": 167.08, - "Egyptian": 166.68, "Emirati": 170.46, "Equatoguinean": 167.36, "Eritrean": 168.36, "Estonian": 181.59, "Ethiopian": 166.23, "Fijian": 173.90, "Filipina": 163.23, "Finnish": 179.59, - "French Guianan": 168, "French Polynesian": 177.41, "French": 179.74, "Gabonese": 167.94, "Gambian": 165.40, "Georgian": 174.34, "German": 179.88, "Ghanan": 168.85, "Greek": 177.32, "Greenlandic": 174.87, - "Grenadian": 176.97, "Guamanian": 169.8, "Guatemalan": 163.41, "Guinean": 167.54, "Guyanese": 170.21, "Haitian": 172.64, "Honduran": 166.39, "Hungarian": 177.26, "I-Kiribati": 169.20, "Icelandic": 180.49, - "Indian": 164.95, "Indonesian": 163.55, "Iranian": 170.3, "Iraqi": 170.43, "Irish": 178.93, "Israeli": 176.86, "Italian": 177.77, "Ivorian": 166.53, "Jamaican": 174.53, "Japanese": 170.82, "Jordanian": 171.03, - "Kazakh": 171.14, "Kenyan": 169.64, "Kittitian": 169.62, "Korean": 173.46, "Kosovan": 179.5, "Kurdish": 175, "Kuwaiti": 172.07, "Kyrgyz": 171.24, "Laotian": 160.52, "Latvian": 181.42, "Lebanese": 174.39, - "Liberian": 163.66, "Libyan": 173.53, "a Liechtensteiner": 175.4, "Lithuanian": 179.03, "Luxembourgian": 177.86, "Macedonian": 178.33, "Malagasy": 161.55, "Malawian": 166, "Malaysian": 167.89, - "Maldivian": 167.68, "Malian": 171.3, "Maltese": 173.32, "Marshallese": 162.81, "Mauritanian": 163.28, "Mauritian": 170.50, "Mexican": 169.01, "Micronesian": 168.51, "Moldovan": 175.49, - "Monégasque": 177.77, "Mongolian": 169.07, "Montenegrin": 178.28, "Moroccan": 170.40, "Mosotho": 165.59, "Motswana": 171.63, "Mozambican": 164.80, "Namibian": 166.96, "Nauruan": 167.83, - "Nepalese": 162.32, "New Caledonian": 171.0, "a New Zealander": 177.74, "Ni-Vanuatu": 168.09, "Nicaraguan": 166.71, "Nigerian": 165.91, "Nigerien": 167.68, "Niuean": 175.83, "Norwegian": 179.75, "Omani": 169.16, "Pakistani": 166.95, - "Palauan": 167.69, "Palestinian": 172.09, "Panamanian": 168.49, "Papua New Guinean": 163.57, "Paraguayan": 172.83, "Peruvian": 165.23, "Polish": 177.33, "Portuguese": 172.93, "Puerto Rican": 172.08, "Qatari": 170.48, - "Romanian": 174.74, "Russian": 176.46, "Rwandan": 162.68, "Sahrawi": 170.40, "Saint Lucian": 171.95, "Salvadoran": 169.77, "Sammarinese": 177.77, "Samoan": 174.38, "São Toméan": 167.38, - "Saudi": 167.67, "Scottish": 177.6, "Senegalese": 173.14, "Serbian": 180.57, "Seychellois": 174.21, "Sierra Leonean": 164.41, "Singaporean": 172.57, "Slovak": 179.50, "Slovene": 179.80, - "a Solomon Islander": 164.14, "Somali": 166.60, "South African": 166.68, "South Sudanese": 175.9, "Spanish": 176.59, "Sri Lankan": 165.69, "Sudanese": 166.63, "Surinamese": 172.72, "Swazi": 168.13, - "Swedish": 179.74, "Swiss": 178.42, "Syrian": 170.43, "Taiwanese": 174.52, "Tajik": 171.26, "Tanzanian": 164.80, "Thai": 169.16, "Tibetan": 168.91, "Togolese": 168.33, "Tongan": 176.76, - "Trinidadian": 173.74, "Tunisian": 173.95, "Turkish": 174.21, "Turkmen": 171.97, "Tuvaluan": 169.64, "Ugandan": 165.62, "Ukrainian": 178.46, "Uruguayan": 173.43, "Uzbek": 169.38, "Vatican": 176.5, - "Venezuelan": 171.59, "Vietnamese": 164.45, "Vincentian": 172.78, "Yemeni": 159.89, "Zairian": 166.80, "Zambian": 166.52, "Zimbabwean": 168.59, + "Afghan": 165.26, + "Albanian": 173.39, + "Algerian": 170.07, + "American.asian": 172.5, + "American.black": 177.4, + "American.latina": 172.5, + "American.white": 178.2, + "American": 177.13, + "Andorran": 176.06, + "Angolan": 167.31, + "Antiguan": 164.8, + "Argentinian": 174.62, + "Armenian": 172.00, + "Aruban": 165.1, + "Australian": 179.20, + "Austrian": 177.41, + "Azerbaijani": 169.75, + "Bahamian": 172.75, + "Bahraini": 167.74, + "Bangladeshi": 163.81, + "Barbadian": 175.92, + "Belarusian": 178.44, + "Belgian": 181.70, + "Belizean": 168.73, + "Beninese": 167.06, + "Bermudian": 172.69, + "Bhutanese": 165.31, + "Bissau-Guinean": 167.90, + "Bolivian": 166.85, + "Bosnian": 180.87, + "Brazilian": 173.55, + "British": 177.49, + "Bruneian": 165.01, + "Bulgarian": 178.24, + "Burkinabé": 169.33, + "Burmese": 164.67, + "Burundian": 166.64, + "Cambodian": 163.33, + "Cameroonian": 167.82, + "Canadian": 178.09, + "Cape Verdean": 173.22, + "Catalan": 175.8, + "Central African": 166.67, + "Chadian": 170.44, + "Chilean": 171.81, + "Chinese": 171.83, + "Colombian": 169.50, + "Comorian": 166.19, + "Congolese": 167.45, + "a Cook Islander": 174.77, + "Costa Rican": 168.93, + "Croatian": 180.78, + "Cuban": 172.00, + "Curaçaoan": 165.1, + "Cypriot": 174.99, + "Czech": 180.10, + "Danish": 181.39, + "Djiboutian": 166.57, + "Dominican": 172.75, + "Dominiquais": 176.31, + "Dutch": 182.54, + "East Timorese": 159.79, + "Ecuadorian": 167.08, + "Egyptian": 166.68, + "Emirati": 170.46, + "Equatoguinean": 167.36, + "Eritrean": 168.36, + "Estonian": 181.59, + "Ethiopian": 166.23, + "Fijian": 173.90, + "Filipina": 163.23, + "Finnish": 179.59, + "French Guianan": 168, + "French Polynesian": 177.41, + "French": 179.74, + "Gabonese": 167.94, + "Gambian": 165.40, + "Georgian": 174.34, + "German": 179.88, + "Ghanan": 168.85, + "Greek": 177.32, + "Greenlandic": 174.87, + "Grenadian": 176.97, + "Guamanian": 169.8, + "Guatemalan": 163.41, + "Guinean": 167.54, + "Guyanese": 170.21, + "Haitian": 172.64, + "Honduran": 166.39, + "Hungarian": 177.26, + "I-Kiribati": 169.20, + "Icelandic": 180.49, + "Indian": 164.95, + "Indonesian": 163.55, + "Iranian": 170.3, + "Iraqi": 170.43, + "Irish": 178.93, + "Israeli": 176.86, + "Italian": 177.77, + "Ivorian": 166.53, + "Jamaican": 174.53, + "Japanese": 170.82, + "Jordanian": 171.03, + "Kazakh": 171.14, + "Kenyan": 169.64, + "Kittitian": 169.62, + "Korean": 173.46, + "Kosovan": 179.5, + "Kurdish": 175, + "Kuwaiti": 172.07, + "Kyrgyz": 171.24, + "Laotian": 160.52, + "Latvian": 181.42, + "Lebanese": 174.39, + "Liberian": 163.66, + "Libyan": 173.53, + "a Liechtensteiner": 175.4, + "Lithuanian": 179.03, + "Luxembourgian": 177.86, + "Macedonian": 178.33, + "Malagasy": 161.55, + "Malawian": 166, + "Malaysian": 167.89, + "Maldivian": 167.68, + "Malian": 171.3, + "Maltese": 173.32, + "Marshallese": 162.81, + "Mauritanian": 163.28, + "Mauritian": 170.50, + "Mexican": 169.01, + "Micronesian": 168.51, + "Moldovan": 175.49, + "Monégasque": 177.77, + "Mongolian": 169.07, + "Montenegrin": 178.28, + "Moroccan": 170.40, + "Mosotho": 165.59, + "Motswana": 171.63, + "Mozambican": 164.80, + "Namibian": 166.96, + "Nauruan": 167.83, + "Nepalese": 162.32, + "New Caledonian": 171.0, + "a New Zealander": 177.74, + "Ni-Vanuatu": 168.09, + "Nicaraguan": 166.71, + "Nigerian": 165.91, + "Nigerien": 167.68, + "Niuean": 175.83, + "Norwegian": 179.75, + "Omani": 169.16, + "Pakistani": 166.95, + "Palauan": 167.69, + "Palestinian": 172.09, + "Panamanian": 168.49, + "Papua New Guinean": 163.57, + "Paraguayan": 172.83, + "Peruvian": 165.23, + "Polish": 177.33, + "Portuguese": 172.93, + "Puerto Rican": 172.08, + "Qatari": 170.48, + "Romanian": 174.74, + "Russian": 176.46, + "Rwandan": 162.68, + "Sahrawi": 170.40, + "Saint Lucian": 171.95, + "Salvadoran": 169.77, + "Sammarinese": 177.77, + "Samoan": 174.38, + "São Toméan": 167.38, + "Saudi": 167.67, + "Scottish": 177.6, + "Senegalese": 173.14, + "Serbian": 180.57, + "Seychellois": 174.21, + "Sierra Leonean": 164.41, + "Singaporean": 172.57, + "Slovak": 179.50, + "Slovene": 179.80, + "a Solomon Islander": 164.14, + "Somali": 166.60, + "South African": 166.68, + "South Sudanese": 175.9, + "Spanish": 176.59, + "Sri Lankan": 165.69, + "Sudanese": 166.63, + "Surinamese": 172.72, + "Swazi": 168.13, + "Swedish": 179.74, + "Swiss": 178.42, + "Syrian": 170.43, + "Taiwanese": 174.52, + "Tajik": 171.26, + "Tanzanian": 164.80, + "Thai": 169.16, + "Tibetan": 168.91, + "Togolese": 168.33, + "Tongan": 176.76, + "Trinidadian": 173.74, + "Tunisian": 173.95, + "Turkish": 174.21, + "Turkmen": 171.97, + "Tuvaluan": 169.64, + "Ugandan": 165.62, + "Ukrainian": 178.46, + "Uruguayan": 173.43, + "Uzbek": 169.38, + "Vatican": 176.5, + "Venezuelan": 171.59, + "Vietnamese": 164.45, + "Vincentian": 172.78, + "Yemeni": 159.89, + "Zairian": 166.80, + "Zambian": 166.52, + "Zimbabwean": 168.59, "": 171.42, // defaults }; @@ -185,7 +578,9 @@ window.Height = (function() { if (!_.isFinite(age) || age < 2 || age >= 20) { return height; } - let minHeight = 0; let midHeight = 0; let midAge = 15; + let minHeight = 0; + let midHeight = 0; + let midAge = 15; switch (genes) { case "XX": // female case "XXX": // Triple X syndrome female @@ -200,7 +595,8 @@ window.Height = (function() { midHeight = height * 170 / 178; midAge = 15; break; - case "X0": case "X": // Turner syndrome female + case "X0": + case "X": // Turner syndrome female minHeight = 85 * 0.93; midHeight = height * 157 / 164; midAge = 13; @@ -233,8 +629,9 @@ window.Height = (function() { case "XY": // male result = nationalityMeanHeight(xyMeanHeight, nationality, race); break; - // special cases. Extra SHOX genes on X and Y chromosomes make for larger people - case "X0": case "X": // Turner syndrome female + // special cases. Extra SHOX genes on X and Y chromosomes make for larger people + case "X0": + case "X": // Turner syndrome female result = nationalityMeanHeight(xxMeanHeight, nationality, race) * 0.93; break; case "XXX": // Triple X syndrome female @@ -246,10 +643,15 @@ window.Height = (function() { case "XYY": // XYY syndrome male result = nationalityMeanHeight(xyMeanHeight, nationality, race) * 1.04; break; - case "Y": case "Y0": case "YY": case "YYY": + case "Y": + case "Y0": + case "YY": + case "YYY": + // eslint-disable-next-line no-console console.log(`Height.mean(): non-viable genes ${ genes}`); break; default: + // eslint-disable-next-line no-console console.log(`Height.mean(): unknown genes ${ genes }, returning mean between XX and XY`); result = nationalityMeanHeight(xxMeanHeight, nationality, race) * 0.5 + nationalityMeanHeight(xyMeanHeight, nationality, race) * 0.5; break; @@ -334,7 +736,13 @@ window.Intelligence = (function() { // Configuration method for the above values const _config = function(conf) { if (_.isUndefined(conf)) { - return {mean: mean, limitMult: [minMult, maxMult], limitIntelligence: [minIntelligence, maxIntelligence], skew: skew, spread: spread}; + return { + mean: mean, + limitMult: [minMult, maxMult], + limitIntelligence: [minIntelligence, maxIntelligence], + skew: skew, + spread: spread + }; } if (_.isFinite(conf.mean)) { mean = Math.clamp(conf.mean, -100, 100); @@ -355,7 +763,12 @@ window.Intelligence = (function() { minIntelligence = Math.clamp(Math.min(conf.limitIntelligence[0], conf.limitIntelligence[1]), -101, 100); maxIntelligence = Math.clamp(Math.max(conf.limitIntelligence[0], conf.limitIntelligence[1]), -101, 100); } - return {limitMult: [minMult, maxMult], limitIntelligence: [minIntelligence, maxIntelligence], skew: skew, spread: spread}; + return { + limitMult: [minMult, maxMult], + limitIntelligence: [minIntelligence, maxIntelligence], + skew: skew, + spread: spread + }; }; // Helper method: Generate a skewed normal random variable with the skew s @@ -430,18 +843,18 @@ Original SugarCube code Toned <<elseif _Slave.muscles > -6>> <<elseif _Slave.muscles > -31>> - @@.red;weak@@ + <span class="red">weak</span> <<elseif _Slave.muscles > -96>> - @@.red;weak+@@ + <span class="red">weak+</span> <<else>> - @@.red;weak++@@ + <span class="red">weak++</span> <</if>> As a categorizer <<if ndef $cats>><<set $cats = {}>><</if>> <<if ndef $cats.muscleCat>> <!-- This only gets set once, skipping much of the code evaluation, and can be set outside of the code in an "init" passage for further optimization --> - <<set $cats.muscleCat = new Categorizer([96, 'Musc++'], [31, 'Musc+'], [6, 'Toned'], [-5, ''], [-30, '@@.red;weak@@'], [-95, '@@.red;weak+@@'], [-Infinity, '@@.red;weak++@@'])>> + <<set $cats.muscleCat = new Categorizer([96, 'Musc++'], [31, 'Musc+'], [6, 'Toned'], [-5, ''], [-30, '<span class="red">weak</span>'], [-95, '<span class="red">weak+</span>'], [-Infinity, '<span class="red">weak++</span>'])>> <</if>> <<print $cats.muscleCat.cat(_Slave.muscles)>> */ @@ -614,43 +1027,43 @@ window.repFormat = function(s) { /* if (!s) { s = 0; }*/ if (V.cheatMode === 1 || V.debugMode === 1) { if (s > 0) { - return `@@.green;${ num(Math.round(s * 100) / 100) } rep@@`; + return `<span class="green">${ num(Math.round(s * 100) / 100) } rep</span>`; } else if (s < 0) { - return `@@.red;${ num(Math.round(s * 100) / 100) } rep@@`; + return `<span class="red">${ num(Math.round(s * 100) / 100) } rep</span>`; } else { return `${num(Math.round(s * 100) / 100) } rep`; } } else { /* In order to calculate just how much any one category matters so we can show a "fuzzy" symbolic value to the player, we need to know how "busy" reputation was this week. To calculate this, I ADD income to expenses. Why? 100 - 100 and 10000 - 10000 BOTH are 0, but a +50 event matters a lot more in the first case than the second. I exclude overflow from the calculation because it's not a "real" expense for our purposes, and divide by half just to make percentages a bit easier. */ - let weight = s/(((V.lastWeeksRepIncome.Total - V.lastWeeksRepExpenses.Total) + V.lastWeeksRepExpenses.overflow)/2); + let weight = s / (((V.lastWeeksRepIncome.Total - V.lastWeeksRepExpenses.Total) + V.lastWeeksRepExpenses.overflow) / 2); if (weight > 0.60) { - return "@@.green;+++++ rep@@"; + return `<span class="green">+++++ rep</span>`; } else if (weight > 0.45) { - return "@@.green;++++ rep@@"; + return `<span class="green">++++ rep</span>`; } else if (weight > 0.30) { - return "@@.green;+++ rep@@"; + return `<span class="green">+++ rep</span>`; } else if (weight > 0.15) { - return "@@.green;++ rep@@"; + return `<span class="green">++ rep</span>`; } else if (weight > 0.0) { - return "@@.green;+ rep@@"; + return `<span class="green">+ rep</span>`; } else if (weight === 0) { return "0 rep"; } else if (weight < -0.60) { - return "@@.red;----- rep@@"; + return `<span class="red">----- rep</span>`; } else if (weight < -0.45) { - return "@@.red;---- rep@@"; + return `<span class="red">---- rep</span>`; } else if (weight < -0.30) { - return "@@.red;--- rep@@"; + return `<span class="red">--- rep</span>`; } else if (weight < -0.15) { - return "@@.red;-- rep@@"; + return `<span class="red">-- rep</span>`; } else if (weight < 0) { - return "@@.red;- rep@@"; + return `<span class="red">- rep</span>`; } /* return weight;*/ } }; -window.massFormat = function (s) { +window.massFormat = function(s) { if (!s) { s = 0; } @@ -691,14 +1104,14 @@ window.budgetLine = function(category, title) { <td>${title}</td>\ <td>\ <<if (${income}.${category}) > 0>>\ - @@.yellowgreen;<<print cashFormat(${income}.${category})>>@@ /*please don't put a plus sign in front of income, it's not done on a budget sheet. Safe to assume money is money unless it's in parenthesis or with a - sign.*/ + <span class="yellowgreen"><<print cashFormat(${income}.${category})>></span> /*please don't put a plus sign in front of income, it's not done on a budget sheet. Safe to assume money is money unless it's in parenthesis or with a - sign.*/ <<else>>\ <<print cashFormat(${income}.${category})>>\ <</if>>\ </td>\ <td>\ <<if (${expenses}.${category}) < 0>>\ - @@.red;-<<print cashFormat(Math.abs(${expenses}.${category}))>>\ + <span class="red">-<<print cashFormat(Math.abs(${expenses}.${category}))>></span>\ <<else>>\ <<print cashFormat(${expenses}.${category})>>\ <</if>>\ @@ -706,9 +1119,9 @@ window.budgetLine = function(category, title) { <<set ${profits}.${category} = (${income}.${category} + ${expenses}.${category})>>\ <td>\ <<if (${profits}.${category}) > 0>>\ - @@.yellowgreen;<<print cashFormat(${profits}.${category})>>.@@ + <span class="yellowgreen"><<print cashFormat(${profits}.${category})>>.</span> <<elseif (${profits}.${category}) < 0>>\ - @@.red;-<<print cashFormat(Math.abs(${profits}.${category}))>>.@@ + <span class="red">-<<print cashFormat(Math.abs(${profits}.${category}))>>.</span> <<else>>\ <<print cashFormat(${profits}.${category})>>\ <</if>>\ @@ -722,7 +1135,7 @@ window.isFloat = function(n) { }; window.jsRandom = function(min, max) { - return Math.floor(Math.random()*(max-min+1)+min); + return Math.floor(Math.random() * (max - min + 1) + min); }; window.jsRandomMany = function(arr, count) { @@ -756,7 +1169,7 @@ if(typeof Categorizer === 'function') { jQuery(document).trigger("categorizer.ready"); window.hashChoice = function hashChoice(obj) { - let randint = Math.floor(Math.random()*hashSum(obj)); + let randint = Math.floor(Math.random() * hashSum(obj)); let ret; Object.keys(obj).some((key) => { if (randint < obj[key]) { @@ -813,9 +1226,9 @@ window.between = function between(a, low, high) { window.generateNewID = function generateNewID() { let date = Date.now(); // high-precision timer let uuid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) { - let r = (date + Math.random()*16)%16 | 0; - date = Math.floor(date/16); - return (c==="x" ? r : (r & 0x3 | 0x8)).toString(16); + let r = (date + Math.random() * 16) % 16 | 0; + date = Math.floor(date / 16); + return (c === "x" ? r : (r & 0x3 | 0x8)).toString(16); }); return uuid; }; @@ -858,7 +1271,11 @@ window.addA = function(word) { return "a " + word; }; -window.getSlaveDevotionClass = /** @param {App.Entity.SlaveState} slave */ function(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {string} + */ +window.getSlaveDevotionClass = function(slave) { if ((!slave) || (!State)) { return undefined; } @@ -882,7 +1299,11 @@ window.getSlaveDevotionClass = /** @param {App.Entity.SlaveState} slave */ funct } }; -window.getSlaveTrustClass = /** @param {App.Entity.SlaveState} slave */ function(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {string} + */ +window.getSlaveTrustClass = function(slave) { if ((!slave) || (!State)) { return undefined; } @@ -913,7 +1334,7 @@ window.getSlaveTrustClass = /** @param {App.Entity.SlaveState} slave */ function // takes an integer e.g. $activeSlave.hLength, returns a string in the format 10 inches window.cmToInchString = function(s) { - let inches = Math.round(s/2.54); + let inches = Math.round(s / 2.54); if (inches === 0) { if (s === 0) { inches += " inches"; @@ -930,7 +1351,7 @@ window.cmToInchString = function(s) { // takes an integer e.g. $activeSlave.height, returns a string in the format 6'5" window.cmToFootInchString = function(s) { - if (Math.round(s/2.54) < 12) { + if (Math.round(s / 2.54) < 12) { return cmToInchString(s); } return `${Math.trunc(Math.round(s/2.54)/12) }'${ Math.round(s/2.54)%12 }"`; @@ -944,11 +1365,11 @@ window.dickToInchString = function(s) { // takes a dick value e.g. $activeSlave.dick, returns an int of the dick length in cm window.dickToCM = function(s) { if (s < 9) { - return s*5; + return s * 5; } else if (s === 9) { return 50; } - return s*6; + return s * 6; }; // takes a ball value e.g. $activeSlave.balls, returns a string in the format 3 inches @@ -961,7 +1382,7 @@ window.ballsToCM = function(s) { if (s < 2) { return 0; } - return (s<10?(s-1)*2:s*2); + return (s < 10 ? (s - 1) * 2 : s * 2); }; // takes a dick value e.g. $activeSlave.dick, returns a string in the format of either `20cm (8 inches)`, `8 inches`, or `20cm` @@ -1027,13 +1448,17 @@ window.removeDuplicates = function removeDuplicates(array) { return [...new Set(array)]; }; -window.induceLactation = /** @param {App.Entity.SlaveState} slave */ function induceLactation(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {string} + */ +window.induceLactation = function induceLactation(slave) { let pronouns = getPronouns(slave); let His = capFirstChar(pronouns.possessive); let r = ""; if (slave.induceLactation >= 10) { if (jsRandom(1, 100) < slave.induceLactation) { - r += `${His} breasts have been stimulated often enough to @@.lime;induce lactation.@@`; + r += `${His} breasts have been stimulated often enough to <span class="lime">induce lactation.</span>`; slave.induceLactation = 0; slave.lactationDuration = 2; slave.lactation = 1; @@ -1066,7 +1491,11 @@ window.ResearchLabStockPile = function() { Combat: $prosthetics.combatT.amount`; }; -window.originPronounReplace = /** @param {App.Entity.SlaveState} slave */ function(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {string} + */ +window.originPronounReplace = function(slave) { let r = slave.origin; switch (r) { case "She was the result of unprotected sex with a client. Her mother tracked you down years after her birth to force her upon you.": @@ -1225,7 +1654,11 @@ window.SkillIncrease = (function() { }; /* call as SkillIncrease.Oral() */ - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {number} skillIncrease // I think + * @returns {string} + */ function OralSkillIncrease(slave, skillIncrease = 1) { const He = capFirstChar(slave.pronoun); const his = slave.possessivePronoun; @@ -1233,19 +1666,19 @@ window.SkillIncrease = (function() { if (slave.skill.oral <= 10) { if (slave.skill.oral + skillIncrease > 10) { - r = ` <span class="green">${He} now has basic knowledge about oral sex,</span> and can at least suck a dick without constant gagging.`; + r = `<span class="green">${He} now has basic knowledge about oral sex,</span> and can at least suck a dick without constant gagging.`; } } else if (slave.skill.oral <= 30) { if (slave.skill.oral + skillIncrease > 30) { - r = ` <span class="green">${He} now has some oral skills,</span> and can reliably bring dicks and pussies to climax with ${his} mouth.`; + r = `<span class="green">${He} now has some oral skills,</span> and can reliably bring dicks and pussies to climax with ${his} mouth.`; } } else if (slave.skill.oral <= 60) { if (slave.skill.oral + skillIncrease > 60) { - r = ` <span class="green">${He} is now an oral expert,</span> and has a delightfully experienced tongue.`; + r = `<span class="green">${He} is now an oral expert,</span> and has a delightfully experienced tongue.`; } } else if (slave.skill.oral < 100) { if (slave.skill.oral + skillIncrease >= 100) { - r = ` <span class="green">${He} has mastered oral sex,</span> and can learn nothing more about sucking dick or eating pussy.`; + r = `<span class="green">${He} has mastered oral sex,</span> and can learn nothing more about sucking dick or eating pussy.`; } } slave.skill.oral += skillIncrease; @@ -1253,7 +1686,11 @@ window.SkillIncrease = (function() { } /* call as SkillIncrease.Vaginal() */ - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {number} skillIncrease // I think + * @returns {number} + */ function VaginalSkillIncrease(slave, skillIncrease = 1) { const He = capFirstChar(slave.pronoun); let r = ""; @@ -1280,11 +1717,15 @@ window.SkillIncrease = (function() { } /* call as SkillIncrease.Anal() */ - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {number} skillIncrease // I think + * @returns {string} + */ function AnalSkillIncrease(slave, skillIncrease = 1) { const He = capFirstChar(slave.pronoun); const his = slave.possessivePronoun; - let r =""; + let r = ""; if (slave.skill.anal <= 10) { if (slave.skill.anal + skillIncrease > 10) { @@ -1308,11 +1749,15 @@ window.SkillIncrease = (function() { } /* call as SkillIncrease.Whore() */ - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {number} skillIncrease // I think + * @returns {string} + */ function WhoreSkillIncrease(slave, skillIncrease = 1) { const He = capFirstChar(slave.pronoun); const his = slave.possessivePronoun; - let r =""; + let r = ""; if (slave.skill.whoring <= 10) { if (slave.skill.whoring + skillIncrease > 10) { @@ -1336,10 +1781,14 @@ window.SkillIncrease = (function() { } /* call as SkillIncrease.Entertain() */ - /** @param {App.Entity.SlaveState} slave */ + /** + * @param {App.Entity.SlaveState} slave + * @param {number} skillIncrease // I think + * @returns {string} + */ function EntertainSkillIncrease(slave, skillIncrease = 1) { const He = capFirstChar(slave.pronoun); - let r =""; + let r = ""; if (slave.skill.entertainment <= 10) { if (slave.skill.entertainment + skillIncrease > 10) { @@ -1455,11 +1904,19 @@ window.upgradeMultiplierTrade = function() { }; window.jsNdef = function(input) { - if (typeof input === "undefined") return true; else return false; + if (typeof input === "undefined") { + return true; + } else { + return false; + } }; window.jsDef = function(input) { - if (typeof input !== "undefined") return true; else return false; + if (typeof input !== "undefined") { + return true; + } else { + return false; + } }; /* Return a career at random that would be suitable for the given slave. @@ -1520,23 +1977,24 @@ window.resyncSlaveToAge = function(slave) { }; window.IncreasePCSkills = function(input, increase = 1) { - const player = State.variables.PC, oldSkill = player[input]; + const player = State.variables.PC; + const oldSkill = player[input]; player[input] += increase; if (oldSkill <= 10) { if (player[input] >= 10) { - return ` <span class='green'> <br>You have gained basic knowlege in ${input}.</span>`; + return `<span class="green"> <br>You have gained basic knowlege in ${input}.</span>`; } } else if (oldSkill <= 30) { if (player[input] >= 30) { - return ` <span class='green'> <br>You have gained some knowlege in ${input}.</span>`; + return `<span class="green"> <br>You have gained some knowlege in ${input}.</span>`; } } else if (oldSkill <= 60) { if (player[input] >= 60) { - return ` <span class='green'> <br>You have become an expert in ${input}.</span>`; + return `<span class="green"> <br>You have become an expert in ${input}.</span>`; } } else if (oldSkill < 100) { if (player[input] >= 100) { - return ` <span class='green'> <br>You have mastered ${input}.</span>`; + return `<span class="green"> <br>You have mastered ${input}.</span>`; } } }; diff --git a/src/js/vignettes.js b/src/js/vignettes.js index f7742f35dc340e27c8c0244c7bd8a7a1425bff3a..602652eb7052e4dbaf908cf168ab2efd2e6fe336 100644 --- a/src/js/vignettes.js +++ b/src/js/vignettes.js @@ -1,5 +1,8 @@ -/* eslint-disable no-undef */ -window.GetVignette = /** @param {App.Entity.SlaveState} slave */ function GetVignette(slave) { +/** + * @param {App.Entity.SlaveState} slave + * @returns {string} + */ +window.GetVignette = function GetVignette(slave) { const V = State.variables; let vignettes = []; @@ -309,6 +312,8 @@ window.GetVignette = /** @param {App.Entity.SlaveState} slave */ function GetVig type: "rep", effect: -1, }); + break; + } } switch (slave.behavioralFlaw) { @@ -379,6 +384,8 @@ window.GetVignette = /** @param {App.Entity.SlaveState} slave */ function GetVig type: "cash", effect: -1, }); + break; + } switch (slave.sexualFlaw) { case "hates oral": @@ -502,6 +509,8 @@ window.GetVignette = /** @param {App.Entity.SlaveState} slave */ function GetVig type: "cash", effect: 3, }); + break; + } switch (slave.behavioralQuirk) { case "confident": @@ -586,6 +595,8 @@ window.GetVignette = /** @param {App.Entity.SlaveState} slave */ function GetVig type: "cash", effect: 1, }); + break; + } switch (slave.sexualQuirk) { case "gagfuck queen": @@ -651,6 +662,8 @@ window.GetVignette = /** @param {App.Entity.SlaveState} slave */ function GetVig type: "cash", effect: 1, }); + break; + } if (slave.counter.pitKills > 0) { @@ -943,7 +956,7 @@ window.GetVignette = /** @param {App.Entity.SlaveState} slave */ function GetVig type: "rep", effect: -1, }); - if (slave.behavioralQuirk === "cutting" && slave.intelligence+slave.intelligenceImplant > 50) { + if (slave.behavioralQuirk === "cutting" && slave.intelligence + slave.intelligenceImplant > 50) { vignettes.push({ text: `${he} helped a customer discover a new fetish by making cutting remarks when their cock was too small for ${his} big cunt,`, type: "rep", @@ -1201,7 +1214,7 @@ window.GetVignette = /** @param {App.Entity.SlaveState} slave */ function GetVig effect: 1, }); } - if (slave.intelligence+slave.intelligenceImplant < -50) { + if (slave.intelligence + slave.intelligenceImplant < -50) { vignettes.push({ text: `a customer managed to trick ${him} into fucking him without payment,`, type: "cash", @@ -1281,7 +1294,7 @@ window.GetVignette = /** @param {App.Entity.SlaveState} slave */ function GetVig effect: -1, }); } - if (slave.relationship <= -2 && slave.intelligence+slave.intelligenceImplant <= 15) { + if (slave.relationship <= -2 && slave.intelligence + slave.intelligenceImplant <= 15) { vignettes.push({ text: `${he} accidentally mentions how much ${he} loves you during intercourse with a customer who doesn't like to share,`, type: "rep", @@ -1375,7 +1388,7 @@ window.GetVignette = /** @param {App.Entity.SlaveState} slave */ function GetVig effect: 1, }); } - if (slave.preg > slave.pregData.normalBirth/4 && slave.pregKnown > 1 && slave.bellyPreg >= 5000) { + if (slave.preg > slave.pregData.normalBirth / 4 && slave.pregKnown > 1 && slave.bellyPreg >= 5000) { vignettes.push({ text: `a customer loved ${his} pregnant belly so much that he came back for repeat business,`, type: "cash", @@ -1392,7 +1405,7 @@ window.GetVignette = /** @param {App.Entity.SlaveState} slave */ function GetVig } } if (V.arcologies[0].FSPaternalist !== "unset") { - if (slave.intelligence+slave.intelligenceImplant > 50) { + if (slave.intelligence + slave.intelligenceImplant > 50) { vignettes.push({ text: `${he} got repeat business from a customer who likes to chat with intelligent prostitutes while fucking,`, type: "cash", @@ -1603,7 +1616,7 @@ window.GetVignette = /** @param {App.Entity.SlaveState} slave */ function GetVig } } if (V.arcologies[0].FSAztecRevivalist !== "unset") { - if (slave.devotion > 75 && slave.intelligence+slave.intelligenceImplant > 50) { + if (slave.devotion > 75 && slave.intelligence + slave.intelligenceImplant > 50) { vignettes.push({ text: `${he} indulged a citizen by following a fertility ritual completely,`, type: "rep", @@ -1619,7 +1632,7 @@ window.GetVignette = /** @param {App.Entity.SlaveState} slave */ function GetVig }); } if (V.arcologies[0].FSEdoRevivalist !== "unset") { - if (slave.face > 40 && slave.intelligence+slave.intelligenceImplant > 50) { + if (slave.face > 40 && slave.intelligence + slave.intelligenceImplant > 50) { vignettes.push({ text: `${he} got repeat business from a customer who wished to do nothing more than converse with a beautiful and intelligent ${boy},`, type: "cash", @@ -1995,6 +2008,8 @@ window.GetVignette = /** @param {App.Entity.SlaveState} slave */ function GetVig type: "rep", effect: -1, }); + break; + } } switch (slave.behavioralFlaw) { @@ -2065,6 +2080,8 @@ window.GetVignette = /** @param {App.Entity.SlaveState} slave */ function GetVig type: "rep", effect: -1, }); + break; + } switch (slave.sexualFlaw) { case "hates oral": @@ -2188,6 +2205,8 @@ window.GetVignette = /** @param {App.Entity.SlaveState} slave */ function GetVig type: "rep", effect: 3, }); + break; + } switch (slave.behavioralQuirk) { case "confident": @@ -2272,6 +2291,8 @@ window.GetVignette = /** @param {App.Entity.SlaveState} slave */ function GetVig type: "cash", effect: 1, }); + break; + } switch (slave.sexualQuirk) { case "gagfuck queen": @@ -2337,6 +2358,8 @@ window.GetVignette = /** @param {App.Entity.SlaveState} slave */ function GetVig type: "cash", effect: 1, }); + break; + } if (slave.counter.pitKills > 0) { @@ -2629,7 +2652,7 @@ window.GetVignette = /** @param {App.Entity.SlaveState} slave */ function GetVig type: "rep", effect: -1, }); - if (slave.behavioralQuirk === "cutting" && slave.intelligence+slave.intelligenceImplant > 50) { + if (slave.behavioralQuirk === "cutting" && slave.intelligence + slave.intelligenceImplant > 50) { vignettes.push({ text: `${he} helped a citizen discover a new fetish by making cutting remarks when their cock was too small for ${his} big cunt,`, type: "rep", @@ -2880,7 +2903,7 @@ window.GetVignette = /** @param {App.Entity.SlaveState} slave */ function GetVig effect: 1, }); } - if (slave.intelligence+slave.intelligenceImplant < -50) { + if (slave.intelligence + slave.intelligenceImplant < -50) { vignettes.push({ text: `a low-class citizen who had no business fucking ${him} managed to trick ${him} into fucking him anyway,`, type: "rep", @@ -2960,7 +2983,7 @@ window.GetVignette = /** @param {App.Entity.SlaveState} slave */ function GetVig effect: -1, }); } - if (slave.relationship <= -2 && slave.intelligence+slave.intelligenceImplant <= 15) { + if (slave.relationship <= -2 && slave.intelligence + slave.intelligenceImplant <= 15) { vignettes.push({ text: `${he} accidentally mentions how much ${he} loves you during intercourse with a citizen who doesn't like to share,`, type: "rep", @@ -3054,7 +3077,7 @@ window.GetVignette = /** @param {App.Entity.SlaveState} slave */ function GetVig effect: 1, }); } - if (slave.preg > slave.pregData.normalBirth/4 && slave.pregKnown > 1 && slave.bellyPreg >= 5000) { + if (slave.preg > slave.pregData.normalBirth / 4 && slave.pregKnown > 1 && slave.bellyPreg >= 5000) { vignettes.push({ text: `a citizen loved ${his} pregnant belly so much that he came back for repeat service,`, type: "rep", @@ -3071,7 +3094,7 @@ window.GetVignette = /** @param {App.Entity.SlaveState} slave */ function GetVig } } if (V.arcologies[0].FSPaternalist !== "unset") { - if (slave.intelligence+slave.intelligenceImplant > 50) { + if (slave.intelligence + slave.intelligenceImplant > 50) { vignettes.push({ text: `${he} gratified a citizen who likes to chat with intelligent prostitutes as they fuck ${him},`, type: "rep", @@ -3282,7 +3305,7 @@ window.GetVignette = /** @param {App.Entity.SlaveState} slave */ function GetVig } } if (V.arcologies[0].FSAztecRevivalist !== "unset") { - if (slave.devotion > 75 && slave.intelligence+slave.intelligenceImplant > 50) { + if (slave.devotion > 75 && slave.intelligence + slave.intelligenceImplant > 50) { vignettes.push({ text: `${he} indulged a citizen by following a fertility ritual completely,`, type: "rep", @@ -3298,7 +3321,7 @@ window.GetVignette = /** @param {App.Entity.SlaveState} slave */ function GetVig }); } if (V.arcologies[0].FSEdoRevivalist !== "unset") { - if (slave.face > 40 && slave.intelligence+slave.intelligenceImplant > 50) { + if (slave.face > 40 && slave.intelligence + slave.intelligenceImplant > 50) { vignettes.push({ text: `${he} gratified a citizen who wished to do nothing more than converse with a beautiful and intelligent ${boy},`, type: "rep", @@ -3404,6 +3427,8 @@ window.GetVignette = /** @param {App.Entity.SlaveState} slave */ function GetVig type: "devotion", effect: 1, }); + break; + } } switch (slave.behavioralFlaw) { @@ -3420,6 +3445,8 @@ window.GetVignette = /** @param {App.Entity.SlaveState} slave */ function GetVig type: "devotion", effect: 1, }); + break; + } if (slave.fetish === "mindbroken") { vignettes.push({ @@ -3440,13 +3467,13 @@ window.GetVignette = /** @param {App.Entity.SlaveState} slave */ function GetVig effect: 1, }); } - if (slave.intelligence+slave.intelligenceImplant > 50) { + if (slave.intelligence + slave.intelligenceImplant > 50) { vignettes.push({ text: `${he} devised a highly efficient way to get ${his} entire week's worth of work done in only three days. As a reward, ${he} was given — you guessed it — more work,`, type: "cash", effect: 1, }); - } else if (slave.intelligence+slave.intelligenceImplant < -50) { + } else if (slave.intelligence + slave.intelligenceImplant < -50) { vignettes.push({ text: `after being told all ${he} needed was some 'elbow grease', ${he} wasted an obscene amount of time searching for it,`, type: "cash", @@ -3558,7 +3585,7 @@ window.GetVignette = /** @param {App.Entity.SlaveState} slave */ function GetVig effect: -1, }); } - //TODO: add more vignettes + // TODO: add more vignettes if ((V.farmyardBreeding) && (V.seeBestiality === 1)) { vignettes.push({ text: `a citizen didn't realize how disgusting he found bestiality until he attended one of ${V.farmyardName}'s shows,`, @@ -3629,6 +3656,7 @@ window.GetVignette = /** @param {App.Entity.SlaveState} slave */ function GetVig effect: 0, }); break; + } switch (slave.behavioralQuirk) { case "fitness": @@ -3666,7 +3694,7 @@ window.GetVignette = /** @param {App.Entity.SlaveState} slave */ function GetVig }); } if (slave.devotion > 50) { - if (slave.intelligence+slave.intelligenceImplant > 50) { + if (slave.intelligence + slave.intelligenceImplant > 50) { vignettes.push({ text: `${he} spent some of ${his} downtime figuring out a new way for you to make money,`, type: "cash", @@ -3684,7 +3712,7 @@ window.GetVignette = /** @param {App.Entity.SlaveState} slave */ function GetVig } } if (slave.devotion < -50) { - if (slave.intelligence+slave.intelligenceImplant > 50) { + if (slave.intelligence + slave.intelligenceImplant > 50) { vignettes.push({ text: `${he} spent some of ${his} downtime figuring out a way to sabotage your profits,`, type: "cash", @@ -3763,7 +3791,7 @@ window.GetVignette = /** @param {App.Entity.SlaveState} slave */ function GetVig effect: 0, }); } - if (slave.intelligence+slave.intelligenceImplant > 50) { + if (slave.intelligence + slave.intelligenceImplant > 50) { vignettes.push({ text: `${he} immersed ${himself} in classics of literature at an arcology library, giving ${him} uncomfortable ideas about society,`, type: "devotion", diff --git a/src/js/walkPastJS.js b/src/js/walkPastJS.js index 595a01280116bf813791fc425e5c800e78053f6f..c46ff5da7655b6a956209da3a5c740121258bd1e 100644 --- a/src/js/walkPastJS.js +++ b/src/js/walkPastJS.js @@ -1,5 +1,4 @@ /* eslint-disable no-unused-vars */ -/* eslint-disable no-undef */ /* temporary container until the entire thing is complete. No point in not deploying the working functions, you know? */ window.primeSlave = function(activeSlave, seed) { @@ -46,7 +45,7 @@ window.rivalSlave = function(activeSlave, seed) { t += walkPasts(_partnerSlave, 100-seed); _partnerSlave = null; - V.target = "FRival"; /*potentially removed later*/ + V.target = "FRival"; /* potentially removed later */ } return t; @@ -55,30 +54,30 @@ window.rivalSlave = function(activeSlave, seed) { window.loverSlave = function(activeSlave) { /* will be moved up once this becomes a single, contained function. */ - var _target = ""; - var t = ""; - var V = State.variables; - var race; + let _target = ""; + let t = ""; + let V = State.variables; + let race; if (V.seeRace === 1) { race = activeSlave.race; } else { race = ""; } - var name = activeSlave.slaveName; + let name = activeSlave.slaveName; const pronouns = getPronouns(activeSlave); const he = pronouns.pronoun, him = pronouns.object, his = pronouns.possessive, hers = pronouns.possessivePronoun, himself = pronouns.objectReflexive, boy = pronouns.noun; const He = capFirstChar(he), His = capFirstChar(his); - var _partnerSlave = getSlave(activeSlave.relationshipTarget); - var _fuckSeed = jsRandom(1,100); - var _seed = jsRandom(1,100); - var _fuckSpot; + let _partnerSlave = getSlave(activeSlave.relationshipTarget); + let _fuckSeed = jsRandom(1, 100); + let _seed = jsRandom(1, 100); + let _fuckSpot; if (_partnerSlave !== undefined) { - var pronouns2 = getPronouns(_partnerSlave); - var he2 = pronouns2.pronoun, him2 = pronouns2.object, his2 = pronouns2.possessive, hers2 = pronouns2.possessivePronoun, himself2 = pronouns2.objectReflexive, boy2 = pronouns2.noun; - var He2 = capFirstChar(he2), His2 = capFirstChar(his2); - var race2; + let pronouns2 = getPronouns(_partnerSlave); + let he2 = pronouns2.pronoun, him2 = pronouns2.object, his2 = pronouns2.possessive, hers2 = pronouns2.possessivePronoun, himself2 = pronouns2.objectReflexive, boy2 = pronouns2.noun; + let He2 = capFirstChar(he2), His2 = capFirstChar(his2); + let race2; if (V.seeRace === 1) { race2 = _partnerSlave.race; } else { race2 = ""; } - var partnerName = _partnerSlave.slaveName; - var activeSlaveRel; + let partnerName = _partnerSlave.slaveName; + let activeSlaveRel; if (activeSlave.relationship <= 3) { activeSlaveRel = "friend with benefits"; } else if (activeSlave.relationship <= 4) { @@ -638,7 +637,7 @@ window.loverSlave = function(activeSlave) { } } } else if (canDoVaginal(activeSlave) && _fuckSeed > 30) { - if (canPenetrate(_partnerSlave) && activeSlave.vagina > 0 && activeSlave.preg === 0 && activeSlave.ovaries === 1) { //impreg + if (canPenetrate(_partnerSlave) && activeSlave.vagina > 0 && activeSlave.preg === 0 && activeSlave.ovaries === 1) { // impreg if (_partnerSlave.belly >= 5000) { t += `${partnerName} is `; if (_partnerSlave.bellyPreg >= 1500) { @@ -651,7 +650,7 @@ window.loverSlave = function(activeSlave) { t += `${partnerName} has ${name} pinned on ${his} back in a mating press as ${he2} fervently tries to sate ${his} lust by putting a baby in ${him}.`; } } else { - if (_fuckSeed > 50) { //vanilla + if (_fuckSeed > 50) { // vanilla if (canPenetrate(_partnerSlave) && activeSlave.vagina !== 0) { if (_partnerSlave.belly >= 5000) { t += `${partnerName} is `; @@ -693,7 +692,7 @@ window.loverSlave = function(activeSlave) { t += `${name} and ${partnerName} are both pretending to be hugely pregnant and cuddling each other.`; } } - } else if (canDoVaginal(_partnerSlave) && _fuckSeed > 40) { //scissor + } else if (canDoVaginal(_partnerSlave) && _fuckSeed > 40) { // scissor if (_partnerSlave.belly >= 5000) { t += `${partnerName} is `; if (_partnerSlave.bellyPreg >= 1500) { @@ -715,7 +714,7 @@ window.loverSlave = function(activeSlave) { t += `are enthusiastically tribbing.`; } } - } else { //oral + } else { // oral if (_partnerSlave.belly >= 5000) { t += `${partnerName} is `; if (_partnerSlave.bellyPreg >= 1500) { @@ -753,7 +752,7 @@ window.loverSlave = function(activeSlave) { } } } else if (canDoAnal(activeSlave) && canPenetrate(_partnerSlave) && _fuckSeed > 10) { - if (activeSlave.anus > 0 && activeSlave.preg === 0 && activeSlave.mpreg === 1) { //impreg + if (activeSlave.anus > 0 && activeSlave.preg === 0 && activeSlave.mpreg === 1) { // impreg if (_partnerSlave.belly >= 5000) { t += `${partnerName} is `; if (_partnerSlave.bellyPreg >= 1500) { @@ -804,7 +803,7 @@ window.loverSlave = function(activeSlave) { t += `${partnerName} has ${name} pinned on ${his} front as ${he2} dutifully plows ${his} needy anus in an attempt to sate ${his} bottomless lust.`; } } - } else { //oral + } else { // oral if (_partnerSlave.belly >= 5000) { t += `${partnerName} is `; if (_partnerSlave.bellyPreg >= 1500) { @@ -1244,7 +1243,7 @@ window.relatedSlave = function(activeSlave) { let t = ""; let partnerSlave; - let fuckseed = jsRandom(1,100); + let fuckseed = jsRandom(1, 100); if (V.partner === "relation") { if (V.familyTesting === 1) { @@ -1253,7 +1252,7 @@ window.relatedSlave = function(activeSlave) { partnerSlave = getSlave(activeSlave.relationTarget); } } else { - var activeSlaveRel = relationshipTerm(activeSlave); + let activeSlaveRel = relationshipTerm(activeSlave); partnerSlave = getSlave(activeSlave.relationshipTarget); } @@ -1272,7 +1271,7 @@ window.relatedSlave = function(activeSlave) { t += `${partnerSlave.slaveName} `; t += walkPasts(partnerSlave, fuckseed); - V.target = "FRelation"; /*potentially removed later*/ + V.target = "FRelation"; /* potentially removed later */ } else { t += ` Expected partner not found!`; } @@ -1301,14 +1300,14 @@ window.walkPasts = function(slave, _seed) { case "work in the dairy": if (V.dairyRestraintsSetting > 1) { t += `is strapped to a milking machine in ${V.dairyName}, `; - if (slave.ovaries === 1 && V.dairyPregSetting > 0 && jsRandom(1,2) === 2) { + if (slave.ovaries === 1 && V.dairyPregSetting > 0 && jsRandom(1, 2) === 2) { if (isFertile(slave)) { t += `and is wincing in pain as the machine forces another load of cum into ${his} womb. As you watch, ${his} ${race} stomach steadily swells with baby batter.`; } else { t += `giving you a good view of ${his} ${race} body and heavy belly on the feeds.`; } } else if (slave.lactation > 0) { - if (slave.balls > 0 && jsRandom(1,2) === 1) { + if (slave.balls > 0 && jsRandom(1, 2) === 1) { if (slave.dick > 0) { if (_seed > 50) { t += `and is having ${his} cock sucked dry. As you watch, `; @@ -1393,7 +1392,7 @@ window.walkPasts = function(slave, _seed) { } else { t += `is working in ${V.dairyName}, `; if (slave.lactation > 0) { - if (slave.balls > 0 && jsRandom(1,2) === 1) { + if (slave.balls > 0 && jsRandom(1, 2) === 1) { if (slave.dick > 0) { if (_seed > 50) { t += `and is having ${his} cock milked. As you watch, `; @@ -1479,7 +1478,7 @@ window.walkPasts = function(slave, _seed) { break; case "work in the brothel": t += `is working in ${V.brothelName}, and is `; - if (Beauty(slave) > 100 && jsRandom(1,2) === 1) { + if (Beauty(slave) > 100 && jsRandom(1, 2) === 1) { if (_seed > 80) { if (canDoAnal(slave) || canDoVaginal(slave)) { t += `riding one customer's dick while ${he} gives another a blowjob.`; @@ -1685,7 +1684,7 @@ window.walkPasts = function(slave, _seed) { t += `is managing ${V.brothelName}: ${he} is making sure all the customers are satisfied and all the whores are working hard.`; break; case "be your Concubine": - if (jsRandom(1,2) === 1) { + if (jsRandom(1, 2) === 1) { t += `is looking after ${himself}; ${he} spends many hours every day on ${his} beauty regimen.`; } else { t += `is checking over the appearance of your harem, making sure everyone looks perfect.`; @@ -1748,7 +1747,7 @@ window.walkPasts = function(slave, _seed) { } else { t += `walks past your desk on ${his} way to `; } - if (slave.inflation > 0 && jsRandom(1,100) > 70) { + if (slave.inflation > 0 && jsRandom(1, 100) > 70) { if (slave.inflationMethod === 1) { t += `gorge ${himself} with ${slave.inflationType}; `; } else if (slave.inflationMethod === 2) { @@ -2019,7 +2018,7 @@ window.boobWatch = function(slave) { break; case "a slutty outfit": t += `For today's slutty outfit ${he}'s chosen a `; - if (jsRandom(1,100) > 50) { + if (jsRandom(1, 100) > 50) { t += `handkerchief top that occasionally comes untied and `; if (slave.boobs < 300) { t += `reveals ${his} flat chest.`; @@ -2172,7 +2171,7 @@ window.boobWatch = function(slave) { } break; - //needs improvement + // needs improvement case "a klan robe": t += `${His} robe covers ${his} ${breasts} totally.`; break; @@ -2406,7 +2405,7 @@ window.buttWatch = function(slave) { break; case "a slutty outfit": t += `For today's slutty outfit ${he}'s chosen `; - if (jsRandom(1,100) > 50 && slave.amp !== 1) { + if (jsRandom(1, 100) > 50 && slave.amp !== 1) { t += `yoga pants so sheer that everything ${he}'s got is clearly visible.`; } else { t += `a miniskirt so brief that ${his} ass is hanging out the back, and a glimpse of ${his} goods is occasionally visible from the front.`; @@ -2605,7 +2604,7 @@ window.buttWatch = function(slave) { t += `${His} oversized t-shirt is covering ${his} rear, but it can be lifted easily enough.`; break; default: - //"a bra" "a button-up shirt" "a sweater" "a tank-top" "a tube top" "a striped bra" "a sports bra" "a t-shirt" + // "a bra" "a button-up shirt" "a sweater" "a tank-top" "a tube top" "a striped bra" "a sports bra" "a t-shirt" if (slave.chastityAnus && slave.chastityVagina) { t += `${His} chastity protects ${his} holes from penetration.`; V.target = "FondleButt"; @@ -2632,7 +2631,7 @@ window.anusWatch = function(slave) { V.target = "FAnus"; t += `<<AnusDescription>>`; - if (slave.chastityAnus == 0) { + if (slave.chastityAnus === 0) { t += ` `; switch (slave.clothes) { case "a Fuckdoll suit": @@ -3005,17 +3004,17 @@ window.lipWatch = function(slave) { break; default: t += `${His} unadorned `; - if (V.PC.dick == 1) { + if (V.PC.dick === 1) { t += `throat is just waiting to be wrapped around a thick shaft.`; } else { t += `lips are just begging for a cunt to lavish attention on.`; } } - if (jsRandom(1,3) === 1) { + if (jsRandom(1, 3) === 1) { V.target = "FKiss"; } else { V.target = "FLips"; } return t; -}; \ No newline at end of file +}; diff --git a/src/js/wombJS.js b/src/js/wombJS.js index 9fec5854034c9b95522ff8f856e16cd755f1fca7..8c59bc22dab2981dea568dfdb56713045327ee45 100644 --- a/src/js/wombJS.js +++ b/src/js/wombJS.js @@ -1,4 +1,3 @@ -/* eslint-disable no-undef */ /* This is a womb processor/simulator script. It takes care of calculation of belly sizes based on individual fetus sizes, with full support of broodmothers implant random turning on and off possibility. Also this can be expanded to store more parents data in each individual fetus in future. Design limitations: @@ -24,16 +23,16 @@ $slave.bellyPreg = WombGetWolume($slave) - return double, with current womb volu */ -//Init womb system. -window.WombInit = function (actor) { +// Init womb system. +window.WombInit = function(actor) { let i; if (!Array.isArray(actor.womb)) { - //alert("creating new womb"); //debugging + // alert("creating new womb"); //debugging actor.womb = []; } - //console.log("broodmother:" + typeof actor.broodmother); + // console.log("broodmother:" + typeof actor.broodmother); if (typeof actor.broodmother !== "number") { actor.broodmother = 0; @@ -46,24 +45,24 @@ window.WombInit = function (actor) { if (actor.pregData === undefined) { actor.pregData = clone(setup.pregData.human); - //Setup should be through deep copy, so in future, if we like, these values can be changed individually. Gameplay expansion possibilities. But for dev time to simplify debugging: - //actor.pregData = setup.pregData.human; // any changes in setup pregData template will be applied immediately to all. But can't be made separate changes. + // Setup should be through deep copy, so in future, if we like, these values can be changed individually. Gameplay expansion possibilities. But for dev time to simplify debugging: + // actor.pregData = setup.pregData.human; // any changes in setup pregData template will be applied immediately to all. But can't be made separate changes. } - //backward compatibility setup. Fully accurate for normal pregnancy only. + // backward compatibility setup. Fully accurate for normal pregnancy only. if (actor.womb.length > 0 && actor.womb[0].genetics === undefined && actor.eggType === "human") { i = 0; - actor.womb.forEach(function (ft) { + actor.womb.forEach(function(ft) { ft.genetics = generateGenetics(actor, actor.pregSource, i); i++; }); } else if (actor.womb.length === 0 && actor.pregType > 0 && actor.broodmother === 0) { WombImpregnate(actor, actor.pregType, actor.pregSource, actor.preg); } else if (actor.womb.length === 0 && actor.pregType > 0 && actor.broodmother > 0 && actor.broodmotherOnHold < 1) { - //sorry but for already present broodmothers it's impossible to calculate fully, approximation used. - var pw = actor.preg, + // sorry but for already present broodmothers it's impossible to calculate fully, approximation used. + let pw = actor.preg, bCount, bLeft; - if (pw > actor.pregData.normalBirth) pw = actor.pregData.normalBirth; //to avoid disaster. + if (pw > actor.pregData.normalBirth) pw = actor.pregData.normalBirth; // to avoid disaster. bCount = Math.floor(actor.pregType / pw); bLeft = actor.pregType - (bCount * pw); if (pw > actor.pregType) { @@ -80,27 +79,27 @@ window.WombInit = function (actor) { } }; -window.WombImpregnate = function (actor, fCount, fatherID, age, surrogate) { - var i; - var tf; +window.WombImpregnate = function(actor, fCount, fatherID, age, surrogate) { + let i; + let tf; for (i = 0; i < fCount; i++) { - tf = {}; //new Object - tf.age = age; //initial age - tf.realAge = 1; //initial real age (first week in mother) - tf.fatherID = fatherID; //We can store who is father too. - tf.volume = 1; //Initial, to create property. Updated with actual data after WombGetVolume call. - tf.reserve = ""; //Initial, to create property. Used later to mark if this child is to be kept. - tf.identical = 0; //Initial, to create property. Updated with actual data during fetalSplit call. - tf.splitted = 0; //marker for already splitted fetus. + tf = {}; // new Object + tf.age = age; // initial age + tf.realAge = 1; // initial real age (first week in mother) + tf.fatherID = fatherID; // We can store who is father too. + tf.volume = 1; // Initial, to create property. Updated with actual data after WombGetVolume call. + tf.reserve = ""; // Initial, to create property. Used later to mark if this child is to be kept. + tf.identical = 0; // Initial, to create property. Updated with actual data during fetalSplit call. + tf.splitted = 0; // marker for already splitted fetus. if (surrogate) { - tf.motherID = surrogate.ID; //Initial biological mother ID setup. + tf.motherID = surrogate.ID; // Initial biological mother ID setup. if (actor.eggType === "human") { - tf.genetics = generateGenetics(surrogate, fatherID, i + 1); //Stored genetic information. + tf.genetics = generateGenetics(surrogate, fatherID, i + 1); // Stored genetic information. } } else { - tf.motherID = actor.ID; //Initial biological mother ID setup. + tf.motherID = actor.ID; // Initial biological mother ID setup. if (actor.eggType === "human") { - tf.genetics = generateGenetics(actor, fatherID, i + 1); //Stored genetic information. + tf.genetics = generateGenetics(actor, fatherID, i + 1); // Stored genetic information. } } tf.ID = generateNewID(); @@ -121,27 +120,27 @@ window.WombImpregnate = function (actor, fCount, fatherID, age, surrogate) { MissingParentIDCorrection(actor); }; -window.WombSurrogate = function (actor, fCount, mother, fatherID, age) { +window.WombSurrogate = function(actor, fCount, mother, fatherID, age) { WombImpregnate(actor, fCount, fatherID, age, mother); }; -window.WombImpregnateClone = function (actor, fCount, mother, motherOriginal, age) { - var i; - var tf; +window.WombImpregnateClone = function(actor, fCount, mother, motherOriginal, age) { + let i; + let tf; for (i = 0; i < fCount; i++) { - tf = {}; //new Object - tf.age = age; //initial age - tf.realAge = 1; //initial real age (first week in mother) - tf.fatherID = mother.ID; //We can store who is father too. - tf.volume = 1; //Initial, to create property. Updated with actual data after WombGetVolume call. - tf.reserve = ""; //Initial, to create property. Used later to mark if this child is to be kept. - tf.identical = 0; //Initial, to create property. Updated with actual data during fetalSplit call. - tf.splitted = 0; //marker for already splitted fetus. - tf.motherID = mother.ID; //Initial biological mother ID setup. - tf.genetics = generateGenetics(mother, mother.ID, i + 1); //Stored genetic information. + tf = {}; // new Object + tf.age = age; // initial age + tf.realAge = 1; // initial real age (first week in mother) + tf.fatherID = mother.ID; // We can store who is father too. + tf.volume = 1; // Initial, to create property. Updated with actual data after WombGetVolume call. + tf.reserve = ""; // Initial, to create property. Used later to mark if this child is to be kept. + tf.identical = 0; // Initial, to create property. Updated with actual data during fetalSplit call. + tf.splitted = 0; // marker for already splitted fetus. + tf.motherID = mother.ID; // Initial biological mother ID setup. + tf.genetics = generateGenetics(mother, mother.ID, i + 1); // Stored genetic information. tf.ID = generateNewID(); - //Welcome to having to set up common relatives for the slave and her clone + // Welcome to having to set up common relatives for the slave and her clone if (mother.father === 0 || (mother.father < -1 && mother.father >= -20 && mother.father !== -3)) { mother.father = State.variables.missingParentID; State.variables.missingParentID--; @@ -151,7 +150,7 @@ window.WombImpregnateClone = function (actor, fCount, mother, motherOriginal, ag State.variables.missingParentID--; } - //gene corrections + // gene corrections tf.fatherID = -7; tf.genetics.gender = mother.genes; tf.genetics.mother = mother.mother; @@ -190,7 +189,7 @@ window.WombImpregnateClone = function (actor, fCount, mother, motherOriginal, ag }; // Should be used to set biological age for fetus (ageToAdd), AND chronological (realAgeToAdd). Speed up or slow down gestation drugs should affect ONLY biological. -window.WombProgress = function (actor, ageToAdd, realAgeToAdd = ageToAdd) { +window.WombProgress = function(actor, ageToAdd, realAgeToAdd = ageToAdd) { ageToAdd = Math.ceil(ageToAdd * 10) / 10; realAgeToAdd = Math.ceil(realAgeToAdd * 10) / 10; try { @@ -204,31 +203,31 @@ window.WombProgress = function (actor, ageToAdd, realAgeToAdd = ageToAdd) { } }; -window.WombBirth = function (actor, readyAge) { +window.WombBirth = function(actor, readyAge) { try { - WombSort(actor); //For normal processing fetuses that more old should be first. Now - they are. + WombSort(actor); // For normal processing fetuses that more old should be first. Now - they are. } catch (err) { WombInit(actor); alert("WombBirth warning - " + actor.slaveName + " " + err); } - var birthed = []; - var ready = WombBirthReady(actor, readyAge); - var i; + let birthed = []; + let ready = WombBirthReady(actor, readyAge); + let i; - for (i = 0; i < ready; i++) { //here can't be used "for .. in .." syntax. + for (i = 0; i < ready; i++) { // here can't be used "for .. in .." syntax. birthed.push(actor.womb.shift()); } return birthed; }; -window.WombFlush = function (actor) { +window.WombFlush = function(actor) { actor.womb = []; }; -window.WombBirthReady = function (actor, readyAge) { - var readyCnt = 0; +window.WombBirthReady = function(actor, readyAge) { + let readyCnt = 0; try { readyCnt += actor.womb.filter(ft => ft.age >= readyAge).length; } catch (err) { @@ -240,7 +239,7 @@ window.WombBirthReady = function (actor, readyAge) { return readyCnt; }; -window.WombGetVolume = function (actor) { //most legacy code from pregJS.tw with minor adaptation. +window.WombGetVolume = function(actor) { // most legacy code from pregJS.tw with minor adaptation. if (actor.pregData.sizeType === 0) @@ -275,13 +274,13 @@ window.WombGetVolume = function (actor) { //most legacy code from pregJS.tw with rate = rateMin + (rateOne * cage); csize = (min + (one * cage)); - //console.log("min:"+min+" max:"+max+" ageMin:"+ageMin+" ageMax:"+ageMax+" one:"+one+" rateOne:"+rateOne+" cage:"+cage+" rate:"+rate+" csize:"+csize+" final size:"+csize*rate); + // console.log("min:"+min+" max:"+max+" ageMin:"+ageMin+" ageMax:"+ageMax+" one:"+one+" rateOne:"+rateOne+" cage:"+cage+" rate:"+rate+" csize:"+csize+" final size:"+csize*rate); data.size = csize; data.rate = rate; - return data; //csize * rate; - //maybe not very effective code, but simple and easy to debug. May be optimized more in future. + return data; // csize * rate; + // maybe not very effective code, but simple and easy to debug. May be optimized more in future. } function getVolByLen(actor) { @@ -322,9 +321,9 @@ window.WombGetVolume = function (actor) { //most legacy code from pregJS.tw with ft.volume = ((4 / 3) * (Math.PI) * (phi / 2) * (Math.pow((targetLen / 2), 3))); wombSize += ft.volume; - //oldVol = ((4 / 3) * (Math.PI) * (phi / 2) * (Math.pow((oldLen / 2), 3))); //for debug + // oldVol = ((4 / 3) * (Math.PI) * (phi / 2) * (Math.pow((oldLen / 2), 3))); //for debug - //console.log("fetus.age:" + ft.age + " oldLen:"+oldLen+" targetLen:"+targetLen+" ft.volume:"+ft.volume+ " old volume:"+oldVol ); + // console.log("fetus.age:" + ft.age + " oldLen:"+oldLen+" targetLen:"+targetLen+" ft.volume:"+ft.volume+ " old volume:"+oldVol ); /* I found, that previous targetLen calculation not exactly accurate if compared to the actual medical data chart for fetal length. It's been rough approximation based only on pregnancy week (giving smaller fetus size then it should in most cases). So I need all this debug code to compare data and verify calculations. After final tweaking I will remove or comment out legacy code. Please not touch this before it. Pregmodfan. @@ -334,7 +333,7 @@ window.WombGetVolume = function (actor) { //most legacy code from pregJS.tw with WombInit(actor); alert("WombGetVolume warning - " + actor.slaveName + " " + err); } - if (wombSize < 0) //catch for strange cases, to avoid messing with outside code. + if (wombSize < 0) // catch for strange cases, to avoid messing with outside code. wombSize = 0; return wombSize; @@ -343,8 +342,8 @@ window.WombGetVolume = function (actor) { //most legacy code from pregJS.tw with function getVolByWeight(actor) { - var targetData; - var wombSize = 0; + let targetData; + let wombSize = 0; actor.womb.forEach(ft => { @@ -354,7 +353,7 @@ window.WombGetVolume = function (actor) { //most legacy code from pregJS.tw with }); - if (wombSize < 0) //catch for strange cases, to avoid messing with outside code. + if (wombSize < 0) // catch for strange cases, to avoid messing with outside code. wombSize = 0; return wombSize; @@ -362,8 +361,8 @@ window.WombGetVolume = function (actor) { //most legacy code from pregJS.tw with function getVolByRaw(actor) { - var targetData; - var wombSize = 0; + let targetData; + let wombSize = 0; actor.womb.forEach(ft => { @@ -373,7 +372,7 @@ window.WombGetVolume = function (actor) { //most legacy code from pregJS.tw with }); - if (wombSize < 0) //catch for strange cases, to avoid messing with outside code. + if (wombSize < 0) // catch for strange cases, to avoid messing with outside code. wombSize = 0; return wombSize; @@ -381,7 +380,7 @@ window.WombGetVolume = function (actor) { //most legacy code from pregJS.tw with }; -window.WombUpdatePregVars = function (actor) { +window.WombUpdatePregVars = function(actor) { WombSort(actor); if (actor.womb.length > 0) { if (actor.preg > 0 && actor.womb[0].age > 0) { @@ -392,7 +391,7 @@ window.WombUpdatePregVars = function (actor) { } }; -window.WombMinPreg = function (actor) { +window.WombMinPreg = function(actor) { WombSort(actor); if (actor.womb.length > 0) return actor.womb[actor.womb.length - 1].age; @@ -400,7 +399,7 @@ window.WombMinPreg = function (actor) { return 0; }; -window.WombMaxPreg = function (actor) { +window.WombMaxPreg = function(actor) { WombSort(actor); if (actor.womb.length > 0) return actor.womb[0].age; @@ -408,7 +407,7 @@ window.WombMaxPreg = function (actor) { return 0; }; -window.WombNormalizePreg = function (actor) { +window.WombNormalizePreg = function(actor) { // console.log("New actor: " + actor.slaveName + " ===============" + actor.name); WombInit(actor); @@ -433,7 +432,7 @@ window.WombNormalizePreg = function (actor) { } if (actor.womb.length > 0) { - var max = WombMaxPreg(actor); + let max = WombMaxPreg(actor); // console.log("max: " + max); // console.log(".preg: "+ actor.preg); if (actor.pregWeek < 1) @@ -450,7 +449,7 @@ window.WombNormalizePreg = function (actor) { actor.pregType = actor.womb.length; actor.pregSource = actor.womb[0].fatherID; } else if (actor.womb.length === 0 && actor.broodmother < 1) { - //not broodmother + // not broodmother // console.log("preg fixing"); actor.pregType = 0; actor.pregKnown = 0; @@ -469,7 +468,7 @@ window.WombNormalizePreg = function (actor) { actor.bellyPreg = WombGetVolume(actor); }; -window.WombZeroID = function (actor, id) { +window.WombZeroID = function(actor, id) { WombInit(actor); actor.womb .filter(ft => ft.fatherID === id) @@ -477,7 +476,7 @@ window.WombZeroID = function (actor, id) { WombNormalizePreg(actor); }; -window.WombChangeID = function (actor, fromID, toID) { +window.WombChangeID = function(actor, fromID, toID) { WombInit(actor); actor.womb .filter(ft => ft.fatherID === fromID) @@ -485,7 +484,7 @@ window.WombChangeID = function (actor, fromID, toID) { WombNormalizePreg(actor); }; -window.WombChangeGeneID = function (actor, fromID, toID) { +window.WombChangeGeneID = function(actor, fromID, toID) { WombInit(actor); actor.womb .filter(ft => ft.genetics.father === fromID) @@ -497,17 +496,17 @@ window.WombChangeGeneID = function (actor, fromID, toID) { }; /* Sorts the womb object by age with oldest and thus soonest to be born, first. This will be needed in the future once individual fertilization is a possibility.*/ -window.WombSort = function (actor) { +window.WombSort = function(actor) { actor.womb.sort((a, b) => { return b.age - a.age; }); }; -//now function work with chance. Literary we give it "one from X" as chance. -window.fetalSplit = function (actor, chance) { - var nft; +// now function work with chance. Literary we give it "one from X" as chance. +window.fetalSplit = function(actor, chance) { + let nft; - actor.womb.forEach(function (s) { + actor.womb.forEach(function(s) { if ((jsRandom(1, chance) >= chance) && s.splitted !== 1) { nft = {}; nft.age = s.age; @@ -515,11 +514,11 @@ window.fetalSplit = function (actor, chance) { nft.fatherID = s.fatherID; nft.motherID = s.motherID; nft.volume = s.volume; - nft.reserve = ""; //splitted fetus is new separate, reserve - it's not genetic to split. + nft.reserve = ""; // splitted fetus is new separate, reserve - it's not genetic to split. nft.genetics = clone(s.genetics); - s.splitted = 1; //this is marker that this is already splitted fetus (to not split second time in loop), only source fetus needed it. - nft.identical = 1; //this is marker that this fetus has at least one twin. - s.identical = 1; //this is marker that this fetus has at least one twin. + s.splitted = 1; // this is marker that this is already splitted fetus (to not split second time in loop), only source fetus needed it. + nft.identical = 1; // this is marker that this fetus has at least one twin. + s.identical = 1; // this is marker that this fetus has at least one twin. if (s.twinID === "" || s.twinID === undefined) s.twinID = generateNewID(); @@ -533,14 +532,14 @@ window.fetalSplit = function (actor, chance) { WombNormalizePreg(actor); }; -//safe alternative to .womb.length. -window.WombFetusCount = function (actor) { +// safe alternative to .womb.length. +window.WombFetusCount = function(actor) { WombInit(actor); return actor.womb.length; }; -//give reference to fetus object, but not remove fetus, use for manipulation in the womb. -window.WombGetFetus = function (actor, fetusNum) { +// give reference to fetus object, but not remove fetus, use for manipulation in the womb. +window.WombGetFetus = function(actor, fetusNum) { WombInit(actor); if (actor.womb.length >= fetusNum) return actor.womb[fetusNum]; @@ -548,8 +547,8 @@ window.WombGetFetus = function (actor, fetusNum) { return null; }; -//give reference to fetus object, and remove it form the womb. -window.WombRemoveFetus = function (actor, fetusNum) { +// give reference to fetus object, and remove it form the womb. +window.WombRemoveFetus = function(actor, fetusNum) { WombInit(actor); if (actor.womb.length >= fetusNum) { let ft = actor.womb[fetusNum]; @@ -561,27 +560,27 @@ window.WombRemoveFetus = function (actor, fetusNum) { return null; }; -/*to add fetus object in the womb. Be warned - you can add one single fetus to many wombs, or even add it many times to one womb. It will not show error, but behavior becomes strange, as fetus object will be the same - it's reference, not full copies. If this is not desired - use clone() on fetus before adding.*/ -window.WombAddFetus = function (actor, fetus) { +/* to add fetus object in the womb. Be warned - you can add one single fetus to many wombs, or even add it many times to one womb. It will not show error, but behavior becomes strange, as fetus object will be the same - it's reference, not full copies. If this is not desired - use clone() on fetus before adding.*/ +window.WombAddFetus = function(actor, fetus) { WombInit(actor); actor.womb.push(fetus); WombSort(actor); }; // change property for all fetuses. Like fetus.age = X. -window.WombChangeFetus = function (actor, propName, newValue) { +window.WombChangeFetus = function(actor, propName, newValue) { WombInit(actor); actor.womb.forEach(ft => ft[propName] = newValue); }; // change genetic property of all fetuses. Like fetus.genetic.intelligence = X -window.WombChangeGene = function (actor, geneName, newValue) { +window.WombChangeGene = function(actor, geneName, newValue) { WombInit(actor); actor.womb.forEach(ft => ft.genetics[geneName] = newValue); }; // change genetic property of all fetuses based on race -window.WombFatherRace = function (actor, raceName) { +window.WombFatherRace = function(actor, raceName) { let skinColor = randomRaceSkin(raceName); let eyeColor = randomRaceEye(raceName); let hairColor = randomRaceHair(raceName); @@ -592,7 +591,7 @@ window.WombFatherRace = function (actor, raceName) { }; // replaces untraceable fatherIDs with missingParentID. Required for concurrent pregnancy to differentiate between siblings. -window.MissingParentIDCorrection = function (actor) { +window.MissingParentIDCorrection = function(actor) { WombInit(actor); actor.womb .filter(ft => (ft.genetics.father === 0 || (ft.genetics.father < -1 && ft.genetics.father >= -20 && ft.genetics.father !== -3))) @@ -600,11 +599,11 @@ window.MissingParentIDCorrection = function (actor) { State.variables.missingParentID--; }; -window.WombCleanYYFetuses = function (actor) { - var reserved = []; +window.WombCleanYYFetuses = function(actor) { + let reserved = []; - var i = actor.womb.length - 1; - var ft; + let i = actor.womb.length - 1; + let ft; while (i >= 0) { ft = actor.womb[i]; @@ -621,21 +620,21 @@ window.WombCleanYYFetuses = function (actor) { return reserved; }; -window.FetusGlobalReserveCount = function (reserveType) { - var cnt = 0; - var SV = State.variables; +window.FetusGlobalReserveCount = function(reserveType) { + let cnt = 0; + let SV = State.variables; if (typeof reserveType !== 'string') return 0; - SV.slaves.forEach(function (slave) { - slave.womb.forEach(function (ft) { + SV.slaves.forEach(function(slave) { + slave.womb.forEach(function(ft) { if (ft.reserve === reserveType) cnt++; }); }); - SV.PC.womb.forEach(function (ft) { + SV.PC.womb.forEach(function(ft) { if (ft.reserve === reserveType) cnt++; }); @@ -643,12 +642,12 @@ window.FetusGlobalReserveCount = function (reserveType) { return cnt; }; -window.WombSetGenericReserve = function (actor, type, count) { - //console.log ("actor: " + actor + " type: " + type + " typeof: " + typeof type + " count: " + count); - actor.womb.forEach(function (ft) { - //console.log (" type: " + ft.reserve + " typeof: " + typeof ft.reserve); +window.WombSetGenericReserve = function(actor, type, count) { + // console.log ("actor: " + actor + " type: " + type + " typeof: " + typeof type + " count: " + count); + actor.womb.forEach(function(ft) { + // console.log (" type: " + ft.reserve + " typeof: " + typeof ft.reserve); if ((ft.reserve === "" || ft.reserve === type) && count > 0) { - //console.log ("!trigger"); + // console.log ("!trigger"); ft.reserve = type; count--; } @@ -656,15 +655,15 @@ window.WombSetGenericReserve = function (actor, type, count) { }); }; -window.WombAddToGenericReserve = function (actor, type, count) { +window.WombAddToGenericReserve = function(actor, type, count) { WombSetGenericReserve(actor, type, (WombReserveCount(actor, type) + count)); }; -window.WombChangeReserveType = function (actor, oldType, newType) { - var count = 0; +window.WombChangeReserveType = function(actor, oldType, newType) { + let count = 0; - actor.womb.forEach(function (ft) { + actor.womb.forEach(function(ft) { if (ft.reserve === oldType) { ft.reserve = newType; count++; @@ -674,8 +673,8 @@ window.WombChangeReserveType = function (actor, oldType, newType) { return count; }; -window.WombCleanGenericReserve = function (actor, type, count) { - actor.womb.forEach(function (ft) { +window.WombCleanGenericReserve = function(actor, type, count) { + actor.womb.forEach(function(ft) { if (ft.reserve === type && count > 0) { ft.reserve = ""; @@ -685,11 +684,11 @@ window.WombCleanGenericReserve = function (actor, type, count) { }); }; -window.WombReserveCount = function (actor, type) { +window.WombReserveCount = function(actor, type) { - var cnt = 0; + let cnt = 0; - actor.womb.forEach(function (ft) { + actor.womb.forEach(function(ft) { if (ft.reserve === type) /* the lazy equality will catch "" case */ { cnt++; @@ -700,10 +699,10 @@ window.WombReserveCount = function (actor, type) { return cnt; }; -window.WombGetReservedFetuses = function (actor, type) { - var reserved = []; +window.WombGetReservedFetuses = function(actor, type) { + let reserved = []; - actor.womb.forEach(function (ft) { + actor.womb.forEach(function(ft) { if (ft.reserve === type) { reserved.push(ft); @@ -714,11 +713,11 @@ window.WombGetReservedFetuses = function (actor, type) { return reserved; }; -window.WombRemoveReservedFetuses = function (actor, type) { - var reserved = []; +window.WombRemoveReservedFetuses = function(actor, type) { + let reserved = []; - var i = actor.womb.length - 1; - var ft; + let i = actor.womb.length - 1; + let ft; while (i >= 0) { ft = actor.womb[i]; @@ -734,9 +733,9 @@ window.WombRemoveReservedFetuses = function (actor, type) { return reserved; }; -window.WombCleanAllReserve = function (actor) { +window.WombCleanAllReserve = function(actor) { - actor.womb.forEach(function (ft) { + actor.womb.forEach(function(ft) { ft.reserve = ""; }); @@ -758,23 +757,23 @@ She is _wd.litters[0] weeks pregnant with her first set of _wd.countLitter[0] ch In summary she carry _wd.litters.length separate sets of children. Her most progressed fetus of second pregnancy is already reached _wd.litterData[1][0].age biological week of gestation. --- */ -window.WombGetLittersData = function (actor) { - var data = {}; - var unicLiters = []; //array with realAges of separate litters. - var countLitter = []; - var litterData = []; - var tmp; - - //in first place we need to know how many litters here (Assuming that unique litter is have similar .realAge). Also we will know their ages. - actor.womb.forEach(function (ft) { +window.WombGetLittersData = function(actor) { + let data = {}; + let unicLiters = []; // array with realAges of separate litters. + let countLitter = []; + let litterData = []; + let tmp; + + // in first place we need to know how many litters here (Assuming that unique litter is have similar .realAge). Also we will know their ages. + actor.womb.forEach(function(ft) { if (!unicLiters.includes(Math.ceil(ft.realAge))) unicLiters.push(Math.ceil(ft.realAge)); }); - //now we should find and store separate litters data (count of fetuses): - unicLiters.forEach(function (litter, i) { - tmp = actor.womb.filter(ft => Math.ceil(ft.realAge) == litter); + // now we should find and store separate litters data (count of fetuses): + unicLiters.forEach(function(litter) { + tmp = actor.womb.filter(ft => Math.ceil(ft.realAge) === litter); countLitter.push(tmp.length); litterData.push(tmp); }); @@ -786,28 +785,28 @@ window.WombGetLittersData = function (actor) { return data; }; -window.BCReserveInit = function () { - var SV = State.variables; +window.BCReserveInit = function() { + let SV = State.variables; - SV.slaves.forEach(function (slave) { - slave.womb.forEach(function (ft) { + SV.slaves.forEach(function(slave) { + slave.womb.forEach(function(ft) { if (typeof ft.reserve !== 'string') ft.reserve = ""; - if (typeof ft.motherID !== 'number') //setting missing biological mother ID for fetus. + if (typeof ft.motherID !== 'number') // setting missing biological mother ID for fetus. ft.motherID = slave.ID; if (ft.ID === undefined) ft.ID = generateNewID(); - if (typeof ft.realAge !== 'number') //setting missing chronological age + if (typeof ft.realAge !== 'number') // setting missing chronological age ft.realAge = ft.age; }); }); - SV.PC.womb.forEach(function (ft) { + SV.PC.womb.forEach(function(ft) { if (typeof ft.reserve !== 'string') ft.reserve = ""; if (typeof ft.motherID !== 'number') ft.motherID = SV.PC.ID; - if (typeof ft.realAge !== 'number') //setting missing chronological age + if (typeof ft.realAge !== 'number') // setting missing chronological age ft.realAge = ft.age; }); @@ -816,7 +815,7 @@ window.BCReserveInit = function () { /* alt window.fetalSplit = function(actor, chance) { - var i, ft, nft; + let i, ft, nft; actor.womb.forEach(function(s){ if ((jsRandom(1,chance) >= chance) && s.identical !== 1) diff --git a/src/uncategorized/BackwardsCompatibility.tw b/src/uncategorized/BackwardsCompatibility.tw index 773bdd0de9664163889a7af819d59e5ee5dc561c..2fe2b72df3881cc8211cb8ab165bb14e3340ec6d 100644 --- a/src/uncategorized/BackwardsCompatibility.tw +++ b/src/uncategorized/BackwardsCompatibility.tw @@ -233,9 +233,7 @@ <<unset $customValue>> <</if>> <<if ndef $tabChoice>> - <<set $tabChoice = { - Main: "all" - }>> + <<set $tabChoice = {Main: "all"}>> <</if>> /* pregmod stuff */ @@ -3799,7 +3797,7 @@ Done! <<if ndef $prosthetics>> <<if ndef $stockpile>> <<set $prosthetics = {}>> - <<run setup.prostheticIDs.forEach(function (id) { + <<run setup.prostheticIDs.forEach(function(id) { $prosthetics[id] = {amount: 0, research: 0}; })>> <<else>> diff --git a/src/uncategorized/costsWidgets.tw b/src/uncategorized/costsWidgets.tw index fd33a509e5336b256d4b3687cc6e3df3bbca6398..22ec2b669732ffad0e17d9d0b7ab4b680473584e 100644 --- a/src/uncategorized/costsWidgets.tw +++ b/src/uncategorized/costsWidgets.tw @@ -511,7 +511,7 @@ <<widget "setupLastWeeksCash">> /* Feel free to add categories. Just make sure to display them in costsBudget.tw as well! */ <<set $lastWeeksCashIncome = { -/*Slave Jobs*/ +/* Slave Jobs */ whore: 0, whoreBrothel: 0, rest: 0, @@ -529,7 +529,7 @@ porn: 0, recruiter: 0, -/*Slaves in general*/ +/* Slaves in general */ fuckdolls: 0, menialTrades: 0, menialBioreactors: 0, diff --git a/src/uncategorized/reMalefactor.tw b/src/uncategorized/reMalefactor.tw index 59a0e199416685d2ba2b88890a33a012c3aa56e8..7e5748627ca768014833e7451364ca084750902f 100644 --- a/src/uncategorized/reMalefactor.tw +++ b/src/uncategorized/reMalefactor.tw @@ -509,7 +509,7 @@ $He is easily taken into custody and $his contraband confiscated once the jeerin <<case "liberator">> You complete the legalities and biometric scanning quickly and cautiously. The condemned resists installation in $dairyName with energy born of desperation. The public @@.green;accepts@@ this as an appropriate punishment, especially when you release footage of the criminal's <<if ($dairyPregSetting > 1) && ($activeSlave.vagina > 0)>>discomfort as $his pussy adapts to industrial reproduction<<elseif $dairyStimulatorsSetting > 1>>discomfort as $his anus adapts to accommodate rectal dildo hydration<<else>>breasts as they are roughly milked<</if>>, together with a report on the likely productivity of such a fit body capable of withstanding the stress of high throughput. <<case "passfail">> - You complete the legalities and biometric scanning quickly. The condemned is too weak to resist as $he is installed in $dairyName but $he weeps the entire time. The public @@.green;accepts@@ this as an appropriate punishment, especially when you release footage of the criminal's <<<if ($dairyPregSetting > 1) && ($activeSlave.vagina > 0)>>discomfort as $his pussy adapts to industrial reproduction<<elseif $dairyStimulatorsSetting > 1>>discomfort as $his anus adapts to accommodate rectal dildo hydration<<else>>breasts as they are roughly milked<</if>. + You complete the legalities and biometric scanning quickly. The condemned is too weak to resist as $he is installed in $dairyName but $he weeps the entire time. The public @@.green;accepts@@ this as an appropriate punishment, especially when you release footage of the criminal's <<if ($dairyPregSetting > 1) && ($activeSlave.vagina > 0)>>discomfort as $his pussy adapts to industrial reproduction<<elseif $dairyStimulatorsSetting > 1>>discomfort as $his anus adapts to accommodate rectal dildo hydration<<else>>breasts as they are roughly milked<</if>>. <</switch>> <<run repX(250, "event", $activeSlave)>> <<run newSlave($activeSlave)>> /* skip New Slave Intro */ diff --git a/src/uncategorized/slaveSummary.tw b/src/uncategorized/slaveSummary.tw index 3264fbbead5df3a1047ccceff7770912e09efe57..8a44cf7adebb039456ac43659b3fde964399ee12 100644 --- a/src/uncategorized/slaveSummary.tw +++ b/src/uncategorized/slaveSummary.tw @@ -3,7 +3,7 @@ <<print App.UI.slaveSummaryList(passage())>> <<run $(document).one(':passagedisplay', function() { - $("[data-quick-index]").click(function () { + $("[data-quick-index]").click(function() { let which = this.attributes["data-quick-index"].value; let quick = $("div#list_index" + which); quick.toggleClass("hidden");