From 3e3945461d0be9d0be863211f542559fa09203ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Fri, 9 Apr 2021 15:53:33 +0200 Subject: [PATCH] Show buildings left till achievement in tooltip #4 --- CookieMonster.js | 2 +- dist/CookieMonster.js | 2 +- dist/CookieMonster.js.map | 2 +- .../AllAmountTillNextAchievement.js | 26 +++++++++++++++++++ .../IndividualAmountTillNextAchievement.js | 13 ++++++++++ src/Cache/VariablesAndData.js | 1 + src/Disp/Tooltips/CreateTooltip.js | 14 +++++++--- src/Disp/Tooltips/TypesOfTooltips/Building.js | 26 ++++++++++++++----- src/Main/LoopHook.js | 3 +++ 9 files changed, 77 insertions(+), 12 deletions(-) create mode 100644 src/Cache/TillNextAchievement/AllAmountTillNextAchievement.js create mode 100644 src/Cache/TillNextAchievement/IndividualAmountTillNextAchievement.js diff --git a/CookieMonster.js b/CookieMonster.js index 5ed776f..f694bd8 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -1,2 +1,2 @@ /*! For license information please see CookieMonster.js.LICENSE.txt */ -(()=>{var e={877:function(e){!function(t,o){"use strict";"object"!=typeof e.exports?o(t):e.exports=t.document?o(t):function(e){if(!e.document)throw new Error("jscolor needs a window with document");return o(e)}}("undefined"!=typeof window?window:this,(function(e){"use strict";var t,o,n,i,a=((i={initialized:!1,instances:[],readyQueue:[],register:function(){void 0!==e&&e.document&&e.document.addEventListener("DOMContentLoaded",i.pub.init,!1)},installBySelector:function(t,o){if(!(o=o?i.node(o):e.document))throw new Error("Missing root node");for(var n=o.querySelectorAll(t),a=new RegExp("(^|\\s)("+i.pub.lookupClass+")(\\s*(\\{[^}]*\\})|\\s|$)","i"),r=0;r-1},isButtonEmpty:function(e){switch(i.nodeName(e)){case"input":return!e.value||""===e.value.trim();case"button":return""===e.textContent.trim()}return null},isPassiveEventSupported:function(){var t=!1;try{var o=Object.defineProperty({},"passive",{get:function(){t=!0}});e.addEventListener("testPassive",null,o),e.removeEventListener("testPassive",null,o)}catch(e){}return t}(),isColorAttrSupported:(n=e.document.createElement("input"),!(!n.setAttribute||(n.setAttribute("type","color"),"color"!=n.type.toLowerCase()))),dataProp:"_data_jscolor",setData:function(){var e=arguments[0];if(3===arguments.length){var t=e.hasOwnProperty(i.dataProp)?e[i.dataProp]:e[i.dataProp]={},o=arguments[2];return t[a=arguments[1]]=o,!0}if(2===arguments.length&&"object"==typeof arguments[1]){t=e.hasOwnProperty(i.dataProp)?e[i.dataProp]:e[i.dataProp]={};var n=arguments[1];for(var a in n)n.hasOwnProperty(a)&&(t[a]=n[a]);return!0}throw new Error("Invalid arguments")},removeData:function(){var e=arguments[0];if(!e.hasOwnProperty(i.dataProp))return!0;for(var t=1;t=3&&(n=l[0].match(s))&&(i=l[1].match(s))&&(a=l[2].match(s)))return o.format="rgb",o.rgba=[parseFloat(n[1])||0,parseFloat(i[1])||0,parseFloat(a[1])||0,null],l.length>=4&&(r=l[3].match(s))&&(o.format="rgba",o.rgba[3]=parseFloat(r[1])||0),o}return!1},parsePaletteValue:function(e){var t=[];"string"==typeof e?e.replace(/#[0-9A-F]{3}([0-9A-F]{3})?|rgba?\(([^)]*)\)/gi,(function(e){t.push(e)})):Array.isArray(e)&&(t=e);for(var o=[],n=0;ns[n]&&-t[n]+e[n]+l[n]/2>s[n]/2&&e[n]+l[n]-d[n]>=0?e[n]+l[n]-d[n]:e[n],-t[a]+e[a]+l[a]+d[a]-p+p*r>s[a]?-t[a]+e[a]+l[a]/2>s[a]/2&&e[a]+l[a]-p-p*r>=0?e[a]+l[a]-p-p*r:e[a]+l[a]-p+p*r:e[a]+l[a]-p+p*r>=0?e[a]+l[a]-p+p*r:e[a]+l[a]-p-p*r];else var u=[e[n],e[a]+l[a]-p+p*r];var m=u[n],h=u[a],g=o.fixed?"fixed":"absolute",f=(u[0]+d[0]>e[0]||u[0]0?Math.ceil(l/o):0,i=Math.max(1,Math.floor((t-(o-1)*e.paletteSpacing)/o)),a=e.paletteHeight?Math.min(e.paletteHeight,i):i),n&&(r=n*a+(n-1)*e.paletteSpacing),{cols:o,rows:n,cellW:i,cellH:a,width:t,height:r}},getControlPadding:function(e){return Math.max(e.padding/2,2*e.pointerBorderWidth+e.pointerThickness-e.controlBorderWidth)},getPadYChannel:function(e){switch(e.mode.charAt(1).toLowerCase()){case"v":return"v"}return"s"},getSliderChannel:function(e){if(e.mode.length>2)switch(e.mode.charAt(2).toLowerCase()){case"s":return"s";case"v":return"v"}return null},triggerCallback:function(e,t){if(e[t]){var o=null;if("string"==typeof e[t])try{o=new Function(e[t])}catch(e){console.error(e)}else o=e[t];o&&o.call(e)}},triggerGlobal:function(e){for(var t=i.getInstances(),o=0;o0)for(var c=0;c=2&&"string"==typeof arguments[0]){try{if(!a(arguments[0],arguments[1]))return!1}catch(e){return console.warn(e),!1}return this.redraw(),this.exposeColor(),!0}if(1===arguments.length&&"object"==typeof arguments[0]){var e=arguments[0],t=!0;for(var o in e)if(e.hasOwnProperty(o))try{a(o,e[o])||(t=!1)}catch(e){console.warn(e),t=!1}return this.redraw(),this.exposeColor(),t}throw new Error("Invalid arguments")},this.channel=function(e,t){if("string"!=typeof e)throw new Error("Invalid value for channel name: "+e);if(void 0===t)return this.channels.hasOwnProperty(e.toLowerCase())?this.channels[e.toLowerCase()]:(console.warn("Getting unknown channel: "+e),!1);var o=!1;switch(e.toLowerCase()){case"r":o=this.fromRGBA(t,null,null,null);break;case"g":o=this.fromRGBA(null,t,null,null);break;case"b":o=this.fromRGBA(null,null,t,null);break;case"h":o=this.fromHSVA(t,null,null,null);break;case"s":o=this.fromHSVA(null,t,null,null);break;case"v":o=this.fromHSVA(null,null,t,null);break;case"a":o=this.fromHSVA(null,null,null,t);break;default:return console.warn("Setting unknown channel: "+e),!1}return!!o&&(this.redraw(),!0)},this.trigger=function(e){for(var t=i.strList(e),o=0;o127.5},this.hide=function(){p()&&(i.removeClass(n.targetElement,i.pub.activeClassName),i.picker.wrap.parentNode.removeChild(i.picker.wrap),delete i.picker.owner)},this.show=function(){l()},this.redraw=function(){p()&&l()},this.getFormat=function(){return this._currentFormat},this._setFormat=function(e){this._currentFormat=e.toLowerCase()},this.hasAlphaChannel=function(){return"auto"===this.alphaChannel?"any"===this.format.toLowerCase()||i.isAlphaFormat(this.getFormat())||void 0!==this.alpha||void 0!==this.alphaElement:this.alphaChannel},this.processValueInput=function(e){this.fromString(e)||this.exposeColor()},this.processAlphaInput=function(e){this.fromHSVA(null,null,null,parseFloat(e))||this.exposeColor()},this.exposeColor=function(e){var t=this.toString(),o=this.getFormat();if(i.setDataAttr(this.targetElement,"current-color",t),e&i.flags.leaveValue||!this.valueElement||("hex"!==o&&"hexa"!==o||(this.uppercase||(t=t.toLowerCase()),this.hash||(t=t.replace(/^#/,""))),this.setValueElementValue(t)),!(e&i.flags.leaveAlpha)&&this.alphaElement){var n=Math.round(100*this.channels.a)/100;this.setAlphaElementValue(n)}e&i.flags.leavePreview||!this.previewElement||((i.isTextInput(this.previewElement)||i.isButton(this.previewElement)&&!i.isButtonEmpty(this.previewElement))&&this.previewPosition,this.setPreviewElementBg(this.toRGBAString())),p()&&(s(),c(),d())},this.setPreviewElementBg=function(e){if(this.previewElement){var t=null,o=null;(i.isTextInput(this.previewElement)||i.isButton(this.previewElement)&&!i.isButtonEmpty(this.previewElement))&&(t=this.previewPosition,o=this.previewSize);var n=[];if(e){n.push({image:i.genColorPreviewGradient(e,t,o?o-i.pub.previewSeparator.length:null),position:"left top",size:"auto",repeat:t?"repeat-y":"repeat",origin:"padding-box"});var a=i.genColorPreviewCanvas("rgba(0,0,0,0)",t?{left:"right",right:"left"}[t]:null,o,!0);n.push({image:"url('"+a.canvas.toDataURL()+"')",position:(t||"left")+" top",size:a.width+"px "+a.height+"px",repeat:t?"repeat-y":"repeat",origin:"padding-box"})}else n.push({image:"none",position:"left top",size:"auto",repeat:"no-repeat",origin:"padding-box"});for(var r={image:[],position:[],size:[],repeat:[],origin:[]},l=0;l=0;h-=1){var g=m[h];if(g)if(i.pub.presets.hasOwnProperty(g)){for(var u in i.pub.presets[g])if(i.pub.presets[g].hasOwnProperty(u))try{a(u,i.pub.presets[g][u])}catch(e){console.warn(e)}}else console.warn("Unknown preset: %s",g)}var f=["preset"];for(var u in o)if(o.hasOwnProperty(u)&&-1===f.indexOf(u))try{a(u,o[u])}catch(e){console.warn(e)}if(void 0===this.container?this.container=e.document.body:this.container=i.node(this.container),!this.container)throw new Error("Cannot instantiate color picker without a container element");if(this.targetElement=i.node(t),!this.targetElement){if("string"==typeof t&&/^[a-zA-Z][\w:.-]*$/.test(t))throw new Error("If '"+t+"' is supposed to be an ID, please use '#"+t+"' or any valid CSS selector.");throw new Error("Cannot instantiate color picker without a target element")}if(this.targetElement.jscolor&&this.targetElement.jscolor instanceof i.pub)throw new Error("Color picker already installed on this element");if(this.targetElement.jscolor=this,i.addClass(this.targetElement,i.pub.className),i.instances.push(this),i.isButton(this.targetElement)&&("button"!==this.targetElement.type.toLowerCase()&&(this.targetElement.type="button"),i.isButtonEmpty(this.targetElement))){i.removeChildren(this.targetElement),this.targetElement.appendChild(e.document.createTextNode(" "));var C=i.getCompStyle(this.targetElement);(parseFloat(C["min-width"])||0)-1){var G=i.parseColorString(b);this._currentFormat=G?G.format:"hex"}else this._currentFormat=this.format.toLowerCase();this.processValueInput(b),void 0!==k&&this.processAlphaInput(k)}}).pub.className="jscolor",i.pub.activeClassName="jscolor-active",i.pub.looseJSON=!0,i.pub.presets={},i.pub.presets.default={},i.pub.presets.light={backgroundColor:"rgba(255,255,255,1)",controlBorderColor:"rgba(187,187,187,1)",buttonColor:"rgba(0,0,0,1)"},i.pub.presets.dark={backgroundColor:"rgba(51,51,51,1)",controlBorderColor:"rgba(153,153,153,1)",buttonColor:"rgba(240,240,240,1)"},i.pub.presets.small={width:101,height:101,padding:10,sliderSize:14,paletteCols:8},i.pub.presets.medium={width:181,height:101,padding:12,sliderSize:16,paletteCols:10},i.pub.presets.large={width:271,height:151,padding:12,sliderSize:24,paletteCols:15},i.pub.presets.thin={borderWidth:1,controlBorderWidth:1,pointerBorderWidth:1},i.pub.presets.thick={borderWidth:2,controlBorderWidth:2,pointerBorderWidth:2},i.pub.sliderInnerSpace=3,i.pub.chessboardSize=8,i.pub.chessboardColor1="#666666",i.pub.chessboardColor2="#999999",i.pub.previewSeparator=["rgba(255,255,255,.65)","rgba(128,128,128,.65)"],i.pub.init=function(){if(!i.initialized)for(e.document.addEventListener("mousedown",i.onDocumentMouseDown,!1),e.document.addEventListener("keyup",i.onDocumentKeyUp,!1),e.addEventListener("resize",i.onWindowResize,!1),e.addEventListener("scroll",i.onWindowScroll,!1),i.pub.install(),i.initialized=!0;i.readyQueue.length;)i.readyQueue.shift()()},i.pub.install=function(e){var t=!0;try{i.installBySelector("[data-jscolor]",e)}catch(e){t=!1,console.warn(e)}if(i.pub.lookupClass)try{i.installBySelector("input."+i.pub.lookupClass+", button."+i.pub.lookupClass,e)}catch(e){}return t},i.pub.ready=function(e){return"function"!=typeof e?(console.warn("Passed value is not a function"),!1):(i.initialized?e():i.readyQueue.push(e),!0)},i.pub.trigger=function(e){var t=function(){i.triggerGlobal(e)};i.initialized?t():i.pub.ready(t)},i.pub.hide=function(){i.picker&&i.picker.owner&&i.picker.owner.hide()},i.pub.chessboard=function(e){return e||(e="rgba(0,0,0,0)"),i.genColorPreviewCanvas(e).canvas.toDataURL()},i.pub.background=function(e){var t=[];t.push(i.genColorPreviewGradient(e));var o=i.genColorPreviewCanvas();return t.push(["url('"+o.canvas.toDataURL()+"')","left top","repeat"].join(" ")),t.join(", ")},i.pub.options={},i.pub.lookupClass="jscolor",i.pub.installByClassName=function(){return console.error('jscolor.installByClassName() is DEPRECATED. Use data-jscolor="" attribute instead of a class name.'+i.docsRef),!1},i.register(),i.pub);return void 0===e.jscolor&&(e.jscolor=e.JSColor=a),a}))}},t={};function o(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,o),a.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";let e={};function t(){e.WrinklerButtons&&Game.elderWrath?(l("PopAllNormalWrinklerButton").style.display="",l("PopFattestWrinklerButton").style.display=""):(l("PopAllNormalWrinklerButton").style.display="none",l("PopFattestWrinklerButton").style.display="none")}const n=["","","M","G","T","P","E","Z","Y"],i=["","","M","B","Tr","Quadr","Quint","Sext","Sept","Oct","Non","Dec","Undec","Duodec","Tredec","Quattuordec","Quindec","Sexdec","Septendec","Octodec","Novemdec","Vigint","Unvigint","Duovigint","Trevigint","Quattuorvigint"],a=["","K","M","B","T","Qa","Qi","Sx","Sp","Oc","No","De","UDe","DDe","TDe","QaDe","QiDe","SxDe","SpDe","ODe","NDe","Vi","UVi","DVi","TVi","QaVi","QiVi","SxVi","SpVi","OVi","NVi","Tr","UTr","DTr","TTr","QaTr","QiTr","SxTr","SpTr","OTr","NTr","Qaa","UQa","DQa","TQa","QaQa","QiQa","SxQa","SpQa","OQa","NQa","Qia","UQi","DQi","TQi","QaQi","QiQi","SxQi","SpQi","OQi","NQi","Sxa","USx","DSx","TSx","QaSx","QiSx","SxSx","SpSx","OSx","NSx","Spa","USp","DSp","TSp","QaSp","QiSp","SxSp","SpSp","OSp","NSp","Oco","UOc","DOc","TOc","QaOc","QiOc","SxOc","SpOc","OOc","NOc","Noa","UNo","DNo","TNo","QaNo","QiNo","SxNo","SpNo","ONo","NNo","Ct","UCt"];let r,s,c,d,p,u,m,h,g,f,C,y,b,k,G,v,w,x=[],T=[],M=[],S={},B=Date.now(),P=Date.now();const E="CMText",N="CMBack",O="Blue",F="Green",W="Yellow",L="Orange",A="Red",j="Purple",D="Gray",H="Pink",U="Brown",$=[D,O,F,W,L,A,j,H,U],R=[["GoldCookTooltipPlaceholder","Calculated with Golden Switch off","200px"],["GoldCookDragonsFortuneTooltipPlaceholder","Calculated with Golden Switch off and at least one golden cookie on-screen","240px"],["PrestMaxTooltipPlaceholder","The MAX prestige is calculated with the cookies gained from popping all wrinklers with Skruuia god in Diamond slot, selling all stock market goods, selling all buildings with Earth Shatterer and Reality Bending auras, and buying Chocolate egg","320px"],["NextPrestTooltipPlaceholder","Calculated with cookies gained from wrinklers and Chocolate egg","200px"],["HeavenChipMaxTooltipPlaceholder","The MAX heavenly chips is calculated with the cookies gained from popping all wrinklers with Skruuia god in Diamond slot, selling all stock market goods, selling all buildings with Earth Shatterer and Reality Bending auras, and buying Chocolate egg","330px"],["ResetTooltipPlaceholder","The bonus income you would get from new prestige levels unlocked at 100% of its potential and from ascension achievements if you have the same buildings/upgrades after reset","370px"],["ChoEggTooltipPlaceholder","The amount of cookies you would get from popping all wrinklers with Skruuia god in Diamond slot, selling all stock market goods, selling all buildings with Earth Shatterer and Reality Bending auras, and then buying Chocolate egg","300px"],["ChainNextLevelPlaceholder","Cheated cookies might break this formula","250px"],["FavouriteSettingPlaceholder","Click to set this setting as favourite and show it in 'favourite' settings at the top of the Cookie Monster Settings","250px"]],I={};let z,V,_=0,Q=-1,X=[],q=1,Y=1,K=1;const J=[10,15,30,60,300,600,900,1800],Z=[1,5,10,15,30],ee={Frenzy:W,"Dragon Harvest":U,"Elder frenzy":F,Clot:A,"Click frenzy":O,Dragonflight:H};let te,oe,ne,ie,ae,re,le,se={},ce="",de=[];function pe(t,o,r){const l=e.ScaleDecimals+1;if(t===1/0)return"Infinity";if(void 0===t)return"0";if(0===e.Scale)return S.Beautify(t,o);if(Number.isFinite(t)){if(t<0)return`-${pe(Math.abs(t))}`;let s="";if(0===t)return t.toString();if(t>.001&&t=.01&&t=.01&&t=.01&&t315576e4)return"XX:XX:XX:XX:XX";c+=(i<10?"0":"")+i+":",c+=(a<10?"0":"")+a+":",c+=(r<10?"0":"")+r+":",c+=(l<10?"0":"")+l+":",c+=(s<10?"0":"")+s}else{if(n>7776e5)return o?"Over 9000 days!":">9000d";c+=i>0?i+(o?1===i?" year":" years":"y")+", ":"",c+=a>0?a+(o?1===a?" day":" days":"d")+", ":"",(c.length>0||r>0)&&(c+=r+(o?1===r?" hour":" hours":"h")+", "),(c.length>0||l>0)&&(c+=l+(o?1===l?" minute":" minutes":"m")+", "),c+=s+(o?1===s?" second":" seconds":"s")}return c}function me(t){let o,n;return t<=0?(n=e.TimeFormat?"00:00:00:00:00":"Done!",o=F):(n=ue(t),o=t>300?A:t>60?L:W),{text:n,color:o}}let he,ge,fe,Ce,ye,be,ke,Ge,ve,we,xe,Te,Me,Se,Be,Pe,Ee,Ne,Oe,Fe,We,Le,Ae,je,De,He,Ue,$e,Re,Ie,ze,Ve,_e,Qe,Xe,qe,Ye=0,Ke=0,Je=0,Ze=0,et=0,tt=0,ot=0,nt=0,it=0,at=0,rt=0,lt=0,st=0,ct=0,dt=0,pt=1,ut=1,mt=1,ht=0,gt=0,ft=0,Ct=0,yt={},bt={},kt={},Gt=0,vt=0,wt=[0,null],xt=0,Tt=0,Mt={},St={},Bt={},Pt={},Et={},Nt=0,Ot=0,Ft=[],Wt=0,Lt=0,At=[],jt=0,Dt=0,Ht=[],Ut=0,$t=0,Rt=[],It=0,zt=0,Vt={},_t={},Qt=0,Xt=0,qt=[],Yt={},Kt=0,Jt={0:[0,0,0],1:[0,0,0],2:[0,0,0],3:[0,0,0],4:[0,0,0],5:[0,0,0],6:[0,0,0],7:[0,0,0],8:[0,0,0],9:[0,0,0],10:[0,0,0]},Zt=[],eo=[],to=[];function oo(e){let t=0;return Game.dragonAuras[$e].name!==e&&Game.dragonAuras[Re].name!==e||(t=1),"Reality Bending"!==Game.dragonAuras[$e].name&&"Reality Bending"!==Game.dragonAuras[Re].name||(t+=.1),t}function no(){let e=.25;return e*=1+oo("Earth Shatterer"),e}function io(e,t){return void 0===Qe[e]?void 0===t?1:t:Qe[e]}function ao(e){const t=eo[e];return(1!==Game.ascensionMode||"prestige"!==t.pool&&"fortune"!==t.tier)&&t?t.bought:0}function ro(e){if(Game.hasGod){void 0===Zt.Temple.minigame&&(Zt.Temple.minigame=Game.Objects.Temple.minigame);const t=Zt.Temple.minigame.gods[e];if(Ie===t.id)return 1;if(ze===t.id)return 2;if(Ve===t.id)return 3}return!1}function lo(e,t){let o=t;if(ao("Season savings")&&(o*=.99),ao("Santa's dominion")&&(o*=.99),ao("Faberge egg")&&(o*=.99),ao("Divine discount")&&(o*=.99),ao("Fortune #100")&&(o*=.99),o*=1-.02*oo("Fierce Hoarder"),Game.hasBuff("Everything must go")&&(o*=.95),Game.hasBuff("Crafty pixies")&&(o*=.98),Game.hasBuff("Nasty goblins")&&(o*=1.02),e.fortune&&ao(e.fortune.name)&&(o*=.93),o*=io("buildingCost"),Zt.Temple.minigameLoaded){const e=ro("creation");1===e?o*=.93:2===e?o*=.95:3===e&&(o*=.98)}return o}function so(e,t,o,n,i,a){const r=void 0===a?0:a;let l=i,s=o,c=0;-1===i&&(l=s),i||(l=Game.buyBulk);for(let o=0;o0&&(c+=o,s-=1)}return c}function co(){let t=Game.buyBulk;if(1===Game.buyMode?Y=t:t=Y,1===t?t=yt:10===t?t=bt:100===t&&(t=kt),1===Game.buyMode?1===e.BuildColour?Object.keys(t).forEach((o=>{l(`productPrice${Game.Objects[o].id}`).style.color=e[`Colour${t[o].color}`]})):Object.keys(Game.Objects).forEach((e=>{l(`productPrice${Game.Objects[e].id}`).style.removeProperty("color")})):-1===Game.buyMode&&Object.keys(yt).forEach((e=>{const t=Game.Objects[e];l(`productPrice${t.id}`).style.color="",l(`productPrice${t.id}`).innerHTML=pe(so(t,t.basePrice,t.amount,t.free,Game.buyBulk,1))})),1===Game.buyMode&&e.SortBuildings){let o;1===e.SortBuildings?(o=Object.keys(yt).map((e=>{const t=yt[e];return t.name=e,t.id=Game.Objects[e].id,t})),o.sort((function(e,t){return $.indexOf(e.color)>$.indexOf(t.color)?1:$.indexOf(e.color)<$.indexOf(t.color)||e.pp{const o=t[e];return o.name=e,o.id=Game.Objects[e].id,o})),o.sort((function(e,t){return $.indexOf(e.color)>$.indexOf(t.color)?1:$.indexOf(e.color)<$.indexOf(t.color)||e.pp{const t=yt[e];return t.name=e,t.id=Game.Objects[e].id,t}));e.sort(((e,t)=>e.id-t.id));for(let t=0;t0){let e=0,t=0,o=0,n=0,i=0,a=0,r=0;Object.keys(Game.UpgradesInStore).forEach((s=>{const c=Game.UpgradesInStore[s];let d=!1;for(let e=0;e$.indexOf(t.color)?1:$.indexOf(e.color)<$.indexOf(t.color)||e.ppe.price-t.price));const o=function(e,t){return e.findIndex((e=>e.name===t.name))};for(let e=0;e{let n,i=Game.buyBulk;1===Game.buyMode?q=i:i=q,1===i&&(i=yt),10===i&&(i=bt),100===i&&(i=kt),t+=1,l("CMBotBar").firstChild.firstChild.childNodes[0].childNodes[t].childNodes[1].textContent=Game.Objects[o].amount,l("CMBotBar").firstChild.firstChild.childNodes[1].childNodes[t].textContent=pe(i[o].bonus,2),l("CMBotBar").firstChild.firstChild.childNodes[2].childNodes[t].className=E+i[o].color,n=e.PPDisplayTime?ue(Math.round(i[o].pp)):pe(Math.round(i[o].pp),2),l("CMBotBar").firstChild.firstChild.childNodes[2].childNodes[t].textContent=n;const a=me((Game.Objects[o].bulkPrice-(Game.cookies+mo()))/uo());l("CMBotBar").firstChild.firstChild.childNodes[3].childNodes[t].className=E+a.color,"Done!"===a.text&&Game.cookies{!Game.Tiers[e.tieredUpgrades[o].tier].special&&ao(e.tieredUpgrades[o].name)&&(t*=2)})),Object.keys(e.synergies).forEach((o=>{if(ao(e.synergies[o].name)){const n=e.synergies[o];n.buildingTie1.name===e.name?t*=1+.05*n.buildingTie2.amount:n.buildingTie2.name===e.name&&(t*=1+.001*n.buildingTie1.amount)}})),e.fortune&&ao(e.fortune.name)&&(t*=1.07),e.grandma&&ao(e.grandma.name)&&(t*=1+.01*Zt.Grandma.amount*(1/(e.id-1))),"object"==typeof e.tieredUpgrades.misfortune&&1===e.vanilla&&ao(e.tieredUpgrades.misfortune.name))switch(Game.elderWrath){default:t*=1;break;case 1:t*=1.02;break;case 2:t*=1.04;break;case 3:t*=1.06}return t}function wo(e){const t=Game.Objects[e],o={};return"Cursor"===t.name?o.cps=function(e){let t=0;ao("Thousand fingers")&&(t+=.1),ao("Million fingers")&&(t*=5),ao("Billion fingers")&&(t*=10),ao("Trillion fingers")&&(t*=20),ao("Quadrillion fingers")&&(t*=20),ao("Quintillion fingers")&&(t*=20),ao("Sextillion fingers")&&(t*=20),ao("Septillion fingers")&&(t*=20),ao("Octillion fingers")&&(t*=20),ao("Nonillion fingers")&&(t*=20);let o=1,n=0;return Object.keys(Zt).forEach((e=>{"Cursor"!==Zt[e].name&&(n+=Zt[e].amount)})),t*=n,o*=vo(e),o*=Game.magicCpS("Cursor"),o*=io("cursorCps"),Game.ComputeCps(.1,ao("Reinforced index finger")+ao("Carpal tunnel prevention cream")+ao("Ambidextrous"),t)*o}:"Grandma"===t.name?o.cps=function(e){let o=1;if(Object.keys(Game.GrandmaSynergies).forEach((e=>{ao(Game.GrandmaSynergies[e])&&(o*=2)})),ao("Bingo center/Research facility")&&(o*=4),ao("Ritual rolling pins")&&(o*=2),ao("Naughty list")&&(o*=2),ao("Elderwort biscuits")&&(o*=1.02),o*=io("grandmaCps"),ao("Cat ladies"))for(let e=0;e{"Grandma"!==Zt[e].name&&(i+=Zt[e].amount)})),o*=1+.01*oo("Elder Battalion")*i,o*=Game.magicCpS(t.name),(t.baseCps+n)*o}:o.cps=function(e){let t=1;return t*=vo(e),t*=Game.magicCpS(e.name),e.baseCPS*t},o.baseCps=t.baseCps,o.name=t.name,o.tieredUpgrades=t.tieredUpgrades,o.synergies=t.synergies,o.fortune=t.fortune,o.grandma=t.grandma,o.baseCPS=t.baseCps,o.id=t.id,o.vanilla=t.vanilla,o}function xo(e){const t=Game.Upgrades[e],o={};return o.power=t.power,"function"==typeof o.power&&("Sugar crystal cookies"===t.name?o.power=function(){let e=5;return Object.keys(Zt).forEach((t=>{Zt[t].level>=10&&(e+=1)})),e}:o.power=function(){let e=2;if(ao("Starlove")&&(e=3),Game.hasGod){const t=ro("seasons");1===t?e*=1.3:2===t?e*=1.2:3===t&&(e*=1.1)}return e}),o.pool=t.pool,o.name=t.name,o}function To(){Ae=Game.UpgradesOwned,je=Game.pledges,De=Game.AchievementsOwned,He=Game.heavenlyPower,Ue=Game.prestige,Object.keys(Game.Objects).forEach((e=>{const t=Game.Objects[e];let o=Zt[e];void 0===o&&(Zt[e]=wo(e),o=Zt[e],go(e)),o.amount=t.amount,o.level=t.level,o.totalCookies=t.totalCookies,o.basePrice=t.basePrice,o.free=t.free,t.minigameLoaded&&("Temple"===t.name&&(Ie=t.minigame.slot[0],ze=t.minigame.slot[1],Ve=t.minigame.slot[2]),o.minigameLoaded=t.minigameLoaded,o.minigame=t.minigame),Zt[e]=o})),Object.keys(Game.Upgrades).forEach((e=>{const t=Game.Upgrades[e];let o=eo[e];void 0===o&&(eo[e]=xo(e),o=eo[e]),o.bought=t.bought,eo[e]=o})),Object.keys(Game.Achievements).forEach((e=>{const t=Game.Achievements[e];let o=to[e];void 0===o&&(to[e]=Go(e),o=to[e]),o.won=t.won,to[e]=o})),ko(),$e=Ye,Re=Ke}function Mo(e){const t=document.createElement("div");return t.style.fontWeight="bold",t.id=`${e}Title`,t.className="CMTextBlue",t.textContent=e,t}function So(e){e.appendChild(Mo("Bonus Income"));const t=document.createElement("div");t.style.marginBottom="4px",t.style.color="white",t.id="CMTooltipIncome",e.appendChild(t),e.appendChild(Mo("Bonus Cookies per Click")),e.lastChild.style.display="none";const o=document.createElement("div");o.style.marginBottom="4px",o.style.color="white",o.style.display="none",o.id="CMTooltipCookiePerClick",e.appendChild(o),e.appendChild(Mo("Payback Period"));const n=document.createElement("div");n.style.marginBottom="4px",n.id="CMTooltipPP",e.appendChild(n),e.appendChild(Mo("Time Left"));const i=document.createElement("div");if(i.id="CMTooltipTime",e.appendChild(i),"b"===ne){e.appendChild(Mo("Production left till next achievement")),e.lastChild.id="CMTooltipProductionHeader";const t=document.createElement("div");t.id="CMTooltipProduction",e.appendChild(t)}}function Bo(e,t,o){let n=e,i=0;for(;n{void 0!==Game.buffs[t].multCpS&&(e*=Game.buffs[t].multCpS)})),e}function Eo(){null!==l("CMDispTooltipWarningParent")&&(0===e.ToolWarnPos?(l("CMDispTooltipWarningParent").style.top="auto",l("CMDispTooltipWarningParent").style.margin="4px -4px",l("CMDispTooltipWarningParent").style.padding="3px 4px"):(l("CMDispTooltipWarningParent").style.right="auto",l("CMDispTooltipWarningParent").style.margin="4px",l("CMDispTooltipWarningParent").style.padding="4px 3px"))}function No(){if(To(),"none"!==l("tooltipAnchor").style.display&&l("CMTooltipArea")){l("CMTooltipArea").innerHTML="";const t=function(){l("tooltip").firstChild.style.paddingBottom="4px";const e=document.createElement("div");return e.style.border="1px solid",e.style.padding="4px",e.style.margin="0px -4px",e.id="CMTooltipBorder",e.className="CMTextGray",e}();l("CMTooltipArea").appendChild(t),"b"===ne?function(){if(1===e.TooltipBuildUpgrade&&1===Game.buyMode){let t;if(So(l("CMTooltipBorder")),1===Game.buyMode?K=t:t=K,1===Game.buyBulk?t=yt:10===Game.buyBulk?t=bt:100===Game.buyBulk&&(t=kt),te=Game.Objects[ie].bulkPrice,oe=t[ie].bonus,1===e.TooltipBuildUpgrade&&1===Game.buyMode){l("CMTooltipIncome").textContent=pe(oe,2);const o=Math.round(oe/Game.cookiesPs*1e4);Number.isFinite(o)&&0!==o?l("CMTooltipIncome").textContent+=` (${o/100}% of income)`:l("CMTooltipIncome").textContent+=` (<0${e.ScaleSeparator?",":"."}01% of income)`,l("CMTooltipBorder").className=E+t[ie].color,e.PPDisplayTime?l("CMTooltipPP").textContent=ue(t[ie].pp):l("CMTooltipPP").textContent=pe(t[ie].pp,2),l("CMTooltipPP").className=E+t[ie].color;const n=me((te-(Game.cookies+mo()))/uo());l("CMTooltipTime").textContent=n.text,"Done!"===n.text&&Game.cookiest.plantsById[t.plot[ie[1]][ie[0]][0]-1].mature,o=t.plantsById[t.plot[ie[1]][ie[0]][0]-1].name;l("CMTooltipBorder").appendChild(Mo("Reward (Current / Maximum)"));const n=document.createElement("div");n.id="CMTooltipPlantReward",l("CMTooltipBorder").appendChild(n),"Bakeberry"===o?l("CMTooltipPlantReward").textContent=`${e?pe(Math.min(.03*Game.cookies,60*Game.cookiesPs*30)):"0"} / ${pe(60*Game.cookiesPs*30)}`:"Chocoroot"===o||"White chocoroot"===o?l("CMTooltipPlantReward").textContent=`${e?pe(Math.min(.03*Game.cookies,60*Game.cookiesPs*3)):"0"} / ${pe(60*Game.cookiesPs*3)}`:"Queenbeet"===o?l("CMTooltipPlantReward").textContent=`${e?pe(Math.min(.04*Game.cookies,60*Game.cookiesPs*60)):"0"} / ${pe(60*Game.cookiesPs*60)}`:"Duketater"===o?l("CMTooltipPlantReward").textContent=`${e?pe(Math.min(.08*Game.cookies,60*Game.cookiesPs*120)):"0"} / ${pe(60*Game.cookiesPs*120)}`:l("CMTooltipArea").style.display="none"}else l("CMTooltipArea").style.display="none"}():"ha"===ne?function(){const{minigame:t}=Game.Objects.Farm;if(e.TooltipLump){l("CMTooltipBorder").appendChild(Mo("Cookies gained from harvesting:"));let e=0,o=0;Game.keys[16]&&Game.keys[17]&&(o=1);for(let n=0;n<6;n++)for(let i=0;i<6;i++)if(t.plot[n][i][0]>=1){const a=t.plot[n][i],r=t.plantsById[a[0]-1],l=r.name;let s=!0;o&&r.immortal&&(s=!1),a[1]0&&t=1?l("CMTimerBarGCMinBar").textContent=Math.ceil((Game.shimmerTypes.golden.minTime-Game.shimmerTypes.golden.time)/Game.fps):l("CMTimerBarGCMinBar").textContent="",Game.shimmerTypes.golden.minTime===Game.shimmerTypes.golden.maxTime?(l("CMTimerBarGCMinBar").style.borderTopRightRadius="10px",l("CMTimerBarGCMinBar").style.borderBottomRightRadius="10px"):(l("CMTimerBarGCMinBar").style.borderTopRightRadius="",l("CMTimerBarGCMinBar").style.borderBottomRightRadius=""),l("CMTimerBarGCBar").style.width=`${Math.round(Math.min(Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.minTime,Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.time)*t/Game.shimmerTypes.golden.maxTime)}px`,e.TimerBarOverlay>=1?l("CMTimerBarGCBar").textContent=Math.ceil(Math.min(Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.minTime,Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.time)/Game.fps):l("CMTimerBarGCBar").textContent="",l("CMTimerBarGCTime").textContent=Math.ceil((Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.time)/Game.fps),n+=1),"christmas"===Game.season&&0===Game.shimmerTypes.reindeer.spawned?(l("CMTimerBarRen").style.display="",l("CMTimerBarRenMinBar").style.width=`${Math.round(Math.max(0,Game.shimmerTypes.reindeer.minTime-Game.shimmerTypes.reindeer.time)*t/Game.shimmerTypes.reindeer.maxTime)}px`,e.TimerBarOverlay>=1?l("CMTimerBarRenMinBar").textContent=Math.ceil((Game.shimmerTypes.reindeer.minTime-Game.shimmerTypes.reindeer.time)/Game.fps):l("CMTimerBarRenMinBar").textContent="",l("CMTimerBarRenBar").style.width=`${Math.round(Math.min(Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.minTime,Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.time)*t/Game.shimmerTypes.reindeer.maxTime)}px`,e.TimerBarOverlay>=1?l("CMTimerBarRenBar").textContent=Math.ceil(Math.min(Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.minTime,Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.time)/Game.fps):l("CMTimerBarRenBar").textContent="",l("CMTimerBarRenTime").textContent=Math.ceil((Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.time)/Game.fps),n+=1):l("CMTimerBarRen").style.display="none";const i={};l("CMTimerBarBuffTimers").innerHTML="",Object.keys(Game.buffs).forEach((t=>{if(Game.buffs[t]){const a=ho(Game.buffs[t].name,Game.buffs[t].name,[{id:`${Game.buffs[t].name}Bar`}]);a.style.display="";let r="";r=void 0!==ee[Game.buffs[t].name]?ee[Game.buffs[t].name]:j,a.lastChild.children[1].className=N+r,a.lastChild.children[1].style.color="black",2===e.TimerBarOverlay?a.lastChild.children[1].textContent=`${Math.round(Game.buffs[t].time/Game.buffs[t].maxTime*100)}%`:a.lastChild.children[1].textContent="",a.lastChild.children[1].style.width=`${Math.round(Game.buffs[t].time*(o-8*Math.ceil(Game.buffs[t].time/Game.fps).toString().length)/Game.buffs[t].maxTime)}px`,a.lastChild.children[2].textContent=Math.ceil(Game.buffs[t].time/Game.fps),n+=1,i[Game.buffs[t].name]=a}})),Object.keys(i).forEach((e=>{l("CMTimerBarBuffTimers").appendChild(i[e])})),0!==n&&(l("CMTimerBar").style.height=12*n+2+"px"),le!==n&&(le=n,yo())}}(),fo(),No(),function(){if(1===e.TooltipWrink&&1===_){let e=!1;Object.keys(Game.wrinklers).forEach((t=>{const o=Game.wrinklers[t];if(o.phase>0&&o.selected){if(e=!0,0===X[t]||void 0===X[t]){const e=document.createElement("div"),o=document.createElement("div");o.style.minWidth="120px",o.style.marginBottom="4px";const n=document.createElement("div");n.style.textAlign="center",n.id="CMTooltipWrinkler",o.appendChild(n),e.appendChild(o),Game.tooltip.draw(this,escape(e.innerHTML)),Q=t,X[t]=1}}else X[t]=0})),e||Game.tooltip.hide()}}(),function(){if(1===e.TooltipWrink&&null!==l("CMTooltipWrinkler")){let{sucked:e}=Game.wrinklers[Q],t=1.1;if(Game.Has("Sacrilegious corruption")&&(t*=1.05),1===Game.wrinklers[Q].type&&(t*=3),e*=t,Game.Has("Wrinklerspawn")&&(e*=1.05),Zt.Temple.minigameLoaded){const t=Game.hasGod("scorn");1===t?e*=1.15:2===t?e*=1.1:3===t&&(e*=1.05)}l("CMTooltipWrinkler").textContent=pe(e)}}(),e.UpStats&&"stats"===Game.onMenu&&(Game.drawT-1)%(5*Game.fps)!=0&&(Game.drawT-1)%Game.fps==0&&Game.UpdateMenu(),t(),e.Scale){let e=l("cookies").innerHTML.replace(/.*(?=
)/i,pe(Game.cookies));Game.prefs.monospace&&(e=`${e}`),l("cookies").innerHTML=e}}function Fo(){he.addLatest(Game.computedMouseCps)}class Wo{constructor(e){this.maxLength=e,this.queue=[]}addLatest(e){this.queue.push(e)>this.maxLength&&this.queue.shift()}calcAverage(e){let t=e;t>this.maxLength&&(t=this.maxLength),t>this.queue.length&&(t=this.queue.length);let o=0;for(let e=this.queue.length-1;e>=0&&e>this.queue.length-1-t;e--)o+=this.queue[e];return 0===o?0:o/t}calcSum(e){let t=e;return t>this.maxLength&&(t=this.maxLength),t>this.queue.length&&(t=this.queue.length),0===t?0:this.queue.slice(-t).reduce(((e,t)=>e+t),0)}}function Lo(){const t=Math.floor(Date.now()/1e3);if(Game.T/Game.fps%1==0){let o=Game.cookies+Kt;Game.cpsSucked>0&&(o+=Gt),It=Math.max(Game.cookiesEarned,o),o*=.05;const n=t-Ge,i=Math.max(0,Game.cookies-ve)/n,a=Math.max(0,Gt-we)/n,r=Math.max(0,wt[0]-xe)/n,l=Math.max(0,o-Ct)/n,s=(Game.cookieClicks-Te)/n;for(let e=0;e0&&(n=A),n}function jo(t,o){Object.keys(t).forEach((n=>{if(e.PPRigidelMode&&1===o)t[n].color=D;else{t[n].color=Ao(t[n],Game.Objects[n].getSumPrice(o));for(let o=0;o{const i=Game.Objects[n].getSumPrice(o);Game.cookiesPs?t[n].pp=Math.max(i-(Game.cookies+mo()),0)/Game.cookiesPs+i/t[n].bonus:t[n].pp=i/t[n].bonus,e.PPRigidelMode&&1===o||qt.push([t[n].pp,o])}))}function Ho(){!function(){Xt=1/0,qt=[],void 0===e.PPExcludeTop&&(e.PPExcludeTop=0),Do(yt,1),Do(bt,10),Do(kt,100),qt.sort(((e,t)=>e[0]-t[0]));let t=0;if(e.PPOnlyConsiderBuyable)for(;qt[t][1]>Game.cookies&&(t+=1,qt.length!==t+1););Xt=qt[e.PPExcludeTop][t],jo(yt,1),jo(bt,10),jo(kt,100)}(),Object.keys(Mt).forEach((e=>{Game.cookiesPs?Mt[e].pp=Math.max(Game.Upgrades[e].getPrice()-(Game.cookies+mo()),0)/Game.cookiesPs+Game.Upgrades[e].getPrice()/Mt[e].bonus:Mt[e].pp=Game.Upgrades[e].getPrice()/Mt[e].bonus,Number.isNaN(Mt[e].pp)&&(Mt[e].pp=1/0),Mt[e].color=Ao(Mt[e],Game.Upgrades[e].getPrice())}))}function Uo(e,t,o,n,i){let a=o,r=0;for(let o=0;o{if(Game.Objects[e].minigameLoaded&&Game.Objects[e].minigame.effs){const o=Game.Objects[e].minigame.effs;Object.keys(o).forEach((e=>{t[e]?t[e]*=o[e]:t[e]=o[e]}))}})),Qe=t,1!==Game.ascensionMode&&(e+=.01*parseFloat(Ue)*He*function(){let e=0;if(ao("Heavenly chip secret")&&(e+=.05),ao("Heavenly cookie stand")&&(e+=.2),ao("Heavenly bakery")&&(e+=.25),ao("Heavenly confectionery")&&(e+=.25),ao("Heavenly key")&&(e+=.25),e*=1+.05*oo("Dragon God"),ao("Lucky digit")&&(e*=1.01),ao("Lucky number")&&(e*=1.01),ao("Lucky payout")&&(e*=1.01),Game.hasGod){const t=ro("creation");1===t?e*=.7:2===t?e*=.8:3===t&&(e*=.9)}return e}()),e*=io("cps"),ao("Heralds")&&1!==Game.ascensionMode&&(e*=1+.01*Game.heralds),Object.keys(Game.cookieUpgrades).forEach((t=>{const o=Game.cookieUpgrades[t];ao(o.name)&&("function"==typeof o.power?e*=1+.01*eo[o.name].power(eo[o.name]):e*=1+.01*o.power)})),ao("Specialized chocolate chips")&&(e*=1.01),ao("Designer cocoa beans")&&(e*=1.02),ao("Underworld ovens")&&(e*=1.03),ao("Exotic nuts")&&(e*=1.04),ao("Arcane sugar")&&(e*=1.05),ao("Increased merriness")&&(e*=1.15),ao("Improved jolliness")&&(e*=1.15),ao("A lump of coal")&&(e*=1.01),ao("An itchy sweater")&&(e*=1.01),ao("Santa's dominion")&&(e*=1.2),ao("Fortune #100")&&(e*=1.01),ao("Fortune #101")&&(e*=1.07),ao("Dragon scale")&&(e*=1.03);let o=1;if(ro){let t=ro("asceticism");1===t?e*=1.15:2===t?e*=1.1:3===t&&(e*=1.05),t=ro("ages"),1===t?e*=1+.15*Math.sin(B/1e3/10800*Math.PI*2):2===t?e*=1+.15*Math.sin(B/1e3/43200*Math.PI*2):3===t&&(e*=1+.15*Math.sin(B/1e3/86400*Math.PI*2)),t=ro("decadence"),1===t?o*=.93:2===t?o*=.95:3===t&&(o*=.98),t=ro("industry"),1===t?o*=1.1:2===t?o*=1.06:3===t&&(o*=1.03),t=ro("labor"),1===t?o*=.97:2===t?o*=.98:3===t&&(o*=.99)}ao("Santa's legacy")&&(e*=1+.03*(Game.santaLevel+1));const n=De/25;let i=1;if(ao("Santa's milk and cookies")&&(i*=1.05),i*=1+.05*oo("Breath of Milk"),ro){const e=ro("mother");1===e?i*=1.1:2===e?i*=1.05:3===e&&(i*=1.03)}i*=io("milk");let a=1;ao("Kitten helpers")&&(a*=1+.1*n*i),ao("Kitten workers")&&(a*=1+.125*n*i),ao("Kitten engineers")&&(a*=1+.15*n*i),ao("Kitten overseers")&&(a*=1+.175*n*i),ao("Kitten managers")&&(a*=1+.2*n*i),ao("Kitten accountants")&&(a*=1+.2*n*i),ao("Kitten specialists")&&(a*=1+.2*n*i),ao("Kitten experts")&&(a*=1+.2*n*i),ao("Kitten consultants")&&(a*=1+.2*n*i),ao("Kitten assistants to the regional manager")&&(a*=1+.175*n*i),ao("Kitten marketeers")&&(a*=1+.15*n*i),ao("Kitten analysts")&&(a*=1+.125*n*i),ao("Kitten executives")&&(a*=1+.115*n*i),ao("Kitten angels")&&(a*=1+.1*n*i),ao("Fortune #103")&&(a*=1+.05*n*i),Object.keys(Zt).forEach((e=>{const t=Zt[e];let a=t.cps(t);1!==Game.ascensionMode&&(a*=(1+.01*t.level)*o),"Grandma"===t.name&&ao("Milkhelp® lactose intolerance relief tablets")&&(a*=1+.05*n*i),Xe+=t.amount*a})),ao('"egg"')&&(Xe+=9),e*=a;let r=1;if(ao("Chicken egg")&&(r*=1.01),ao("Duck egg")&&(r*=1.01),ao("Turkey egg")&&(r*=1.01),ao("Quail egg")&&(r*=1.01),ao("Robin egg")&&(r*=1.01),ao("Ostrich egg")&&(r*=1.01),ao("Cassowary egg")&&(r*=1.01),ao("Salmon roe")&&(r*=1.01),ao("Frogspawn")&&(r*=1.01),ao("Shark egg")&&(r*=1.01),ao("Turtle egg")&&(r*=1.01),ao("Ant larva")&&(r*=1.01),ao("Century egg")){let e=10*Math.floor((P-Game.startDate)/1e3/10)/60/60/24;e=Math.min(e,100),gt=1+.1*(1-(1-e/100)**3),r*=gt}e*=r,ao("Sugar baking")&&(e*=1+.01*Math.min(100,Game.lumps)),e*=1+oo("Radiant Appetite");const l=Xe*e;Object.keys(Game.CpsAchievements).forEach((e=>{l>=Game.CpsAchievements[e].threshold&&$o(Game.CpsAchievements[e].name)})),qe=l;const{n:s}=Game.shimmerTypes.golden,c=oo("Dragon's Fortune");for(let t=0;t{ao(e[o])&&(t+=.1)}))}e*=t}if(ao("Shimmering veil [off]")){let t=.5;ao("Reinforced membrane")&&(t+=.1),e*=1+t}ao("Magic shenanigans")&&(e*=1e3),ao("Occult obstruction")&&(e*=0),Xe=Game.runModHookOnValue("cps",Xe),e*=Po(),Xe*=e}const Io=["Fortune #001","Fortune #002","Fortune #003","Fortune #004","Fortune #005","Fortune #006","Fortune #007","Fortune #008","Fortune #009","Fortune #010","Fortune #011","Fortune #012","Fortune #013","Fortune #014","Fortune #015","Fortune #016","Fortune #017","Fortune #018","Fortune #100","Fortune #101","Fortune #102","Fortune #103","Fortune #104"],zo=["Skull cookies","Ghost cookies","Bat cookies","Slime cookies","Pumpkin cookies","Eyeball cookies","Spider cookies"],Vo=["Christmas tree biscuits","Snowflake biscuits","Snowman biscuits","Holly biscuits","Candy cane biscuits","Bell biscuits","Present biscuits"],_o=["Pure heart biscuits","Ardent heart biscuits","Sour heart biscuits","Weeping heart biscuits","Golden heart biscuits","Eternal heart biscuits","Prism heart biscuits"],Qo=["Elderwort biscuits","Bakeberry cookies","Duketater cookies","Green yeast digestives","Wheat slims","Fern tea","Ichor syrup"];function Xo(e){return to[e]?to[e].won:0}function qo(){let e=0;Object.keys(Game.GrandmaSynergies).forEach((t=>{ao(Game.GrandmaSynergies[t])&&(e+=1)})),!Xo("Elder")&&e>=7&&$o("Elder"),!Xo("Veteran")&&e>=14&&$o("Veteran");let t=0,o=1,n=1,i=1e5;Object.keys(Zt).forEach((e=>{t+=Zt[e].amount,i=Math.min(Zt[e].amount,i),Xo("Mathematician")||Zt[e].amount=1&&$o("One with everything"),1===o&&$o("Mathematician"),1===n&&$o("Base 10"),i>=100&&$o("Centennial"),i>=150&&$o("Centennial and a half"),i>=200&&$o("Bicentennial"),i>=250&&$o("Bicentennial and a half"),i>=300&&$o("Tricentennial"),i>=350&&$o("Tricentennial and a half"),i>=400&&$o("Quadricentennial"),i>=450&&$o("Quadricentennial and a half"),i>=500&&$o("Quincentennial"),i>=550&&$o("Quincentennial and a half"),i>=600&&$o("Sexcentennial"),t>=100&&$o("Builder"),t>=500&&$o("Architect"),t>=1e3&&$o("Engineer"),t>=2e3&&$o("Lord of Constructs"),t>=4e3&&$o("Grand design"),t>=8e3&&$o("Ecumenopolis"),Ae>=20&&$o("Enhancer"),Ae>=50&&$o("Augmenter"),Ae>=100&&$o("Upgrader"),Ae>=200&&$o("Lord of Progress"),Ae>=300&&$o("The full picture"),Ae>=400&&$o("When there's nothing left to add"),t>=4e3&&Ae>=300&&$o("Polymath"),t>=8e3&&Ae>=400&&$o("Renaissance baker"),Zt.Cursor.amount+Zt.Grandma.amount>=777&&$o("The elder scrolls");let a=!0;Object.keys(zo).forEach((e=>{ao(zo[e])||(a=!1)})),a&&$o("Spooky cookies");let r=!0;if(Object.keys(Vo).forEach((e=>{ao(Vo[e])||(r=!1)})),r&&$o("Let it snow"),ao("Fortune cookies")){const e=Game.Tiers.fortune.upgrades;let t=0;Object.keys(e).forEach((o=>{ao(e[o].name)&&(t+=1)})),t>=e.length&&$o("O Fortuna")}}function Yo(e){const t={};return Object.keys(Game.Objects).forEach((o=>{t[o]={},t[o].bonus=function(e,t){To(),Zt[e].amount+=t;const o=Zt[e];"Cursor"===e?(o.amount>=1&&$o("Click"),o.amount>=2&&$o("Double-click"),o.amount>=50&&$o("Mouse wheel"),o.amount>=100&&$o("Of Mice and Men"),o.amount>=200&&$o("The Digital"),o.amount>=300&&$o("Extreme polydactyly"),o.amount>=400&&$o("Dr. T"),o.amount>=500&&$o("Thumbs, phalanges, metacarpals"),o.amount>=600&&$o("With her finger and her thumb"),o.amount>=700&&$o("Gotta hand it to you"),o.amount>=800&&$o("The devil's workshop")):Object.keys(Game.Objects[o.name].tieredAchievs).forEach((e=>{o.amount>=Game.Tiers[Game.Objects[o.name].tieredAchievs[e].tier].achievUnlock&&$o(Game.Objects[o.name].tieredAchievs[e].name)}));const n=De;return Ro(),qo(),n!==De&&Ro(),Xe-Game.cookiesPs}(o,e),1!==e&&(Fe=1)})),t}function Ko(){Object.keys(Game.Objects).forEach((e=>{yt[e].price=Uo(Game.Objects[e],Game.Objects[e].basePrice,Game.Objects[e].amount,Game.Objects[e].free,1),bt[e].price=Uo(Game.Objects[e],Game.Objects[e].basePrice,Game.Objects[e].amount,Game.Objects[e].free,10),kt[e].price=Uo(Game.Objects[e],Game.Objects[e].basePrice,Game.Objects[e].amount,Game.Objects[e].free,100)}))}function Jo(){yt=Yo(1),bt=Yo(10),kt=Yo(100),Mt=[],Object.keys(Game.Upgrades).forEach((t=>{const o=function(e){if("toggle"===Game.Upgrades[e].pool||0===Game.Upgrades[e].bought&&Game.Upgrades[e].unlocked&&"prestige"!==Game.Upgrades[e].pool){To(),"Shimmering veil [on]"===eo[e].name?eo["Shimmering veil [off]"].bought=0:"Golden switch [on]"===eo[e].name?eo["Golden switch [off]"].bought=0:eo[e].bought=(eo[e].bought+1)%2,Game.CountsAsUpgradeOwned(Game.Upgrades[e].pool)&&(Ae+=1),"Elder Pledge"===e?(je+=1,je>0&&$o("Elder nap"),je>=5&&$o("Elder slumber")):"Elder Covenant"===e?$o("Elder calm"):"Prism heart biscuits"===e?$o("Lovely cookies"):"Heavenly key"===e&&$o("Wholesome");const t=De;Ro(),qo(),t!==De&&Ro();const o=function(){let e=0;ao("Thousand fingers")&&(e+=.1),ao("Million fingers")&&(e*=5),ao("Billion fingers")&&(e*=10),ao("Trillion fingers")&&(e*=20),ao("Quadrillion fingers")&&(e*=20),ao("Quintillion fingers")&&(e*=20),ao("Sextillion fingers")&&(e*=20),ao("Septillion fingers")&&(e*=20),ao("Octillion fingers")&&(e*=20),ao("Nonillion fingers")&&(e*=20);let t=0;Object.keys(Zt).forEach((e=>{t+=Zt[e].amount})),t-=Zt.Cursor.amount,e*=t,ao("Plastic mouse")&&(e+=.01*Xe),ao("Iron mouse")&&(e+=.01*Xe),ao("Titanium mouse")&&(e+=.01*Xe),ao("Adamantium mouse")&&(e+=.01*Xe),ao("Unobtainium mouse")&&(e+=.01*Xe),ao("Eludium mouse")&&(e+=.01*Xe),ao("Wishalloy mouse")&&(e+=.01*Xe),ao("Fantasteel mouse")&&(e+=.01*Xe),ao("Nevercrack mouse")&&(e+=.01*Xe),ao("Armythril mouse")&&(e+=.01*Xe),ao("Technobsidian mouse")&&(e+=.01*Xe),ao("Plasmarble mouse")&&(e+=.01*Xe),ao("Miraculite mouse")&&(e+=.01*Xe),ao("Fortune #104")&&(e+=.01*Xe);let o=1;if(ao("Santa's helpers")&&(o*=1.1),ao("Cookie egg")&&(o*=1.1),ao("Halo gloves")&&(o*=1.1),ao("Dragon claw")&&(o*=1.03),ao("Aura gloves")&&(o*=1+.05*Math.min(Game.Objects.Cursor.level,ao("Luminous gloves")?20:10)),o*=io("click"),Zt.Temple.minigameLoaded&&ro){const e=ro("labor");1===e?o*=1.15:2===e?o*=1.1:3===e&&(o*=1.05)}Object.keys(Game.buffs).forEach((e=>{void 0!==Game.buffs[e].multClick&&(o*=Game.buffs[e].multClick)})),o*=1+.05*oo("Dragon Cursor");let n=o*Game.ComputeCps(1,ao("Reinforced index finger")+ao("Carpal tunnel prevention cream")+ao("Ambidextrous"),e);return n=Game.runModHookOnValue("cookiesPerClick",n),Game.hasBuff("Cursed finger")&&(n=Game.buffs["Cursed finger"].power),n}()-Game.computedMouseCps;return o?[Xe-Game.cookiesPs,o]:[Xe-Game.cookiesPs]}return[]}(t);"Elder Pledge"===t?(Mt[t]={bonus:Game.cookiesPs-Me},1===e.CalcWrink?Mt[t].bonus-=Se:2===e.CalcWrink&&(Mt[t].bonus-=Be),Number.isFinite(Mt[t].bonus)||(Mt[t].bonus=0)):(Mt[t]={},o[0]&&(Mt[t].bonus=o[0]),o[1]&&(Mt[t].bonusMouse=o[1]))}))}function Zo(e,t,o){let n=0,i=0,a=0,r=0,l=1+Math.max(0,Math.ceil(Math.log(Game.cookies)/Math.LN10)-10);for(;a0?e/=t:e=0,Ft=Zo(7,e,ut),Nt=2*Ft[1]/ut,Ot=Ft[2]/60/60/6/pt,At=Zo(6,e,mt),Wt=2*At[1]/mt,Lt=At[2]/60/60/6/pt,Ht=Zo(7,7*e,ut),jt=2*Ht[1]/ut,Dt=Ht[2]/60/60/6/pt,Rt=Zo(6,7*e,mt),Ut=2*Rt[1]/mt,$t=Rt[2]/60/60/6/pt}function tn(){const e=Math.floor(Date.now()/1e3);if(Game.T/Game.fps%1==0){const t=Game.HowMuchPrestige(Game.cookiesReset),o=Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned))-Math.floor(t),n=e-Ne,i=Math.max(0,o-Oe)/n;for(let e=0;e{e.push(Game.Upgrades[t])})),e.sort((function(e,t){return e.order>t.order?1:e.order{const o=e[t];if(0===o.bought){let e="";e+=function(e){let t="crate upgrade missing";"prestige"===e.pool&&(t+=" heavenly");let o=0;Game.prefs.crates||(o=1),o&&(t+=" noFrame");let{icon:n}=e;e.iconFunction&&(n=e.iconFunction());const i=`function() {return Game.crateTooltip(Game.UpgradesById[${e.id}], 'stats');}`;return`
\n\t
`}(o),"prestige"===o.pool?Pt+=e:"cookie"===o.pool?Et+=e:"toggle"!==o.pool&&"unused"!==o.pool&&"debug"!==o.pool&&(Bt+=e)}}))}function nn(){if("christmas"===Game.season){let e=60*Game.cookiesPs;Game.hasBuff("Elder frenzy")&&(e*=.5),Game.hasBuff("Frenzy")&&(e*=.75),ft=Math.max(25,e),Game.Has("Ho ho ho-flavored frosting")&&(ft*=2)}}function an(){et=900*dt/.15,et*=pt;const e=Po();e>0?et/=e:et=0,tt=ut*(.15*et)+13,ot=mt*(.15*et)+13,nt=7*et,it=ut*(.15*nt)+13,at=mt*(.15*nt)+13,rt=2*et,lt=.15*rt,st=0;let t=0,o=0;Object.keys(Game.Objects).forEach((e=>{Game.Objects[e].amount>t&&(t=Game.Objects[e].amount),Game.Objects[e].amount>0&&(o+=1)})),Object.keys(Game.Objects).forEach((e=>{(Game.Objects[e].amountst&&(st=2*Game.Objects[e].price,ct=e)}))}function rn(){let e=1,t=1,o=1;ao("Green yeast digestives")&&(o*=1.01),ao("Dragon fang")&&(o*=1.03),e*=1+.1*Game.auraMult("Ancestral Metamorphosis"),e*=Game.eff("goldenCookieGain"),t*=1+.1*Game.auraMult("Unholy Dominion"),t*=Game.eff("wrathCookieGain"),ut=o*e,mt=o*t,pt=1,0===Game.shimmerTypes.golden.n&&(pt*=1+1.23*Game.auraMult("Dragon's Fortune"))}function ln(){Gt=0,vt=0,wt=[0,null];for(let e=0;ewt[0]&&(wt=[t,e]))}}function sn(){ko(),ln(),an(),rn(),en(),on(),nn(),ge=new Wo(J[J.length-1]),fe=new Wo(J[J.length-1]),Ce=new Wo(J[J.length-1]),ye=new Wo(J[J.length-1]),be=new Wo(Z[Z.length-1]),ke=new Wo(5),he=new Wo(20*Z[Z.length-1]),tn(),Lo(),Jo(),Ko(),Ho()}const cn={CPSMode:1,AvgCPSHist:3,AvgClicksHist:0,CalcWrink:0,Scale:2,ScaleDecimals:2,ScaleSeparator:0,ScaleCutoff:999999,TimeFormat:0,DetailedTime:1,PPDisplayTime:0,BuildColour:1,PPOnlyConsiderBuyable:0,PPExcludeTop:0,PPRigidelMode:0,PPSecondsLowerLimit:0,ColourBlue:"#4bb8f0",ColourGreen:"#00ff00",ColourYellow:"#ffff00",ColourOrange:"#ff7f00",ColourRed:"#ff0000",ColourPurple:"#ff00ff",ColourGray:"#b3b3b3",ColourPink:"#ff1493",ColourBrown:"#8b4513",BotBar:1,TimerBar:1,TimerBarPos:0,TimerBarOverlay:2,UpBarColour:1,UpgradeBarFixedPos:1,SortBuildings:0,SortUpgrades:0,DragonAuraInfo:1,GrimoireBar:1,GCTimer:1,Favicon:1,WrinklerButtons:1,HideSectionsButtons:0,TooltipBuildUpgrade:1,TooltipAmor:0,ToolWarnLucky:1,ToolWarnLuckyFrenzy:1,ToolWarnConjure:1,ToolWarnConjureFrenzy:1,ToolWarnEdifice:1,ToolWarnUser:0,ToolWarnBon:1,ToolWarnPos:1,TooltipGrim:1,TooltipWrink:1,TooltipLump:1,TooltipPlots:1,TooltipPantheon:1,TooltipAscendButton:1,Stats:1,MissingUpgrades:1,MissingAchievements:0,UpStats:1,HeavenlyChipsTarget:1,ShowMissedGC:1,Title:1,GeneralSound:1,GCNotification:0,GCFlash:1,ColourGCFlash:"#ffffff",GCSound:1,GCVolume:100,GCSoundURL:"https://freesound.org/data/previews/66/66717_931655-lq.mp3",FortuneNotification:0,FortuneFlash:1,ColourFortuneFlash:"#ffffff",FortuneSound:1,FortuneVolume:100,FortuneSoundURL:"https://freesound.org/data/previews/174/174027_3242494-lq.mp3",SeaNotification:0,SeaFlash:1,ColourSeaFlash:"#ffffff",SeaSound:1,SeaVolume:100,SeaSoundURL:"https://www.freesound.org/data/previews/121/121099_2193266-lq.mp3",GardFlash:1,ColourGardFlash:"#ffffff",GardSound:1,GardVolume:100,GardSoundURL:"https://freesound.org/data/previews/103/103046_861714-lq.mp3",MagicNotification:0,MagicFlash:1,ColourMagicFlash:"#ffffff",MagicSound:1,MagicVolume:100,MagicSoundURL:"https://freesound.org/data/previews/221/221683_1015240-lq.mp3",WrinklerNotification:0,WrinklerFlash:1,ColourWrinklerFlash:"#ffffff",WrinklerSound:1,WrinklerVolume:100,WrinklerSoundURL:"https://freesound.org/data/previews/124/124186_8043-lq.mp3",WrinklerMaxNotification:0,WrinklerMaxFlash:1,ColourWrinklerMaxFlash:"#ffffff",WrinklerMaxSound:1,WrinklerMaxVolume:100,WrinklerMaxSoundURL:"https://freesound.org/data/previews/152/152743_15663-lq.mp3",BulkBuyBlock:0,FavouriteSettings:1,Header:{Favourite:1,Calculation:1,Notation:1,Colours:1,BarsDisplay:1,Tooltip:1,Statistics:1,Notification:1,NotificationGeneral:1,NotificationGC:1,NotificationFC:1,NotificationSea:1,NotificationGard:1,NotificationMagi:1,NotificationWrink:1,NotificationWrinkMax:1,Miscellaneous:1,Lucky:1,Chain:1,Spells:1,Garden:1,Prestige:1,Wrink:1,Sea:1,Misc:1,InfoTab:1}},dn=function(e){if(1===e){const e=function(){try{Notification.requestPermission().then()}catch(e){return!1}return!0};"Notification"in window?e()?Notification.requestPermission().then():Notification.requestPermission():console.log("This browser does not support notifications.")}};function pn(){1===e.BotBar?(l("CMBotBar").style.display="",fo()):l("CMBotBar").style.display="none",yo()}function un(){BeautifyAll(),Game.RefreshStore(),Game.RebuildUpgrades(),fo(),co(),po()}function mn(){1===e.Favicon&&y>0?Vt.wrath?l("CMFavicon").href="https://aktanusa.github.io/CookieMonster/favicon/wrathCookie.ico":l("CMFavicon").href="https://aktanusa.github.io/CookieMonster/favicon/goldenCookie.ico":l("CMFavicon").href="https://orteil.dashnet.org/cookieclicker/favicon.ico"}class hn{constructor(e,t){this.type=e,this.group=t}}class gn extends hn{constructor(e,t,o){super(e,t),this.desc=o}}class fn extends hn{constructor(e,t,o,n,i,a){super(e,t),this.label=o,this.desc=n,this.min=i,this.max=a}}class Cn extends hn{constructor(e,t,o,n,i,a){super(e,t),this.label=o,this.desc=n,this.toggle=i,void 0!==a&&(this.func=a)}}class yn extends hn{constructor(e,t,o,n){super(e,t),this.label=o,this.desc=n;for(let e=0;e<101;e++)this.label[e]=`${e}%`}}const bn={CPSMode:new Cn("bool","Calculation",["Current cookies per second","Average cookies per second"],"Calculate times using current cookies per second or average cookies per second",!1),AvgCPSHist:new Cn("bool","Calculation",["Average CPS in past 10s","Average CPS in past 15s","Average CPS in past 30s","Average CPS in past 1m","Average CPS in past 5m","Average CPS in past 10m","Average CPS in past 15m","Average CPS in past 30m"],"How much time average Cookies Per Second should consider",!1),AvgClicksHist:new Cn("bool","Calculation",["Average clicks in past 1s","Average clicks in past 5s","Average clicks in past 10s","Average clicks in past 15s","Average clicks in past 30s"],"How much time average Cookie Clicks should consider",!1),CalcWrink:new Cn("bool","Calculation",["Calculate with wrinklers OFF","Calculate with wrinklers ON","Calculate with single fattest wrinkler ON"],"Calculate times and average Cookies Per Second with (only the single non-shiny fattest) wrinklers",!0,(function(){_e=!0})),Scale:new Cn("bool","Notation",["Game's setting scale","Metric","Short scale","Short scale (Abbreviated)","Scientific notation","Engineering notation"],"Change how long numbers are formatted",!1,(function(){un()})),ScaleDecimals:new Cn("bool","Notation",["1 decimals","2 decimals","3 decimals"],'Set the number of decimals used when applicable. This only works with Cookie Monster scales and not with "Game\'s Setting Scale"',!1,(function(){un()})),ScaleSeparator:new Cn("bool","Notation",[". for decimals (standard)",". for thousands"],"Set the separator used for decimals and thousands",!1,(function(){un()})),ScaleCutoff:new fn("numscale","Notation","Notation cut-off point: ","The number from which Cookie Monster will start formatting numbers based on chosen scale. Standard is 999,999. Setting this above 999,999,999 might break certain notations",1,999999999),TimeFormat:new Cn("bool","Notation",["Time XXd, XXh, XXm, XXs","Time XX:XX:XX:XX:XX"],"Change the time format",!1),DetailedTime:new Cn("bool","Notation",["Detailed time OFF","Detailed time ON"],"Change how time is displayed in certain statistics and tooltips",!0,(function(){1===e.DetailedTime?Game.sayTime=V:Game.sayTime=S.sayTime})),PPDisplayTime:new Cn("bool","Notation",["PP as value (standard)","PP as time unit"],"Display PP as calculated value or as approximate time unit. Note that PP does not translate directly into a time unit and this is therefore only an approximation.",!1),BuildColour:new Cn("bool","Colours",["Building colours OFF","Building colours ON"],"Colour code buildings",!0,(function(){co()})),PPOnlyConsiderBuyable:new Cn("bool","Colours",["Don't ignore non-buyable","Ignore non-buyable"],"Makes Cookie Monster label buildings and upgrades you can't buy right now red, useful in those situations where you just want to spend your full bank 'most optimally'",!0),PPExcludeTop:new Cn("bool","Colours",["Don't ignore any","Ignore 1st best","Ignore 1st and 2nd best","Ignore 1st, 2nd and 3rd best"],"Makes Cookie Monster ignore the 1st, 2nd or 3rd best buildings in labeling and colouring PP values",!0),PPRigidelMode:new Cn("bool","Colours",["Rigidel mode OFF","Rigidel mode ON"],'Makes Cookie Monster ignore all "buy 1" options when colouring PP in order to stay at a total building count ending in 10 for pantheon god Rigidel',!0),PPSecondsLowerLimit:new fn("numscale","Colours","Lower limit for PP (in seconds): ",'If a building or upgrade costs less than the specified seconds of CPS it will also be considered optimal and label it as such ("PP is less than xx seconds of CPS"); setting to 0 ignores this option',0,1/0),ColourBlue:new gn("colour","Colours","Standard colour is blue. Used to show upgrades better than best PP building, for Click Frenzy bar, and for various labels"),ColourGreen:new gn("colour","Colours","Standard colour is green. Used to show best PP building, for Blood Frenzy bar, and for various labels"),ColourYellow:new gn("colour","Colours","Standard colour is yellow. Used to show buildings within the top 10 of PP, for Frenzy bar, and for various labels"),ColourOrange:new gn("colour","Colours","Standard colour is orange. Used to show buildings within the top 20 of PP, for Next Reindeer bar, and for various labels"),ColourRed:new gn("colour","Colours","Standard colour is Red. Used to show buildings within the top 30 of PP, for Clot bar, and for various labels"),ColourPurple:new gn("colour","Colours","Standard colour is purple. Used to show buildings outside of the top 30 of PP, for Next Cookie bar, and for various labels"),ColourGray:new gn("colour","Colours","Standard colour is gray. Used to show negative or infinity PP, and for Next Cookie/Next Reindeer bar"),ColourPink:new gn("colour","Colours","Standard colour is pink. Used for Dragonflight bar"),ColourBrown:new gn("colour","Colours","Standard colour is brown. Used for Dragon Harvest bar"),BotBar:new Cn("bool","BarsDisplay",["Bottom bar OFF","Bottom bar ON"],"Building information",!0,(function(){pn()})),TimerBar:new Cn("bool","BarsDisplay",["Timer bar OFF","Timer bar ON"],"Bar with timers for golden cookie, season popup, Frenzy (Normal, Clot, Elder), Click Frenzy",!0,(function(){bo()})),TimerBarPos:new Cn("bool","BarsDisplay",["Timer bar position (top left)","Timer bar position (bottom)"],"Placement of the timer bar",!1,(function(){0===e.TimerBarPos?(l("CMTimerBar").style.width="30%",l("CMTimerBar").style.bottom="",l("game").insertBefore(l("CMTimerBar"),l("sectionLeft"))):(l("CMTimerBar").style.width="100%",l("CMTimerBar").style.bottom="0px",l("wrapper").appendChild(l("CMTimerBar"))),yo()})),TimerBarOverlay:new Cn("bool","BarsDisplay",["Timer bar overlay OFF","Timer bar overlay only seconds","Timer bar overlay full"],"Overlay on timers displaying seconds and/or percentage left",!0),UpBarColour:new Cn("bool","BarsDisplay",["Upgrade colours/bar OFF","Upgrade colours with bar ON","Upgrade colours without bar ON"],"Colour code upgrades and optionally add a counter bar",!1,(function(){1===e.UpBarColor?(l("CMUpgradeBar").style.display="",po()):2===e.UpBarColor?(l("CMUpgradeBar").style.display="none",po()):(l("CMUpgradeBar").style.display="none",Game.RebuildUpgrades())})),UpgradeBarFixedPos:new Cn("bool","BarsDisplay",["Upgrade bar fixed position OFF","Upgrade bar fixed position ON"],"Lock the upgrade bar at top of the screen to prevent it from moving ofscreen when scrolling",!0,(function(){1===e.UpgradeBarFixedPos?(l("CMUpgradeBar").style.position="sticky",l("CMUpgradeBar").style.top="0px"):l("CMUpgradeBar").style.position=""})),SortBuildings:new Cn("bool","BarsDisplay",["Sort buildings: default","Sort buildings: PP of x1 purchase","Sort buildings: PP of selected bulk mode"],"Sort the display of buildings in either default order or by PP",!1,(function(){co()})),SortUpgrades:new Cn("bool","BarsDisplay",["Sort upgrades: default","Sort upgrades: PP"],"Sort the display of upgrades in either default order or by PP",!1,(function(){po()})),DragonAuraInfo:new Cn("bool","BarsDisplay",["Extra dragon aura info OFF","Extra dragon aura info ON"],"Shows information about changes in CPS and costs in the dragon aura interface.",!0),GrimoireBar:new Cn("bool","BarsDisplay",["Grimoire magic meter timer OFF","Grimoire magic meter timer ON"],"A timer on how long before the Grimoire magic meter is full",!0),GCTimer:new Cn("bool","BarsDisplay",["Golden cookie timer OFF","Golden cookie timer ON"],"A timer on the golden cookie when it has been spawned",!0,(function(){1===e.GCTimer?Object.keys(se).forEach((e=>{se[e].style.display="block",se[e].style.left=Yt[e].l.style.left,se[e].style.top=Yt[e].l.style.top})):Object.keys(se).forEach((e=>se[e].style.display="none"))})),Favicon:new Cn("bool","BarsDisplay",["Favicon OFF","Favicon ON"],"Update favicon with golden/wrath cookie",!0,(function(){mn()})),WrinklerButtons:new Cn("bool","BarsDisplay",["Extra wrinkler buttons OFF","Extra wrinkler buttons ON"],"Show buttons for popping wrinklers at bottom of cookie section",!0,(function(){t()})),HideSectionsButtons:new Cn("bool","BarsDisplay",["Hide buildings/upgrades button OFF","Hide buildings/upgrades button ON"],"Show buttons for hiding and showing the buildings and upgrades sections in the right column",!0,(function(){e.HideSectionsButtons?l("CMSectionHidButtons").style.display="":l("CMSectionHidButtons").style.display="none"})),TooltipBuildUpgrade:new Cn("bool","Tooltip",["Building/upgrade tooltip information OFF","Building/upgrade tooltip information ON"],"Extra information in building/upgrade tooltips",!0),TooltipAmor:new Cn("bool","Tooltip",["Buildings tooltip amortization information OFF","Buildings tooltip amortization information ON"],"Add amortization information to buildings tooltip",!0),ToolWarnLucky:new Cn("bool","Tooltip",["Tooltip lucky warning OFF","Tooltip lucky warning ON"],'A warning when buying if it will put the bank under the amount needed for max "Lucky!" rewards',!0),ToolWarnLuckyFrenzy:new Cn("bool","Tooltip",["Tooltip lucky frenzy warning OFF","Tooltip lucky frenzy warning ON"],'A warning when buying if it will put the bank under the amount needed for max "Lucky!" (Frenzy) rewards',!0),ToolWarnConjure:new Cn("bool","Tooltip",["Tooltip conjure warning OFF","Tooltip conjure warning ON"],'A warning when buying if it will put the bank under the amount needed for max "Conjure Baked Goods" rewards',!0),ToolWarnConjureFrenzy:new Cn("bool","Tooltip",["Tooltip conjure frenzy warning OFF","Tooltip conjure frenzy warning ON"],'A warning when buying if it will put the bank under the amount needed for max "Conjure Baked Goods" rewards with Frenzy active',!0),ToolWarnEdifice:new Cn("bool","Tooltip",["Tooltip edifice warning OFF","Tooltip edifice warning ON"],'A warning when buying if it will put the bank under the amount needed for "Spontaneous Edifice" to possibly give you your most expensive building',!0),ToolWarnUser:new fn("numscale","Tooltip","Tooltip warning at x times CPS: ","Use this to show a customized warning if buying it will put the bank under the amount equal to value times cps; setting to 0 disables the function altogether",0,1/0),ToolWarnBon:new Cn("bool","Tooltip",["Calculate tooltip warning with bonus CPS OFF","Calculate tooltip warning with bonus CPS ON"],"Calculate the warning with or without the bonus CPS you get from buying",!0),ToolWarnPos:new Cn("bool","Tooltip",["Tooltip warning position (left)","Tooltip warning position (bottom)"],"Placement of the warning boxes",!1,(function(){Eo()})),TooltipGrim:new Cn("bool","Tooltip",["Grimoire tooltip information OFF","Grimoire tooltip information ON"],"Extra information in tooltip for grimoire",!0),TooltipWrink:new Cn("bool","Tooltip",["Wrinkler tooltip OFF","Wrinkler tooltip ON"],"Shows the amount of cookies a wrinkler will give when popping it",!0),TooltipLump:new Cn("bool","Tooltip",["Sugar lump tooltip OFF","Sugar lump tooltip ON"],"Shows the current Sugar Lump type in Sugar lump tooltip.",!0),TooltipPlots:new Cn("bool","Tooltip",["Garden plots tooltip OFF","Garden plots tooltip ON"],"Shows a tooltip for plants that have a cookie reward.",!0),TooltipPantheon:new Cn("bool","Tooltip",["Pantheon tooltip OFF","Pantheon tooltip ON"],"Shows additional info in the pantheon tooltip",!0),TooltipAscendButton:new Cn("bool","Tooltip",["Show Extra Info Ascend Tooltip OFF","Show Extra Info Ascend Tooltip ON"],"Shows additional info in the ascend tooltip",!0),Stats:new Cn("bool","Statistics",["Statistics OFF","Statistics ON"],"Extra Cookie Monster statistics!",!0),MissingUpgrades:new Cn("bool","Statistics",["Missing upgrades OFF","Missing upgrades ON"],"Shows missing upgrades in statistics menu",!0),MissingAchievements:new Cn("bool","Statistics",["Missing Achievements OFF","Missing Normal Achievements ON"],"Shows missing normal achievements in statistics menu.",!0),UpStats:new Cn("bool","Statistics",["Statistics update rate (default)","Statistics update rate (1s)"],"Default rate is once every 5 seconds",!1),HeavenlyChipsTarget:new fn("numscale","Statistics","Heavenly chips target: ",'Use this to set a heavenly chips target that will be counted towards in the "prestige" statsistics sections',1,1/0),ShowMissedGC:new Cn("bool","Statistics",["Missed GC OFF","Missed GC ON"],"Show a stat in the statistics screen that counts how many golden cookies you have missed",!0),Title:new Cn("bool","NotificationGeneral",["Title OFF","Title ON","Title pinned tab highlight"],'Update title with colden cookie/season popup timers; pinned tab highlight only changes the title when a golden cookie/season popup spawns; "!" means that golden cookie/reindeer can spawn',!0),GeneralSound:new Cn("bool","NotificationGeneral",["Consider game volume setting OFF","Consider game volume setting ON"],'Turning this toggle to "off" makes Cookie Monster no longer consider the volume setting of the base game, allowing mod notifications to play with base game volume turned down',!0),GCNotification:new Cn("bool","NotificationGC",["Notification OFF","Notification ON"],"Create a notification when golden cookie spawns",!0,(function(){dn(e.GCNotification)})),GCFlash:new Cn("bool","NotificationGC",["Flash OFF","Flash ON"],"Flash screen on golden cookie",!0),ColourGCFlash:new gn("colour","NotificationGC","The colour of the GC flash, standard colour is white"),GCSound:new Cn("bool","NotificationGC",["Sound OFF","Sound ON"],"Play a sound on golden cookie",!0),GCVolume:new yn("vol","NotificationGC",[],"Volume"),GCSoundURL:new Cn("url","NotificationGC","Sound URL:","URL of the sound to be played when a golden cookie spawns"),FortuneNotification:new Cn("bool","NotificationFC",["Notification OFF","Notification ON"],"Create a notification when fortune cookie is on the ticker",!0,(function(){dn(e.FortuneNotification)})),FortuneFlash:new Cn("bool","NotificationFC",["Flash OFF","Flash ON"],"Flash screen on fortune cookie spawn",!0),ColourFortuneFlash:new gn("colour","NotificationFC","The colour of the fortune flash, standard colour is white"),FortuneSound:new Cn("bool","NotificationFC",["Sound OFF","Sound ON"],"Play a sound on fortune cookie spawn",!0),FortuneVolume:new yn("vol","NotificationFC",[],"Volume"),FortuneSoundURL:new Cn("url","NotificationFC","Sound URL:","URL of the sound to be played when the ticker has a fortune cookie"),SeaNotification:new Cn("bool","NotificationSea",["Notification OFF","Notification ON"],"Create a notification on season popup",!0,(function(){dn(e.SeaNotification)})),SeaFlash:new Cn("bool","NotificationSea",["Flash OFF","Flash ON"],"Flash screen on season popup",!0),ColourSeaFlash:new gn("colour","NotificationSea","The colour of the season popup flash, standard colour is white"),SeaSound:new Cn("bool","NotificationSea",["Sound OFF","Sound ON"],"Play a sound on season popup",!0),SeaVolume:new yn("vol","NotificationSea",[],"Volume"),SeaSoundURL:new Cn("url","NotificationSea","Sound URL:","URL of the sound to be played when on season popup spawns"),GardFlash:new Cn("bool","NotificationGard",["Garden Tick Flash OFF","Flash ON"],"Flash screen on garden tick",!0),ColourGardFlash:new gn("colour","NotificationGard","The colour of the garden flash, standard colour is white"),GardSound:new Cn("bool","NotificationGard",["Sound OFF","Sound ON"],"Play a sound on garden tick",!0),GardVolume:new yn("vol","NotificationGard",[],"Volume"),GardSoundURL:new Cn("url","NotificationGard","Garden Tick Sound URL:","URL of the sound to be played when the garden ticks"),MagicNotification:new Cn("bool","NotificationMagi",["Notification OFF","Notification ON"],"Create a notification when magic reaches maximum",!0,(function(){dn(e.MagicNotification)})),MagicFlash:new Cn("bool","NotificationMagi",["Flash OFF","Flash ON"],"Flash screen when magic reaches maximum",!0),ColourMagicFlash:new gn("colour","NotificationMagi","The colour of the magic flash, standard colour is white"),MagicSound:new Cn("bool","NotificationMagi",["Sound OFF","Sound ON"],"Play a sound when magic reaches maximum",!0),MagicVolume:new yn("vol","NotificationMagi",[],"Volume"),MagicSoundURL:new Cn("url","NotificationMagi","Sound URL:","URL of the sound to be played when magic reaches maxium"),WrinklerNotification:new Cn("bool","NotificationWrink",["Notification OFF","Notification ON"],"Create a notification when a wrinkler appears",!0,(function(){dn(e.WrinklerNotification)})),WrinklerFlash:new Cn("bool","NotificationWrink",["Flash OFF","Flash ON"],"Flash screen when a wrinkler appears",!0),ColourWrinklerFlash:new gn("colour","NotificationWrink","The colour of the wrinkler flash, standard colour is white"),WrinklerSound:new Cn("bool","NotificationWrink",["Sound OFF","Sound ON"],"Play a sound when a wrinkler appears",!0),WrinklerVolume:new yn("vol","NotificationWrink",[],"Volume"),WrinklerSoundURL:new Cn("url","NotificationWrink","Sound URL:","URL of the sound to be played when a wrinkler appears"),WrinklerMaxNotification:new Cn("bool","NotificationWrinkMax",["Notification OFF","Notification ON"],"Create a notification when the maximum amount of wrinklers has appeared",!0,(function(){dn(e.WrinklerMaxNotification)})),WrinklerMaxFlash:new Cn("bool","NotificationWrinkMax",["Flash OFF","Flash ON"],"Flash screen when the maximum amount of Wrinklers has appeared",!0),ColourWrinklerMaxFlash:new gn("colour","NotificationWrinkMax","The colour of the maximum wrinkler flash, standard colour is white"),WrinklerMaxSound:new Cn("bool","NotificationWrinkMax",["Sound OFF","Sound ON"],"Play a sound when the maximum amount of wrinklers has appeared",!0),WrinklerMaxVolume:new yn("vol","NotificationWrinkMax",[],"Volume"),WrinklerMaxSoundURL:new Cn("url","NotificationWrinkMax","Sound URL:","URL of the sound to be played when the maximum amount of wrinklers has appeared"),BulkBuyBlock:new Cn("bool","Miscellaneous",["Block bulk buying OFF","Block bulk buying ON"],"Block clicking bulk buying when you can't buy all. This prevents buying 7 of a building when you are in buy-10 or buy-100 mode.",!0),FavouriteSettings:new Cn("bool","Miscellaneous",["Favourite settings section OFF","Favourite settings section ON","Favourite settings section ON (Locked)"],"Show stars before each setting which allows selecting it for a 'favourites' section at the top of the Cookie Monster settings. Setting this to Locked removes the stars but shows the 'favourites' section",!0,(function(){Game.UpdateMenu()}))};function kn(){return JSON.stringify({favouriteSettings:de,settings:e,version:"2.031.7"})}function Gn(){if(Je!==Game.dragonLevel||_e){if(Game.dragonLevel<25&&Game.dragonLevels[Game.dragonLevel].buy.toString().includes("sacrifice")){let e=Game.dragonLevels[Game.dragonLevel].buy.toString().match(/Objects\[(.*)\]/)[1];const t=Game.dragonLevels[Game.dragonLevel].buy.toString().match(/sacrifice\((.*?)\)/)[1];if("i"!==e)if(e=e.replaceAll("'",""),Game.Objects[e].amount{if(e=n,Game.Objects[e].amount{Zt[e]=wo(e)})),eo=[],Object.keys(Game.Upgrades).forEach((e=>{eo[e]=xo(e)})),to=[],Object.keys(Game.Achievements).forEach((e=>{to[e]=Go(e)})),To()}let xn=!1;function Tn(t,o,n){(1===e[o]||n)&&3===t&&!1===xn||1===t?(l("CMFlashScreen").style.backgroundColor=e[`Colour${o}`],l("CMFlashScreen").style.opacity="0.5",3===t?(l("CMFlashScreen").style.display="inline",setTimeout((function(){Tn(2,o,!0)}),1e3/Game.fps)):setTimeout((function(){Tn(0,o,!0)}),1e3/Game.fps)):2===t?(l("CMFlashScreen").style.opacity="1",setTimeout((function(){Tn(1,o,!0)}),1e3/Game.fps)):0===t&&(l("CMFlashScreen").style.display="none")}function Mn(t,o,n,i){if((1===e[o]||i)&&!1===xn){const o=new Audio(t);e.GeneralSound?o.volume=e[n]/100*(Game.volume/100):o.volume=e[n]/100,o.play()}}function Sn(t,o,n){1===e[t]&&"hidden"===document.visibilityState&&!1===xn&&new Notification(o,{body:n,badge:"https://orteil.dashnet.org/cookieclicker/favicon.ico"})}function Bn(){if(re!==Game.OnAscend&&(re=Game.OnAscend,Game.OnAscend?(l("game").style.bottom="0px",1===e.BotBar&&(l("CMBotBar").style.display="none"),1===e.TimerBar&&(l("CMTimerBar").style.display="none")):(pn(),bo()),Co()),!Game.OnAscend&&0===Game.AscendTimer){r!==Object.keys(Game.mods).length&&(wn(),sn(),r=Object.keys(Game.mods).length),_e&&(Jo(),Game.Has("Golden switch [off]")?(To(),eo["Golden switch [off]"].bought=0,Ro(),dt=Xe):dt=Game.cookiesPs,rn(),an(),on(),en(),Gn(),function(){for(let e=0;e<11;e+=1)for(let t=0;t<3;t+=1)Jt[e][t]=vn(e,t)}(),nn(),function(){let e=0;if(Game.Objects.Bank.minigameLoaded){const t=Game.Objects.Bank.minigame.goods;let o=0;Object.keys(t).forEach((e=>{const n=t[e];o+=n.stock*n.val})),e+=o*Game.cookiesPsRawHighest}e+=function(){let e=0;To();let t=2;5!==$e&&18!==$e||(t-=1),5!==Re&&18!==Re||(t-=1),$e=5,Re=18;for(let e=0;e{Zt[t].amount>0&&(e=t)})),Zt[e].amount-=1,Le-=1}return Object.keys(Zt).forEach((t=>{const o=Zt[t];e+=so(Game.Objects[o.name],Game.Objects[t].basePrice,o.amount,Game.Objects[t].free,o.amount)})),e}(),Kt=e}(),_e=0);const t=Game.auraMult("Fierce Hoarder")>0;!We&&t?(We=!0,Fe=1):We&&!t&&(We=!1,Fe=1),Fe&&(Ko(),Fe=0),function(){ln(),Ho(),function(){xt=0;let e=0;Object.keys(Game.wrinklers).forEach((t=>{2===Game.wrinklers[t].phase&&(e+=1)}));let t=1;if(Zt.Temple.minigameLoaded){const e=Game.hasGod("scorn");1===e?t*=1.15:2===e?t*=1.1:3===e&&(t*=1.05)}Tt=e,xt=e*(.05*e*1.1)*(.05*Game.Has("Sacrilegious corruption")+1)*(.05*Game.Has("Wrinklerspawn")+1)*t}(),Lo(),tn();const e=Game.HowManyCookiesReset(Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned))+1)-(Game.cookiesEarned+Game.cookiesReset);Qt=ue(e/uo())}(),G=0,Yt={},Object.keys(Game.shimmers).forEach((e=>{Yt[Game.shimmers[e].id]=Game.shimmers[e],Game.shimmers[e].spawnLead&&"golden"===Game.shimmers[e].type&&(Vt=Game.shimmers[e],G+=1)})),Object.keys(se).forEach((e=>{void 0===Yt[e]&&(se[e].parentNode.removeChild(se[e]),delete se[e])})),y!==Game.shimmerTypes.golden.n?(y=Game.shimmerTypes.golden.n,y&&(b{void 0===se[Game.shimmers[t].id]&&function(t){const o=document.createElement("div");o.id=`GCTimer${t.id}`,o.style.width="96px",o.style.height="96px",o.style.position="absolute",o.style.zIndex="10000000001",o.style.textAlign="center",o.style.lineHeight="96px",o.style.fontFamily='"Kavoon", Georgia, serif',o.style.fontSize="35px",o.style.cursor="pointer",o.style.display="block",0===e.GCTimer&&(o.style.display="none"),o.style.left=t.l.style.left,o.style.top=t.l.style.top,o.onclick=function(){t.pop()},o.onmouseover=function(){t.l.style.filter="brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))",t.l.style.webkitFilter="brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))"},o.onmouseout=function(){t.l.style.filter="",t.l.style.webkitFilter=""},se[t.id]=o,l("shimmers").appendChild(o)}(Game.shimmers[t])}))),mn(),b=G,0===G&&(Vt=0)):1===e.GCTimer&&y&&Object.keys(se).forEach((e=>{se[e].style.opacity=Yt[e].l.style.opacity,se[e].style.transform=Yt[e].l.style.transform,se[e].textContent=Math.ceil(Yt[e].life/Game.fps)})),f!==(Game.TickerEffect&&"fortune"===Game.TickerEffect.type)&&(f=Game.TickerEffect&&"fortune"===Game.TickerEffect.type,f&&(Tn(3,"FortuneFlash",!1),Mn(e.FortuneSoundURL,"FortuneSound","FortuneVolume",!1),Sn("FortuneNotification","Fortune Cookie found","A Fortune Cookie has appeared on the Ticker."))),g!==Game.shimmerTypes.reindeer.spawned&&(g=Game.shimmerTypes.reindeer.spawned,Object.keys(Game.shimmers).forEach((e=>{Game.shimmers[e].spawnLead&&"reindeer"===Game.shimmers[e].type&&(_t=Game.shimmers[e])})),Tn(3,"SeaFlash",!1),Mn(e.SeaSoundURL,"SeaSound","SeaVolume",!1),Sn("SeaNotification","Reindeer sighted!","A Reindeer has spawned. Click it now!")),Game.Objects.Farm.minigameLoaded&&C!==Game.Objects.Farm.minigame.nextStep&&(0!==C&&C0){let t=0;Object.keys(Game.wrinklers).forEach((e=>{2===Game.wrinklers[e].phase&&(t+=1)})),t>v?(v=t,t===Game.getWrinklersMax()&&e.WrinklerMaxFlash?Tn(3,"WrinklerMaxFlash",!1):Tn(3,"WrinklerFlash",!1),t===Game.getWrinklersMax()&&e.WrinklerMaxSound?Mn(e.WrinklerMaxSoundURL,"WrinklerMaxSound","WrinklerMaxVolume",!1):Mn(e.WrinklerSoundURL,"WrinklerSound","WrinklerVolume",!1),t===Game.getWrinklersMax()&&e.WrinklerMaxNotification?Sn("WrinklerMaxNotification","Maximum Wrinklers Reached","You have reached your maximum ammount of wrinklers"):Sn("WrinklerNotification","A Wrinkler appeared","A new wrinkler has appeared")):v=t}}()}}function Pn(){let t="";for(let o=0;o<$.length;o++)t+=`.CMText${$[o]} { color: ${e[`Colour${$[o]}`]}; }\n`;for(let o=0;o<$.length;o++)t+=`.CMBack${$[o]} { background-color: ${e[`Colour${$[o]}`]}; }\n`;for(let o=0;o<$.length;o++)t+=`.CMBorder${$[o]} { border: 1px solid ${e[`Colour${$[o]}`]}; }\n`;l("CMCSS").textContent=t,co()}function En(){const e=b64_to_utf8(unescape(localStorage.getItem("CookieClickerGame")).split("!END!")[0]),t=e.match(/CookieMonster.*(;|$)/);if(null!==t){const o=e.replace(t[0],`CookieMonster:${kn()}`);localStorage.setItem("CookieClickerGame",escape(`${utf8_to_b64(o)}!END!`))}}function Nn(t){if(void 0!==localStorage.CMConfig&&delete localStorage.CMConfig,void 0!==t){e=t,void 0!==e.Colors&&delete e.Colors,void 0!==e.Colours&&delete e.Colours;let o=!1;Object.keys(cn).forEach((t=>{void 0===e[t]?(o=!0,e[t]=cn[t]):"Header"===t&&Object.keys(cn.Header).forEach((n=>{void 0!==e[t][n]&&e[t][n]>-1&&e[t][n]<2||(o=!0,e[t][n]=cn[t][n])}))})),o&&En(),Bn(),Object.keys(cn).forEach((e=>{"Header"!==e&&void 0!==bn[e].func&&bn[e].func()}))}else Nn(cn);Game.UpdateMenu(),Pn()}function On(){Object.keys(Game.wrinklers).forEach((e=>{Game.wrinklers[e].sucked>0&&0===Game.wrinklers[e].type&&(Game.wrinklers[e].hp=0)}))}function Fn(t,o){if("b"===t){if(l("tooltip").innerHTML=Game.Objects[o].tooltip(),1===e.TooltipAmor){const e=Uo(Game.Objects[o],Game.Objects[o].basePrice,0,Game.Objects[o].free,Game.Objects[o].amount),t=e-Game.Objects[o].totalCookies;t>0&&(l("tooltip").innerHTML=l("tooltip").innerHTML.split("so far").join(`so far
${pe(t)} ${1===Math.floor(t)?"cookie":"cookies"} left to amortize (${me((e-Game.Objects[o].totalCookies)/(Game.Objects[o].storedTotalCps*Game.globalCpsMult)).text})`))}-1===Game.buyMode&&(l("tooltip").innerHTML=l("tooltip").innerHTML.split(pe(Game.Objects[o].bulkPrice)).join(pe((Game.Objects[o],Game.Objects[o].basePrice,Game.Objects[o].amount,Game.Objects[o].free,Game.buyBulk,1))))}else if("u"===t){if(!Game.UpgradesInStore[o])return"";l("tooltip").innerHTML=Game.crateTooltip(Game.UpgradesInStore[o],"store")}else"s"===t?l("tooltip").innerHTML=Game.lumpTooltip():"g"===t?l("tooltip").innerHTML=Game.Objects["Wizard tower"].minigame.spellTooltip(o)():"p"===t?l("tooltip").innerHTML=Game.ObjectsById[2].minigame.tileTooltip(o[0],o[1])():"ha"===t?l("tooltip").innerHTML=Game.ObjectsById[2].minigame.toolTooltip(1)():"wb"===t?l("tooltip").innerHTML="":"pag"===t?l("tooltip").innerHTML=Game.Objects.Temple.minigame.godTooltip(o)():"pas"===t&&(l("tooltip").innerHTML=Game.Objects.Temple.minigame.slotTooltip(o[0])());if("b"===t&&1===Game.buyMode||"u"===t||"s"===t||"g"===t||"p"===t&&!Game.keys[16]||"ha"===t||"wb"===t||"pag"===t||"pas"===t&&-1!==o[1]){const e=document.createElement("div");e.id="CMTooltipArea",l("tooltip").appendChild(e)}return ne=t,ie=o,No(),l("tooltip").innerHTML}function Wn(){Game.Objects["Wizard tower"].minigameLoaded&&Object.keys(Game.Objects["Wizard tower"].minigame.spellsById).forEach((e=>{null!==l(`grimoireSpell${e}`).onmouseover&&(T[e]=l(`grimoireSpell${e}`).onmouseover,l(`grimoireSpell${e}`).onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Fn("g",`${e}`)}),"this"),Game.tooltip.wobble()})}))}function Ln(){if(!m&&Game.Objects["Wizard tower"].minigameLoaded){const{minigame:t}=Game.Objects["Wizard tower"];p=t.draw,Game.Objects["Wizard tower"].minigame.draw=function(){p(),1===e.GrimoireBar&&t.magic1&&(e.Header[t]=0),En()}function Rn(t,o){const n=document.createElement("div");n.className="title",n.style.padding="0px 16px",n.style.opacity="0.7",n.style.fontSize="17px",n.style.fontFamily='"Kavoon", Georgia, serif',n.appendChild(document.createTextNode(`${t} `));const i=document.createElement("span");return i.style.cursor="pointer",i.style.display="inline-block",i.style.height="14px",i.style.width="14px",i.style.borderRadius="7px",i.style.textAlign="center",i.style.backgroundColor="#C0C0C0",i.style.color="black",i.style.fontSize="13px",i.style.verticalAlign="middle",i.textContent=e.Header[o]?"-":"+",i.onclick=function(){$n(o),Game.UpdateMenu()},n.appendChild(i),n}function In(e,t,o,n){const i=document.createElement("div");i.className="listing";const a=document.createElement("b");if(a.textContent=t,i.appendChild(a),"withTooltip"===e){i.className="listing",i.appendChild(document.createTextNode(" "));const e=document.createElement("span");e.onmouseout=function(){Game.tooltip.hide()},e.onmouseover=function(){Game.tooltip.draw(this,escape(I[n].innerHTML))},e.style.cursor="default",e.style.display="inline-block",e.style.height="10px",e.style.width="10px",e.style.borderRadius="5px",e.style.textAlign="center",e.style.backgroundColor="#C0C0C0",e.style.color="black",e.style.fontSize="9px",e.style.verticalAlign="bottom",e.textContent="?",i.appendChild(e)}return i.appendChild(document.createTextNode(": ")),i.appendChild(o),i}function zn(e){const t=document.createDocumentFragment();t.appendChild(document.createTextNode(`${e.length} `));const o=document.createElement("span");o.onmouseout=function(){Game.tooltip.hide()};const n=document.createElement("div"),i=document.createElement("div");i.style.minWidth="140px",i.style.marginBottom="4px";const a=document.createElement("div");return a.className="name",a.style.marginBottom="4px",a.style.textAlign="center",a.textContent="Missing",i.appendChild(a),Object.keys(e).forEach((t=>{const o=document.createElement("div");o.style.textAlign="center",o.appendChild(document.createTextNode(e[t])),i.appendChild(o)})),n.appendChild(i),o.onmouseover=function(){Game.tooltip.draw(this,escape(n.innerHTML))},o.style.cursor="default",o.style.display="inline-block",o.style.height="10px",o.style.width="10px",o.style.borderRadius="5px",o.style.textAlign="center",o.style.backgroundColor="#C0C0C0",o.style.color="black",o.style.fontSize="9px",o.style.verticalAlign="bottom",o.textContent="?",t.appendChild(o),t}function Vn(t){const o=document.createElement("div");if(o.className="subsection",o.appendChild(t),o.appendChild(Rn("Lucky Cookies","Lucky")),e.Header.Lucky&&o.appendChild(function(){const e=Game.auraMult("Dragon's Fortune")?"GoldCookDragonsFortuneTooltipPlaceholder":"GoldCookTooltipPlaceholder",t=document.createElement("div");t.className="CMStatsLuckySection";const o=Game.cookies+mo(){Game.HasUnlocked(Qo[e])||c.push(Qo[e])})),0!==c.length&&e.appendChild(In("basic","Rare plant drops left to unlock",zn(c))),e}())),o.appendChild(Rn("Prestige","Prestige")),e.Header.Prestige&&o.appendChild(function(){const t=document.createElement("div");t.className="CMStatsPrestigeSection";const o=Math.floor(Game.HowMuchPrestige(It+Game.cookiesReset+Gt+(Game.HasUnlocked("Chocolate egg")&&!Game.Has("Chocolate egg")?Ct:0)));t.appendChild(In("withTooltip","Prestige level (cur / max)",document.createTextNode(`${pe(Game.prestige)} / ${pe(o)}`),"PrestMaxTooltipPlaceholder"));const n=Math.max(0,Game.HowManyCookiesReset(o+1)-(It+Game.cookiesReset+Gt+(Game.HasUnlocked("Chocolate egg")&&!Game.Has("Chocolate egg")&&Ct?Ct:0))),i=document.createDocumentFragment();i.appendChild(document.createTextNode(pe(n)));const a=document.createElement("small");a.textContent=` (${ue(n/zt,1)})`,i.appendChild(a),t.appendChild(In("withTooltip","Cookies to next level",i,"NextPrestTooltipPlaceholder")),t.appendChild(In("withTooltip","Heavenly chips (cur / max)",document.createTextNode(`${pe(Game.heavenlyChips)} / ${pe(o-Game.prestige+Game.heavenlyChips)}`),"HeavenChipMaxTooltipPlaceholder")),t.appendChild(In("basic","Heavenly chips per second (last 5 seconds)",document.createTextNode(pe(ht,2))));const r=Number(e.HeavenlyChipsTarget);if(!Number.isNaN(r)){const e=r-Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned));e>0&&(t.appendChild(In("basic","Heavenly chips to target set in settings (cur)",document.createTextNode(pe(e)))),t.appendChild(In("basic","Time till target (cur, current 5 second average)",document.createTextNode(ue(e/ht)))))}const l=function(e){let t=Game.cookiesPs;To(),0===eo["Heavenly key"].bought&&(eo["Heavenly chip secret"].bought=1,eo["Heavenly cookie stand"].bought=1,eo["Heavenly bakery"].bought=1,eo["Heavenly confectionery"].bought=1,eo["Heavenly key"].bought=1,Ro(),t=Xe,To()),It>=1e6&&$o("Sacrifice"),It>=1e9&&$o("Oblivion"),It>=1e12&&$o("From scratch"),It>=1e15&&$o("Nihilism"),It>=1e18&&$o("Dematerialize"),It>=1e21&&$o("Nil zero zilch"),It>=1e24&&$o("Transcendence"),It>=1e27&&$o("Obliterate"),It>=1e30&&$o("Negative void"),It>=1e33&&$o("To crumbs, you say?"),It>=1e36&&$o("You get nothing"),It>=1e39&&$o("Humble rebeginnings"),It>=1e42&&$o("The end of the world"),It>=1e45&&$o("Oh, you're back"),It>=1e48&&$o("Lazarus"),It>=1e51&&$o("Smurf account"),It>=1e54&&$o("If at first you don't succeed"),eo["Heavenly chip secret"].bought=1,eo["Heavenly cookie stand"].bought=1,eo["Heavenly bakery"].bought=1,eo["Heavenly confectionery"].bought=1,eo["Heavenly key"].bought=1,Ue=e;const o=De;Ro(),qo(),o!==De&&Ro();const n=Xe-t;return Ue=Game.prestige,n}(o),s=document.createDocumentFragment();s.appendChild(document.createTextNode(pe(l)));const c=Math.round(l/Game.cookiesPs*1e4);if(Number.isFinite(c)&&0!==c){const e=document.createElement("small");e.textContent=` (${c/100}% of income)`,s.appendChild(e)}t.appendChild(In("withTooltip","Reset bonus income",s,"ResetTooltipPlaceholder"));const d=Math.floor(Game.HowMuchPrestige(Game.cookiesReset)),p=Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned)),u=p-d;if(!Game.Has("Lucky digit")){let e=7-p%10;e<0&&(e+=10);const o=u+e,n=p+e,i=document.createDocumentFragment();i.appendChild(document.createTextNode(`${n.toLocaleString()} / ${o.toLocaleString()} (+${e})`)),t.appendChild(In("basic",'Next "Lucky Digit" (total / reset)',i))}if(!Game.Has("Lucky number")){let e=777-p%1e3;e<0&&(e+=1e3);const o=u+e,n=p+e,i=document.createDocumentFragment();i.appendChild(document.createTextNode(`${n.toLocaleString()} / ${o.toLocaleString()} (+${e})`)),t.appendChild(In("basic",'Next "Lucky Number" (total / reset)',i))}if(!Game.Has("Lucky payout")){let e=777777-p%1e6;e<0&&(e+=1e6);const o=u+e,n=p+e,i=document.createDocumentFragment();i.appendChild(document.createTextNode(`${n.toLocaleString()} / ${o.toLocaleString()} (+${e})`)),t.appendChild(In("basic",'Next "Lucky Payout" (total / reset)',i))}return t}()),Game.cpsSucked>0&&(o.appendChild(Rn("Wrinklers","Wrink")),e.Header.Wrink)){const e=document.createDocumentFragment();e.appendChild(document.createTextNode(`${pe(Gt)} / ${pe(vt)} `));const t=document.createElement("a");t.textContent="Pop All Normal",t.className="option",t.onclick=function(){On()},e.appendChild(t),o.appendChild(In("basic","Rewards of Popping (All/Normal)",e));const n=document.createDocumentFragment();n.appendChild(document.createTextNode(`${pe(wt[0])} `));const i=document.createElement("a");i.textContent="Pop Single Fattest",i.className="option",i.onclick=function(){null!==wt[1]&&(Game.wrinklers[wt[1]].hp=0)},n.appendChild(i),o.appendChild(In("basic",`Rewards of Popping Single Fattest Non-Shiny Wrinkler (id: ${null!==wt[1]?wt[1]:"None"})`,n))}if(o.appendChild(function(){const t=document.createElement("div");t.className="CMStatsSeasonSection";let o=!1;const n=[];Object.keys(zo).forEach((e=>{Game.Has(zo[e])||(n.push(zo[e]),o=!0)}));const i=[];Object.keys(Vo).forEach((e=>{Game.Has(Vo[e])||(i.push(Vo[e]),o=!0)}));const a=[];Object.keys(_o).forEach((e=>{Game.Has(_o[e])||(a.push(_o[e]),o=!0)}));const r=[];Object.keys(Game.eggDrops).forEach((e=>{Game.HasUnlocked(Game.eggDrops[e])||(r.push(Game.eggDrops[e]),o=!0)}));const l=[];Object.keys(Game.rareEggDrops).forEach((e=>{Game.HasUnlocked(Game.rareEggDrops[e])||(l.push(Game.rareEggDrops[e]),o=!0)}));const s=Game.HasUnlocked("Chocolate egg")&&!Game.Has("Chocolate egg"),c=Game.Has("Century egg");if(("christmas"===Game.season||o||s||c)&&(t.appendChild(Rn("Season Specials","Sea")),e.Header.Sea)){if(0!==n.length){t.appendChild(In("basic","Halloween cookies left to buy",zn(n)));let e=.95;if(Game.HasAchiev("Spooky cookies")&&(e=.8),Game.Has("Starterror")&&(e*=.9),e*=1/Game.dropRateMult(),Game.hasGod){const t=Game.hasGod("seasons");1===t?e*=.9:2===t?e*=.95:3===t&&(e*=.97)}const o=n.length/7;t.appendChild(In("basic","Chance of receiving a cookie from wrinkler/shiny wrinkler",document.createTextNode(`${pe((1-e)*o*100)}% / ${pe((1-.9*e)*o*100)}%`)))}if(0!==i.length){t.appendChild(In("basic","Christmas cookies left to buy",zn(i)));let e=.8;if(Game.HasAchiev("Let it snow")&&(e=.6),e*=1/Game.dropRateMult(),Game.Has("Starsnow")&&(e*=.95),Game.hasGod){const t=Game.hasGod("seasons");1===t?e*=.9:2===t?e*=.95:3===t&&(e*=.97)}const o=i.length/7;t.appendChild(In("basic","Chance of receiving a cookie from reindeer",document.createTextNode(`${pe((1-e)*o*100)}%`)))}0!==a.length&&t.appendChild(In("basic","Valentine cookies left to buy",zn(a)));const e=function(e){let t=e*(1/Game.dropRateMult());if(Game.HasAchiev("Hide & seek champion")&&(t*=.7),Game.Has("Omelette")&&(t*=.9),Game.Has("Starspawn")&&(t*=.9),Game.hasGod){const e=Game.hasGod("seasons");1===e?t*=.9:2===e?t*=.95:3===e&&(t*=.97)}const o=1-t,n=Game.eggDrops.length-r.length,i=Game.rareEggDrops.length-l.length,a=.9*o*(1-n/Game.eggDrops.length),s=.1*o*(1-i/Game.rareEggDrops.length),c=.9*o*(n/Game.eggDrops.length)+.1*o*(i/Game.rareEggDrops.length);return[a+.9*c*(1-n/Game.eggDrops.length),s+.1*c*(1-i/Game.rareEggDrops.length)]};0!==r.length&&(t.appendChild(In("basic","Normal easter eggs left to unlock",zn(r))),t.appendChild(In("basic","Chance of receiving an egg from wrinkler/golden cookie",document.createTextNode(`${pe(100*e(.98)[0])}% / ${pe(100*e(.9)[0])}%`)))),0!==l.length&&(t.appendChild(In("basic","Rare easter eggs left to unlock",zn(l))),t.appendChild(In("basic","Chance of receiving a rare egg from wrinkler/golden cookie",document.createTextNode(`${pe(100*e(.98)[1])}% / ${pe(100*e(.9)[1])}%`)))),"christmas"===Game.season&&t.appendChild(In("basic","Reindeer reward",document.createTextNode(pe(ft)))),s&&t.appendChild(In("withTooltip","Chocolate egg cookies",document.createTextNode(pe(Ct)),"ChoEggTooltipPlaceholder")),c&&t.appendChild(In("basic","Century egg multiplier",document.createTextNode(Math.round(1e4*(gt-1))/100+"%")))}return t}()),o.appendChild(Rn("Miscellaneous","Misc")),e.Header.Misc){if(o.appendChild(In("basic",`Average cookies per second (past ${J[e.AvgCPSHist]<60?`${J[e.AvgCPSHist]} seconds`:J[e.AvgCPSHist]/60+(3===e.AvgCPSHist?" minute":" minutes")})`,document.createTextNode(pe(uo(),3)))),o.appendChild(In("basic",`Average cookie clicks per second (past ${Z[e.AvgClicksHist]}${0===e.AvgClicksHist?" second":" seconds"})`,document.createTextNode(pe(St,1)))),o.appendChild(In("basic",`Cookies from clicking (past ${Z[e.AvgClicksHist]}${0===e.AvgClicksHist?" second":" seconds"})`,document.createTextNode(pe(he.calcSum(St*Z[e.AvgClicksHist]))))),Game.Has("Fortune cookies")){const e=[];Object.keys(Io).forEach((t=>{Game.Has(Io[t])||e.push(Io[t])})),0!==e.length&&o.appendChild(In("basic","Fortune Upgrades Left to Buy",zn(e)))}if(e.ShowMissedGC&&o.appendChild(In("basic","Missed golden cookies",document.createTextNode(pe(Game.missedGoldenClicks)))),Game.prefs.autosave){const e=document.createElement("span");e.id="CMStatsAutosaveTimer",e.innerText=Game.sayTime(60*Game.fps-(Game.OnAscend?0:Game.T%(60*Game.fps)),4),o.appendChild(In("basic","Time till autosave",e))}}l("menu").insertBefore(o,l("menu").childNodes[2]),e.MissingUpgrades&&l("menu").childNodes.forEach((e=>{if(e.children[0])if("Prestige"===e.children[0].innerHTML&&Pt){const t=Pt.match(new RegExp("div","g")||0).length/2,o=document.createElement("div");o.id="CMMissingUpgradesPrestigeTitle",o.className="listing";const n=document.createElement("div");n.innerHTML=`Missing Prestige upgrades: ${t}/${Game.PrestigeUpgrades.length} (${Math.floor(t/Game.PrestigeUpgrades.length*100)}%)`,o.appendChild(n),e.appendChild(o);const i=document.createElement("div");i.className="listing crateBox",i.innerHTML=Pt,e.appendChild(i)}else if("Upgrades"===e.children[0].innerHTML){if(Bt){const t=Bt.match(new RegExp("div","g")||0).length/2,o=document.createElement("div");o.id="CMMissingUpgradesTitle",o.className="listing";const n=document.createElement("div");n.innerHTML=`Missing normal upgrades: ${t}/${Game.UpgradesByPool[""].length+Game.UpgradesByPool.tech.length} (${Math.floor(t/(Game.UpgradesByPool[""].length+Game.UpgradesByPool.tech.length)*100)}%)`,o.appendChild(n),e.insertBefore(o,e.childNodes[3]);const i=document.createElement("div");i.className="listing crateBox",i.innerHTML=Bt,e.insertBefore(i,document.getElementById("CMMissingUpgradesTitle").nextSibling)}if(Et){const t=Et.match(new RegExp("div","g")||0).length/2,o=document.createElement("div");o.id="CMMissingUpgradesCookiesTitle",o.className="listing";const n=document.createElement("div");n.innerHTML=`Missing Cookie upgrades: ${t}/${Game.UpgradesByPool.cookie.length} (${Math.floor(t/Game.UpgradesByPool.cookie.length*100)}%)`,o.appendChild(n),e.appendChild(o);const i=document.createElement("div");i.className="listing crateBox",i.innerHTML=Et,e.appendChild(i)}}})),e.MissingAchievements&&function(){let t;Object.values(document.querySelectorAll("div.title")).forEach((e=>{e.textContent.includes("Achievements")&&(t=e.parentElement.querySelectorAll("div.listing.crateBox")[0])})),e.MissingAchievements&&Object.values(t.children).forEach((e=>{if(!e.className.includes("enabled")){const t=e.onclick.toString().split(/\[(.*)\]/gi)[1],{icon:o}=Game.AchievementsById[t];e.style.backgroundPosition=`${48*-o[0]}px ${48*-o[1]}px`,e.onmouseover=function(){Game.mouseDown||(Game.setOnCrate(this),Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return function(e){const t=[];"shadow"===e.pool?t.push("Shadow Achievement","#9700cf"):t.push("Achievement",0),t.push("Locked",0);let o=0;(Game.Has("Neuromancy")||Game.sesame&&"debug"===e.pool)&&(o=1),o&&0===e.won?t.push("Click to win!","#00c462"):o&&e.won>0&&t.push("Click to lose!","#00c462");let{icon:n}=e;e.iconFunction&&(n=e.iconFunction());let{desc:i}=e;e.descFunc&&(i=e.descFunc("stats"));let a="";for(let e=0;e[${t[e]}]`);return a=a.substring(1),`
\n
\n
${e.name}
\n ${a}
${i}
\n ${Game.sesame?`
Id : ${e.id} | Order : ${Math.floor(e.order)}${e.tier?` | Tier : ${e.tier}`:""}
`:""}`}(Game.AchievementsById[t])}),"top"),Game.tooltip.wobble())}}}))}()}const _n={Favourite:"Favourite Settings",Calculation:"Calculation",Notation:"Notation",Colours:"Colours and colour coding",BarsDisplay:"Infobars and visual settings",Tooltip:"Tooltips",Statistics:"Statistics",Notification:"Notifications",Miscellaneous:"Miscellaneous"},Qn={NotificationGeneral:"General Notifications",NotificationGC:"Golden Cookie",NotificationFC:"Fortune Cookie",NotificationSea:"Season Special",NotificationGard:"Garden Tick",NotificationMagi:"Full Magic Bar",NotificationWrink:"Wrinkler",NotificationWrinkMax:"Maximum Wrinklers"};function Xn(t,o){const n=document.createElement("div");n.className="title",n.style.opacity="0.7",n.style.fontSize="17px",n.appendChild(document.createTextNode(`${o} `));const i=document.createElement("span");return i.style.cursor="pointer",i.style.display="inline-block",i.style.height="14px",i.style.width="14px",i.style.borderRadius="7px",i.style.textAlign="center",i.style.backgroundColor="#C0C0C0",i.style.color="black",i.style.fontSize="13px",i.style.verticalAlign="middle",i.textContent=e.Header[t]?"-":"+",i.onclick=function(){$n(t),Game.UpdateMenu()},n.appendChild(i),n}function qn(t){const o=document.createElement("div");if(o.className="listing",1===e.FavouriteSettings&&o.appendChild(function(e){const t=document.createElement("a");return de.includes(e)?(t.innerText="★",t.style.color="yellow"):t.innerText="☆",t.className="option",t.onclick=function(){!function(e){de.includes(e)?de=de.filter((function(t){return t!==e})):de.push(e)}(e),En(),Game.UpdateMenu()},t.onmouseover=function(){Game.tooltip.draw(this,escape(I.FavouriteSettingPlaceholder.innerHTML))},t.onmouseout=function(){Game.tooltip.hide()},t.appendChild(document.createTextNode(" ")),t}(t)),"bool"===bn[t].type){const n=document.createElement("a");bn[t].toggle&&0===e[t]?n.className="option off":n.className="option",n.id=Hn+t,n.onclick=function(){!function(t){e[t]+=1,e[t]===bn[t].label.length?(e[t]=0,bn[t].toggle&&(l(Hn+t).className="option off")):l(Hn+t).className="option",void 0!==bn[t].func&&bn[t].func(),l(Hn+t).innerHTML=bn[t].label[e[t]],En()}(t)},n.textContent=bn[t].label[e[t]],o.appendChild(n);const i=document.createElement("label");return i.textContent=bn[t].desc,i.style.lineHeight="1.6",o.appendChild(i),o}if("vol"===bn[t].type){const n=document.createElement("div");n.className="sliderBox";const i=document.createElement("div");i.style.float="left",i.innerHTML=bn[t].desc,n.appendChild(i);const a=document.createElement("div");a.id=`slider${t}right`,a.style.float="right",a.innerHTML=`${e[t]}%`,n.appendChild(a);const r=document.createElement("input");r.className="slider",r.id=`slider${t}`,r.style.clear="both",r.type="range",r.min="0",r.max="100",r.step="1",r.value=e[t],r.oninput=function(){Un(t)},r.onchange=function(){Un(t)},n.appendChild(r),o.appendChild(n);const l=document.createElement("a");return l.className="option",l.onclick=function(){Mn(e[t.replace("Volume","SoundURL")],t.replace("Volume","Sound"),t,!0)},l.textContent="Test sound",o.appendChild(l),o}if("url"===bn[t].type){const n=document.createElement("span");n.className="option",n.textContent=`${bn[t].label} `,n.style.lineHeight="1.6",o.appendChild(n);const i=document.createElement("input");i.id=Hn+t,i.className="option",i.type="text",i.readOnly=!0,i.setAttribute("value",e[t]),i.style.width="300px",o.appendChild(i),o.appendChild(document.createTextNode(" "));const a=document.createElement("input");a.id=`${Hn+t}Prompt`,a.className="option",a.type="text",a.setAttribute("value",e[t]);const r=document.createElement("a");r.className="option",r.onclick=function(){!function(e,t){Game.promptWrapL.className="framed";const o=e;Game.promptL.innerHTML=`${o}
`,Object.keys(t).forEach((e=>{const o=document.createElement("a");o.id=`promptOption${e}`,o.className="option",o.onclick=function(){PlaySound("snd/tick.mp3"),t[e][1]()},o.textContent=t[e][0],Game.promptL.children[1].appendChild(o)})),Game.promptAnchorL.style.display="block",Game.darkenL.style.display="block",Game.promptL.focus(),Game.promptOn=1,Game.UpdatePrompt()}(a.outerHTML,[["Save",function(){e[t]=l(`CMConfig${t}Prompt`).value,En(),Game.ClosePrompt(),Game.UpdateMenu()}],["Cancel",function(){Game.ClosePrompt()}]])},r.textContent="Edit",o.appendChild(r);const s=document.createElement("label");return s.textContent=bn[t].desc,s.style.lineHeight="1.6",o.appendChild(s),o}if("colour"===bn[t].type){const n=document.createElement("span");n.className="option";const i=document.createElement("input");i.id=t,i.style.width="65px",i.setAttribute("value",e[t]),n.appendChild(i),new jn(i,{hash:!0,position:"right",onInput:function(){e[this.targetElement.id]=this.toHEXString(),Pn(),En(),Game.UpdateMenu()}});const a=document.createElement("label");if(a.textContent=bn[t].desc,a.style.lineHeight="1.6",n.appendChild(a),t.includes("Flash")){const e=document.createElement("a");e.className="option",e.onclick=function(){Tn(3,t.replace("Colour",""),!0)},e.textContent="Test flash",n.appendChild(e)}return o.appendChild(n),Dn().init(),o}if("numscale"===bn[t].type){const n=document.createElement("span");n.className="option",n.textContent=`${bn[t].label} `,n.style.lineHeight="1.6",o.appendChild(n);const i=document.createElement("input");i.id=Hn+t,i.className="option",i.type="number",i.value=e[t],i.min=bn[t].min,i.max=bn[t].max,i.oninput=function(){e[t]=this.value,En(),un()},o.appendChild(i),o.appendChild(document.createTextNode(" "));const a=document.createElement("label");return a.textContent=bn[t].desc,a.style.lineHeight="1.6",o.appendChild(a),o}return o}function Yn(t){if(1===e.TimerBar&&0===e.TimerBarPos){const e=parseInt(l("CMTimerBar").style.height,10);Game.mouseY-=e,t(),Game.mouseY+=e}else t()}function Kn(){S.Beautify=Beautify,Beautify=pe,S.CalculateGains=Game.CalculateGains,Game.CalculateGains=function(){S.CalculateGains(),_e=1,B=Date.now(),P=Date.now()},S.tooltip={},S.tooltip.draw=Game.tooltip.draw,S.tooltip.drawMod=new Function(`return ${Game.tooltip.draw.toString().split("this").join("Game.tooltip")}`)(),Game.tooltip.draw=function(e,t,o){S.tooltip.drawMod(e,t,o)},S.tooltip.update=Game.tooltip.update,S.tooltip.updateMod=new Function(`return ${Game.tooltip.update.toString().split("this.").join("Game.tooltip.")}`)(),Game.tooltip.update=function(){S.tooltip.updateMod(),function(){if("store"===Game.tooltip.origin){let t=0;1===e.ToolWarnLucky&&1===e.ToolWarnPos&&null!==l("CMDispTooltipWarningParent")&&(t=l("CMDispTooltipWarningParent").clientHeight-4),Game.tooltip.tta.style.top=`${Math.min(parseInt(Game.tooltip.tta.style.top,10),l("game").clientHeight+l("topBar").clientHeight-Game.tooltip.tt.clientHeight-t-46)}px`}}()},S.UpdateWrinklers=Game.UpdateWrinklers,Game.UpdateWrinklers=function(){Yn(S.UpdateWrinklers)},S.UpdateSpecial=Game.UpdateSpecial,Game.UpdateSpecial=function(){Yn(S.UpdateSpecial)},l("bigCookie").removeEventListener("click",Game.ClickCookie,!1),l("bigCookie").addEventListener("click",(function(){Yn(Game.ClickCookie)}),!1),S.RebuildUpgrades=Game.RebuildUpgrades,Game.RebuildUpgrades=function(){S.RebuildUpgrades(),M=[],Object.keys(Game.UpgradesInStore).forEach((e=>{null!==l(`upgrade${e}`).onmouseover&&(M[e]=l(`upgrade${e}`).onmouseover,l(`upgrade${e}`).onmouseover=function(){Game.mouseDown||(Game.setOnCrate(this),Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Fn("u",`${e}`)}),"store"),Game.tooltip.wobble())})})),Game.CalculateGains()},S.ClickProduct=Game.ClickProduct,Game.ClickProduct=function(t){(!e.BulkBuyBlock||Game.ObjectsById[t].bulkPrice-1;--e)if(Game.ObjectsById[e].amount>0){const o=Zt[Game.ObjectsById[e].name].name;Zt[o].amount-=1,Le-=1,t=Zt[o].basePrice*Game.priceIncrease**Math.max(0,Zt[o].amount-1-Zt[o].free),t=Game.modifyBuildingPrice(Zt[o],t),t=Math.ceil(t);break}const o=De;return Ro(),qo(),o!==De&&Ro(),[Xe-Game.cookiesPs,t]}(t),n=ue(o/(e+Game.cookiesPs));let i;i=0===Game.cookiesPs?pe(1/0):pe(e/Game.cookiesPs*100),l("dragonAuraInfo").style.minHeight="60px",l("dragonAuraInfo").style.margin="8px",l("dragonAuraInfo").appendChild(document.createElement("div")).className="line";const a=document.createElement("div");a.style.minWidth="200px",a.style.textAlign="center",a.textContent=`Picking this aura will change CPS by ${pe(e)} (${i}% of current CPS).`,l("dragonAuraInfo").appendChild(a);const r=document.createElement("div");r.style.minWidth="200px",r.style.textAlign="center",r.textContent=`It will take ${n} to recover the cost.`,l("dragonAuraInfo").appendChild(r)}}(t)},S.ToggleSpecialMenu=Game.ToggleSpecialMenu,Game.ToggleSpecialMenu=function(e){S.ToggleSpecialMenu(e),function(){if(null!==(l("specialPopup").className.match(/onScreen/)&&l("specialPopup").children[0].style.background.match(/dragon/)))for(let e=0;e${Ze}`,"this"),Game.tooltip.wobble()},l("specialPopup").children[e].onmouseout=function(){Game.tooltip.shouldHide=1})}()},S.UpdateMenu=Game.UpdateMenu,Game.UpdateMenu=function(){void 0!==Dn().picker&&void 0!==Dn().picker.owner||(S.UpdateMenu(),function(){const t=document.createElement("div");t.className="title","prefs"===Game.onMenu?(t.textContent="Cookie Monster Settings",function(t){const o=document.createDocumentFragment();o.appendChild(t),Object.keys(_n).forEach((t=>{if("Favourite"===t){if(0!==de.length&&e.FavouriteSettings>0&&(o.appendChild(Xn(t,_n[t])),e.Header[t]))for(let e=0;e{const n=Xn(t,Qn[t]);n.style.fontSize="15px",n.style.opacity="0.5",o.appendChild(n),e.Header[t]&&Object.keys(bn).forEach((e=>{bn[e].group===t&&o.appendChild(qn(e))}))})):Object.keys(bn).forEach((e=>{bn[e].group===t&&o.appendChild(qn(e))})))}));const n=document.createElement("div");n.className="listing";const i=document.createElement("a");i.className="option",i.onclick=function(){Nn(cn)},i.textContent="Restore Default",n.appendChild(i),o.appendChild(n),l("menu").childNodes[2].insertBefore(o,l("menu").childNodes[2].childNodes[l("menu").childNodes[2].childNodes.length-1])}(t)):"stats"===Game.onMenu?e.Stats&&(t.textContent="Cookie Monster Statistics",Vn(t)):"log"===Game.onMenu&&(t.textContent="Cookie Monster ",function(t){const o=document.createElement("div");o.className="subsection";const n=document.createElement("span");if(n.style.cursor="pointer",n.style.display="inline-block",n.style.height="14px",n.style.width="14px",n.style.borderRadius="7px",n.style.textAlign="center",n.style.backgroundColor="#C0C0C0",n.style.color="black",n.style.fontSize="13px",n.style.verticalAlign="middle",n.textContent=e.Header.InfoTab?"-":"+",n.onclick=function(){$n("InfoTab"),Game.UpdateMenu()},t.appendChild(n),o.appendChild(t),e.Header.InfoTab){const e=document.createElement("div");e.innerHTML='
\n Cookie Monster\n offers a wide range of tools and statistics to enhance your game experience.\n It is not a cheat interface – although it does offer helpers for golden cookies and such, everything can be toggled off at will to only leave how much information you want.
\n Progess on new updates and all previous release notes can be found on the GitHub page linked above!
\n Please also report any bugs you may find over there!
\n
\n ',o.appendChild(e);const t=document.createElement("div");t.innerHTML="
\nThese are the release notes for the latest update (v 2.031.7).
\n
\nThis update implements the following functions:
\n- Updated the ordering and description of all settings of Cookie Monster
\n- Colours of Flash notifications can now be set by the user
\n- You can now select a number of settings to be your 'favourite'. They will be displayed at the top of all other settings in a new section. This functionality is toggleable and you can find it in the miscellaneous section
\n- The statistics page now shows cookies earned by clicking for a selected time period
\n- The statistics page can now show missing normal achievements, this can be toggled in the settings
\n
\nThis update fixes the following bugs:
\n- Fixed some typo's
\n- No longer show the wrinkler pop buttons when wrinklers can't spawn
\n- Fixed incorrect calculation of plant maturity for relevant tooltips
\n- Fixed edit prompts not working in settings
\n- Fixed red and purple being switched around for PP colour coding
\n- Fixed incorrect notation of numbers in Dragon tooltip and interface
\n- Fixed incorrect calculation of changing Dragon aura cost
\n- Fixed incorrect calculation of changing Pantheon gods effect
\n- Fixed fluctuating PP values when god Cyclius was selected
\n- Fixed black flickering when Golden Cookies or buffs start
\n
\n",o.appendChild(t)}const i=l("menu").children[1];i.insertBefore(o,i.children[1])}(t))}())},S.sayTime=Game.sayTime,V=function(e,t){return Number.isNaN(e)||e<=0?S.sayTime(e,t):ue(e/Game.fps,1)},S.Logic=Game.Logic,Game.Logic=function(){S.Logic();let t="Cookie Clicker";"fools"===Game.season&&(t="Cookie Baker"),ce=`${Game.OnAscend?"Ascending! ":""}${pe(Game.cookies)} ${1===Game.cookies?"cookie":"cookies"} - ${t}`,function(){if(Game.OnAscend||0===e.Title)document.title=ce;else if(1===e.Title){let e,t,o,n=!1,i=!1;e=Vt?Vt.wrath?`[W${Math.ceil(Vt.life/Game.fps)}]`:`[G${Math.ceil(Vt.life/Game.fps)}]`:Game.Has("Golden switch [off]")?"[GS]":`[${Number(l("CMTimerBarGCMinBar").textContent)<0?"!":""}${Math.ceil((Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.time)/Game.fps)}]`,f&&(n=!0,t="[F]"),"christmas"===Game.season&&(i=!0,o=g?`[R${Math.ceil(_t.life/Game.fps)}]`:`[${Number(l("CMTimerBarRenMinBar").textContent)<0?"!":""}${Math.ceil((Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.time)/Game.fps)}]`);let a=ce;"["===a.charAt(0)&&(a=a.substring(a.lastIndexOf("]")+1)),document.title=`${e+(n?t:"")+(i?o:"")} ${a}`}else if(2===e.Title){let e="",t=!1;Vt&&(t=!0,Vt.wrath?e+=`[W${Math.ceil(Vt.life/Game.fps)}]`:e+=`[G${Math.ceil(Vt.life/Game.fps)}]`),f&&(t=!0,e+="[F]"),"christmas"===Game.season&&g&&(e+=`[R${Math.ceil(_t.life/Game.fps)}]`,t=!0),t&&(e+=" - ");let o="Cookie Clicker";"fools"===Game.season&&(o="Cookie Baker"),e+=o,document.title=e}}(),function(){const t=Math.max(0,Game.HowManyCookiesReset(Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned))+1)-(Game.cookiesEarned+Game.cookiesReset)),o=Game.sayTime((Date.now()-Game.startDate)/1e3*Game.fps,-1);let n="";n+=`You've been on this run for ${""===o?"not very long":o}.
`,n+='
',Game.prestige>0&&(n+=`Your prestige level is currently ${pe(Game.prestige)}.
(CpS +${pe(Game.prestige)}%)`,n+='
'),n+=Oe<1?"Ascending now would grant you no prestige.":Oe<2?"Ascending now would grant you
1 prestige level (+1% CpS)
and 1 heavenly chip to spend.":`Ascending now would grant you
${pe(Oe)} prestige levels (+${pe(Oe)}% CpS)
and ${pe(Oe)} heavenly chips to spend.`,n+='
',n+=`You need ${pe(t)} more cookies for the next level.
`,n+=e.TooltipAscendButton?`
It takes ${Qt} to reach the next level and you were making ${pe(ht,2)} chips on average in the last 5 seconds.
`:"",l("ascendTooltip").innerHTML=n}()}}function Jn(){wn(),an(),sn(),r=Object.keys(Game.mods).length,w=document.createElement("style"),w.type="text/css",w.id="CMCSS",document.head.appendChild(w),function(){const e=document.createElement("div");e.id="CMBotBar",e.style.height="69px",e.style.width="100%",e.style.position="absolute",e.style.display="none",e.style.backgroundColor="#262224",e.style.backgroundImage="linear-gradient(to bottom, #4d4548, #000000)",e.style.borderTop="1px solid black",e.style.overflow="auto",e.style.textShadow="-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black";const t=e.appendChild(document.createElement("table"));t.style.width="100%",t.style.textAlign="center",t.style.whiteSpace="nowrap";const o=t.appendChild(document.createElement("tbody")),n=function(e,t){const o=document.createElement("td");return o.style.textAlign="right",o.className=E+t,o.textContent=e,o},i=o.appendChild(document.createElement("tr"));i.style.fontWeight="bold",i.appendChild(n("CM 2.031.7",W)),o.appendChild(document.createElement("tr")).appendChild(n("Bonus Income",O)),o.appendChild(document.createElement("tr")).appendChild(n("Payback Period",O)),o.appendChild(document.createElement("tr")).appendChild(n("Time Left",O)),l("wrapper").appendChild(e),Object.keys(Game.Objects).forEach((e=>{go(e)}))}(),function(){const e=document.createElement("div");e.id="CMTimerBar",e.style.position="absolute",e.style.display="none",e.style.height="0px",e.style.fontSize="10px",e.style.fontWeight="bold",e.style.backgroundColor="black";const t=ho("CMTimerBarGC","Next Cookie",[{id:"CMTimerBarGCMinBar",color:D},{id:"CMTimerBarGCBar",color:j}]);e.appendChild(t);const o=ho("CMTimerBarRen","Next Reindeer",[{id:"CMTimerBarRenMinBar",color:D},{id:"CMTimerBarRenBar",color:L}]);e.appendChild(o);const n=document.createElement("div");n.id="CMTimerBarBuffTimers",e.appendChild(n),l("wrapper").appendChild(e)}(),function(){const e=document.createElement("div");e.id="CMUpgradeBar",e.style.width="100%",e.style.backgroundColor="black",e.style.textAlign="center",e.style.fontWeight="bold",e.style.display="none",e.style.zIndex="21",e.onmouseout=function(){Game.tooltip.hide()};const t=document.createElement("div");t.appendChild(function(){const e=document.createElement("div");e.style.minWidth="330px",e.style.marginBottom="4px";const t=document.createElement("div");t.className="name",t.style.marginBottom="4px",t.textContent="Legend",e.appendChild(t);const o=function(e,t){const o=document.createElement("div");o.style.verticalAlign="middle";const n=document.createElement("span");return n.className=N+e,n.style.display="inline-block",n.style.height="10px",n.style.width="10px",n.style.marginRight="4px",o.appendChild(n),o.appendChild(document.createTextNode(t)),o};return e.appendChild(o(O,"Better than the best PP of a building option")),e.appendChild(o(F,"Same as the best PP building option")),e.appendChild(o(W,"Within the top 10 of PP for buildings")),e.appendChild(o(L,"Within the top 20 of PP for buildings")),e.appendChild(o(A,"Within the top 30 of PP for buildings")),e.appendChild(o(j,"Outside of the top 30 of PP for buildings")),e.appendChild(o(D,"Negative or infinity PP")),e}()),e.onmouseover=function(){Game.tooltip.draw(this,escape(t.innerHTML),"store")};const o=function(e,t){const o=document.createElement("span");return o.id=e,o.className=E+t,o.style.width="14.28571428571429%",o.style.display="inline-block",o.textContent="0",o};e.appendChild(o("CMUpgradeBarBlue",O)),e.appendChild(o("CMUpgradeBarGreen",F)),e.appendChild(o("CMUpgradeBarYellow",W)),e.appendChild(o("CMUpgradeBarOrange",L)),e.appendChild(o("CMUpgradeBarRed",A)),e.appendChild(o("CMUpgradeBarPurple",j)),e.appendChild(o("CMUpgradeBarGray",D)),l("upgrades").parentNode.insertBefore(e,l("upgrades").parentNode.childNodes[3])}(),function(){const e=document.createElement("div");e.id="CMFlashScreen",e.style.width="100%",e.style.height="100%",e.style.backgroundColor="white",e.style.display="none",e.style.zIndex="9999999999",e.style.position="absolute",l("wrapper").appendChild(e)}(),function(){const e=document.createElement("div");e.id="CMSectionHidButtons",e.style.textAlign="center";const t=document.createElement("a");t.className="option",t.onclick=function(){"flex"===l("upgrades").style.display?(l("upgrades").style.display="none",l("toggleUpgrades").style.display="none",l("techUpgrades").style.display="none",l("vaultUpgrades").style.display="none"):(l("upgrades").style.display="flex",0!==l("toggleUpgrades").children.length&&(l("toggleUpgrades").style.display="block"),0!==l("techUpgrades").children.length&&(l("techUpgrades").style.display="block"),0!==l("vaultUpgrades").children.length&&(l("vaultUpgrades").style.display="block"))},t.textContent="Hide/Show Upgrades",e.appendChild(t);const o=document.createElement("a");o.className="option",o.onclick=function(){"grid"===l("products").style.display?l("products").style.display="none":l("products").style.display="grid"},o.textContent="Hide/Show Buildings",e.appendChild(o),l("store").insertBefore(e,l("store").childNodes[2])}(),function(){const e=document.createElement("link");e.id="CMFavicon",e.rel="shortcut icon",e.href="https://orteil.dashnet.org/cookieclicker/favicon.ico",document.getElementsByTagName("head")[0].appendChild(e)}(),Object.keys(R).forEach((e=>{!function(e,t,o){const n=document.createElement("div");n.id=e;const i=document.createElement("div");i.style.minWidth=o,i.style.marginBottom="4px";const a=document.createElement("div");a.style.textAlign="left",a.textContent=t,i.appendChild(a),n.appendChild(i),I[e]=n}(R[e][0],R[e][1],R[e][2])})),function(){const e=document.createElement("a");e.id="PopAllNormalWrinklerButton",e.textContent="Pop All Normal",e.className="option",e.onclick=function(){On()},e.onmouseout=function(){Game.tooltip.shouldHide=1},e.onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Fn("wb","PopAll")}),"this"),Game.tooltip.wobble()},l("sectionLeftExtra").children[0].append(e);const t=document.createElement("a");t.id="PopFattestWrinklerButton",t.textContent="Pop Single Fattest",t.className="option",t.onclick=function(){null!==wt[1]&&(Game.wrinklers[wt[1]].hp=0)},t.onmouseout=function(){Game.tooltip.shouldHide=1},t.onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Fn("wb","PopFattest")}),"this"),Game.tooltip.wobble()},l("sectionLeftExtra").children[0].append(t)}(),l("products").style.display="grid",l("storeBulk").style.gridRow="1/1",l("upgrades").style.display="flex",l("upgrades").style["flex-wrap"]="wrap",Object.keys(Game.Objects).forEach((e=>{const t=Game.Objects[e];null!==l(`product${t.id}`).onmouseover&&(x[e]=l(`product${t.id}`).onmouseover,l(`product${t.id}`).onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Fn("b",`${e}`)}),"store"),Game.tooltip.wobble()})})),Game.canLumps()&&(s=l("lumps").onmouseover,l("lumps").onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Fn("s","Lump")}),"this"),Game.tooltip.wobble()}),h=Game.LoadMinigames,Game.LoadMinigames=function(){h(),Game.Objects.Farm.minigameLoaded&&(l("gardenTool-1").onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Fn("ha","HarvestAllButton")}),"this"),Game.tooltip.wobble()},Array.from(l("gardenPlot").children).forEach((e=>{const t=e.id.slice(-3);e.onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Fn("p",[`${t[0]}`,`${t[2]}`])}),"this"),Game.tooltip.wobble()}}))),Wn(),function(){if(Game.Objects.Temple.minigameLoaded){for(let e=0;e<11;e+=1)l(`templeGod${e}`).onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Fn("pag",e)}),"this"),Game.tooltip.wobble()};for(let e=0;e<3;e+=1)l(`templeSlot${e}`).onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Fn("pas",[e,Game.Objects.Temple.minigame.slot[e]])}),"this"),Game.tooltip.wobble()}}}(),An()},Game.LoadMinigames(),l("backgroundLeftCanvas").onmouseover=function(){_=1},l("backgroundLeftCanvas").onmouseout=function(){_=0,Game.tooltip.hide(),Object.keys(Game.wrinklers).forEach((e=>{X[e]=0}))},Kn(),An(),Game.CalculateGains(),Nn(),z=Game.OnAscend,Game.prefs.popups?Game.Popup("Cookie Monster version 2.031.7 loaded!"):Game.Notify("Cookie Monster version 2.031.7 loaded!","","",1,1),Game.Win("Third-party")}const Zn={init:function(){xn=!0;let e=!0;Game.version!==Number("2.031")&&(e=confirm("Cookie Monster version 2.031.7 is meant for Game version 2.031. Loading a different version may cause errors. Do you still want to load Cookie Monster?")),e&&(Jn(),Game.registerHook("draw",Oo),Game.registerHook("logic",Bn),Game.registerHook("click",Fo),xn=!1)},load:function(e){const t=JSON.parse(e);wn(),void 0!==t.favouriteSettings&&(de=t.favouriteSettings),Nn(t.settings),"2.031.7"!==t.version&&(Game.prefs.popups?Game.Popup("A new version of Cookie Monster has been loaded, check out the release notes in the info tab!"):Game.Notify("A new version of Cookie Monster has been loaded, check out the release notes in the info tab!","","",0,1))},save:kn};Game.registerMod("CookieMonster",Zn)})()})(); +(()=>{var e={877:function(e){!function(t,o){"use strict";"object"!=typeof e.exports?o(t):e.exports=t.document?o(t):function(e){if(!e.document)throw new Error("jscolor needs a window with document");return o(e)}}("undefined"!=typeof window?window:this,(function(e){"use strict";var t,o,n,i,a=((i={initialized:!1,instances:[],readyQueue:[],register:function(){void 0!==e&&e.document&&e.document.addEventListener("DOMContentLoaded",i.pub.init,!1)},installBySelector:function(t,o){if(!(o=o?i.node(o):e.document))throw new Error("Missing root node");for(var n=o.querySelectorAll(t),a=new RegExp("(^|\\s)("+i.pub.lookupClass+")(\\s*(\\{[^}]*\\})|\\s|$)","i"),r=0;r-1},isButtonEmpty:function(e){switch(i.nodeName(e)){case"input":return!e.value||""===e.value.trim();case"button":return""===e.textContent.trim()}return null},isPassiveEventSupported:function(){var t=!1;try{var o=Object.defineProperty({},"passive",{get:function(){t=!0}});e.addEventListener("testPassive",null,o),e.removeEventListener("testPassive",null,o)}catch(e){}return t}(),isColorAttrSupported:(n=e.document.createElement("input"),!(!n.setAttribute||(n.setAttribute("type","color"),"color"!=n.type.toLowerCase()))),dataProp:"_data_jscolor",setData:function(){var e=arguments[0];if(3===arguments.length){var t=e.hasOwnProperty(i.dataProp)?e[i.dataProp]:e[i.dataProp]={},o=arguments[2];return t[a=arguments[1]]=o,!0}if(2===arguments.length&&"object"==typeof arguments[1]){t=e.hasOwnProperty(i.dataProp)?e[i.dataProp]:e[i.dataProp]={};var n=arguments[1];for(var a in n)n.hasOwnProperty(a)&&(t[a]=n[a]);return!0}throw new Error("Invalid arguments")},removeData:function(){var e=arguments[0];if(!e.hasOwnProperty(i.dataProp))return!0;for(var t=1;t=3&&(n=l[0].match(s))&&(i=l[1].match(s))&&(a=l[2].match(s)))return o.format="rgb",o.rgba=[parseFloat(n[1])||0,parseFloat(i[1])||0,parseFloat(a[1])||0,null],l.length>=4&&(r=l[3].match(s))&&(o.format="rgba",o.rgba[3]=parseFloat(r[1])||0),o}return!1},parsePaletteValue:function(e){var t=[];"string"==typeof e?e.replace(/#[0-9A-F]{3}([0-9A-F]{3})?|rgba?\(([^)]*)\)/gi,(function(e){t.push(e)})):Array.isArray(e)&&(t=e);for(var o=[],n=0;ns[n]&&-t[n]+e[n]+l[n]/2>s[n]/2&&e[n]+l[n]-d[n]>=0?e[n]+l[n]-d[n]:e[n],-t[a]+e[a]+l[a]+d[a]-p+p*r>s[a]?-t[a]+e[a]+l[a]/2>s[a]/2&&e[a]+l[a]-p-p*r>=0?e[a]+l[a]-p-p*r:e[a]+l[a]-p+p*r:e[a]+l[a]-p+p*r>=0?e[a]+l[a]-p+p*r:e[a]+l[a]-p-p*r];else var u=[e[n],e[a]+l[a]-p+p*r];var m=u[n],h=u[a],g=o.fixed?"fixed":"absolute",f=(u[0]+d[0]>e[0]||u[0]0?Math.ceil(l/o):0,i=Math.max(1,Math.floor((t-(o-1)*e.paletteSpacing)/o)),a=e.paletteHeight?Math.min(e.paletteHeight,i):i),n&&(r=n*a+(n-1)*e.paletteSpacing),{cols:o,rows:n,cellW:i,cellH:a,width:t,height:r}},getControlPadding:function(e){return Math.max(e.padding/2,2*e.pointerBorderWidth+e.pointerThickness-e.controlBorderWidth)},getPadYChannel:function(e){switch(e.mode.charAt(1).toLowerCase()){case"v":return"v"}return"s"},getSliderChannel:function(e){if(e.mode.length>2)switch(e.mode.charAt(2).toLowerCase()){case"s":return"s";case"v":return"v"}return null},triggerCallback:function(e,t){if(e[t]){var o=null;if("string"==typeof e[t])try{o=new Function(e[t])}catch(e){console.error(e)}else o=e[t];o&&o.call(e)}},triggerGlobal:function(e){for(var t=i.getInstances(),o=0;o0)for(var c=0;c=2&&"string"==typeof arguments[0]){try{if(!a(arguments[0],arguments[1]))return!1}catch(e){return console.warn(e),!1}return this.redraw(),this.exposeColor(),!0}if(1===arguments.length&&"object"==typeof arguments[0]){var e=arguments[0],t=!0;for(var o in e)if(e.hasOwnProperty(o))try{a(o,e[o])||(t=!1)}catch(e){console.warn(e),t=!1}return this.redraw(),this.exposeColor(),t}throw new Error("Invalid arguments")},this.channel=function(e,t){if("string"!=typeof e)throw new Error("Invalid value for channel name: "+e);if(void 0===t)return this.channels.hasOwnProperty(e.toLowerCase())?this.channels[e.toLowerCase()]:(console.warn("Getting unknown channel: "+e),!1);var o=!1;switch(e.toLowerCase()){case"r":o=this.fromRGBA(t,null,null,null);break;case"g":o=this.fromRGBA(null,t,null,null);break;case"b":o=this.fromRGBA(null,null,t,null);break;case"h":o=this.fromHSVA(t,null,null,null);break;case"s":o=this.fromHSVA(null,t,null,null);break;case"v":o=this.fromHSVA(null,null,t,null);break;case"a":o=this.fromHSVA(null,null,null,t);break;default:return console.warn("Setting unknown channel: "+e),!1}return!!o&&(this.redraw(),!0)},this.trigger=function(e){for(var t=i.strList(e),o=0;o127.5},this.hide=function(){p()&&(i.removeClass(n.targetElement,i.pub.activeClassName),i.picker.wrap.parentNode.removeChild(i.picker.wrap),delete i.picker.owner)},this.show=function(){l()},this.redraw=function(){p()&&l()},this.getFormat=function(){return this._currentFormat},this._setFormat=function(e){this._currentFormat=e.toLowerCase()},this.hasAlphaChannel=function(){return"auto"===this.alphaChannel?"any"===this.format.toLowerCase()||i.isAlphaFormat(this.getFormat())||void 0!==this.alpha||void 0!==this.alphaElement:this.alphaChannel},this.processValueInput=function(e){this.fromString(e)||this.exposeColor()},this.processAlphaInput=function(e){this.fromHSVA(null,null,null,parseFloat(e))||this.exposeColor()},this.exposeColor=function(e){var t=this.toString(),o=this.getFormat();if(i.setDataAttr(this.targetElement,"current-color",t),e&i.flags.leaveValue||!this.valueElement||("hex"!==o&&"hexa"!==o||(this.uppercase||(t=t.toLowerCase()),this.hash||(t=t.replace(/^#/,""))),this.setValueElementValue(t)),!(e&i.flags.leaveAlpha)&&this.alphaElement){var n=Math.round(100*this.channels.a)/100;this.setAlphaElementValue(n)}e&i.flags.leavePreview||!this.previewElement||((i.isTextInput(this.previewElement)||i.isButton(this.previewElement)&&!i.isButtonEmpty(this.previewElement))&&this.previewPosition,this.setPreviewElementBg(this.toRGBAString())),p()&&(s(),c(),d())},this.setPreviewElementBg=function(e){if(this.previewElement){var t=null,o=null;(i.isTextInput(this.previewElement)||i.isButton(this.previewElement)&&!i.isButtonEmpty(this.previewElement))&&(t=this.previewPosition,o=this.previewSize);var n=[];if(e){n.push({image:i.genColorPreviewGradient(e,t,o?o-i.pub.previewSeparator.length:null),position:"left top",size:"auto",repeat:t?"repeat-y":"repeat",origin:"padding-box"});var a=i.genColorPreviewCanvas("rgba(0,0,0,0)",t?{left:"right",right:"left"}[t]:null,o,!0);n.push({image:"url('"+a.canvas.toDataURL()+"')",position:(t||"left")+" top",size:a.width+"px "+a.height+"px",repeat:t?"repeat-y":"repeat",origin:"padding-box"})}else n.push({image:"none",position:"left top",size:"auto",repeat:"no-repeat",origin:"padding-box"});for(var r={image:[],position:[],size:[],repeat:[],origin:[]},l=0;l=0;h-=1){var g=m[h];if(g)if(i.pub.presets.hasOwnProperty(g)){for(var u in i.pub.presets[g])if(i.pub.presets[g].hasOwnProperty(u))try{a(u,i.pub.presets[g][u])}catch(e){console.warn(e)}}else console.warn("Unknown preset: %s",g)}var f=["preset"];for(var u in o)if(o.hasOwnProperty(u)&&-1===f.indexOf(u))try{a(u,o[u])}catch(e){console.warn(e)}if(void 0===this.container?this.container=e.document.body:this.container=i.node(this.container),!this.container)throw new Error("Cannot instantiate color picker without a container element");if(this.targetElement=i.node(t),!this.targetElement){if("string"==typeof t&&/^[a-zA-Z][\w:.-]*$/.test(t))throw new Error("If '"+t+"' is supposed to be an ID, please use '#"+t+"' or any valid CSS selector.");throw new Error("Cannot instantiate color picker without a target element")}if(this.targetElement.jscolor&&this.targetElement.jscolor instanceof i.pub)throw new Error("Color picker already installed on this element");if(this.targetElement.jscolor=this,i.addClass(this.targetElement,i.pub.className),i.instances.push(this),i.isButton(this.targetElement)&&("button"!==this.targetElement.type.toLowerCase()&&(this.targetElement.type="button"),i.isButtonEmpty(this.targetElement))){i.removeChildren(this.targetElement),this.targetElement.appendChild(e.document.createTextNode(" "));var C=i.getCompStyle(this.targetElement);(parseFloat(C["min-width"])||0)-1){var G=i.parseColorString(b);this._currentFormat=G?G.format:"hex"}else this._currentFormat=this.format.toLowerCase();this.processValueInput(b),void 0!==k&&this.processAlphaInput(k)}}).pub.className="jscolor",i.pub.activeClassName="jscolor-active",i.pub.looseJSON=!0,i.pub.presets={},i.pub.presets.default={},i.pub.presets.light={backgroundColor:"rgba(255,255,255,1)",controlBorderColor:"rgba(187,187,187,1)",buttonColor:"rgba(0,0,0,1)"},i.pub.presets.dark={backgroundColor:"rgba(51,51,51,1)",controlBorderColor:"rgba(153,153,153,1)",buttonColor:"rgba(240,240,240,1)"},i.pub.presets.small={width:101,height:101,padding:10,sliderSize:14,paletteCols:8},i.pub.presets.medium={width:181,height:101,padding:12,sliderSize:16,paletteCols:10},i.pub.presets.large={width:271,height:151,padding:12,sliderSize:24,paletteCols:15},i.pub.presets.thin={borderWidth:1,controlBorderWidth:1,pointerBorderWidth:1},i.pub.presets.thick={borderWidth:2,controlBorderWidth:2,pointerBorderWidth:2},i.pub.sliderInnerSpace=3,i.pub.chessboardSize=8,i.pub.chessboardColor1="#666666",i.pub.chessboardColor2="#999999",i.pub.previewSeparator=["rgba(255,255,255,.65)","rgba(128,128,128,.65)"],i.pub.init=function(){if(!i.initialized)for(e.document.addEventListener("mousedown",i.onDocumentMouseDown,!1),e.document.addEventListener("keyup",i.onDocumentKeyUp,!1),e.addEventListener("resize",i.onWindowResize,!1),e.addEventListener("scroll",i.onWindowScroll,!1),i.pub.install(),i.initialized=!0;i.readyQueue.length;)i.readyQueue.shift()()},i.pub.install=function(e){var t=!0;try{i.installBySelector("[data-jscolor]",e)}catch(e){t=!1,console.warn(e)}if(i.pub.lookupClass)try{i.installBySelector("input."+i.pub.lookupClass+", button."+i.pub.lookupClass,e)}catch(e){}return t},i.pub.ready=function(e){return"function"!=typeof e?(console.warn("Passed value is not a function"),!1):(i.initialized?e():i.readyQueue.push(e),!0)},i.pub.trigger=function(e){var t=function(){i.triggerGlobal(e)};i.initialized?t():i.pub.ready(t)},i.pub.hide=function(){i.picker&&i.picker.owner&&i.picker.owner.hide()},i.pub.chessboard=function(e){return e||(e="rgba(0,0,0,0)"),i.genColorPreviewCanvas(e).canvas.toDataURL()},i.pub.background=function(e){var t=[];t.push(i.genColorPreviewGradient(e));var o=i.genColorPreviewCanvas();return t.push(["url('"+o.canvas.toDataURL()+"')","left top","repeat"].join(" ")),t.join(", ")},i.pub.options={},i.pub.lookupClass="jscolor",i.pub.installByClassName=function(){return console.error('jscolor.installByClassName() is DEPRECATED. Use data-jscolor="" attribute instead of a class name.'+i.docsRef),!1},i.register(),i.pub);return void 0===e.jscolor&&(e.jscolor=e.JSColor=a),a}))}},t={};function o(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,o),a.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";let e={};function t(){e.WrinklerButtons&&Game.elderWrath?(l("PopAllNormalWrinklerButton").style.display="",l("PopFattestWrinklerButton").style.display=""):(l("PopAllNormalWrinklerButton").style.display="none",l("PopFattestWrinklerButton").style.display="none")}const n=["","","M","G","T","P","E","Z","Y"],i=["","","M","B","Tr","Quadr","Quint","Sext","Sept","Oct","Non","Dec","Undec","Duodec","Tredec","Quattuordec","Quindec","Sexdec","Septendec","Octodec","Novemdec","Vigint","Unvigint","Duovigint","Trevigint","Quattuorvigint"],a=["","K","M","B","T","Qa","Qi","Sx","Sp","Oc","No","De","UDe","DDe","TDe","QaDe","QiDe","SxDe","SpDe","ODe","NDe","Vi","UVi","DVi","TVi","QaVi","QiVi","SxVi","SpVi","OVi","NVi","Tr","UTr","DTr","TTr","QaTr","QiTr","SxTr","SpTr","OTr","NTr","Qaa","UQa","DQa","TQa","QaQa","QiQa","SxQa","SpQa","OQa","NQa","Qia","UQi","DQi","TQi","QaQi","QiQi","SxQi","SpQi","OQi","NQi","Sxa","USx","DSx","TSx","QaSx","QiSx","SxSx","SpSx","OSx","NSx","Spa","USp","DSp","TSp","QaSp","QiSp","SxSp","SpSp","OSp","NSp","Oco","UOc","DOc","TOc","QaOc","QiOc","SxOc","SpOc","OOc","NOc","Noa","UNo","DNo","TNo","QaNo","QiNo","SxNo","SpNo","ONo","NNo","Ct","UCt"];let r,s,c,d,p,u,m,h,g,f,C,y,b,k,G,v,w,x=[],T=[],M=[],S={},B=Date.now(),P=Date.now();const E="CMText",N="CMBack",O="Blue",F="Green",L="Yellow",W="Orange",A="Red",j="Purple",D="Gray",H="Pink",U="Brown",$=[D,O,F,L,W,A,j,H,U],R=[["GoldCookTooltipPlaceholder","Calculated with Golden Switch off","200px"],["GoldCookDragonsFortuneTooltipPlaceholder","Calculated with Golden Switch off and at least one golden cookie on-screen","240px"],["PrestMaxTooltipPlaceholder","The MAX prestige is calculated with the cookies gained from popping all wrinklers with Skruuia god in Diamond slot, selling all stock market goods, selling all buildings with Earth Shatterer and Reality Bending auras, and buying Chocolate egg","320px"],["NextPrestTooltipPlaceholder","Calculated with cookies gained from wrinklers and Chocolate egg","200px"],["HeavenChipMaxTooltipPlaceholder","The MAX heavenly chips is calculated with the cookies gained from popping all wrinklers with Skruuia god in Diamond slot, selling all stock market goods, selling all buildings with Earth Shatterer and Reality Bending auras, and buying Chocolate egg","330px"],["ResetTooltipPlaceholder","The bonus income you would get from new prestige levels unlocked at 100% of its potential and from ascension achievements if you have the same buildings/upgrades after reset","370px"],["ChoEggTooltipPlaceholder","The amount of cookies you would get from popping all wrinklers with Skruuia god in Diamond slot, selling all stock market goods, selling all buildings with Earth Shatterer and Reality Bending auras, and then buying Chocolate egg","300px"],["ChainNextLevelPlaceholder","Cheated cookies might break this formula","250px"],["FavouriteSettingPlaceholder","Click to set this setting as favourite and show it in 'favourite' settings at the top of the Cookie Monster Settings","250px"]],I={};let z,V,_=0,Q=-1,X=[],q=1,Y=1,K=1;const J=[10,15,30,60,300,600,900,1800],Z=[1,5,10,15,30],ee={Frenzy:L,"Dragon Harvest":U,"Elder frenzy":F,Clot:A,"Click frenzy":O,Dragonflight:H};let te,oe,ne,ie,ae,re,le,se={},ce="",de=[];function pe(t,o,r){const l=e.ScaleDecimals+1;if(t===1/0)return"Infinity";if(void 0===t)return"0";if(0===e.Scale)return S.Beautify(t,o);if(Number.isFinite(t)){if(t<0)return`-${pe(Math.abs(t))}`;let s="";if(0===t)return t.toString();if(t>.001&&t=.01&&t=.01&&t=.01&&t315576e4)return"XX:XX:XX:XX:XX";c+=(i<10?"0":"")+i+":",c+=(a<10?"0":"")+a+":",c+=(r<10?"0":"")+r+":",c+=(l<10?"0":"")+l+":",c+=(s<10?"0":"")+s}else{if(n>7776e5)return o?"Over 9000 days!":">9000d";c+=i>0?i+(o?1===i?" year":" years":"y")+", ":"",c+=a>0?a+(o?1===a?" day":" days":"d")+", ":"",(c.length>0||r>0)&&(c+=r+(o?1===r?" hour":" hours":"h")+", "),(c.length>0||l>0)&&(c+=l+(o?1===l?" minute":" minutes":"m")+", "),c+=s+(o?1===s?" second":" seconds":"s")}return c}function me(t){let o,n;return t<=0?(n=e.TimeFormat?"00:00:00:00:00":"Done!",o=F):(n=ue(t),o=t>300?A:t>60?W:L),{text:n,color:o}}let he,ge,fe,Ce,ye,be,ke,Ge,ve,we,xe,Te,Me,Se,Be,Pe,Ee,Ne,Oe,Fe,Le,We,Ae,je,De,He,Ue,$e,Re,Ie,ze,Ve,_e,Qe,Xe,qe,Ye=0,Ke=0,Je=0,Ze=0,et=0,tt=0,ot=0,nt=0,it=0,at=0,rt=0,lt=0,st=0,ct=0,dt=0,pt=1,ut=1,mt=1,ht=0,gt=0,ft=0,Ct=0,yt={},bt={},kt={},Gt={},vt=0,wt=0,xt=[0,null],Tt=0,Mt=0,St={},Bt={},Pt={},Et={},Nt={},Ot=0,Ft=0,Lt=[],Wt=0,At=0,jt=[],Dt=0,Ht=0,Ut=[],$t=0,Rt=0,It=[],zt=0,Vt=0,_t={},Qt={},Xt=0,qt=0,Yt=[],Kt={},Jt=0,Zt={0:[0,0,0],1:[0,0,0],2:[0,0,0],3:[0,0,0],4:[0,0,0],5:[0,0,0],6:[0,0,0],7:[0,0,0],8:[0,0,0],9:[0,0,0],10:[0,0,0]},eo=[],to=[],oo=[];function no(e){let t=0;return Game.dragonAuras[$e].name!==e&&Game.dragonAuras[Re].name!==e||(t=1),"Reality Bending"!==Game.dragonAuras[$e].name&&"Reality Bending"!==Game.dragonAuras[Re].name||(t+=.1),t}function io(){let e=.25;return e*=1+no("Earth Shatterer"),e}function ao(e,t){return void 0===Qe[e]?void 0===t?1:t:Qe[e]}function ro(e){const t=to[e];return(1!==Game.ascensionMode||"prestige"!==t.pool&&"fortune"!==t.tier)&&t?t.bought:0}function lo(e){if(Game.hasGod){void 0===eo.Temple.minigame&&(eo.Temple.minigame=Game.Objects.Temple.minigame);const t=eo.Temple.minigame.gods[e];if(Ie===t.id)return 1;if(ze===t.id)return 2;if(Ve===t.id)return 3}return!1}function so(e,t){let o=t;if(ro("Season savings")&&(o*=.99),ro("Santa's dominion")&&(o*=.99),ro("Faberge egg")&&(o*=.99),ro("Divine discount")&&(o*=.99),ro("Fortune #100")&&(o*=.99),o*=1-.02*no("Fierce Hoarder"),Game.hasBuff("Everything must go")&&(o*=.95),Game.hasBuff("Crafty pixies")&&(o*=.98),Game.hasBuff("Nasty goblins")&&(o*=1.02),e.fortune&&ro(e.fortune.name)&&(o*=.93),o*=ao("buildingCost"),eo.Temple.minigameLoaded){const e=lo("creation");1===e?o*=.93:2===e?o*=.95:3===e&&(o*=.98)}return o}function co(e,t,o,n,i,a){const r=void 0===a?0:a;let l=i,s=o,c=0;-1===i&&(l=s),i||(l=Game.buyBulk);for(let o=0;o0&&(c+=o,s-=1)}return c}function po(){let t=Game.buyBulk;if(1===Game.buyMode?Y=t:t=Y,1===t?t=yt:10===t?t=bt:100===t&&(t=kt),1===Game.buyMode?1===e.BuildColour?Object.keys(t).forEach((o=>{l(`productPrice${Game.Objects[o].id}`).style.color=e[`Colour${t[o].color}`]})):Object.keys(Game.Objects).forEach((e=>{l(`productPrice${Game.Objects[e].id}`).style.removeProperty("color")})):-1===Game.buyMode&&Object.keys(yt).forEach((e=>{const t=Game.Objects[e];l(`productPrice${t.id}`).style.color="",l(`productPrice${t.id}`).innerHTML=pe(co(t,t.basePrice,t.amount,t.free,Game.buyBulk,1))})),1===Game.buyMode&&e.SortBuildings){let o;1===e.SortBuildings?(o=Object.keys(yt).map((e=>{const t=yt[e];return t.name=e,t.id=Game.Objects[e].id,t})),o.sort((function(e,t){return $.indexOf(e.color)>$.indexOf(t.color)?1:$.indexOf(e.color)<$.indexOf(t.color)||e.pp{const o=t[e];return o.name=e,o.id=Game.Objects[e].id,o})),o.sort((function(e,t){return $.indexOf(e.color)>$.indexOf(t.color)?1:$.indexOf(e.color)<$.indexOf(t.color)||e.pp{const t=yt[e];return t.name=e,t.id=Game.Objects[e].id,t}));e.sort(((e,t)=>e.id-t.id));for(let t=0;t0){let e=0,t=0,o=0,n=0,i=0,a=0,r=0;Object.keys(Game.UpgradesInStore).forEach((s=>{const c=Game.UpgradesInStore[s];let d=!1;for(let e=0;e$.indexOf(t.color)?1:$.indexOf(e.color)<$.indexOf(t.color)||e.ppe.price-t.price));const o=function(e,t){return e.findIndex((e=>e.name===t.name))};for(let e=0;e{let n,i=Game.buyBulk;1===Game.buyMode?q=i:i=q,1===i&&(i=yt),10===i&&(i=bt),100===i&&(i=kt),t+=1,l("CMBotBar").firstChild.firstChild.childNodes[0].childNodes[t].childNodes[1].textContent=Game.Objects[o].amount,l("CMBotBar").firstChild.firstChild.childNodes[1].childNodes[t].textContent=pe(i[o].bonus,2),l("CMBotBar").firstChild.firstChild.childNodes[2].childNodes[t].className=E+i[o].color,n=e.PPDisplayTime?ue(Math.round(i[o].pp)):pe(Math.round(i[o].pp),2),l("CMBotBar").firstChild.firstChild.childNodes[2].childNodes[t].textContent=n;const a=me((Game.Objects[o].bulkPrice-(Game.cookies+ho()))/mo());l("CMBotBar").firstChild.firstChild.childNodes[3].childNodes[t].className=E+a.color,"Done!"===a.text&&Game.cookies{!Game.Tiers[e.tieredUpgrades[o].tier].special&&ro(e.tieredUpgrades[o].name)&&(t*=2)})),Object.keys(e.synergies).forEach((o=>{if(ro(e.synergies[o].name)){const n=e.synergies[o];n.buildingTie1.name===e.name?t*=1+.05*n.buildingTie2.amount:n.buildingTie2.name===e.name&&(t*=1+.001*n.buildingTie1.amount)}})),e.fortune&&ro(e.fortune.name)&&(t*=1.07),e.grandma&&ro(e.grandma.name)&&(t*=1+.01*eo.Grandma.amount*(1/(e.id-1))),"object"==typeof e.tieredUpgrades.misfortune&&1===e.vanilla&&ro(e.tieredUpgrades.misfortune.name))switch(Game.elderWrath){default:t*=1;break;case 1:t*=1.02;break;case 2:t*=1.04;break;case 3:t*=1.06}return t}function xo(e){const t=Game.Objects[e],o={};return"Cursor"===t.name?o.cps=function(e){let t=0;ro("Thousand fingers")&&(t+=.1),ro("Million fingers")&&(t*=5),ro("Billion fingers")&&(t*=10),ro("Trillion fingers")&&(t*=20),ro("Quadrillion fingers")&&(t*=20),ro("Quintillion fingers")&&(t*=20),ro("Sextillion fingers")&&(t*=20),ro("Septillion fingers")&&(t*=20),ro("Octillion fingers")&&(t*=20),ro("Nonillion fingers")&&(t*=20);let o=1,n=0;return Object.keys(eo).forEach((e=>{"Cursor"!==eo[e].name&&(n+=eo[e].amount)})),t*=n,o*=wo(e),o*=Game.magicCpS("Cursor"),o*=ao("cursorCps"),Game.ComputeCps(.1,ro("Reinforced index finger")+ro("Carpal tunnel prevention cream")+ro("Ambidextrous"),t)*o}:"Grandma"===t.name?o.cps=function(e){let o=1;if(Object.keys(Game.GrandmaSynergies).forEach((e=>{ro(Game.GrandmaSynergies[e])&&(o*=2)})),ro("Bingo center/Research facility")&&(o*=4),ro("Ritual rolling pins")&&(o*=2),ro("Naughty list")&&(o*=2),ro("Elderwort biscuits")&&(o*=1.02),o*=ao("grandmaCps"),ro("Cat ladies"))for(let e=0;e{"Grandma"!==eo[e].name&&(i+=eo[e].amount)})),o*=1+.01*no("Elder Battalion")*i,o*=Game.magicCpS(t.name),(t.baseCps+n)*o}:o.cps=function(e){let t=1;return t*=wo(e),t*=Game.magicCpS(e.name),e.baseCPS*t},o.baseCps=t.baseCps,o.name=t.name,o.tieredUpgrades=t.tieredUpgrades,o.synergies=t.synergies,o.fortune=t.fortune,o.grandma=t.grandma,o.baseCPS=t.baseCps,o.id=t.id,o.vanilla=t.vanilla,o}function To(e){const t=Game.Upgrades[e],o={};return o.power=t.power,"function"==typeof o.power&&("Sugar crystal cookies"===t.name?o.power=function(){let e=5;return Object.keys(eo).forEach((t=>{eo[t].level>=10&&(e+=1)})),e}:o.power=function(){let e=2;if(ro("Starlove")&&(e=3),Game.hasGod){const t=lo("seasons");1===t?e*=1.3:2===t?e*=1.2:3===t&&(e*=1.1)}return e}),o.pool=t.pool,o.name=t.name,o}function Mo(){Ae=Game.UpgradesOwned,je=Game.pledges,De=Game.AchievementsOwned,He=Game.heavenlyPower,Ue=Game.prestige,Object.keys(Game.Objects).forEach((e=>{const t=Game.Objects[e];let o=eo[e];void 0===o&&(eo[e]=xo(e),o=eo[e],fo(e)),o.amount=t.amount,o.level=t.level,o.totalCookies=t.totalCookies,o.basePrice=t.basePrice,o.free=t.free,t.minigameLoaded&&("Temple"===t.name&&(Ie=t.minigame.slot[0],ze=t.minigame.slot[1],Ve=t.minigame.slot[2]),o.minigameLoaded=t.minigameLoaded,o.minigame=t.minigame),eo[e]=o})),Object.keys(Game.Upgrades).forEach((e=>{const t=Game.Upgrades[e];let o=to[e];void 0===o&&(to[e]=To(e),o=to[e]),o.bought=t.bought,to[e]=o})),Object.keys(Game.Achievements).forEach((e=>{const t=Game.Achievements[e];let o=oo[e];void 0===o&&(oo[e]=vo(e),o=oo[e]),o.won=t.won,oo[e]=o})),Go(),$e=Ye,Re=Ke}function So(e){const t=document.createElement("div");return t.style.fontWeight="bold",t.id=`${e}Title`,t.className="CMTextBlue",t.textContent=e,t}function Bo(e){e.appendChild(So("Bonus Income"));const t=document.createElement("div");t.style.marginBottom="4px",t.style.color="white",t.id="CMTooltipIncome",e.appendChild(t),e.appendChild(So("Bonus Cookies per Click")),e.lastChild.style.display="none";const o=document.createElement("div");o.style.marginBottom="4px",o.style.color="white",o.style.display="none",o.id="CMTooltipCookiePerClick",e.appendChild(o),e.appendChild(So("Payback Period"));const n=document.createElement("div");n.style.marginBottom="4px",n.id="CMTooltipPP",e.appendChild(n),e.appendChild(So("Time Left"));const i=document.createElement("div");if(i.id="CMTooltipTime",e.appendChild(i),"b"===ne){e.appendChild(So("Production left till next achievement")),e.lastChild.id="CMTooltipProductionLeftHeader";const t=document.createElement("div");t.id="CMTooltipProductionLeft",e.appendChild(t)}if("b"===ne){e.appendChild(So("Buildings left till next additional achievement")),e.lastChild.id="CMTooltipNextAchievementHeader";const t=document.createElement("div");t.id="CMTooltipNextAchievement",e.appendChild(t)}}function Po(e,t,o){let n=e,i=0;for(;n{void 0!==Game.buffs[t].multCpS&&(e*=Game.buffs[t].multCpS)})),e}function No(){null!==l("CMDispTooltipWarningParent")&&(0===e.ToolWarnPos?(l("CMDispTooltipWarningParent").style.top="auto",l("CMDispTooltipWarningParent").style.margin="4px -4px",l("CMDispTooltipWarningParent").style.padding="3px 4px"):(l("CMDispTooltipWarningParent").style.right="auto",l("CMDispTooltipWarningParent").style.margin="4px",l("CMDispTooltipWarningParent").style.padding="4px 3px"))}function Oo(){if(Mo(),"none"!==l("tooltipAnchor").style.display&&l("CMTooltipArea")){l("CMTooltipArea").innerHTML="";const t=function(){l("tooltip").firstChild.style.paddingBottom="4px";const e=document.createElement("div");return e.style.border="1px solid",e.style.padding="4px",e.style.margin="0px -4px",e.id="CMTooltipBorder",e.className="CMTextGray",e}();l("CMTooltipArea").appendChild(t),"b"===ne?function(){if(1===e.TooltipBuildUpgrade&&1===Game.buyMode){let t;if(Bo(l("CMTooltipBorder")),1===Game.buyMode?K=t:t=K,1===Game.buyBulk?t=yt:10===Game.buyBulk?t=bt:100===Game.buyBulk&&(t=kt),te=Game.Objects[ie].bulkPrice,oe=t[ie].bonus,1===e.TooltipBuildUpgrade&&1===Game.buyMode){l("CMTooltipIncome").textContent=pe(oe,2);const o=Math.round(oe/Game.cookiesPs*1e4);Number.isFinite(o)&&0!==o?l("CMTooltipIncome").textContent+=` (${o/100}% of income)`:l("CMTooltipIncome").textContent+=` (<0${e.ScaleSeparator?",":"."}01% of income)`,l("CMTooltipBorder").className=E+t[ie].color,e.PPDisplayTime?l("CMTooltipPP").textContent=ue(t[ie].pp):l("CMTooltipPP").textContent=pe(t[ie].pp,2),l("CMTooltipPP").className=E+t[ie].color;const n=me((te-(Game.cookies+ho()))/mo());l("CMTooltipTime").textContent=n.text,"Done!"===n.text&&Game.cookiest.plantsById[t.plot[ie[1]][ie[0]][0]-1].mature,o=t.plantsById[t.plot[ie[1]][ie[0]][0]-1].name;l("CMTooltipBorder").appendChild(So("Reward (Current / Maximum)"));const n=document.createElement("div");n.id="CMTooltipPlantReward",l("CMTooltipBorder").appendChild(n),"Bakeberry"===o?l("CMTooltipPlantReward").textContent=`${e?pe(Math.min(.03*Game.cookies,60*Game.cookiesPs*30)):"0"} / ${pe(60*Game.cookiesPs*30)}`:"Chocoroot"===o||"White chocoroot"===o?l("CMTooltipPlantReward").textContent=`${e?pe(Math.min(.03*Game.cookies,60*Game.cookiesPs*3)):"0"} / ${pe(60*Game.cookiesPs*3)}`:"Queenbeet"===o?l("CMTooltipPlantReward").textContent=`${e?pe(Math.min(.04*Game.cookies,60*Game.cookiesPs*60)):"0"} / ${pe(60*Game.cookiesPs*60)}`:"Duketater"===o?l("CMTooltipPlantReward").textContent=`${e?pe(Math.min(.08*Game.cookies,60*Game.cookiesPs*120)):"0"} / ${pe(60*Game.cookiesPs*120)}`:l("CMTooltipArea").style.display="none"}else l("CMTooltipArea").style.display="none"}():"ha"===ne?function(){const{minigame:t}=Game.Objects.Farm;if(e.TooltipLump){l("CMTooltipBorder").appendChild(So("Cookies gained from harvesting:"));let e=0,o=0;Game.keys[16]&&Game.keys[17]&&(o=1);for(let n=0;n<6;n++)for(let i=0;i<6;i++)if(t.plot[n][i][0]>=1){const a=t.plot[n][i],r=t.plantsById[a[0]-1],l=r.name;let s=!0;o&&r.immortal&&(s=!1),a[1]0&&t=1?l("CMTimerBarGCMinBar").textContent=Math.ceil((Game.shimmerTypes.golden.minTime-Game.shimmerTypes.golden.time)/Game.fps):l("CMTimerBarGCMinBar").textContent="",Game.shimmerTypes.golden.minTime===Game.shimmerTypes.golden.maxTime?(l("CMTimerBarGCMinBar").style.borderTopRightRadius="10px",l("CMTimerBarGCMinBar").style.borderBottomRightRadius="10px"):(l("CMTimerBarGCMinBar").style.borderTopRightRadius="",l("CMTimerBarGCMinBar").style.borderBottomRightRadius=""),l("CMTimerBarGCBar").style.width=`${Math.round(Math.min(Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.minTime,Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.time)*t/Game.shimmerTypes.golden.maxTime)}px`,e.TimerBarOverlay>=1?l("CMTimerBarGCBar").textContent=Math.ceil(Math.min(Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.minTime,Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.time)/Game.fps):l("CMTimerBarGCBar").textContent="",l("CMTimerBarGCTime").textContent=Math.ceil((Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.time)/Game.fps),n+=1),"christmas"===Game.season&&0===Game.shimmerTypes.reindeer.spawned?(l("CMTimerBarRen").style.display="",l("CMTimerBarRenMinBar").style.width=`${Math.round(Math.max(0,Game.shimmerTypes.reindeer.minTime-Game.shimmerTypes.reindeer.time)*t/Game.shimmerTypes.reindeer.maxTime)}px`,e.TimerBarOverlay>=1?l("CMTimerBarRenMinBar").textContent=Math.ceil((Game.shimmerTypes.reindeer.minTime-Game.shimmerTypes.reindeer.time)/Game.fps):l("CMTimerBarRenMinBar").textContent="",l("CMTimerBarRenBar").style.width=`${Math.round(Math.min(Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.minTime,Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.time)*t/Game.shimmerTypes.reindeer.maxTime)}px`,e.TimerBarOverlay>=1?l("CMTimerBarRenBar").textContent=Math.ceil(Math.min(Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.minTime,Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.time)/Game.fps):l("CMTimerBarRenBar").textContent="",l("CMTimerBarRenTime").textContent=Math.ceil((Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.time)/Game.fps),n+=1):l("CMTimerBarRen").style.display="none";const i={};l("CMTimerBarBuffTimers").innerHTML="",Object.keys(Game.buffs).forEach((t=>{if(Game.buffs[t]){const a=go(Game.buffs[t].name,Game.buffs[t].name,[{id:`${Game.buffs[t].name}Bar`}]);a.style.display="";let r="";r=void 0!==ee[Game.buffs[t].name]?ee[Game.buffs[t].name]:j,a.lastChild.children[1].className=N+r,a.lastChild.children[1].style.color="black",2===e.TimerBarOverlay?a.lastChild.children[1].textContent=`${Math.round(Game.buffs[t].time/Game.buffs[t].maxTime*100)}%`:a.lastChild.children[1].textContent="",a.lastChild.children[1].style.width=`${Math.round(Game.buffs[t].time*(o-8*Math.ceil(Game.buffs[t].time/Game.fps).toString().length)/Game.buffs[t].maxTime)}px`,a.lastChild.children[2].textContent=Math.ceil(Game.buffs[t].time/Game.fps),n+=1,i[Game.buffs[t].name]=a}})),Object.keys(i).forEach((e=>{l("CMTimerBarBuffTimers").appendChild(i[e])})),0!==n&&(l("CMTimerBar").style.height=12*n+2+"px"),le!==n&&(le=n,bo())}}(),Co(),Oo(),function(){if(1===e.TooltipWrink&&1===_){let e=!1;Object.keys(Game.wrinklers).forEach((t=>{const o=Game.wrinklers[t];if(o.phase>0&&o.selected){if(e=!0,0===X[t]||void 0===X[t]){const e=document.createElement("div"),o=document.createElement("div");o.style.minWidth="120px",o.style.marginBottom="4px";const n=document.createElement("div");n.style.textAlign="center",n.id="CMTooltipWrinkler",o.appendChild(n),e.appendChild(o),Game.tooltip.draw(this,escape(e.innerHTML)),Q=t,X[t]=1}}else X[t]=0})),e||Game.tooltip.hide()}}(),function(){if(1===e.TooltipWrink&&null!==l("CMTooltipWrinkler")){let{sucked:e}=Game.wrinklers[Q],t=1.1;if(Game.Has("Sacrilegious corruption")&&(t*=1.05),1===Game.wrinklers[Q].type&&(t*=3),e*=t,Game.Has("Wrinklerspawn")&&(e*=1.05),eo.Temple.minigameLoaded){const t=Game.hasGod("scorn");1===t?e*=1.15:2===t?e*=1.1:3===t&&(e*=1.05)}l("CMTooltipWrinkler").textContent=pe(e)}}(),e.UpStats&&"stats"===Game.onMenu&&(Game.drawT-1)%(5*Game.fps)!=0&&(Game.drawT-1)%Game.fps==0&&Game.UpdateMenu(),t(),e.Scale){let e=l("cookies").innerHTML.replace(/.*(?=
)/i,pe(Game.cookies));Game.prefs.monospace&&(e=`${e}`),l("cookies").innerHTML=e}}function Lo(){he.addLatest(Game.computedMouseCps)}class Wo{constructor(e){this.maxLength=e,this.queue=[]}addLatest(e){this.queue.push(e)>this.maxLength&&this.queue.shift()}calcAverage(e){let t=e;t>this.maxLength&&(t=this.maxLength),t>this.queue.length&&(t=this.queue.length);let o=0;for(let e=this.queue.length-1;e>=0&&e>this.queue.length-1-t;e--)o+=this.queue[e];return 0===o?0:o/t}calcSum(e){let t=e;return t>this.maxLength&&(t=this.maxLength),t>this.queue.length&&(t=this.queue.length),0===t?0:this.queue.slice(-t).reduce(((e,t)=>e+t),0)}}function Ao(){const t=Math.floor(Date.now()/1e3);if(Game.T/Game.fps%1==0){let o=Game.cookies+Jt;Game.cpsSucked>0&&(o+=vt),zt=Math.max(Game.cookiesEarned,o),o*=.05;const n=t-Ge,i=Math.max(0,Game.cookies-ve)/n,a=Math.max(0,vt-we)/n,r=Math.max(0,xt[0]-xe)/n,l=Math.max(0,o-Ct)/n,s=(Game.cookieClicks-Te)/n;for(let e=0;e0&&(n=A),n}function Do(t,o){Object.keys(t).forEach((n=>{if(e.PPRigidelMode&&1===o)t[n].color=D;else{t[n].color=jo(t[n],Game.Objects[n].getSumPrice(o));for(let o=0;o{const i=Game.Objects[n].getSumPrice(o);Game.cookiesPs?t[n].pp=Math.max(i-(Game.cookies+ho()),0)/Game.cookiesPs+i/t[n].bonus:t[n].pp=i/t[n].bonus,e.PPRigidelMode&&1===o||Yt.push([t[n].pp,o])}))}function Uo(){!function(){qt=1/0,Yt=[],void 0===e.PPExcludeTop&&(e.PPExcludeTop=0),Ho(yt,1),Ho(bt,10),Ho(kt,100),Yt.sort(((e,t)=>e[0]-t[0]));let t=0;if(e.PPOnlyConsiderBuyable)for(;Yt[t][1]>Game.cookies&&(t+=1,Yt.length!==t+1););qt=Yt[e.PPExcludeTop][t],Do(yt,1),Do(bt,10),Do(kt,100)}(),Object.keys(St).forEach((e=>{Game.cookiesPs?St[e].pp=Math.max(Game.Upgrades[e].getPrice()-(Game.cookies+ho()),0)/Game.cookiesPs+Game.Upgrades[e].getPrice()/St[e].bonus:St[e].pp=Game.Upgrades[e].getPrice()/St[e].bonus,Number.isNaN(St[e].pp)&&(St[e].pp=1/0),St[e].color=jo(St[e],Game.Upgrades[e].getPrice())}))}function $o(e,t,o,n,i){let a=o,r=0;for(let o=0;o{if(Game.Objects[e].minigameLoaded&&Game.Objects[e].minigame.effs){const o=Game.Objects[e].minigame.effs;Object.keys(o).forEach((e=>{t[e]?t[e]*=o[e]:t[e]=o[e]}))}})),Qe=t,1!==Game.ascensionMode&&(e+=.01*parseFloat(Ue)*He*function(){let e=0;if(ro("Heavenly chip secret")&&(e+=.05),ro("Heavenly cookie stand")&&(e+=.2),ro("Heavenly bakery")&&(e+=.25),ro("Heavenly confectionery")&&(e+=.25),ro("Heavenly key")&&(e+=.25),e*=1+.05*no("Dragon God"),ro("Lucky digit")&&(e*=1.01),ro("Lucky number")&&(e*=1.01),ro("Lucky payout")&&(e*=1.01),Game.hasGod){const t=lo("creation");1===t?e*=.7:2===t?e*=.8:3===t&&(e*=.9)}return e}()),e*=ao("cps"),ro("Heralds")&&1!==Game.ascensionMode&&(e*=1+.01*Game.heralds),Object.keys(Game.cookieUpgrades).forEach((t=>{const o=Game.cookieUpgrades[t];ro(o.name)&&("function"==typeof o.power?e*=1+.01*to[o.name].power(to[o.name]):e*=1+.01*o.power)})),ro("Specialized chocolate chips")&&(e*=1.01),ro("Designer cocoa beans")&&(e*=1.02),ro("Underworld ovens")&&(e*=1.03),ro("Exotic nuts")&&(e*=1.04),ro("Arcane sugar")&&(e*=1.05),ro("Increased merriness")&&(e*=1.15),ro("Improved jolliness")&&(e*=1.15),ro("A lump of coal")&&(e*=1.01),ro("An itchy sweater")&&(e*=1.01),ro("Santa's dominion")&&(e*=1.2),ro("Fortune #100")&&(e*=1.01),ro("Fortune #101")&&(e*=1.07),ro("Dragon scale")&&(e*=1.03);let o=1;if(lo){let t=lo("asceticism");1===t?e*=1.15:2===t?e*=1.1:3===t&&(e*=1.05),t=lo("ages"),1===t?e*=1+.15*Math.sin(B/1e3/10800*Math.PI*2):2===t?e*=1+.15*Math.sin(B/1e3/43200*Math.PI*2):3===t&&(e*=1+.15*Math.sin(B/1e3/86400*Math.PI*2)),t=lo("decadence"),1===t?o*=.93:2===t?o*=.95:3===t&&(o*=.98),t=lo("industry"),1===t?o*=1.1:2===t?o*=1.06:3===t&&(o*=1.03),t=lo("labor"),1===t?o*=.97:2===t?o*=.98:3===t&&(o*=.99)}ro("Santa's legacy")&&(e*=1+.03*(Game.santaLevel+1));const n=De/25;let i=1;if(ro("Santa's milk and cookies")&&(i*=1.05),i*=1+.05*no("Breath of Milk"),lo){const e=lo("mother");1===e?i*=1.1:2===e?i*=1.05:3===e&&(i*=1.03)}i*=ao("milk");let a=1;ro("Kitten helpers")&&(a*=1+.1*n*i),ro("Kitten workers")&&(a*=1+.125*n*i),ro("Kitten engineers")&&(a*=1+.15*n*i),ro("Kitten overseers")&&(a*=1+.175*n*i),ro("Kitten managers")&&(a*=1+.2*n*i),ro("Kitten accountants")&&(a*=1+.2*n*i),ro("Kitten specialists")&&(a*=1+.2*n*i),ro("Kitten experts")&&(a*=1+.2*n*i),ro("Kitten consultants")&&(a*=1+.2*n*i),ro("Kitten assistants to the regional manager")&&(a*=1+.175*n*i),ro("Kitten marketeers")&&(a*=1+.15*n*i),ro("Kitten analysts")&&(a*=1+.125*n*i),ro("Kitten executives")&&(a*=1+.115*n*i),ro("Kitten angels")&&(a*=1+.1*n*i),ro("Fortune #103")&&(a*=1+.05*n*i),Object.keys(eo).forEach((e=>{const t=eo[e];let a=t.cps(t);1!==Game.ascensionMode&&(a*=(1+.01*t.level)*o),"Grandma"===t.name&&ro("Milkhelp® lactose intolerance relief tablets")&&(a*=1+.05*n*i),Xe+=t.amount*a})),ro('"egg"')&&(Xe+=9),e*=a;let r=1;if(ro("Chicken egg")&&(r*=1.01),ro("Duck egg")&&(r*=1.01),ro("Turkey egg")&&(r*=1.01),ro("Quail egg")&&(r*=1.01),ro("Robin egg")&&(r*=1.01),ro("Ostrich egg")&&(r*=1.01),ro("Cassowary egg")&&(r*=1.01),ro("Salmon roe")&&(r*=1.01),ro("Frogspawn")&&(r*=1.01),ro("Shark egg")&&(r*=1.01),ro("Turtle egg")&&(r*=1.01),ro("Ant larva")&&(r*=1.01),ro("Century egg")){let e=10*Math.floor((P-Game.startDate)/1e3/10)/60/60/24;e=Math.min(e,100),gt=1+.1*(1-(1-e/100)**3),r*=gt}e*=r,ro("Sugar baking")&&(e*=1+.01*Math.min(100,Game.lumps)),e*=1+no("Radiant Appetite");const l=Xe*e;Object.keys(Game.CpsAchievements).forEach((e=>{l>=Game.CpsAchievements[e].threshold&&Ro(Game.CpsAchievements[e].name)})),qe=l;const{n:s}=Game.shimmerTypes.golden,c=no("Dragon's Fortune");for(let t=0;t{ro(e[o])&&(t+=.1)}))}e*=t}if(ro("Shimmering veil [off]")){let t=.5;ro("Reinforced membrane")&&(t+=.1),e*=1+t}ro("Magic shenanigans")&&(e*=1e3),ro("Occult obstruction")&&(e*=0),Xe=Game.runModHookOnValue("cps",Xe),e*=Eo(),Xe*=e}const zo=["Fortune #001","Fortune #002","Fortune #003","Fortune #004","Fortune #005","Fortune #006","Fortune #007","Fortune #008","Fortune #009","Fortune #010","Fortune #011","Fortune #012","Fortune #013","Fortune #014","Fortune #015","Fortune #016","Fortune #017","Fortune #018","Fortune #100","Fortune #101","Fortune #102","Fortune #103","Fortune #104"],Vo=["Skull cookies","Ghost cookies","Bat cookies","Slime cookies","Pumpkin cookies","Eyeball cookies","Spider cookies"],_o=["Christmas tree biscuits","Snowflake biscuits","Snowman biscuits","Holly biscuits","Candy cane biscuits","Bell biscuits","Present biscuits"],Qo=["Pure heart biscuits","Ardent heart biscuits","Sour heart biscuits","Weeping heart biscuits","Golden heart biscuits","Eternal heart biscuits","Prism heart biscuits"],Xo=["Elderwort biscuits","Bakeberry cookies","Duketater cookies","Green yeast digestives","Wheat slims","Fern tea","Ichor syrup"];function qo(e){return oo[e]?oo[e].won:0}function Yo(){let e=0;Object.keys(Game.GrandmaSynergies).forEach((t=>{ro(Game.GrandmaSynergies[t])&&(e+=1)})),!qo("Elder")&&e>=7&&Ro("Elder"),!qo("Veteran")&&e>=14&&Ro("Veteran");let t=0,o=1,n=1,i=1e5;Object.keys(eo).forEach((e=>{t+=eo[e].amount,i=Math.min(eo[e].amount,i),qo("Mathematician")||eo[e].amount=1&&Ro("One with everything"),1===o&&Ro("Mathematician"),1===n&&Ro("Base 10"),i>=100&&Ro("Centennial"),i>=150&&Ro("Centennial and a half"),i>=200&&Ro("Bicentennial"),i>=250&&Ro("Bicentennial and a half"),i>=300&&Ro("Tricentennial"),i>=350&&Ro("Tricentennial and a half"),i>=400&&Ro("Quadricentennial"),i>=450&&Ro("Quadricentennial and a half"),i>=500&&Ro("Quincentennial"),i>=550&&Ro("Quincentennial and a half"),i>=600&&Ro("Sexcentennial"),t>=100&&Ro("Builder"),t>=500&&Ro("Architect"),t>=1e3&&Ro("Engineer"),t>=2e3&&Ro("Lord of Constructs"),t>=4e3&&Ro("Grand design"),t>=8e3&&Ro("Ecumenopolis"),Ae>=20&&Ro("Enhancer"),Ae>=50&&Ro("Augmenter"),Ae>=100&&Ro("Upgrader"),Ae>=200&&Ro("Lord of Progress"),Ae>=300&&Ro("The full picture"),Ae>=400&&Ro("When there's nothing left to add"),t>=4e3&&Ae>=300&&Ro("Polymath"),t>=8e3&&Ae>=400&&Ro("Renaissance baker"),eo.Cursor.amount+eo.Grandma.amount>=777&&Ro("The elder scrolls");let a=!0;Object.keys(Vo).forEach((e=>{ro(Vo[e])||(a=!1)})),a&&Ro("Spooky cookies");let r=!0;if(Object.keys(_o).forEach((e=>{ro(_o[e])||(r=!1)})),r&&Ro("Let it snow"),ro("Fortune cookies")){const e=Game.Tiers.fortune.upgrades;let t=0;Object.keys(e).forEach((o=>{ro(e[o].name)&&(t+=1)})),t>=e.length&&Ro("O Fortuna")}}function Ko(e,t){Mo(),eo[e].amount+=t;const o=eo[e];"Cursor"===e?(o.amount>=1&&Ro("Click"),o.amount>=2&&Ro("Double-click"),o.amount>=50&&Ro("Mouse wheel"),o.amount>=100&&Ro("Of Mice and Men"),o.amount>=200&&Ro("The Digital"),o.amount>=300&&Ro("Extreme polydactyly"),o.amount>=400&&Ro("Dr. T"),o.amount>=500&&Ro("Thumbs, phalanges, metacarpals"),o.amount>=600&&Ro("With her finger and her thumb"),o.amount>=700&&Ro("Gotta hand it to you"),o.amount>=800&&Ro("The devil's workshop")):Object.keys(Game.Objects[o.name].tieredAchievs).forEach((e=>{o.amount>=Game.Tiers[Game.Objects[o.name].tieredAchievs[e].tier].achievUnlock&&Ro(Game.Objects[o.name].tieredAchievs[e].name)}));const n=De;return Io(),Yo(),n!==De&&Io(),Xe-Game.cookiesPs}function Jo(e){const t={};return Object.keys(Game.Objects).forEach((o=>{t[o]={},t[o].bonus=Ko(o,e),1!==e&&(Fe=1)})),t}function Zo(){Object.keys(Game.Objects).forEach((e=>{yt[e].price=$o(Game.Objects[e],Game.Objects[e].basePrice,Game.Objects[e].amount,Game.Objects[e].free,1),bt[e].price=$o(Game.Objects[e],Game.Objects[e].basePrice,Game.Objects[e].amount,Game.Objects[e].free,10),kt[e].price=$o(Game.Objects[e],Game.Objects[e].basePrice,Game.Objects[e].amount,Game.Objects[e].free,100)}))}function en(){yt=Jo(1),bt=Jo(10),kt=Jo(100),St=[],Object.keys(Game.Upgrades).forEach((t=>{const o=function(e){if("toggle"===Game.Upgrades[e].pool||0===Game.Upgrades[e].bought&&Game.Upgrades[e].unlocked&&"prestige"!==Game.Upgrades[e].pool){Mo(),"Shimmering veil [on]"===to[e].name?to["Shimmering veil [off]"].bought=0:"Golden switch [on]"===to[e].name?to["Golden switch [off]"].bought=0:to[e].bought=(to[e].bought+1)%2,Game.CountsAsUpgradeOwned(Game.Upgrades[e].pool)&&(Ae+=1),"Elder Pledge"===e?(je+=1,je>0&&Ro("Elder nap"),je>=5&&Ro("Elder slumber")):"Elder Covenant"===e?Ro("Elder calm"):"Prism heart biscuits"===e?Ro("Lovely cookies"):"Heavenly key"===e&&Ro("Wholesome");const t=De;Io(),Yo(),t!==De&&Io();const o=function(){let e=0;ro("Thousand fingers")&&(e+=.1),ro("Million fingers")&&(e*=5),ro("Billion fingers")&&(e*=10),ro("Trillion fingers")&&(e*=20),ro("Quadrillion fingers")&&(e*=20),ro("Quintillion fingers")&&(e*=20),ro("Sextillion fingers")&&(e*=20),ro("Septillion fingers")&&(e*=20),ro("Octillion fingers")&&(e*=20),ro("Nonillion fingers")&&(e*=20);let t=0;Object.keys(eo).forEach((e=>{t+=eo[e].amount})),t-=eo.Cursor.amount,e*=t,ro("Plastic mouse")&&(e+=.01*Xe),ro("Iron mouse")&&(e+=.01*Xe),ro("Titanium mouse")&&(e+=.01*Xe),ro("Adamantium mouse")&&(e+=.01*Xe),ro("Unobtainium mouse")&&(e+=.01*Xe),ro("Eludium mouse")&&(e+=.01*Xe),ro("Wishalloy mouse")&&(e+=.01*Xe),ro("Fantasteel mouse")&&(e+=.01*Xe),ro("Nevercrack mouse")&&(e+=.01*Xe),ro("Armythril mouse")&&(e+=.01*Xe),ro("Technobsidian mouse")&&(e+=.01*Xe),ro("Plasmarble mouse")&&(e+=.01*Xe),ro("Miraculite mouse")&&(e+=.01*Xe),ro("Fortune #104")&&(e+=.01*Xe);let o=1;if(ro("Santa's helpers")&&(o*=1.1),ro("Cookie egg")&&(o*=1.1),ro("Halo gloves")&&(o*=1.1),ro("Dragon claw")&&(o*=1.03),ro("Aura gloves")&&(o*=1+.05*Math.min(Game.Objects.Cursor.level,ro("Luminous gloves")?20:10)),o*=ao("click"),eo.Temple.minigameLoaded&&lo){const e=lo("labor");1===e?o*=1.15:2===e?o*=1.1:3===e&&(o*=1.05)}Object.keys(Game.buffs).forEach((e=>{void 0!==Game.buffs[e].multClick&&(o*=Game.buffs[e].multClick)})),o*=1+.05*no("Dragon Cursor");let n=o*Game.ComputeCps(1,ro("Reinforced index finger")+ro("Carpal tunnel prevention cream")+ro("Ambidextrous"),e);return n=Game.runModHookOnValue("cookiesPerClick",n),Game.hasBuff("Cursed finger")&&(n=Game.buffs["Cursed finger"].power),n}()-Game.computedMouseCps;return o?[Xe-Game.cookiesPs,o]:[Xe-Game.cookiesPs]}return[]}(t);"Elder Pledge"===t?(St[t]={bonus:Game.cookiesPs-Me},1===e.CalcWrink?St[t].bonus-=Se:2===e.CalcWrink&&(St[t].bonus-=Be),Number.isFinite(St[t].bonus)||(St[t].bonus=0)):(St[t]={},o[0]&&(St[t].bonus=o[0]),o[1]&&(St[t].bonusMouse=o[1]))}))}function tn(e,t,o){let n=0,i=0,a=0,r=0,l=1+Math.max(0,Math.ceil(Math.log(Game.cookies)/Math.LN10)-10);for(;a0?e/=t:e=0,Lt=tn(7,e,ut),Ot=2*Lt[1]/ut,Ft=Lt[2]/60/60/6/pt,jt=tn(6,e,mt),Wt=2*jt[1]/mt,At=jt[2]/60/60/6/pt,Ut=tn(7,7*e,ut),Dt=2*Ut[1]/ut,Ht=Ut[2]/60/60/6/pt,It=tn(6,7*e,mt),$t=2*It[1]/mt,Rt=It[2]/60/60/6/pt}function nn(){const e=Math.floor(Date.now()/1e3);if(Game.T/Game.fps%1==0){const t=Game.HowMuchPrestige(Game.cookiesReset),o=Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned))-Math.floor(t),n=e-Ne,i=Math.max(0,o-Oe)/n;for(let e=0;e{e.push(Game.Upgrades[t])})),e.sort((function(e,t){return e.order>t.order?1:e.order{const o=e[t];if(0===o.bought){let e="";e+=function(e){let t="crate upgrade missing";"prestige"===e.pool&&(t+=" heavenly");let o=0;Game.prefs.crates||(o=1),o&&(t+=" noFrame");let{icon:n}=e;e.iconFunction&&(n=e.iconFunction());const i=`function() {return Game.crateTooltip(Game.UpgradesById[${e.id}], 'stats');}`;return`
\n\t
`}(o),"prestige"===o.pool?Et+=e:"cookie"===o.pool?Nt+=e:"toggle"!==o.pool&&"unused"!==o.pool&&"debug"!==o.pool&&(Pt+=e)}}))}function rn(){if("christmas"===Game.season){let e=60*Game.cookiesPs;Game.hasBuff("Elder frenzy")&&(e*=.5),Game.hasBuff("Frenzy")&&(e*=.75),ft=Math.max(25,e),Game.Has("Ho ho ho-flavored frosting")&&(ft*=2)}}function ln(){et=900*dt/.15,et*=pt;const e=Eo();e>0?et/=e:et=0,tt=ut*(.15*et)+13,ot=mt*(.15*et)+13,nt=7*et,it=ut*(.15*nt)+13,at=mt*(.15*nt)+13,rt=2*et,lt=.15*rt,st=0;let t=0,o=0;Object.keys(Game.Objects).forEach((e=>{Game.Objects[e].amount>t&&(t=Game.Objects[e].amount),Game.Objects[e].amount>0&&(o+=1)})),Object.keys(Game.Objects).forEach((e=>{(Game.Objects[e].amountst&&(st=2*Game.Objects[e].price,ct=e)}))}function sn(){let e=1,t=1,o=1;ro("Green yeast digestives")&&(o*=1.01),ro("Dragon fang")&&(o*=1.03),e*=1+.1*Game.auraMult("Ancestral Metamorphosis"),e*=Game.eff("goldenCookieGain"),t*=1+.1*Game.auraMult("Unholy Dominion"),t*=Game.eff("wrathCookieGain"),ut=o*e,mt=o*t,pt=1,0===Game.shimmerTypes.golden.n&&(pt*=1+1.23*Game.auraMult("Dragon's Fortune"))}function cn(){vt=0,wt=0,xt=[0,null];for(let e=0;ext[0]&&(xt=[t,e]))}}function dn(){Go(),cn(),ln(),sn(),on(),an(),rn(),ge=new Wo(J[J.length-1]),fe=new Wo(J[J.length-1]),Ce=new Wo(J[J.length-1]),ye=new Wo(J[J.length-1]),be=new Wo(Z[Z.length-1]),ke=new Wo(5),he=new Wo(20*Z[Z.length-1]),nn(),Ao(),en(),Zo(),Uo()}const pn={CPSMode:1,AvgCPSHist:3,AvgClicksHist:0,CalcWrink:0,Scale:2,ScaleDecimals:2,ScaleSeparator:0,ScaleCutoff:999999,TimeFormat:0,DetailedTime:1,PPDisplayTime:0,BuildColour:1,PPOnlyConsiderBuyable:0,PPExcludeTop:0,PPRigidelMode:0,PPSecondsLowerLimit:0,ColourBlue:"#4bb8f0",ColourGreen:"#00ff00",ColourYellow:"#ffff00",ColourOrange:"#ff7f00",ColourRed:"#ff0000",ColourPurple:"#ff00ff",ColourGray:"#b3b3b3",ColourPink:"#ff1493",ColourBrown:"#8b4513",BotBar:1,TimerBar:1,TimerBarPos:0,TimerBarOverlay:2,UpBarColour:1,UpgradeBarFixedPos:1,SortBuildings:0,SortUpgrades:0,DragonAuraInfo:1,GrimoireBar:1,GCTimer:1,Favicon:1,WrinklerButtons:1,HideSectionsButtons:0,TooltipBuildUpgrade:1,TooltipAmor:0,ToolWarnLucky:1,ToolWarnLuckyFrenzy:1,ToolWarnConjure:1,ToolWarnConjureFrenzy:1,ToolWarnEdifice:1,ToolWarnUser:0,ToolWarnBon:1,ToolWarnPos:1,TooltipGrim:1,TooltipWrink:1,TooltipLump:1,TooltipPlots:1,TooltipPantheon:1,TooltipAscendButton:1,Stats:1,MissingUpgrades:1,MissingAchievements:0,UpStats:1,HeavenlyChipsTarget:1,ShowMissedGC:1,Title:1,GeneralSound:1,GCNotification:0,GCFlash:1,ColourGCFlash:"#ffffff",GCSound:1,GCVolume:100,GCSoundURL:"https://freesound.org/data/previews/66/66717_931655-lq.mp3",FortuneNotification:0,FortuneFlash:1,ColourFortuneFlash:"#ffffff",FortuneSound:1,FortuneVolume:100,FortuneSoundURL:"https://freesound.org/data/previews/174/174027_3242494-lq.mp3",SeaNotification:0,SeaFlash:1,ColourSeaFlash:"#ffffff",SeaSound:1,SeaVolume:100,SeaSoundURL:"https://www.freesound.org/data/previews/121/121099_2193266-lq.mp3",GardFlash:1,ColourGardFlash:"#ffffff",GardSound:1,GardVolume:100,GardSoundURL:"https://freesound.org/data/previews/103/103046_861714-lq.mp3",MagicNotification:0,MagicFlash:1,ColourMagicFlash:"#ffffff",MagicSound:1,MagicVolume:100,MagicSoundURL:"https://freesound.org/data/previews/221/221683_1015240-lq.mp3",WrinklerNotification:0,WrinklerFlash:1,ColourWrinklerFlash:"#ffffff",WrinklerSound:1,WrinklerVolume:100,WrinklerSoundURL:"https://freesound.org/data/previews/124/124186_8043-lq.mp3",WrinklerMaxNotification:0,WrinklerMaxFlash:1,ColourWrinklerMaxFlash:"#ffffff",WrinklerMaxSound:1,WrinklerMaxVolume:100,WrinklerMaxSoundURL:"https://freesound.org/data/previews/152/152743_15663-lq.mp3",BulkBuyBlock:0,FavouriteSettings:1,Header:{Favourite:1,Calculation:1,Notation:1,Colours:1,BarsDisplay:1,Tooltip:1,Statistics:1,Notification:1,NotificationGeneral:1,NotificationGC:1,NotificationFC:1,NotificationSea:1,NotificationGard:1,NotificationMagi:1,NotificationWrink:1,NotificationWrinkMax:1,Miscellaneous:1,Lucky:1,Chain:1,Spells:1,Garden:1,Prestige:1,Wrink:1,Sea:1,Misc:1,InfoTab:1}},un=function(e){if(1===e){const e=function(){try{Notification.requestPermission().then()}catch(e){return!1}return!0};"Notification"in window?e()?Notification.requestPermission().then():Notification.requestPermission():console.log("This browser does not support notifications.")}};function mn(){1===e.BotBar?(l("CMBotBar").style.display="",Co()):l("CMBotBar").style.display="none",bo()}function hn(){BeautifyAll(),Game.RefreshStore(),Game.RebuildUpgrades(),Co(),po(),uo()}function gn(){1===e.Favicon&&y>0?_t.wrath?l("CMFavicon").href="https://aktanusa.github.io/CookieMonster/favicon/wrathCookie.ico":l("CMFavicon").href="https://aktanusa.github.io/CookieMonster/favicon/goldenCookie.ico":l("CMFavicon").href="https://orteil.dashnet.org/cookieclicker/favicon.ico"}class fn{constructor(e,t){this.type=e,this.group=t}}class Cn extends fn{constructor(e,t,o){super(e,t),this.desc=o}}class yn extends fn{constructor(e,t,o,n,i,a){super(e,t),this.label=o,this.desc=n,this.min=i,this.max=a}}class bn extends fn{constructor(e,t,o,n,i,a){super(e,t),this.label=o,this.desc=n,this.toggle=i,void 0!==a&&(this.func=a)}}class kn extends fn{constructor(e,t,o,n){super(e,t),this.label=o,this.desc=n;for(let e=0;e<101;e++)this.label[e]=`${e}%`}}const Gn={CPSMode:new bn("bool","Calculation",["Current cookies per second","Average cookies per second"],"Calculate times using current cookies per second or average cookies per second",!1),AvgCPSHist:new bn("bool","Calculation",["Average CPS in past 10s","Average CPS in past 15s","Average CPS in past 30s","Average CPS in past 1m","Average CPS in past 5m","Average CPS in past 10m","Average CPS in past 15m","Average CPS in past 30m"],"How much time average Cookies Per Second should consider",!1),AvgClicksHist:new bn("bool","Calculation",["Average clicks in past 1s","Average clicks in past 5s","Average clicks in past 10s","Average clicks in past 15s","Average clicks in past 30s"],"How much time average Cookie Clicks should consider",!1),CalcWrink:new bn("bool","Calculation",["Calculate with wrinklers OFF","Calculate with wrinklers ON","Calculate with single fattest wrinkler ON"],"Calculate times and average Cookies Per Second with (only the single non-shiny fattest) wrinklers",!0,(function(){_e=!0})),Scale:new bn("bool","Notation",["Game's setting scale","Metric","Short scale","Short scale (Abbreviated)","Scientific notation","Engineering notation"],"Change how long numbers are formatted",!1,(function(){hn()})),ScaleDecimals:new bn("bool","Notation",["1 decimals","2 decimals","3 decimals"],'Set the number of decimals used when applicable. This only works with Cookie Monster scales and not with "Game\'s Setting Scale"',!1,(function(){hn()})),ScaleSeparator:new bn("bool","Notation",[". for decimals (standard)",". for thousands"],"Set the separator used for decimals and thousands",!1,(function(){hn()})),ScaleCutoff:new yn("numscale","Notation","Notation cut-off point: ","The number from which Cookie Monster will start formatting numbers based on chosen scale. Standard is 999,999. Setting this above 999,999,999 might break certain notations",1,999999999),TimeFormat:new bn("bool","Notation",["Time XXd, XXh, XXm, XXs","Time XX:XX:XX:XX:XX"],"Change the time format",!1),DetailedTime:new bn("bool","Notation",["Detailed time OFF","Detailed time ON"],"Change how time is displayed in certain statistics and tooltips",!0,(function(){1===e.DetailedTime?Game.sayTime=V:Game.sayTime=S.sayTime})),PPDisplayTime:new bn("bool","Notation",["PP as value (standard)","PP as time unit"],"Display PP as calculated value or as approximate time unit. Note that PP does not translate directly into a time unit and this is therefore only an approximation.",!1),BuildColour:new bn("bool","Colours",["Building colours OFF","Building colours ON"],"Colour code buildings",!0,(function(){po()})),PPOnlyConsiderBuyable:new bn("bool","Colours",["Don't ignore non-buyable","Ignore non-buyable"],"Makes Cookie Monster label buildings and upgrades you can't buy right now red, useful in those situations where you just want to spend your full bank 'most optimally'",!0),PPExcludeTop:new bn("bool","Colours",["Don't ignore any","Ignore 1st best","Ignore 1st and 2nd best","Ignore 1st, 2nd and 3rd best"],"Makes Cookie Monster ignore the 1st, 2nd or 3rd best buildings in labeling and colouring PP values",!0),PPRigidelMode:new bn("bool","Colours",["Rigidel mode OFF","Rigidel mode ON"],'Makes Cookie Monster ignore all "buy 1" options when colouring PP in order to stay at a total building count ending in 10 for pantheon god Rigidel',!0),PPSecondsLowerLimit:new yn("numscale","Colours","Lower limit for PP (in seconds): ",'If a building or upgrade costs less than the specified seconds of CPS it will also be considered optimal and label it as such ("PP is less than xx seconds of CPS"); setting to 0 ignores this option',0,1/0),ColourBlue:new Cn("colour","Colours","Standard colour is blue. Used to show upgrades better than best PP building, for Click Frenzy bar, and for various labels"),ColourGreen:new Cn("colour","Colours","Standard colour is green. Used to show best PP building, for Blood Frenzy bar, and for various labels"),ColourYellow:new Cn("colour","Colours","Standard colour is yellow. Used to show buildings within the top 10 of PP, for Frenzy bar, and for various labels"),ColourOrange:new Cn("colour","Colours","Standard colour is orange. Used to show buildings within the top 20 of PP, for Next Reindeer bar, and for various labels"),ColourRed:new Cn("colour","Colours","Standard colour is Red. Used to show buildings within the top 30 of PP, for Clot bar, and for various labels"),ColourPurple:new Cn("colour","Colours","Standard colour is purple. Used to show buildings outside of the top 30 of PP, for Next Cookie bar, and for various labels"),ColourGray:new Cn("colour","Colours","Standard colour is gray. Used to show negative or infinity PP, and for Next Cookie/Next Reindeer bar"),ColourPink:new Cn("colour","Colours","Standard colour is pink. Used for Dragonflight bar"),ColourBrown:new Cn("colour","Colours","Standard colour is brown. Used for Dragon Harvest bar"),BotBar:new bn("bool","BarsDisplay",["Bottom bar OFF","Bottom bar ON"],"Building information",!0,(function(){mn()})),TimerBar:new bn("bool","BarsDisplay",["Timer bar OFF","Timer bar ON"],"Bar with timers for golden cookie, season popup, Frenzy (Normal, Clot, Elder), Click Frenzy",!0,(function(){ko()})),TimerBarPos:new bn("bool","BarsDisplay",["Timer bar position (top left)","Timer bar position (bottom)"],"Placement of the timer bar",!1,(function(){0===e.TimerBarPos?(l("CMTimerBar").style.width="30%",l("CMTimerBar").style.bottom="",l("game").insertBefore(l("CMTimerBar"),l("sectionLeft"))):(l("CMTimerBar").style.width="100%",l("CMTimerBar").style.bottom="0px",l("wrapper").appendChild(l("CMTimerBar"))),bo()})),TimerBarOverlay:new bn("bool","BarsDisplay",["Timer bar overlay OFF","Timer bar overlay only seconds","Timer bar overlay full"],"Overlay on timers displaying seconds and/or percentage left",!0),UpBarColour:new bn("bool","BarsDisplay",["Upgrade colours/bar OFF","Upgrade colours with bar ON","Upgrade colours without bar ON"],"Colour code upgrades and optionally add a counter bar",!1,(function(){1===e.UpBarColor?(l("CMUpgradeBar").style.display="",uo()):2===e.UpBarColor?(l("CMUpgradeBar").style.display="none",uo()):(l("CMUpgradeBar").style.display="none",Game.RebuildUpgrades())})),UpgradeBarFixedPos:new bn("bool","BarsDisplay",["Upgrade bar fixed position OFF","Upgrade bar fixed position ON"],"Lock the upgrade bar at top of the screen to prevent it from moving ofscreen when scrolling",!0,(function(){1===e.UpgradeBarFixedPos?(l("CMUpgradeBar").style.position="sticky",l("CMUpgradeBar").style.top="0px"):l("CMUpgradeBar").style.position=""})),SortBuildings:new bn("bool","BarsDisplay",["Sort buildings: default","Sort buildings: PP of x1 purchase","Sort buildings: PP of selected bulk mode"],"Sort the display of buildings in either default order or by PP",!1,(function(){po()})),SortUpgrades:new bn("bool","BarsDisplay",["Sort upgrades: default","Sort upgrades: PP"],"Sort the display of upgrades in either default order or by PP",!1,(function(){uo()})),DragonAuraInfo:new bn("bool","BarsDisplay",["Extra dragon aura info OFF","Extra dragon aura info ON"],"Shows information about changes in CPS and costs in the dragon aura interface.",!0),GrimoireBar:new bn("bool","BarsDisplay",["Grimoire magic meter timer OFF","Grimoire magic meter timer ON"],"A timer on how long before the Grimoire magic meter is full",!0),GCTimer:new bn("bool","BarsDisplay",["Golden cookie timer OFF","Golden cookie timer ON"],"A timer on the golden cookie when it has been spawned",!0,(function(){1===e.GCTimer?Object.keys(se).forEach((e=>{se[e].style.display="block",se[e].style.left=Kt[e].l.style.left,se[e].style.top=Kt[e].l.style.top})):Object.keys(se).forEach((e=>se[e].style.display="none"))})),Favicon:new bn("bool","BarsDisplay",["Favicon OFF","Favicon ON"],"Update favicon with golden/wrath cookie",!0,(function(){gn()})),WrinklerButtons:new bn("bool","BarsDisplay",["Extra wrinkler buttons OFF","Extra wrinkler buttons ON"],"Show buttons for popping wrinklers at bottom of cookie section",!0,(function(){t()})),HideSectionsButtons:new bn("bool","BarsDisplay",["Hide buildings/upgrades button OFF","Hide buildings/upgrades button ON"],"Show buttons for hiding and showing the buildings and upgrades sections in the right column",!0,(function(){e.HideSectionsButtons?l("CMSectionHidButtons").style.display="":l("CMSectionHidButtons").style.display="none"})),TooltipBuildUpgrade:new bn("bool","Tooltip",["Building/upgrade tooltip information OFF","Building/upgrade tooltip information ON"],"Extra information in building/upgrade tooltips",!0),TooltipAmor:new bn("bool","Tooltip",["Buildings tooltip amortization information OFF","Buildings tooltip amortization information ON"],"Add amortization information to buildings tooltip",!0),ToolWarnLucky:new bn("bool","Tooltip",["Tooltip lucky warning OFF","Tooltip lucky warning ON"],'A warning when buying if it will put the bank under the amount needed for max "Lucky!" rewards',!0),ToolWarnLuckyFrenzy:new bn("bool","Tooltip",["Tooltip lucky frenzy warning OFF","Tooltip lucky frenzy warning ON"],'A warning when buying if it will put the bank under the amount needed for max "Lucky!" (Frenzy) rewards',!0),ToolWarnConjure:new bn("bool","Tooltip",["Tooltip conjure warning OFF","Tooltip conjure warning ON"],'A warning when buying if it will put the bank under the amount needed for max "Conjure Baked Goods" rewards',!0),ToolWarnConjureFrenzy:new bn("bool","Tooltip",["Tooltip conjure frenzy warning OFF","Tooltip conjure frenzy warning ON"],'A warning when buying if it will put the bank under the amount needed for max "Conjure Baked Goods" rewards with Frenzy active',!0),ToolWarnEdifice:new bn("bool","Tooltip",["Tooltip edifice warning OFF","Tooltip edifice warning ON"],'A warning when buying if it will put the bank under the amount needed for "Spontaneous Edifice" to possibly give you your most expensive building',!0),ToolWarnUser:new yn("numscale","Tooltip","Tooltip warning at x times CPS: ","Use this to show a customized warning if buying it will put the bank under the amount equal to value times cps; setting to 0 disables the function altogether",0,1/0),ToolWarnBon:new bn("bool","Tooltip",["Calculate tooltip warning with bonus CPS OFF","Calculate tooltip warning with bonus CPS ON"],"Calculate the warning with or without the bonus CPS you get from buying",!0),ToolWarnPos:new bn("bool","Tooltip",["Tooltip warning position (left)","Tooltip warning position (bottom)"],"Placement of the warning boxes",!1,(function(){No()})),TooltipGrim:new bn("bool","Tooltip",["Grimoire tooltip information OFF","Grimoire tooltip information ON"],"Extra information in tooltip for grimoire",!0),TooltipWrink:new bn("bool","Tooltip",["Wrinkler tooltip OFF","Wrinkler tooltip ON"],"Shows the amount of cookies a wrinkler will give when popping it",!0),TooltipLump:new bn("bool","Tooltip",["Sugar lump tooltip OFF","Sugar lump tooltip ON"],"Shows the current Sugar Lump type in Sugar lump tooltip.",!0),TooltipPlots:new bn("bool","Tooltip",["Garden plots tooltip OFF","Garden plots tooltip ON"],"Shows a tooltip for plants that have a cookie reward.",!0),TooltipPantheon:new bn("bool","Tooltip",["Pantheon tooltip OFF","Pantheon tooltip ON"],"Shows additional info in the pantheon tooltip",!0),TooltipAscendButton:new bn("bool","Tooltip",["Show Extra Info Ascend Tooltip OFF","Show Extra Info Ascend Tooltip ON"],"Shows additional info in the ascend tooltip",!0),Stats:new bn("bool","Statistics",["Statistics OFF","Statistics ON"],"Extra Cookie Monster statistics!",!0),MissingUpgrades:new bn("bool","Statistics",["Missing upgrades OFF","Missing upgrades ON"],"Shows missing upgrades in statistics menu",!0),MissingAchievements:new bn("bool","Statistics",["Missing Achievements OFF","Missing Normal Achievements ON"],"Shows missing normal achievements in statistics menu.",!0),UpStats:new bn("bool","Statistics",["Statistics update rate (default)","Statistics update rate (1s)"],"Default rate is once every 5 seconds",!1),HeavenlyChipsTarget:new yn("numscale","Statistics","Heavenly chips target: ",'Use this to set a heavenly chips target that will be counted towards in the "prestige" statsistics sections',1,1/0),ShowMissedGC:new bn("bool","Statistics",["Missed GC OFF","Missed GC ON"],"Show a stat in the statistics screen that counts how many golden cookies you have missed",!0),Title:new bn("bool","NotificationGeneral",["Title OFF","Title ON","Title pinned tab highlight"],'Update title with colden cookie/season popup timers; pinned tab highlight only changes the title when a golden cookie/season popup spawns; "!" means that golden cookie/reindeer can spawn',!0),GeneralSound:new bn("bool","NotificationGeneral",["Consider game volume setting OFF","Consider game volume setting ON"],'Turning this toggle to "off" makes Cookie Monster no longer consider the volume setting of the base game, allowing mod notifications to play with base game volume turned down',!0),GCNotification:new bn("bool","NotificationGC",["Notification OFF","Notification ON"],"Create a notification when golden cookie spawns",!0,(function(){un(e.GCNotification)})),GCFlash:new bn("bool","NotificationGC",["Flash OFF","Flash ON"],"Flash screen on golden cookie",!0),ColourGCFlash:new Cn("colour","NotificationGC","The colour of the GC flash, standard colour is white"),GCSound:new bn("bool","NotificationGC",["Sound OFF","Sound ON"],"Play a sound on golden cookie",!0),GCVolume:new kn("vol","NotificationGC",[],"Volume"),GCSoundURL:new bn("url","NotificationGC","Sound URL:","URL of the sound to be played when a golden cookie spawns"),FortuneNotification:new bn("bool","NotificationFC",["Notification OFF","Notification ON"],"Create a notification when fortune cookie is on the ticker",!0,(function(){un(e.FortuneNotification)})),FortuneFlash:new bn("bool","NotificationFC",["Flash OFF","Flash ON"],"Flash screen on fortune cookie spawn",!0),ColourFortuneFlash:new Cn("colour","NotificationFC","The colour of the fortune flash, standard colour is white"),FortuneSound:new bn("bool","NotificationFC",["Sound OFF","Sound ON"],"Play a sound on fortune cookie spawn",!0),FortuneVolume:new kn("vol","NotificationFC",[],"Volume"),FortuneSoundURL:new bn("url","NotificationFC","Sound URL:","URL of the sound to be played when the ticker has a fortune cookie"),SeaNotification:new bn("bool","NotificationSea",["Notification OFF","Notification ON"],"Create a notification on season popup",!0,(function(){un(e.SeaNotification)})),SeaFlash:new bn("bool","NotificationSea",["Flash OFF","Flash ON"],"Flash screen on season popup",!0),ColourSeaFlash:new Cn("colour","NotificationSea","The colour of the season popup flash, standard colour is white"),SeaSound:new bn("bool","NotificationSea",["Sound OFF","Sound ON"],"Play a sound on season popup",!0),SeaVolume:new kn("vol","NotificationSea",[],"Volume"),SeaSoundURL:new bn("url","NotificationSea","Sound URL:","URL of the sound to be played when on season popup spawns"),GardFlash:new bn("bool","NotificationGard",["Garden Tick Flash OFF","Flash ON"],"Flash screen on garden tick",!0),ColourGardFlash:new Cn("colour","NotificationGard","The colour of the garden flash, standard colour is white"),GardSound:new bn("bool","NotificationGard",["Sound OFF","Sound ON"],"Play a sound on garden tick",!0),GardVolume:new kn("vol","NotificationGard",[],"Volume"),GardSoundURL:new bn("url","NotificationGard","Garden Tick Sound URL:","URL of the sound to be played when the garden ticks"),MagicNotification:new bn("bool","NotificationMagi",["Notification OFF","Notification ON"],"Create a notification when magic reaches maximum",!0,(function(){un(e.MagicNotification)})),MagicFlash:new bn("bool","NotificationMagi",["Flash OFF","Flash ON"],"Flash screen when magic reaches maximum",!0),ColourMagicFlash:new Cn("colour","NotificationMagi","The colour of the magic flash, standard colour is white"),MagicSound:new bn("bool","NotificationMagi",["Sound OFF","Sound ON"],"Play a sound when magic reaches maximum",!0),MagicVolume:new kn("vol","NotificationMagi",[],"Volume"),MagicSoundURL:new bn("url","NotificationMagi","Sound URL:","URL of the sound to be played when magic reaches maxium"),WrinklerNotification:new bn("bool","NotificationWrink",["Notification OFF","Notification ON"],"Create a notification when a wrinkler appears",!0,(function(){un(e.WrinklerNotification)})),WrinklerFlash:new bn("bool","NotificationWrink",["Flash OFF","Flash ON"],"Flash screen when a wrinkler appears",!0),ColourWrinklerFlash:new Cn("colour","NotificationWrink","The colour of the wrinkler flash, standard colour is white"),WrinklerSound:new bn("bool","NotificationWrink",["Sound OFF","Sound ON"],"Play a sound when a wrinkler appears",!0),WrinklerVolume:new kn("vol","NotificationWrink",[],"Volume"),WrinklerSoundURL:new bn("url","NotificationWrink","Sound URL:","URL of the sound to be played when a wrinkler appears"),WrinklerMaxNotification:new bn("bool","NotificationWrinkMax",["Notification OFF","Notification ON"],"Create a notification when the maximum amount of wrinklers has appeared",!0,(function(){un(e.WrinklerMaxNotification)})),WrinklerMaxFlash:new bn("bool","NotificationWrinkMax",["Flash OFF","Flash ON"],"Flash screen when the maximum amount of Wrinklers has appeared",!0),ColourWrinklerMaxFlash:new Cn("colour","NotificationWrinkMax","The colour of the maximum wrinkler flash, standard colour is white"),WrinklerMaxSound:new bn("bool","NotificationWrinkMax",["Sound OFF","Sound ON"],"Play a sound when the maximum amount of wrinklers has appeared",!0),WrinklerMaxVolume:new kn("vol","NotificationWrinkMax",[],"Volume"),WrinklerMaxSoundURL:new bn("url","NotificationWrinkMax","Sound URL:","URL of the sound to be played when the maximum amount of wrinklers has appeared"),BulkBuyBlock:new bn("bool","Miscellaneous",["Block bulk buying OFF","Block bulk buying ON"],"Block clicking bulk buying when you can't buy all. This prevents buying 7 of a building when you are in buy-10 or buy-100 mode.",!0),FavouriteSettings:new bn("bool","Miscellaneous",["Favourite settings section OFF","Favourite settings section ON","Favourite settings section ON (Locked)"],"Show stars before each setting which allows selecting it for a 'favourites' section at the top of the Cookie Monster settings. Setting this to Locked removes the stars but shows the 'favourites' section",!0,(function(){Game.UpdateMenu()}))};function vn(){return JSON.stringify({favouriteSettings:de,settings:e,version:"2.031.7"})}function wn(){if(Je!==Game.dragonLevel||_e){if(Game.dragonLevel<25&&Game.dragonLevels[Game.dragonLevel].buy.toString().includes("sacrifice")){let e=Game.dragonLevels[Game.dragonLevel].buy.toString().match(/Objects\[(.*)\]/)[1];const t=Game.dragonLevels[Game.dragonLevel].buy.toString().match(/sacrifice\((.*?)\)/)[1];if("i"!==e)if(e=e.replaceAll("'",""),Game.Objects[e].amount{if(e=n,Game.Objects[e].amount{eo[e]=xo(e)})),to=[],Object.keys(Game.Upgrades).forEach((e=>{to[e]=To(e)})),oo=[],Object.keys(Game.Achievements).forEach((e=>{oo[e]=vo(e)})),Mo()}let Mn=!1;function Sn(t,o,n){(1===e[o]||n)&&3===t&&!1===Mn||1===t?(l("CMFlashScreen").style.backgroundColor=e[`Colour${o}`],l("CMFlashScreen").style.opacity="0.5",3===t?(l("CMFlashScreen").style.display="inline",setTimeout((function(){Sn(2,o,!0)}),1e3/Game.fps)):setTimeout((function(){Sn(0,o,!0)}),1e3/Game.fps)):2===t?(l("CMFlashScreen").style.opacity="1",setTimeout((function(){Sn(1,o,!0)}),1e3/Game.fps)):0===t&&(l("CMFlashScreen").style.display="none")}function Bn(t,o,n,i){if((1===e[o]||i)&&!1===Mn){const o=new Audio(t);e.GeneralSound?o.volume=e[n]/100*(Game.volume/100):o.volume=e[n]/100,o.play()}}function Pn(t,o,n){1===e[t]&&"hidden"===document.visibilityState&&!1===Mn&&new Notification(o,{body:n,badge:"https://orteil.dashnet.org/cookieclicker/favicon.ico"})}function En(){if(re!==Game.OnAscend&&(re=Game.OnAscend,Game.OnAscend?(l("game").style.bottom="0px",1===e.BotBar&&(l("CMBotBar").style.display="none"),1===e.TimerBar&&(l("CMTimerBar").style.display="none")):(mn(),ko()),yo()),!Game.OnAscend&&0===Game.AscendTimer){r!==Object.keys(Game.mods).length&&(Tn(),dn(),r=Object.keys(Game.mods).length),_e&&(function(){const e={};Object.keys(Game.Objects).forEach((t=>{if(0!==Object.keys(Gt).length&&Gt[t].TotalNeeded>Game.Objects[t].amount)e[t]={AmountNeeded:Gt[t].TotalNeeded-Game.Objects[t].amount,TotalNeeded:Gt[t].TotalNeeded};else{const o=function(e){const t=Game.AchievementsOwned;for(let o=0;o<101;o++)if(Ko(e,o),De>t)return o;return 101}(t);e[t]={AmountNeeded:o,TotalNeeded:Game.Objects[t].amount+o}}})),Gt=e}(),en(),Game.Has("Golden switch [off]")?(Mo(),to["Golden switch [off]"].bought=0,Io(),dt=Xe):dt=Game.cookiesPs,sn(),ln(),an(),on(),wn(),function(){for(let e=0;e<11;e+=1)for(let t=0;t<3;t+=1)Zt[e][t]=xn(e,t)}(),rn(),function(){let e=0;if(Game.Objects.Bank.minigameLoaded){const t=Game.Objects.Bank.minigame.goods;let o=0;Object.keys(t).forEach((e=>{const n=t[e];o+=n.stock*n.val})),e+=o*Game.cookiesPsRawHighest}e+=function(){let e=0;Mo();let t=2;5!==$e&&18!==$e||(t-=1),5!==Re&&18!==Re||(t-=1),$e=5,Re=18;for(let e=0;e{eo[t].amount>0&&(e=t)})),eo[e].amount-=1,We-=1}return Object.keys(eo).forEach((t=>{const o=eo[t];e+=co(Game.Objects[o.name],Game.Objects[t].basePrice,o.amount,Game.Objects[t].free,o.amount)})),e}(),Jt=e}(),_e=0);const t=Game.auraMult("Fierce Hoarder")>0;!Le&&t?(Le=!0,Fe=1):Le&&!t&&(Le=!1,Fe=1),Fe&&(Zo(),Fe=0),function(){cn(),Uo(),function(){Tt=0;let e=0;Object.keys(Game.wrinklers).forEach((t=>{2===Game.wrinklers[t].phase&&(e+=1)}));let t=1;if(eo.Temple.minigameLoaded){const e=Game.hasGod("scorn");1===e?t*=1.15:2===e?t*=1.1:3===e&&(t*=1.05)}Mt=e,Tt=e*(.05*e*1.1)*(.05*Game.Has("Sacrilegious corruption")+1)*(.05*Game.Has("Wrinklerspawn")+1)*t}(),Ao(),nn();const e=Game.HowManyCookiesReset(Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned))+1)-(Game.cookiesEarned+Game.cookiesReset);Xt=ue(e/mo())}(),G=0,Kt={},Object.keys(Game.shimmers).forEach((e=>{Kt[Game.shimmers[e].id]=Game.shimmers[e],Game.shimmers[e].spawnLead&&"golden"===Game.shimmers[e].type&&(_t=Game.shimmers[e],G+=1)})),Object.keys(se).forEach((e=>{void 0===Kt[e]&&(se[e].parentNode.removeChild(se[e]),delete se[e])})),y!==Game.shimmerTypes.golden.n?(y=Game.shimmerTypes.golden.n,y&&(b{void 0===se[Game.shimmers[t].id]&&function(t){const o=document.createElement("div");o.id=`GCTimer${t.id}`,o.style.width="96px",o.style.height="96px",o.style.position="absolute",o.style.zIndex="10000000001",o.style.textAlign="center",o.style.lineHeight="96px",o.style.fontFamily='"Kavoon", Georgia, serif',o.style.fontSize="35px",o.style.cursor="pointer",o.style.display="block",0===e.GCTimer&&(o.style.display="none"),o.style.left=t.l.style.left,o.style.top=t.l.style.top,o.onclick=function(){t.pop()},o.onmouseover=function(){t.l.style.filter="brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))",t.l.style.webkitFilter="brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))"},o.onmouseout=function(){t.l.style.filter="",t.l.style.webkitFilter=""},se[t.id]=o,l("shimmers").appendChild(o)}(Game.shimmers[t])}))),gn(),b=G,0===G&&(_t=0)):1===e.GCTimer&&y&&Object.keys(se).forEach((e=>{se[e].style.opacity=Kt[e].l.style.opacity,se[e].style.transform=Kt[e].l.style.transform,se[e].textContent=Math.ceil(Kt[e].life/Game.fps)})),f!==(Game.TickerEffect&&"fortune"===Game.TickerEffect.type)&&(f=Game.TickerEffect&&"fortune"===Game.TickerEffect.type,f&&(Sn(3,"FortuneFlash",!1),Bn(e.FortuneSoundURL,"FortuneSound","FortuneVolume",!1),Pn("FortuneNotification","Fortune Cookie found","A Fortune Cookie has appeared on the Ticker."))),g!==Game.shimmerTypes.reindeer.spawned&&(g=Game.shimmerTypes.reindeer.spawned,Object.keys(Game.shimmers).forEach((e=>{Game.shimmers[e].spawnLead&&"reindeer"===Game.shimmers[e].type&&(Qt=Game.shimmers[e])})),Sn(3,"SeaFlash",!1),Bn(e.SeaSoundURL,"SeaSound","SeaVolume",!1),Pn("SeaNotification","Reindeer sighted!","A Reindeer has spawned. Click it now!")),Game.Objects.Farm.minigameLoaded&&C!==Game.Objects.Farm.minigame.nextStep&&(0!==C&&C0){let t=0;Object.keys(Game.wrinklers).forEach((e=>{2===Game.wrinklers[e].phase&&(t+=1)})),t>v?(v=t,t===Game.getWrinklersMax()&&e.WrinklerMaxFlash?Sn(3,"WrinklerMaxFlash",!1):Sn(3,"WrinklerFlash",!1),t===Game.getWrinklersMax()&&e.WrinklerMaxSound?Bn(e.WrinklerMaxSoundURL,"WrinklerMaxSound","WrinklerMaxVolume",!1):Bn(e.WrinklerSoundURL,"WrinklerSound","WrinklerVolume",!1),t===Game.getWrinklersMax()&&e.WrinklerMaxNotification?Pn("WrinklerMaxNotification","Maximum Wrinklers Reached","You have reached your maximum ammount of wrinklers"):Pn("WrinklerNotification","A Wrinkler appeared","A new wrinkler has appeared")):v=t}}()}}function Nn(){let t="";for(let o=0;o<$.length;o++)t+=`.CMText${$[o]} { color: ${e[`Colour${$[o]}`]}; }\n`;for(let o=0;o<$.length;o++)t+=`.CMBack${$[o]} { background-color: ${e[`Colour${$[o]}`]}; }\n`;for(let o=0;o<$.length;o++)t+=`.CMBorder${$[o]} { border: 1px solid ${e[`Colour${$[o]}`]}; }\n`;l("CMCSS").textContent=t,po()}function On(){const e=b64_to_utf8(unescape(localStorage.getItem("CookieClickerGame")).split("!END!")[0]),t=e.match(/CookieMonster.*(;|$)/);if(null!==t){const o=e.replace(t[0],`CookieMonster:${vn()}`);localStorage.setItem("CookieClickerGame",escape(`${utf8_to_b64(o)}!END!`))}}function Fn(t){if(void 0!==localStorage.CMConfig&&delete localStorage.CMConfig,void 0!==t){e=t,void 0!==e.Colors&&delete e.Colors,void 0!==e.Colours&&delete e.Colours;let o=!1;Object.keys(pn).forEach((t=>{void 0===e[t]?(o=!0,e[t]=pn[t]):"Header"===t&&Object.keys(pn.Header).forEach((n=>{void 0!==e[t][n]&&e[t][n]>-1&&e[t][n]<2||(o=!0,e[t][n]=pn[t][n])}))})),o&&On(),En(),Object.keys(pn).forEach((e=>{"Header"!==e&&void 0!==Gn[e].func&&Gn[e].func()}))}else Fn(pn);Game.UpdateMenu(),Nn()}function Ln(){Object.keys(Game.wrinklers).forEach((e=>{Game.wrinklers[e].sucked>0&&0===Game.wrinklers[e].type&&(Game.wrinklers[e].hp=0)}))}function Wn(t,o){if("b"===t){if(l("tooltip").innerHTML=Game.Objects[o].tooltip(),1===e.TooltipAmor){const e=$o(Game.Objects[o],Game.Objects[o].basePrice,0,Game.Objects[o].free,Game.Objects[o].amount),t=e-Game.Objects[o].totalCookies;t>0&&(l("tooltip").innerHTML=l("tooltip").innerHTML.split("so far").join(`so far
${pe(t)} ${1===Math.floor(t)?"cookie":"cookies"} left to amortize (${me((e-Game.Objects[o].totalCookies)/(Game.Objects[o].storedTotalCps*Game.globalCpsMult)).text})`))}-1===Game.buyMode&&(l("tooltip").innerHTML=l("tooltip").innerHTML.split(pe(Game.Objects[o].bulkPrice)).join(pe((Game.Objects[o],Game.Objects[o].basePrice,Game.Objects[o].amount,Game.Objects[o].free,Game.buyBulk,1))))}else if("u"===t){if(!Game.UpgradesInStore[o])return"";l("tooltip").innerHTML=Game.crateTooltip(Game.UpgradesInStore[o],"store")}else"s"===t?l("tooltip").innerHTML=Game.lumpTooltip():"g"===t?l("tooltip").innerHTML=Game.Objects["Wizard tower"].minigame.spellTooltip(o)():"p"===t?l("tooltip").innerHTML=Game.ObjectsById[2].minigame.tileTooltip(o[0],o[1])():"ha"===t?l("tooltip").innerHTML=Game.ObjectsById[2].minigame.toolTooltip(1)():"wb"===t?l("tooltip").innerHTML="":"pag"===t?l("tooltip").innerHTML=Game.Objects.Temple.minigame.godTooltip(o)():"pas"===t&&(l("tooltip").innerHTML=Game.Objects.Temple.minigame.slotTooltip(o[0])());if("b"===t&&1===Game.buyMode||"u"===t||"s"===t||"g"===t||"p"===t&&!Game.keys[16]||"ha"===t||"wb"===t||"pag"===t||"pas"===t&&-1!==o[1]){const e=document.createElement("div");e.id="CMTooltipArea",l("tooltip").appendChild(e)}return ne=t,ie=o,Oo(),l("tooltip").innerHTML}function An(){Game.Objects["Wizard tower"].minigameLoaded&&Object.keys(Game.Objects["Wizard tower"].minigame.spellsById).forEach((e=>{null!==l(`grimoireSpell${e}`).onmouseover&&(T[e]=l(`grimoireSpell${e}`).onmouseover,l(`grimoireSpell${e}`).onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Wn("g",`${e}`)}),"this"),Game.tooltip.wobble()})}))}function jn(){if(!m&&Game.Objects["Wizard tower"].minigameLoaded){const{minigame:t}=Game.Objects["Wizard tower"];p=t.draw,Game.Objects["Wizard tower"].minigame.draw=function(){p(),1===e.GrimoireBar&&t.magic1&&(e.Header[t]=0),On()}function zn(t,o){const n=document.createElement("div");n.className="title",n.style.padding="0px 16px",n.style.opacity="0.7",n.style.fontSize="17px",n.style.fontFamily='"Kavoon", Georgia, serif',n.appendChild(document.createTextNode(`${t} `));const i=document.createElement("span");return i.style.cursor="pointer",i.style.display="inline-block",i.style.height="14px",i.style.width="14px",i.style.borderRadius="7px",i.style.textAlign="center",i.style.backgroundColor="#C0C0C0",i.style.color="black",i.style.fontSize="13px",i.style.verticalAlign="middle",i.textContent=e.Header[o]?"-":"+",i.onclick=function(){In(o),Game.UpdateMenu()},n.appendChild(i),n}function Vn(e,t,o,n){const i=document.createElement("div");i.className="listing";const a=document.createElement("b");if(a.textContent=t,i.appendChild(a),"withTooltip"===e){i.className="listing",i.appendChild(document.createTextNode(" "));const e=document.createElement("span");e.onmouseout=function(){Game.tooltip.hide()},e.onmouseover=function(){Game.tooltip.draw(this,escape(I[n].innerHTML))},e.style.cursor="default",e.style.display="inline-block",e.style.height="10px",e.style.width="10px",e.style.borderRadius="5px",e.style.textAlign="center",e.style.backgroundColor="#C0C0C0",e.style.color="black",e.style.fontSize="9px",e.style.verticalAlign="bottom",e.textContent="?",i.appendChild(e)}return i.appendChild(document.createTextNode(": ")),i.appendChild(o),i}function _n(e){const t=document.createDocumentFragment();t.appendChild(document.createTextNode(`${e.length} `));const o=document.createElement("span");o.onmouseout=function(){Game.tooltip.hide()};const n=document.createElement("div"),i=document.createElement("div");i.style.minWidth="140px",i.style.marginBottom="4px";const a=document.createElement("div");return a.className="name",a.style.marginBottom="4px",a.style.textAlign="center",a.textContent="Missing",i.appendChild(a),Object.keys(e).forEach((t=>{const o=document.createElement("div");o.style.textAlign="center",o.appendChild(document.createTextNode(e[t])),i.appendChild(o)})),n.appendChild(i),o.onmouseover=function(){Game.tooltip.draw(this,escape(n.innerHTML))},o.style.cursor="default",o.style.display="inline-block",o.style.height="10px",o.style.width="10px",o.style.borderRadius="5px",o.style.textAlign="center",o.style.backgroundColor="#C0C0C0",o.style.color="black",o.style.fontSize="9px",o.style.verticalAlign="bottom",o.textContent="?",t.appendChild(o),t}function Qn(t){const o=document.createElement("div");if(o.className="subsection",o.appendChild(t),o.appendChild(zn("Lucky Cookies","Lucky")),e.Header.Lucky&&o.appendChild(function(){const e=Game.auraMult("Dragon's Fortune")?"GoldCookDragonsFortuneTooltipPlaceholder":"GoldCookTooltipPlaceholder",t=document.createElement("div");t.className="CMStatsLuckySection";const o=Game.cookies+ho(){Game.HasUnlocked(Xo[e])||c.push(Xo[e])})),0!==c.length&&e.appendChild(Vn("basic","Rare plant drops left to unlock",_n(c))),e}())),o.appendChild(zn("Prestige","Prestige")),e.Header.Prestige&&o.appendChild(function(){const t=document.createElement("div");t.className="CMStatsPrestigeSection";const o=Math.floor(Game.HowMuchPrestige(zt+Game.cookiesReset+vt+(Game.HasUnlocked("Chocolate egg")&&!Game.Has("Chocolate egg")?Ct:0)));t.appendChild(Vn("withTooltip","Prestige level (cur / max)",document.createTextNode(`${pe(Game.prestige)} / ${pe(o)}`),"PrestMaxTooltipPlaceholder"));const n=Math.max(0,Game.HowManyCookiesReset(o+1)-(zt+Game.cookiesReset+vt+(Game.HasUnlocked("Chocolate egg")&&!Game.Has("Chocolate egg")&&Ct?Ct:0))),i=document.createDocumentFragment();i.appendChild(document.createTextNode(pe(n)));const a=document.createElement("small");a.textContent=` (${ue(n/Vt,1)})`,i.appendChild(a),t.appendChild(Vn("withTooltip","Cookies to next level",i,"NextPrestTooltipPlaceholder")),t.appendChild(Vn("withTooltip","Heavenly chips (cur / max)",document.createTextNode(`${pe(Game.heavenlyChips)} / ${pe(o-Game.prestige+Game.heavenlyChips)}`),"HeavenChipMaxTooltipPlaceholder")),t.appendChild(Vn("basic","Heavenly chips per second (last 5 seconds)",document.createTextNode(pe(ht,2))));const r=Number(e.HeavenlyChipsTarget);if(!Number.isNaN(r)){const e=r-Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned));e>0&&(t.appendChild(Vn("basic","Heavenly chips to target set in settings (cur)",document.createTextNode(pe(e)))),t.appendChild(Vn("basic","Time till target (cur, current 5 second average)",document.createTextNode(ue(e/ht)))))}const l=function(e){let t=Game.cookiesPs;Mo(),0===to["Heavenly key"].bought&&(to["Heavenly chip secret"].bought=1,to["Heavenly cookie stand"].bought=1,to["Heavenly bakery"].bought=1,to["Heavenly confectionery"].bought=1,to["Heavenly key"].bought=1,Io(),t=Xe,Mo()),zt>=1e6&&Ro("Sacrifice"),zt>=1e9&&Ro("Oblivion"),zt>=1e12&&Ro("From scratch"),zt>=1e15&&Ro("Nihilism"),zt>=1e18&&Ro("Dematerialize"),zt>=1e21&&Ro("Nil zero zilch"),zt>=1e24&&Ro("Transcendence"),zt>=1e27&&Ro("Obliterate"),zt>=1e30&&Ro("Negative void"),zt>=1e33&&Ro("To crumbs, you say?"),zt>=1e36&&Ro("You get nothing"),zt>=1e39&&Ro("Humble rebeginnings"),zt>=1e42&&Ro("The end of the world"),zt>=1e45&&Ro("Oh, you're back"),zt>=1e48&&Ro("Lazarus"),zt>=1e51&&Ro("Smurf account"),zt>=1e54&&Ro("If at first you don't succeed"),to["Heavenly chip secret"].bought=1,to["Heavenly cookie stand"].bought=1,to["Heavenly bakery"].bought=1,to["Heavenly confectionery"].bought=1,to["Heavenly key"].bought=1,Ue=e;const o=De;Io(),Yo(),o!==De&&Io();const n=Xe-t;return Ue=Game.prestige,n}(o),s=document.createDocumentFragment();s.appendChild(document.createTextNode(pe(l)));const c=Math.round(l/Game.cookiesPs*1e4);if(Number.isFinite(c)&&0!==c){const e=document.createElement("small");e.textContent=` (${c/100}% of income)`,s.appendChild(e)}t.appendChild(Vn("withTooltip","Reset bonus income",s,"ResetTooltipPlaceholder"));const d=Math.floor(Game.HowMuchPrestige(Game.cookiesReset)),p=Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned)),u=p-d;if(!Game.Has("Lucky digit")){let e=7-p%10;e<0&&(e+=10);const o=u+e,n=p+e,i=document.createDocumentFragment();i.appendChild(document.createTextNode(`${n.toLocaleString()} / ${o.toLocaleString()} (+${e})`)),t.appendChild(Vn("basic",'Next "Lucky Digit" (total / reset)',i))}if(!Game.Has("Lucky number")){let e=777-p%1e3;e<0&&(e+=1e3);const o=u+e,n=p+e,i=document.createDocumentFragment();i.appendChild(document.createTextNode(`${n.toLocaleString()} / ${o.toLocaleString()} (+${e})`)),t.appendChild(Vn("basic",'Next "Lucky Number" (total / reset)',i))}if(!Game.Has("Lucky payout")){let e=777777-p%1e6;e<0&&(e+=1e6);const o=u+e,n=p+e,i=document.createDocumentFragment();i.appendChild(document.createTextNode(`${n.toLocaleString()} / ${o.toLocaleString()} (+${e})`)),t.appendChild(Vn("basic",'Next "Lucky Payout" (total / reset)',i))}return t}()),Game.cpsSucked>0&&(o.appendChild(zn("Wrinklers","Wrink")),e.Header.Wrink)){const e=document.createDocumentFragment();e.appendChild(document.createTextNode(`${pe(vt)} / ${pe(wt)} `));const t=document.createElement("a");t.textContent="Pop All Normal",t.className="option",t.onclick=function(){Ln()},e.appendChild(t),o.appendChild(Vn("basic","Rewards of Popping (All/Normal)",e));const n=document.createDocumentFragment();n.appendChild(document.createTextNode(`${pe(xt[0])} `));const i=document.createElement("a");i.textContent="Pop Single Fattest",i.className="option",i.onclick=function(){null!==xt[1]&&(Game.wrinklers[xt[1]].hp=0)},n.appendChild(i),o.appendChild(Vn("basic",`Rewards of Popping Single Fattest Non-Shiny Wrinkler (id: ${null!==xt[1]?xt[1]:"None"})`,n))}if(o.appendChild(function(){const t=document.createElement("div");t.className="CMStatsSeasonSection";let o=!1;const n=[];Object.keys(Vo).forEach((e=>{Game.Has(Vo[e])||(n.push(Vo[e]),o=!0)}));const i=[];Object.keys(_o).forEach((e=>{Game.Has(_o[e])||(i.push(_o[e]),o=!0)}));const a=[];Object.keys(Qo).forEach((e=>{Game.Has(Qo[e])||(a.push(Qo[e]),o=!0)}));const r=[];Object.keys(Game.eggDrops).forEach((e=>{Game.HasUnlocked(Game.eggDrops[e])||(r.push(Game.eggDrops[e]),o=!0)}));const l=[];Object.keys(Game.rareEggDrops).forEach((e=>{Game.HasUnlocked(Game.rareEggDrops[e])||(l.push(Game.rareEggDrops[e]),o=!0)}));const s=Game.HasUnlocked("Chocolate egg")&&!Game.Has("Chocolate egg"),c=Game.Has("Century egg");if(("christmas"===Game.season||o||s||c)&&(t.appendChild(zn("Season Specials","Sea")),e.Header.Sea)){if(0!==n.length){t.appendChild(Vn("basic","Halloween cookies left to buy",_n(n)));let e=.95;if(Game.HasAchiev("Spooky cookies")&&(e=.8),Game.Has("Starterror")&&(e*=.9),e*=1/Game.dropRateMult(),Game.hasGod){const t=Game.hasGod("seasons");1===t?e*=.9:2===t?e*=.95:3===t&&(e*=.97)}const o=n.length/7;t.appendChild(Vn("basic","Chance of receiving a cookie from wrinkler/shiny wrinkler",document.createTextNode(`${pe((1-e)*o*100)}% / ${pe((1-.9*e)*o*100)}%`)))}if(0!==i.length){t.appendChild(Vn("basic","Christmas cookies left to buy",_n(i)));let e=.8;if(Game.HasAchiev("Let it snow")&&(e=.6),e*=1/Game.dropRateMult(),Game.Has("Starsnow")&&(e*=.95),Game.hasGod){const t=Game.hasGod("seasons");1===t?e*=.9:2===t?e*=.95:3===t&&(e*=.97)}const o=i.length/7;t.appendChild(Vn("basic","Chance of receiving a cookie from reindeer",document.createTextNode(`${pe((1-e)*o*100)}%`)))}0!==a.length&&t.appendChild(Vn("basic","Valentine cookies left to buy",_n(a)));const e=function(e){let t=e*(1/Game.dropRateMult());if(Game.HasAchiev("Hide & seek champion")&&(t*=.7),Game.Has("Omelette")&&(t*=.9),Game.Has("Starspawn")&&(t*=.9),Game.hasGod){const e=Game.hasGod("seasons");1===e?t*=.9:2===e?t*=.95:3===e&&(t*=.97)}const o=1-t,n=Game.eggDrops.length-r.length,i=Game.rareEggDrops.length-l.length,a=.9*o*(1-n/Game.eggDrops.length),s=.1*o*(1-i/Game.rareEggDrops.length),c=.9*o*(n/Game.eggDrops.length)+.1*o*(i/Game.rareEggDrops.length);return[a+.9*c*(1-n/Game.eggDrops.length),s+.1*c*(1-i/Game.rareEggDrops.length)]};0!==r.length&&(t.appendChild(Vn("basic","Normal easter eggs left to unlock",_n(r))),t.appendChild(Vn("basic","Chance of receiving an egg from wrinkler/golden cookie",document.createTextNode(`${pe(100*e(.98)[0])}% / ${pe(100*e(.9)[0])}%`)))),0!==l.length&&(t.appendChild(Vn("basic","Rare easter eggs left to unlock",_n(l))),t.appendChild(Vn("basic","Chance of receiving a rare egg from wrinkler/golden cookie",document.createTextNode(`${pe(100*e(.98)[1])}% / ${pe(100*e(.9)[1])}%`)))),"christmas"===Game.season&&t.appendChild(Vn("basic","Reindeer reward",document.createTextNode(pe(ft)))),s&&t.appendChild(Vn("withTooltip","Chocolate egg cookies",document.createTextNode(pe(Ct)),"ChoEggTooltipPlaceholder")),c&&t.appendChild(Vn("basic","Century egg multiplier",document.createTextNode(Math.round(1e4*(gt-1))/100+"%")))}return t}()),o.appendChild(zn("Miscellaneous","Misc")),e.Header.Misc){if(o.appendChild(Vn("basic",`Average cookies per second (past ${J[e.AvgCPSHist]<60?`${J[e.AvgCPSHist]} seconds`:J[e.AvgCPSHist]/60+(3===e.AvgCPSHist?" minute":" minutes")})`,document.createTextNode(pe(mo(),3)))),o.appendChild(Vn("basic",`Average cookie clicks per second (past ${Z[e.AvgClicksHist]}${0===e.AvgClicksHist?" second":" seconds"})`,document.createTextNode(pe(Bt,1)))),o.appendChild(Vn("basic",`Cookies from clicking (past ${Z[e.AvgClicksHist]}${0===e.AvgClicksHist?" second":" seconds"})`,document.createTextNode(pe(he.calcSum(Bt*Z[e.AvgClicksHist]))))),Game.Has("Fortune cookies")){const e=[];Object.keys(zo).forEach((t=>{Game.Has(zo[t])||e.push(zo[t])})),0!==e.length&&o.appendChild(Vn("basic","Fortune Upgrades Left to Buy",_n(e)))}if(e.ShowMissedGC&&o.appendChild(Vn("basic","Missed golden cookies",document.createTextNode(pe(Game.missedGoldenClicks)))),Game.prefs.autosave){const e=document.createElement("span");e.id="CMStatsAutosaveTimer",e.innerText=Game.sayTime(60*Game.fps-(Game.OnAscend?0:Game.T%(60*Game.fps)),4),o.appendChild(Vn("basic","Time till autosave",e))}}l("menu").insertBefore(o,l("menu").childNodes[2]),e.MissingUpgrades&&l("menu").childNodes.forEach((e=>{if(e.children[0])if("Prestige"===e.children[0].innerHTML&&Et){const t=Et.match(new RegExp("div","g")||0).length/2,o=document.createElement("div");o.id="CMMissingUpgradesPrestigeTitle",o.className="listing";const n=document.createElement("div");n.innerHTML=`Missing Prestige upgrades: ${t}/${Game.PrestigeUpgrades.length} (${Math.floor(t/Game.PrestigeUpgrades.length*100)}%)`,o.appendChild(n),e.appendChild(o);const i=document.createElement("div");i.className="listing crateBox",i.innerHTML=Et,e.appendChild(i)}else if("Upgrades"===e.children[0].innerHTML){if(Pt){const t=Pt.match(new RegExp("div","g")||0).length/2,o=document.createElement("div");o.id="CMMissingUpgradesTitle",o.className="listing";const n=document.createElement("div");n.innerHTML=`Missing normal upgrades: ${t}/${Game.UpgradesByPool[""].length+Game.UpgradesByPool.tech.length} (${Math.floor(t/(Game.UpgradesByPool[""].length+Game.UpgradesByPool.tech.length)*100)}%)`,o.appendChild(n),e.insertBefore(o,e.childNodes[3]);const i=document.createElement("div");i.className="listing crateBox",i.innerHTML=Pt,e.insertBefore(i,document.getElementById("CMMissingUpgradesTitle").nextSibling)}if(Nt){const t=Nt.match(new RegExp("div","g")||0).length/2,o=document.createElement("div");o.id="CMMissingUpgradesCookiesTitle",o.className="listing";const n=document.createElement("div");n.innerHTML=`Missing Cookie upgrades: ${t}/${Game.UpgradesByPool.cookie.length} (${Math.floor(t/Game.UpgradesByPool.cookie.length*100)}%)`,o.appendChild(n),e.appendChild(o);const i=document.createElement("div");i.className="listing crateBox",i.innerHTML=Nt,e.appendChild(i)}}})),e.MissingAchievements&&function(){let t;Object.values(document.querySelectorAll("div.title")).forEach((e=>{e.textContent.includes("Achievements")&&(t=e.parentElement.querySelectorAll("div.listing.crateBox")[0])})),e.MissingAchievements&&Object.values(t.children).forEach((e=>{if(!e.className.includes("enabled")){const t=e.onclick.toString().split(/\[(.*)\]/gi)[1],{icon:o}=Game.AchievementsById[t];e.style.backgroundPosition=`${48*-o[0]}px ${48*-o[1]}px`,e.onmouseover=function(){Game.mouseDown||(Game.setOnCrate(this),Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return function(e){const t=[];"shadow"===e.pool?t.push("Shadow Achievement","#9700cf"):t.push("Achievement",0),t.push("Locked",0);let o=0;(Game.Has("Neuromancy")||Game.sesame&&"debug"===e.pool)&&(o=1),o&&0===e.won?t.push("Click to win!","#00c462"):o&&e.won>0&&t.push("Click to lose!","#00c462");let{icon:n}=e;e.iconFunction&&(n=e.iconFunction());let{desc:i}=e;e.descFunc&&(i=e.descFunc("stats"));let a="";for(let e=0;e[${t[e]}]`);return a=a.substring(1),`
\n
\n
${e.name}
\n ${a}
${i}
\n ${Game.sesame?`
Id : ${e.id} | Order : ${Math.floor(e.order)}${e.tier?` | Tier : ${e.tier}`:""}
`:""}`}(Game.AchievementsById[t])}),"top"),Game.tooltip.wobble())}}}))}()}const Xn={Favourite:"Favourite Settings",Calculation:"Calculation",Notation:"Notation",Colours:"Colours and colour coding",BarsDisplay:"Infobars and visual settings",Tooltip:"Tooltips",Statistics:"Statistics",Notification:"Notifications",Miscellaneous:"Miscellaneous"},qn={NotificationGeneral:"General Notifications",NotificationGC:"Golden Cookie",NotificationFC:"Fortune Cookie",NotificationSea:"Season Special",NotificationGard:"Garden Tick",NotificationMagi:"Full Magic Bar",NotificationWrink:"Wrinkler",NotificationWrinkMax:"Maximum Wrinklers"};function Yn(t,o){const n=document.createElement("div");n.className="title",n.style.opacity="0.7",n.style.fontSize="17px",n.appendChild(document.createTextNode(`${o} `));const i=document.createElement("span");return i.style.cursor="pointer",i.style.display="inline-block",i.style.height="14px",i.style.width="14px",i.style.borderRadius="7px",i.style.textAlign="center",i.style.backgroundColor="#C0C0C0",i.style.color="black",i.style.fontSize="13px",i.style.verticalAlign="middle",i.textContent=e.Header[t]?"-":"+",i.onclick=function(){In(t),Game.UpdateMenu()},n.appendChild(i),n}function Kn(t){const o=document.createElement("div");if(o.className="listing",1===e.FavouriteSettings&&o.appendChild(function(e){const t=document.createElement("a");return de.includes(e)?(t.innerText="★",t.style.color="yellow"):t.innerText="☆",t.className="option",t.onclick=function(){!function(e){de.includes(e)?de=de.filter((function(t){return t!==e})):de.push(e)}(e),On(),Game.UpdateMenu()},t.onmouseover=function(){Game.tooltip.draw(this,escape(I.FavouriteSettingPlaceholder.innerHTML))},t.onmouseout=function(){Game.tooltip.hide()},t.appendChild(document.createTextNode(" ")),t}(t)),"bool"===Gn[t].type){const n=document.createElement("a");Gn[t].toggle&&0===e[t]?n.className="option off":n.className="option",n.id=$n+t,n.onclick=function(){!function(t){e[t]+=1,e[t]===Gn[t].label.length?(e[t]=0,Gn[t].toggle&&(l($n+t).className="option off")):l($n+t).className="option",void 0!==Gn[t].func&&Gn[t].func(),l($n+t).innerHTML=Gn[t].label[e[t]],On()}(t)},n.textContent=Gn[t].label[e[t]],o.appendChild(n);const i=document.createElement("label");return i.textContent=Gn[t].desc,i.style.lineHeight="1.6",o.appendChild(i),o}if("vol"===Gn[t].type){const n=document.createElement("div");n.className="sliderBox";const i=document.createElement("div");i.style.float="left",i.innerHTML=Gn[t].desc,n.appendChild(i);const a=document.createElement("div");a.id=`slider${t}right`,a.style.float="right",a.innerHTML=`${e[t]}%`,n.appendChild(a);const r=document.createElement("input");r.className="slider",r.id=`slider${t}`,r.style.clear="both",r.type="range",r.min="0",r.max="100",r.step="1",r.value=e[t],r.oninput=function(){Rn(t)},r.onchange=function(){Rn(t)},n.appendChild(r),o.appendChild(n);const l=document.createElement("a");return l.className="option",l.onclick=function(){Bn(e[t.replace("Volume","SoundURL")],t.replace("Volume","Sound"),t,!0)},l.textContent="Test sound",o.appendChild(l),o}if("url"===Gn[t].type){const n=document.createElement("span");n.className="option",n.textContent=`${Gn[t].label} `,n.style.lineHeight="1.6",o.appendChild(n);const i=document.createElement("input");i.id=$n+t,i.className="option",i.type="text",i.readOnly=!0,i.setAttribute("value",e[t]),i.style.width="300px",o.appendChild(i),o.appendChild(document.createTextNode(" "));const a=document.createElement("input");a.id=`${$n+t}Prompt`,a.className="option",a.type="text",a.setAttribute("value",e[t]);const r=document.createElement("a");r.className="option",r.onclick=function(){!function(e,t){Game.promptWrapL.className="framed";const o=e;Game.promptL.innerHTML=`${o}
`,Object.keys(t).forEach((e=>{const o=document.createElement("a");o.id=`promptOption${e}`,o.className="option",o.onclick=function(){PlaySound("snd/tick.mp3"),t[e][1]()},o.textContent=t[e][0],Game.promptL.children[1].appendChild(o)})),Game.promptAnchorL.style.display="block",Game.darkenL.style.display="block",Game.promptL.focus(),Game.promptOn=1,Game.UpdatePrompt()}(a.outerHTML,[["Save",function(){e[t]=l(`CMConfig${t}Prompt`).value,On(),Game.ClosePrompt(),Game.UpdateMenu()}],["Cancel",function(){Game.ClosePrompt()}]])},r.textContent="Edit",o.appendChild(r);const s=document.createElement("label");return s.textContent=Gn[t].desc,s.style.lineHeight="1.6",o.appendChild(s),o}if("colour"===Gn[t].type){const n=document.createElement("span");n.className="option";const i=document.createElement("input");i.id=t,i.style.width="65px",i.setAttribute("value",e[t]),n.appendChild(i),new Hn(i,{hash:!0,position:"right",onInput:function(){e[this.targetElement.id]=this.toHEXString(),Nn(),On(),Game.UpdateMenu()}});const a=document.createElement("label");if(a.textContent=Gn[t].desc,a.style.lineHeight="1.6",n.appendChild(a),t.includes("Flash")){const e=document.createElement("a");e.className="option",e.onclick=function(){Sn(3,t.replace("Colour",""),!0)},e.textContent="Test flash",n.appendChild(e)}return o.appendChild(n),Un().init(),o}if("numscale"===Gn[t].type){const n=document.createElement("span");n.className="option",n.textContent=`${Gn[t].label} `,n.style.lineHeight="1.6",o.appendChild(n);const i=document.createElement("input");i.id=$n+t,i.className="option",i.type="number",i.value=e[t],i.min=Gn[t].min,i.max=Gn[t].max,i.oninput=function(){e[t]=this.value,On(),hn()},o.appendChild(i),o.appendChild(document.createTextNode(" "));const a=document.createElement("label");return a.textContent=Gn[t].desc,a.style.lineHeight="1.6",o.appendChild(a),o}return o}function Jn(t){if(1===e.TimerBar&&0===e.TimerBarPos){const e=parseInt(l("CMTimerBar").style.height,10);Game.mouseY-=e,t(),Game.mouseY+=e}else t()}function Zn(){S.Beautify=Beautify,Beautify=pe,S.CalculateGains=Game.CalculateGains,Game.CalculateGains=function(){S.CalculateGains(),_e=1,B=Date.now(),P=Date.now()},S.tooltip={},S.tooltip.draw=Game.tooltip.draw,S.tooltip.drawMod=new Function(`return ${Game.tooltip.draw.toString().split("this").join("Game.tooltip")}`)(),Game.tooltip.draw=function(e,t,o){S.tooltip.drawMod(e,t,o)},S.tooltip.update=Game.tooltip.update,S.tooltip.updateMod=new Function(`return ${Game.tooltip.update.toString().split("this.").join("Game.tooltip.")}`)(),Game.tooltip.update=function(){S.tooltip.updateMod(),function(){if("store"===Game.tooltip.origin){let t=0;1===e.ToolWarnLucky&&1===e.ToolWarnPos&&null!==l("CMDispTooltipWarningParent")&&(t=l("CMDispTooltipWarningParent").clientHeight-4),Game.tooltip.tta.style.top=`${Math.min(parseInt(Game.tooltip.tta.style.top,10),l("game").clientHeight+l("topBar").clientHeight-Game.tooltip.tt.clientHeight-t-46)}px`}}()},S.UpdateWrinklers=Game.UpdateWrinklers,Game.UpdateWrinklers=function(){Jn(S.UpdateWrinklers)},S.UpdateSpecial=Game.UpdateSpecial,Game.UpdateSpecial=function(){Jn(S.UpdateSpecial)},l("bigCookie").removeEventListener("click",Game.ClickCookie,!1),l("bigCookie").addEventListener("click",(function(){Jn(Game.ClickCookie)}),!1),S.RebuildUpgrades=Game.RebuildUpgrades,Game.RebuildUpgrades=function(){S.RebuildUpgrades(),M=[],Object.keys(Game.UpgradesInStore).forEach((e=>{null!==l(`upgrade${e}`).onmouseover&&(M[e]=l(`upgrade${e}`).onmouseover,l(`upgrade${e}`).onmouseover=function(){Game.mouseDown||(Game.setOnCrate(this),Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Wn("u",`${e}`)}),"store"),Game.tooltip.wobble())})})),Game.CalculateGains()},S.ClickProduct=Game.ClickProduct,Game.ClickProduct=function(t){(!e.BulkBuyBlock||Game.ObjectsById[t].bulkPrice-1;--e)if(Game.ObjectsById[e].amount>0){const o=eo[Game.ObjectsById[e].name].name;eo[o].amount-=1,We-=1,t=eo[o].basePrice*Game.priceIncrease**Math.max(0,eo[o].amount-1-eo[o].free),t=Game.modifyBuildingPrice(eo[o],t),t=Math.ceil(t);break}const o=De;return Io(),Yo(),o!==De&&Io(),[Xe-Game.cookiesPs,t]}(t),n=ue(o/(e+Game.cookiesPs));let i;i=0===Game.cookiesPs?pe(1/0):pe(e/Game.cookiesPs*100),l("dragonAuraInfo").style.minHeight="60px",l("dragonAuraInfo").style.margin="8px",l("dragonAuraInfo").appendChild(document.createElement("div")).className="line";const a=document.createElement("div");a.style.minWidth="200px",a.style.textAlign="center",a.textContent=`Picking this aura will change CPS by ${pe(e)} (${i}% of current CPS).`,l("dragonAuraInfo").appendChild(a);const r=document.createElement("div");r.style.minWidth="200px",r.style.textAlign="center",r.textContent=`It will take ${n} to recover the cost.`,l("dragonAuraInfo").appendChild(r)}}(t)},S.ToggleSpecialMenu=Game.ToggleSpecialMenu,Game.ToggleSpecialMenu=function(e){S.ToggleSpecialMenu(e),function(){if(null!==(l("specialPopup").className.match(/onScreen/)&&l("specialPopup").children[0].style.background.match(/dragon/)))for(let e=0;e${Ze}`,"this"),Game.tooltip.wobble()},l("specialPopup").children[e].onmouseout=function(){Game.tooltip.shouldHide=1})}()},S.UpdateMenu=Game.UpdateMenu,Game.UpdateMenu=function(){void 0!==Un().picker&&void 0!==Un().picker.owner||(S.UpdateMenu(),function(){const t=document.createElement("div");t.className="title","prefs"===Game.onMenu?(t.textContent="Cookie Monster Settings",function(t){const o=document.createDocumentFragment();o.appendChild(t),Object.keys(Xn).forEach((t=>{if("Favourite"===t){if(0!==de.length&&e.FavouriteSettings>0&&(o.appendChild(Yn(t,Xn[t])),e.Header[t]))for(let e=0;e{const n=Yn(t,qn[t]);n.style.fontSize="15px",n.style.opacity="0.5",o.appendChild(n),e.Header[t]&&Object.keys(Gn).forEach((e=>{Gn[e].group===t&&o.appendChild(Kn(e))}))})):Object.keys(Gn).forEach((e=>{Gn[e].group===t&&o.appendChild(Kn(e))})))}));const n=document.createElement("div");n.className="listing";const i=document.createElement("a");i.className="option",i.onclick=function(){Fn(pn)},i.textContent="Restore Default",n.appendChild(i),o.appendChild(n),l("menu").childNodes[2].insertBefore(o,l("menu").childNodes[2].childNodes[l("menu").childNodes[2].childNodes.length-1])}(t)):"stats"===Game.onMenu?e.Stats&&(t.textContent="Cookie Monster Statistics",Qn(t)):"log"===Game.onMenu&&(t.textContent="Cookie Monster ",function(t){const o=document.createElement("div");o.className="subsection";const n=document.createElement("span");if(n.style.cursor="pointer",n.style.display="inline-block",n.style.height="14px",n.style.width="14px",n.style.borderRadius="7px",n.style.textAlign="center",n.style.backgroundColor="#C0C0C0",n.style.color="black",n.style.fontSize="13px",n.style.verticalAlign="middle",n.textContent=e.Header.InfoTab?"-":"+",n.onclick=function(){In("InfoTab"),Game.UpdateMenu()},t.appendChild(n),o.appendChild(t),e.Header.InfoTab){const e=document.createElement("div");e.innerHTML='
\n Cookie Monster\n offers a wide range of tools and statistics to enhance your game experience.\n It is not a cheat interface – although it does offer helpers for golden cookies and such, everything can be toggled off at will to only leave how much information you want.
\n Progess on new updates and all previous release notes can be found on the GitHub page linked above!
\n Please also report any bugs you may find over there!
\n
\n ',o.appendChild(e);const t=document.createElement("div");t.innerHTML="
\nThese are the release notes for the latest update (v 2.031.7).
\n
\nThis update implements the following functions:
\n- Updated the ordering and description of all settings of Cookie Monster
\n- Colours of Flash notifications can now be set by the user
\n- You can now select a number of settings to be your 'favourite'. They will be displayed at the top of all other settings in a new section. This functionality is toggleable and you can find it in the miscellaneous section
\n- The statistics page now shows cookies earned by clicking for a selected time period
\n- The statistics page can now show missing normal achievements, this can be toggled in the settings
\n
\nThis update fixes the following bugs:
\n- Fixed some typo's
\n- No longer show the wrinkler pop buttons when wrinklers can't spawn
\n- Fixed incorrect calculation of plant maturity for relevant tooltips
\n- Fixed edit prompts not working in settings
\n- Fixed red and purple being switched around for PP colour coding
\n- Fixed incorrect notation of numbers in Dragon tooltip and interface
\n- Fixed incorrect calculation of changing Dragon aura cost
\n- Fixed incorrect calculation of changing Pantheon gods effect
\n- Fixed fluctuating PP values when god Cyclius was selected
\n- Fixed black flickering when Golden Cookies or buffs start
\n
\n",o.appendChild(t)}const i=l("menu").children[1];i.insertBefore(o,i.children[1])}(t))}())},S.sayTime=Game.sayTime,V=function(e,t){return Number.isNaN(e)||e<=0?S.sayTime(e,t):ue(e/Game.fps,1)},S.Logic=Game.Logic,Game.Logic=function(){S.Logic();let t="Cookie Clicker";"fools"===Game.season&&(t="Cookie Baker"),ce=`${Game.OnAscend?"Ascending! ":""}${pe(Game.cookies)} ${1===Game.cookies?"cookie":"cookies"} - ${t}`,function(){if(Game.OnAscend||0===e.Title)document.title=ce;else if(1===e.Title){let e,t,o,n=!1,i=!1;e=_t?_t.wrath?`[W${Math.ceil(_t.life/Game.fps)}]`:`[G${Math.ceil(_t.life/Game.fps)}]`:Game.Has("Golden switch [off]")?"[GS]":`[${Number(l("CMTimerBarGCMinBar").textContent)<0?"!":""}${Math.ceil((Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.time)/Game.fps)}]`,f&&(n=!0,t="[F]"),"christmas"===Game.season&&(i=!0,o=g?`[R${Math.ceil(Qt.life/Game.fps)}]`:`[${Number(l("CMTimerBarRenMinBar").textContent)<0?"!":""}${Math.ceil((Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.time)/Game.fps)}]`);let a=ce;"["===a.charAt(0)&&(a=a.substring(a.lastIndexOf("]")+1)),document.title=`${e+(n?t:"")+(i?o:"")} ${a}`}else if(2===e.Title){let e="",t=!1;_t&&(t=!0,_t.wrath?e+=`[W${Math.ceil(_t.life/Game.fps)}]`:e+=`[G${Math.ceil(_t.life/Game.fps)}]`),f&&(t=!0,e+="[F]"),"christmas"===Game.season&&g&&(e+=`[R${Math.ceil(Qt.life/Game.fps)}]`,t=!0),t&&(e+=" - ");let o="Cookie Clicker";"fools"===Game.season&&(o="Cookie Baker"),e+=o,document.title=e}}(),function(){const t=Math.max(0,Game.HowManyCookiesReset(Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned))+1)-(Game.cookiesEarned+Game.cookiesReset)),o=Game.sayTime((Date.now()-Game.startDate)/1e3*Game.fps,-1);let n="";n+=`You've been on this run for ${""===o?"not very long":o}.
`,n+='
',Game.prestige>0&&(n+=`Your prestige level is currently ${pe(Game.prestige)}.
(CpS +${pe(Game.prestige)}%)`,n+='
'),n+=Oe<1?"Ascending now would grant you no prestige.":Oe<2?"Ascending now would grant you
1 prestige level (+1% CpS)
and 1 heavenly chip to spend.":`Ascending now would grant you
${pe(Oe)} prestige levels (+${pe(Oe)}% CpS)
and ${pe(Oe)} heavenly chips to spend.`,n+='
',n+=`You need ${pe(t)} more cookies for the next level.
`,n+=e.TooltipAscendButton?`
It takes ${Xt} to reach the next level and you were making ${pe(ht,2)} chips on average in the last 5 seconds.
`:"",l("ascendTooltip").innerHTML=n}()}}function ei(){Tn(),ln(),dn(),r=Object.keys(Game.mods).length,w=document.createElement("style"),w.type="text/css",w.id="CMCSS",document.head.appendChild(w),function(){const e=document.createElement("div");e.id="CMBotBar",e.style.height="69px",e.style.width="100%",e.style.position="absolute",e.style.display="none",e.style.backgroundColor="#262224",e.style.backgroundImage="linear-gradient(to bottom, #4d4548, #000000)",e.style.borderTop="1px solid black",e.style.overflow="auto",e.style.textShadow="-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black";const t=e.appendChild(document.createElement("table"));t.style.width="100%",t.style.textAlign="center",t.style.whiteSpace="nowrap";const o=t.appendChild(document.createElement("tbody")),n=function(e,t){const o=document.createElement("td");return o.style.textAlign="right",o.className=E+t,o.textContent=e,o},i=o.appendChild(document.createElement("tr"));i.style.fontWeight="bold",i.appendChild(n("CM 2.031.7",L)),o.appendChild(document.createElement("tr")).appendChild(n("Bonus Income",O)),o.appendChild(document.createElement("tr")).appendChild(n("Payback Period",O)),o.appendChild(document.createElement("tr")).appendChild(n("Time Left",O)),l("wrapper").appendChild(e),Object.keys(Game.Objects).forEach((e=>{fo(e)}))}(),function(){const e=document.createElement("div");e.id="CMTimerBar",e.style.position="absolute",e.style.display="none",e.style.height="0px",e.style.fontSize="10px",e.style.fontWeight="bold",e.style.backgroundColor="black";const t=go("CMTimerBarGC","Next Cookie",[{id:"CMTimerBarGCMinBar",color:D},{id:"CMTimerBarGCBar",color:j}]);e.appendChild(t);const o=go("CMTimerBarRen","Next Reindeer",[{id:"CMTimerBarRenMinBar",color:D},{id:"CMTimerBarRenBar",color:W}]);e.appendChild(o);const n=document.createElement("div");n.id="CMTimerBarBuffTimers",e.appendChild(n),l("wrapper").appendChild(e)}(),function(){const e=document.createElement("div");e.id="CMUpgradeBar",e.style.width="100%",e.style.backgroundColor="black",e.style.textAlign="center",e.style.fontWeight="bold",e.style.display="none",e.style.zIndex="21",e.onmouseout=function(){Game.tooltip.hide()};const t=document.createElement("div");t.appendChild(function(){const e=document.createElement("div");e.style.minWidth="330px",e.style.marginBottom="4px";const t=document.createElement("div");t.className="name",t.style.marginBottom="4px",t.textContent="Legend",e.appendChild(t);const o=function(e,t){const o=document.createElement("div");o.style.verticalAlign="middle";const n=document.createElement("span");return n.className=N+e,n.style.display="inline-block",n.style.height="10px",n.style.width="10px",n.style.marginRight="4px",o.appendChild(n),o.appendChild(document.createTextNode(t)),o};return e.appendChild(o(O,"Better than the best PP of a building option")),e.appendChild(o(F,"Same as the best PP building option")),e.appendChild(o(L,"Within the top 10 of PP for buildings")),e.appendChild(o(W,"Within the top 20 of PP for buildings")),e.appendChild(o(A,"Within the top 30 of PP for buildings")),e.appendChild(o(j,"Outside of the top 30 of PP for buildings")),e.appendChild(o(D,"Negative or infinity PP")),e}()),e.onmouseover=function(){Game.tooltip.draw(this,escape(t.innerHTML),"store")};const o=function(e,t){const o=document.createElement("span");return o.id=e,o.className=E+t,o.style.width="14.28571428571429%",o.style.display="inline-block",o.textContent="0",o};e.appendChild(o("CMUpgradeBarBlue",O)),e.appendChild(o("CMUpgradeBarGreen",F)),e.appendChild(o("CMUpgradeBarYellow",L)),e.appendChild(o("CMUpgradeBarOrange",W)),e.appendChild(o("CMUpgradeBarRed",A)),e.appendChild(o("CMUpgradeBarPurple",j)),e.appendChild(o("CMUpgradeBarGray",D)),l("upgrades").parentNode.insertBefore(e,l("upgrades").parentNode.childNodes[3])}(),function(){const e=document.createElement("div");e.id="CMFlashScreen",e.style.width="100%",e.style.height="100%",e.style.backgroundColor="white",e.style.display="none",e.style.zIndex="9999999999",e.style.position="absolute",l("wrapper").appendChild(e)}(),function(){const e=document.createElement("div");e.id="CMSectionHidButtons",e.style.textAlign="center";const t=document.createElement("a");t.className="option",t.onclick=function(){"flex"===l("upgrades").style.display?(l("upgrades").style.display="none",l("toggleUpgrades").style.display="none",l("techUpgrades").style.display="none",l("vaultUpgrades").style.display="none"):(l("upgrades").style.display="flex",0!==l("toggleUpgrades").children.length&&(l("toggleUpgrades").style.display="block"),0!==l("techUpgrades").children.length&&(l("techUpgrades").style.display="block"),0!==l("vaultUpgrades").children.length&&(l("vaultUpgrades").style.display="block"))},t.textContent="Hide/Show Upgrades",e.appendChild(t);const o=document.createElement("a");o.className="option",o.onclick=function(){"grid"===l("products").style.display?l("products").style.display="none":l("products").style.display="grid"},o.textContent="Hide/Show Buildings",e.appendChild(o),l("store").insertBefore(e,l("store").childNodes[2])}(),function(){const e=document.createElement("link");e.id="CMFavicon",e.rel="shortcut icon",e.href="https://orteil.dashnet.org/cookieclicker/favicon.ico",document.getElementsByTagName("head")[0].appendChild(e)}(),Object.keys(R).forEach((e=>{!function(e,t,o){const n=document.createElement("div");n.id=e;const i=document.createElement("div");i.style.minWidth=o,i.style.marginBottom="4px";const a=document.createElement("div");a.style.textAlign="left",a.textContent=t,i.appendChild(a),n.appendChild(i),I[e]=n}(R[e][0],R[e][1],R[e][2])})),function(){const e=document.createElement("a");e.id="PopAllNormalWrinklerButton",e.textContent="Pop All Normal",e.className="option",e.onclick=function(){Ln()},e.onmouseout=function(){Game.tooltip.shouldHide=1},e.onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Wn("wb","PopAll")}),"this"),Game.tooltip.wobble()},l("sectionLeftExtra").children[0].append(e);const t=document.createElement("a");t.id="PopFattestWrinklerButton",t.textContent="Pop Single Fattest",t.className="option",t.onclick=function(){null!==xt[1]&&(Game.wrinklers[xt[1]].hp=0)},t.onmouseout=function(){Game.tooltip.shouldHide=1},t.onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Wn("wb","PopFattest")}),"this"),Game.tooltip.wobble()},l("sectionLeftExtra").children[0].append(t)}(),l("products").style.display="grid",l("storeBulk").style.gridRow="1/1",l("upgrades").style.display="flex",l("upgrades").style["flex-wrap"]="wrap",Object.keys(Game.Objects).forEach((e=>{const t=Game.Objects[e];null!==l(`product${t.id}`).onmouseover&&(x[e]=l(`product${t.id}`).onmouseover,l(`product${t.id}`).onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Wn("b",`${e}`)}),"store"),Game.tooltip.wobble()})})),Game.canLumps()&&(s=l("lumps").onmouseover,l("lumps").onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Wn("s","Lump")}),"this"),Game.tooltip.wobble()}),h=Game.LoadMinigames,Game.LoadMinigames=function(){h(),Game.Objects.Farm.minigameLoaded&&(l("gardenTool-1").onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Wn("ha","HarvestAllButton")}),"this"),Game.tooltip.wobble()},Array.from(l("gardenPlot").children).forEach((e=>{const t=e.id.slice(-3);e.onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Wn("p",[`${t[0]}`,`${t[2]}`])}),"this"),Game.tooltip.wobble()}}))),An(),function(){if(Game.Objects.Temple.minigameLoaded){for(let e=0;e<11;e+=1)l(`templeGod${e}`).onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Wn("pag",e)}),"this"),Game.tooltip.wobble()};for(let e=0;e<3;e+=1)l(`templeSlot${e}`).onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Wn("pas",[e,Game.Objects.Temple.minigame.slot[e]])}),"this"),Game.tooltip.wobble()}}}(),Dn()},Game.LoadMinigames(),l("backgroundLeftCanvas").onmouseover=function(){_=1},l("backgroundLeftCanvas").onmouseout=function(){_=0,Game.tooltip.hide(),Object.keys(Game.wrinklers).forEach((e=>{X[e]=0}))},Zn(),Dn(),Game.CalculateGains(),Fn(),z=Game.OnAscend,Game.prefs.popups?Game.Popup("Cookie Monster version 2.031.7 loaded!"):Game.Notify("Cookie Monster version 2.031.7 loaded!","","",1,1),Game.Win("Third-party")}const ti={init:function(){Mn=!0;let e=!0;Game.version!==Number("2.031")&&(e=confirm("Cookie Monster version 2.031.7 is meant for Game version 2.031. Loading a different version may cause errors. Do you still want to load Cookie Monster?")),e&&(ei(),Game.registerHook("draw",Fo),Game.registerHook("logic",En),Game.registerHook("click",Lo),Mn=!1)},load:function(e){const t=JSON.parse(e);Tn(),void 0!==t.favouriteSettings&&(de=t.favouriteSettings),Fn(t.settings),"2.031.7"!==t.version&&(Game.prefs.popups?Game.Popup("A new version of Cookie Monster has been loaded, check out the release notes in the info tab!"):Game.Notify("A new version of Cookie Monster has been loaded, check out the release notes in the info tab!","","",0,1))},save:vn};Game.registerMod("CookieMonster",ti)})()})(); diff --git a/dist/CookieMonster.js b/dist/CookieMonster.js index 5ed776f..f694bd8 100644 --- a/dist/CookieMonster.js +++ b/dist/CookieMonster.js @@ -1,2 +1,2 @@ /*! For license information please see CookieMonster.js.LICENSE.txt */ -(()=>{var e={877:function(e){!function(t,o){"use strict";"object"!=typeof e.exports?o(t):e.exports=t.document?o(t):function(e){if(!e.document)throw new Error("jscolor needs a window with document");return o(e)}}("undefined"!=typeof window?window:this,(function(e){"use strict";var t,o,n,i,a=((i={initialized:!1,instances:[],readyQueue:[],register:function(){void 0!==e&&e.document&&e.document.addEventListener("DOMContentLoaded",i.pub.init,!1)},installBySelector:function(t,o){if(!(o=o?i.node(o):e.document))throw new Error("Missing root node");for(var n=o.querySelectorAll(t),a=new RegExp("(^|\\s)("+i.pub.lookupClass+")(\\s*(\\{[^}]*\\})|\\s|$)","i"),r=0;r-1},isButtonEmpty:function(e){switch(i.nodeName(e)){case"input":return!e.value||""===e.value.trim();case"button":return""===e.textContent.trim()}return null},isPassiveEventSupported:function(){var t=!1;try{var o=Object.defineProperty({},"passive",{get:function(){t=!0}});e.addEventListener("testPassive",null,o),e.removeEventListener("testPassive",null,o)}catch(e){}return t}(),isColorAttrSupported:(n=e.document.createElement("input"),!(!n.setAttribute||(n.setAttribute("type","color"),"color"!=n.type.toLowerCase()))),dataProp:"_data_jscolor",setData:function(){var e=arguments[0];if(3===arguments.length){var t=e.hasOwnProperty(i.dataProp)?e[i.dataProp]:e[i.dataProp]={},o=arguments[2];return t[a=arguments[1]]=o,!0}if(2===arguments.length&&"object"==typeof arguments[1]){t=e.hasOwnProperty(i.dataProp)?e[i.dataProp]:e[i.dataProp]={};var n=arguments[1];for(var a in n)n.hasOwnProperty(a)&&(t[a]=n[a]);return!0}throw new Error("Invalid arguments")},removeData:function(){var e=arguments[0];if(!e.hasOwnProperty(i.dataProp))return!0;for(var t=1;t=3&&(n=l[0].match(s))&&(i=l[1].match(s))&&(a=l[2].match(s)))return o.format="rgb",o.rgba=[parseFloat(n[1])||0,parseFloat(i[1])||0,parseFloat(a[1])||0,null],l.length>=4&&(r=l[3].match(s))&&(o.format="rgba",o.rgba[3]=parseFloat(r[1])||0),o}return!1},parsePaletteValue:function(e){var t=[];"string"==typeof e?e.replace(/#[0-9A-F]{3}([0-9A-F]{3})?|rgba?\(([^)]*)\)/gi,(function(e){t.push(e)})):Array.isArray(e)&&(t=e);for(var o=[],n=0;ns[n]&&-t[n]+e[n]+l[n]/2>s[n]/2&&e[n]+l[n]-d[n]>=0?e[n]+l[n]-d[n]:e[n],-t[a]+e[a]+l[a]+d[a]-p+p*r>s[a]?-t[a]+e[a]+l[a]/2>s[a]/2&&e[a]+l[a]-p-p*r>=0?e[a]+l[a]-p-p*r:e[a]+l[a]-p+p*r:e[a]+l[a]-p+p*r>=0?e[a]+l[a]-p+p*r:e[a]+l[a]-p-p*r];else var u=[e[n],e[a]+l[a]-p+p*r];var m=u[n],h=u[a],g=o.fixed?"fixed":"absolute",f=(u[0]+d[0]>e[0]||u[0]0?Math.ceil(l/o):0,i=Math.max(1,Math.floor((t-(o-1)*e.paletteSpacing)/o)),a=e.paletteHeight?Math.min(e.paletteHeight,i):i),n&&(r=n*a+(n-1)*e.paletteSpacing),{cols:o,rows:n,cellW:i,cellH:a,width:t,height:r}},getControlPadding:function(e){return Math.max(e.padding/2,2*e.pointerBorderWidth+e.pointerThickness-e.controlBorderWidth)},getPadYChannel:function(e){switch(e.mode.charAt(1).toLowerCase()){case"v":return"v"}return"s"},getSliderChannel:function(e){if(e.mode.length>2)switch(e.mode.charAt(2).toLowerCase()){case"s":return"s";case"v":return"v"}return null},triggerCallback:function(e,t){if(e[t]){var o=null;if("string"==typeof e[t])try{o=new Function(e[t])}catch(e){console.error(e)}else o=e[t];o&&o.call(e)}},triggerGlobal:function(e){for(var t=i.getInstances(),o=0;o0)for(var c=0;c=2&&"string"==typeof arguments[0]){try{if(!a(arguments[0],arguments[1]))return!1}catch(e){return console.warn(e),!1}return this.redraw(),this.exposeColor(),!0}if(1===arguments.length&&"object"==typeof arguments[0]){var e=arguments[0],t=!0;for(var o in e)if(e.hasOwnProperty(o))try{a(o,e[o])||(t=!1)}catch(e){console.warn(e),t=!1}return this.redraw(),this.exposeColor(),t}throw new Error("Invalid arguments")},this.channel=function(e,t){if("string"!=typeof e)throw new Error("Invalid value for channel name: "+e);if(void 0===t)return this.channels.hasOwnProperty(e.toLowerCase())?this.channels[e.toLowerCase()]:(console.warn("Getting unknown channel: "+e),!1);var o=!1;switch(e.toLowerCase()){case"r":o=this.fromRGBA(t,null,null,null);break;case"g":o=this.fromRGBA(null,t,null,null);break;case"b":o=this.fromRGBA(null,null,t,null);break;case"h":o=this.fromHSVA(t,null,null,null);break;case"s":o=this.fromHSVA(null,t,null,null);break;case"v":o=this.fromHSVA(null,null,t,null);break;case"a":o=this.fromHSVA(null,null,null,t);break;default:return console.warn("Setting unknown channel: "+e),!1}return!!o&&(this.redraw(),!0)},this.trigger=function(e){for(var t=i.strList(e),o=0;o127.5},this.hide=function(){p()&&(i.removeClass(n.targetElement,i.pub.activeClassName),i.picker.wrap.parentNode.removeChild(i.picker.wrap),delete i.picker.owner)},this.show=function(){l()},this.redraw=function(){p()&&l()},this.getFormat=function(){return this._currentFormat},this._setFormat=function(e){this._currentFormat=e.toLowerCase()},this.hasAlphaChannel=function(){return"auto"===this.alphaChannel?"any"===this.format.toLowerCase()||i.isAlphaFormat(this.getFormat())||void 0!==this.alpha||void 0!==this.alphaElement:this.alphaChannel},this.processValueInput=function(e){this.fromString(e)||this.exposeColor()},this.processAlphaInput=function(e){this.fromHSVA(null,null,null,parseFloat(e))||this.exposeColor()},this.exposeColor=function(e){var t=this.toString(),o=this.getFormat();if(i.setDataAttr(this.targetElement,"current-color",t),e&i.flags.leaveValue||!this.valueElement||("hex"!==o&&"hexa"!==o||(this.uppercase||(t=t.toLowerCase()),this.hash||(t=t.replace(/^#/,""))),this.setValueElementValue(t)),!(e&i.flags.leaveAlpha)&&this.alphaElement){var n=Math.round(100*this.channels.a)/100;this.setAlphaElementValue(n)}e&i.flags.leavePreview||!this.previewElement||((i.isTextInput(this.previewElement)||i.isButton(this.previewElement)&&!i.isButtonEmpty(this.previewElement))&&this.previewPosition,this.setPreviewElementBg(this.toRGBAString())),p()&&(s(),c(),d())},this.setPreviewElementBg=function(e){if(this.previewElement){var t=null,o=null;(i.isTextInput(this.previewElement)||i.isButton(this.previewElement)&&!i.isButtonEmpty(this.previewElement))&&(t=this.previewPosition,o=this.previewSize);var n=[];if(e){n.push({image:i.genColorPreviewGradient(e,t,o?o-i.pub.previewSeparator.length:null),position:"left top",size:"auto",repeat:t?"repeat-y":"repeat",origin:"padding-box"});var a=i.genColorPreviewCanvas("rgba(0,0,0,0)",t?{left:"right",right:"left"}[t]:null,o,!0);n.push({image:"url('"+a.canvas.toDataURL()+"')",position:(t||"left")+" top",size:a.width+"px "+a.height+"px",repeat:t?"repeat-y":"repeat",origin:"padding-box"})}else n.push({image:"none",position:"left top",size:"auto",repeat:"no-repeat",origin:"padding-box"});for(var r={image:[],position:[],size:[],repeat:[],origin:[]},l=0;l=0;h-=1){var g=m[h];if(g)if(i.pub.presets.hasOwnProperty(g)){for(var u in i.pub.presets[g])if(i.pub.presets[g].hasOwnProperty(u))try{a(u,i.pub.presets[g][u])}catch(e){console.warn(e)}}else console.warn("Unknown preset: %s",g)}var f=["preset"];for(var u in o)if(o.hasOwnProperty(u)&&-1===f.indexOf(u))try{a(u,o[u])}catch(e){console.warn(e)}if(void 0===this.container?this.container=e.document.body:this.container=i.node(this.container),!this.container)throw new Error("Cannot instantiate color picker without a container element");if(this.targetElement=i.node(t),!this.targetElement){if("string"==typeof t&&/^[a-zA-Z][\w:.-]*$/.test(t))throw new Error("If '"+t+"' is supposed to be an ID, please use '#"+t+"' or any valid CSS selector.");throw new Error("Cannot instantiate color picker without a target element")}if(this.targetElement.jscolor&&this.targetElement.jscolor instanceof i.pub)throw new Error("Color picker already installed on this element");if(this.targetElement.jscolor=this,i.addClass(this.targetElement,i.pub.className),i.instances.push(this),i.isButton(this.targetElement)&&("button"!==this.targetElement.type.toLowerCase()&&(this.targetElement.type="button"),i.isButtonEmpty(this.targetElement))){i.removeChildren(this.targetElement),this.targetElement.appendChild(e.document.createTextNode(" "));var C=i.getCompStyle(this.targetElement);(parseFloat(C["min-width"])||0)-1){var G=i.parseColorString(b);this._currentFormat=G?G.format:"hex"}else this._currentFormat=this.format.toLowerCase();this.processValueInput(b),void 0!==k&&this.processAlphaInput(k)}}).pub.className="jscolor",i.pub.activeClassName="jscolor-active",i.pub.looseJSON=!0,i.pub.presets={},i.pub.presets.default={},i.pub.presets.light={backgroundColor:"rgba(255,255,255,1)",controlBorderColor:"rgba(187,187,187,1)",buttonColor:"rgba(0,0,0,1)"},i.pub.presets.dark={backgroundColor:"rgba(51,51,51,1)",controlBorderColor:"rgba(153,153,153,1)",buttonColor:"rgba(240,240,240,1)"},i.pub.presets.small={width:101,height:101,padding:10,sliderSize:14,paletteCols:8},i.pub.presets.medium={width:181,height:101,padding:12,sliderSize:16,paletteCols:10},i.pub.presets.large={width:271,height:151,padding:12,sliderSize:24,paletteCols:15},i.pub.presets.thin={borderWidth:1,controlBorderWidth:1,pointerBorderWidth:1},i.pub.presets.thick={borderWidth:2,controlBorderWidth:2,pointerBorderWidth:2},i.pub.sliderInnerSpace=3,i.pub.chessboardSize=8,i.pub.chessboardColor1="#666666",i.pub.chessboardColor2="#999999",i.pub.previewSeparator=["rgba(255,255,255,.65)","rgba(128,128,128,.65)"],i.pub.init=function(){if(!i.initialized)for(e.document.addEventListener("mousedown",i.onDocumentMouseDown,!1),e.document.addEventListener("keyup",i.onDocumentKeyUp,!1),e.addEventListener("resize",i.onWindowResize,!1),e.addEventListener("scroll",i.onWindowScroll,!1),i.pub.install(),i.initialized=!0;i.readyQueue.length;)i.readyQueue.shift()()},i.pub.install=function(e){var t=!0;try{i.installBySelector("[data-jscolor]",e)}catch(e){t=!1,console.warn(e)}if(i.pub.lookupClass)try{i.installBySelector("input."+i.pub.lookupClass+", button."+i.pub.lookupClass,e)}catch(e){}return t},i.pub.ready=function(e){return"function"!=typeof e?(console.warn("Passed value is not a function"),!1):(i.initialized?e():i.readyQueue.push(e),!0)},i.pub.trigger=function(e){var t=function(){i.triggerGlobal(e)};i.initialized?t():i.pub.ready(t)},i.pub.hide=function(){i.picker&&i.picker.owner&&i.picker.owner.hide()},i.pub.chessboard=function(e){return e||(e="rgba(0,0,0,0)"),i.genColorPreviewCanvas(e).canvas.toDataURL()},i.pub.background=function(e){var t=[];t.push(i.genColorPreviewGradient(e));var o=i.genColorPreviewCanvas();return t.push(["url('"+o.canvas.toDataURL()+"')","left top","repeat"].join(" ")),t.join(", ")},i.pub.options={},i.pub.lookupClass="jscolor",i.pub.installByClassName=function(){return console.error('jscolor.installByClassName() is DEPRECATED. Use data-jscolor="" attribute instead of a class name.'+i.docsRef),!1},i.register(),i.pub);return void 0===e.jscolor&&(e.jscolor=e.JSColor=a),a}))}},t={};function o(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,o),a.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";let e={};function t(){e.WrinklerButtons&&Game.elderWrath?(l("PopAllNormalWrinklerButton").style.display="",l("PopFattestWrinklerButton").style.display=""):(l("PopAllNormalWrinklerButton").style.display="none",l("PopFattestWrinklerButton").style.display="none")}const n=["","","M","G","T","P","E","Z","Y"],i=["","","M","B","Tr","Quadr","Quint","Sext","Sept","Oct","Non","Dec","Undec","Duodec","Tredec","Quattuordec","Quindec","Sexdec","Septendec","Octodec","Novemdec","Vigint","Unvigint","Duovigint","Trevigint","Quattuorvigint"],a=["","K","M","B","T","Qa","Qi","Sx","Sp","Oc","No","De","UDe","DDe","TDe","QaDe","QiDe","SxDe","SpDe","ODe","NDe","Vi","UVi","DVi","TVi","QaVi","QiVi","SxVi","SpVi","OVi","NVi","Tr","UTr","DTr","TTr","QaTr","QiTr","SxTr","SpTr","OTr","NTr","Qaa","UQa","DQa","TQa","QaQa","QiQa","SxQa","SpQa","OQa","NQa","Qia","UQi","DQi","TQi","QaQi","QiQi","SxQi","SpQi","OQi","NQi","Sxa","USx","DSx","TSx","QaSx","QiSx","SxSx","SpSx","OSx","NSx","Spa","USp","DSp","TSp","QaSp","QiSp","SxSp","SpSp","OSp","NSp","Oco","UOc","DOc","TOc","QaOc","QiOc","SxOc","SpOc","OOc","NOc","Noa","UNo","DNo","TNo","QaNo","QiNo","SxNo","SpNo","ONo","NNo","Ct","UCt"];let r,s,c,d,p,u,m,h,g,f,C,y,b,k,G,v,w,x=[],T=[],M=[],S={},B=Date.now(),P=Date.now();const E="CMText",N="CMBack",O="Blue",F="Green",W="Yellow",L="Orange",A="Red",j="Purple",D="Gray",H="Pink",U="Brown",$=[D,O,F,W,L,A,j,H,U],R=[["GoldCookTooltipPlaceholder","Calculated with Golden Switch off","200px"],["GoldCookDragonsFortuneTooltipPlaceholder","Calculated with Golden Switch off and at least one golden cookie on-screen","240px"],["PrestMaxTooltipPlaceholder","The MAX prestige is calculated with the cookies gained from popping all wrinklers with Skruuia god in Diamond slot, selling all stock market goods, selling all buildings with Earth Shatterer and Reality Bending auras, and buying Chocolate egg","320px"],["NextPrestTooltipPlaceholder","Calculated with cookies gained from wrinklers and Chocolate egg","200px"],["HeavenChipMaxTooltipPlaceholder","The MAX heavenly chips is calculated with the cookies gained from popping all wrinklers with Skruuia god in Diamond slot, selling all stock market goods, selling all buildings with Earth Shatterer and Reality Bending auras, and buying Chocolate egg","330px"],["ResetTooltipPlaceholder","The bonus income you would get from new prestige levels unlocked at 100% of its potential and from ascension achievements if you have the same buildings/upgrades after reset","370px"],["ChoEggTooltipPlaceholder","The amount of cookies you would get from popping all wrinklers with Skruuia god in Diamond slot, selling all stock market goods, selling all buildings with Earth Shatterer and Reality Bending auras, and then buying Chocolate egg","300px"],["ChainNextLevelPlaceholder","Cheated cookies might break this formula","250px"],["FavouriteSettingPlaceholder","Click to set this setting as favourite and show it in 'favourite' settings at the top of the Cookie Monster Settings","250px"]],I={};let z,V,_=0,Q=-1,X=[],q=1,Y=1,K=1;const J=[10,15,30,60,300,600,900,1800],Z=[1,5,10,15,30],ee={Frenzy:W,"Dragon Harvest":U,"Elder frenzy":F,Clot:A,"Click frenzy":O,Dragonflight:H};let te,oe,ne,ie,ae,re,le,se={},ce="",de=[];function pe(t,o,r){const l=e.ScaleDecimals+1;if(t===1/0)return"Infinity";if(void 0===t)return"0";if(0===e.Scale)return S.Beautify(t,o);if(Number.isFinite(t)){if(t<0)return`-${pe(Math.abs(t))}`;let s="";if(0===t)return t.toString();if(t>.001&&t=.01&&t=.01&&t=.01&&t315576e4)return"XX:XX:XX:XX:XX";c+=(i<10?"0":"")+i+":",c+=(a<10?"0":"")+a+":",c+=(r<10?"0":"")+r+":",c+=(l<10?"0":"")+l+":",c+=(s<10?"0":"")+s}else{if(n>7776e5)return o?"Over 9000 days!":">9000d";c+=i>0?i+(o?1===i?" year":" years":"y")+", ":"",c+=a>0?a+(o?1===a?" day":" days":"d")+", ":"",(c.length>0||r>0)&&(c+=r+(o?1===r?" hour":" hours":"h")+", "),(c.length>0||l>0)&&(c+=l+(o?1===l?" minute":" minutes":"m")+", "),c+=s+(o?1===s?" second":" seconds":"s")}return c}function me(t){let o,n;return t<=0?(n=e.TimeFormat?"00:00:00:00:00":"Done!",o=F):(n=ue(t),o=t>300?A:t>60?L:W),{text:n,color:o}}let he,ge,fe,Ce,ye,be,ke,Ge,ve,we,xe,Te,Me,Se,Be,Pe,Ee,Ne,Oe,Fe,We,Le,Ae,je,De,He,Ue,$e,Re,Ie,ze,Ve,_e,Qe,Xe,qe,Ye=0,Ke=0,Je=0,Ze=0,et=0,tt=0,ot=0,nt=0,it=0,at=0,rt=0,lt=0,st=0,ct=0,dt=0,pt=1,ut=1,mt=1,ht=0,gt=0,ft=0,Ct=0,yt={},bt={},kt={},Gt=0,vt=0,wt=[0,null],xt=0,Tt=0,Mt={},St={},Bt={},Pt={},Et={},Nt=0,Ot=0,Ft=[],Wt=0,Lt=0,At=[],jt=0,Dt=0,Ht=[],Ut=0,$t=0,Rt=[],It=0,zt=0,Vt={},_t={},Qt=0,Xt=0,qt=[],Yt={},Kt=0,Jt={0:[0,0,0],1:[0,0,0],2:[0,0,0],3:[0,0,0],4:[0,0,0],5:[0,0,0],6:[0,0,0],7:[0,0,0],8:[0,0,0],9:[0,0,0],10:[0,0,0]},Zt=[],eo=[],to=[];function oo(e){let t=0;return Game.dragonAuras[$e].name!==e&&Game.dragonAuras[Re].name!==e||(t=1),"Reality Bending"!==Game.dragonAuras[$e].name&&"Reality Bending"!==Game.dragonAuras[Re].name||(t+=.1),t}function no(){let e=.25;return e*=1+oo("Earth Shatterer"),e}function io(e,t){return void 0===Qe[e]?void 0===t?1:t:Qe[e]}function ao(e){const t=eo[e];return(1!==Game.ascensionMode||"prestige"!==t.pool&&"fortune"!==t.tier)&&t?t.bought:0}function ro(e){if(Game.hasGod){void 0===Zt.Temple.minigame&&(Zt.Temple.minigame=Game.Objects.Temple.minigame);const t=Zt.Temple.minigame.gods[e];if(Ie===t.id)return 1;if(ze===t.id)return 2;if(Ve===t.id)return 3}return!1}function lo(e,t){let o=t;if(ao("Season savings")&&(o*=.99),ao("Santa's dominion")&&(o*=.99),ao("Faberge egg")&&(o*=.99),ao("Divine discount")&&(o*=.99),ao("Fortune #100")&&(o*=.99),o*=1-.02*oo("Fierce Hoarder"),Game.hasBuff("Everything must go")&&(o*=.95),Game.hasBuff("Crafty pixies")&&(o*=.98),Game.hasBuff("Nasty goblins")&&(o*=1.02),e.fortune&&ao(e.fortune.name)&&(o*=.93),o*=io("buildingCost"),Zt.Temple.minigameLoaded){const e=ro("creation");1===e?o*=.93:2===e?o*=.95:3===e&&(o*=.98)}return o}function so(e,t,o,n,i,a){const r=void 0===a?0:a;let l=i,s=o,c=0;-1===i&&(l=s),i||(l=Game.buyBulk);for(let o=0;o0&&(c+=o,s-=1)}return c}function co(){let t=Game.buyBulk;if(1===Game.buyMode?Y=t:t=Y,1===t?t=yt:10===t?t=bt:100===t&&(t=kt),1===Game.buyMode?1===e.BuildColour?Object.keys(t).forEach((o=>{l(`productPrice${Game.Objects[o].id}`).style.color=e[`Colour${t[o].color}`]})):Object.keys(Game.Objects).forEach((e=>{l(`productPrice${Game.Objects[e].id}`).style.removeProperty("color")})):-1===Game.buyMode&&Object.keys(yt).forEach((e=>{const t=Game.Objects[e];l(`productPrice${t.id}`).style.color="",l(`productPrice${t.id}`).innerHTML=pe(so(t,t.basePrice,t.amount,t.free,Game.buyBulk,1))})),1===Game.buyMode&&e.SortBuildings){let o;1===e.SortBuildings?(o=Object.keys(yt).map((e=>{const t=yt[e];return t.name=e,t.id=Game.Objects[e].id,t})),o.sort((function(e,t){return $.indexOf(e.color)>$.indexOf(t.color)?1:$.indexOf(e.color)<$.indexOf(t.color)||e.pp{const o=t[e];return o.name=e,o.id=Game.Objects[e].id,o})),o.sort((function(e,t){return $.indexOf(e.color)>$.indexOf(t.color)?1:$.indexOf(e.color)<$.indexOf(t.color)||e.pp{const t=yt[e];return t.name=e,t.id=Game.Objects[e].id,t}));e.sort(((e,t)=>e.id-t.id));for(let t=0;t0){let e=0,t=0,o=0,n=0,i=0,a=0,r=0;Object.keys(Game.UpgradesInStore).forEach((s=>{const c=Game.UpgradesInStore[s];let d=!1;for(let e=0;e$.indexOf(t.color)?1:$.indexOf(e.color)<$.indexOf(t.color)||e.ppe.price-t.price));const o=function(e,t){return e.findIndex((e=>e.name===t.name))};for(let e=0;e{let n,i=Game.buyBulk;1===Game.buyMode?q=i:i=q,1===i&&(i=yt),10===i&&(i=bt),100===i&&(i=kt),t+=1,l("CMBotBar").firstChild.firstChild.childNodes[0].childNodes[t].childNodes[1].textContent=Game.Objects[o].amount,l("CMBotBar").firstChild.firstChild.childNodes[1].childNodes[t].textContent=pe(i[o].bonus,2),l("CMBotBar").firstChild.firstChild.childNodes[2].childNodes[t].className=E+i[o].color,n=e.PPDisplayTime?ue(Math.round(i[o].pp)):pe(Math.round(i[o].pp),2),l("CMBotBar").firstChild.firstChild.childNodes[2].childNodes[t].textContent=n;const a=me((Game.Objects[o].bulkPrice-(Game.cookies+mo()))/uo());l("CMBotBar").firstChild.firstChild.childNodes[3].childNodes[t].className=E+a.color,"Done!"===a.text&&Game.cookies{!Game.Tiers[e.tieredUpgrades[o].tier].special&&ao(e.tieredUpgrades[o].name)&&(t*=2)})),Object.keys(e.synergies).forEach((o=>{if(ao(e.synergies[o].name)){const n=e.synergies[o];n.buildingTie1.name===e.name?t*=1+.05*n.buildingTie2.amount:n.buildingTie2.name===e.name&&(t*=1+.001*n.buildingTie1.amount)}})),e.fortune&&ao(e.fortune.name)&&(t*=1.07),e.grandma&&ao(e.grandma.name)&&(t*=1+.01*Zt.Grandma.amount*(1/(e.id-1))),"object"==typeof e.tieredUpgrades.misfortune&&1===e.vanilla&&ao(e.tieredUpgrades.misfortune.name))switch(Game.elderWrath){default:t*=1;break;case 1:t*=1.02;break;case 2:t*=1.04;break;case 3:t*=1.06}return t}function wo(e){const t=Game.Objects[e],o={};return"Cursor"===t.name?o.cps=function(e){let t=0;ao("Thousand fingers")&&(t+=.1),ao("Million fingers")&&(t*=5),ao("Billion fingers")&&(t*=10),ao("Trillion fingers")&&(t*=20),ao("Quadrillion fingers")&&(t*=20),ao("Quintillion fingers")&&(t*=20),ao("Sextillion fingers")&&(t*=20),ao("Septillion fingers")&&(t*=20),ao("Octillion fingers")&&(t*=20),ao("Nonillion fingers")&&(t*=20);let o=1,n=0;return Object.keys(Zt).forEach((e=>{"Cursor"!==Zt[e].name&&(n+=Zt[e].amount)})),t*=n,o*=vo(e),o*=Game.magicCpS("Cursor"),o*=io("cursorCps"),Game.ComputeCps(.1,ao("Reinforced index finger")+ao("Carpal tunnel prevention cream")+ao("Ambidextrous"),t)*o}:"Grandma"===t.name?o.cps=function(e){let o=1;if(Object.keys(Game.GrandmaSynergies).forEach((e=>{ao(Game.GrandmaSynergies[e])&&(o*=2)})),ao("Bingo center/Research facility")&&(o*=4),ao("Ritual rolling pins")&&(o*=2),ao("Naughty list")&&(o*=2),ao("Elderwort biscuits")&&(o*=1.02),o*=io("grandmaCps"),ao("Cat ladies"))for(let e=0;e{"Grandma"!==Zt[e].name&&(i+=Zt[e].amount)})),o*=1+.01*oo("Elder Battalion")*i,o*=Game.magicCpS(t.name),(t.baseCps+n)*o}:o.cps=function(e){let t=1;return t*=vo(e),t*=Game.magicCpS(e.name),e.baseCPS*t},o.baseCps=t.baseCps,o.name=t.name,o.tieredUpgrades=t.tieredUpgrades,o.synergies=t.synergies,o.fortune=t.fortune,o.grandma=t.grandma,o.baseCPS=t.baseCps,o.id=t.id,o.vanilla=t.vanilla,o}function xo(e){const t=Game.Upgrades[e],o={};return o.power=t.power,"function"==typeof o.power&&("Sugar crystal cookies"===t.name?o.power=function(){let e=5;return Object.keys(Zt).forEach((t=>{Zt[t].level>=10&&(e+=1)})),e}:o.power=function(){let e=2;if(ao("Starlove")&&(e=3),Game.hasGod){const t=ro("seasons");1===t?e*=1.3:2===t?e*=1.2:3===t&&(e*=1.1)}return e}),o.pool=t.pool,o.name=t.name,o}function To(){Ae=Game.UpgradesOwned,je=Game.pledges,De=Game.AchievementsOwned,He=Game.heavenlyPower,Ue=Game.prestige,Object.keys(Game.Objects).forEach((e=>{const t=Game.Objects[e];let o=Zt[e];void 0===o&&(Zt[e]=wo(e),o=Zt[e],go(e)),o.amount=t.amount,o.level=t.level,o.totalCookies=t.totalCookies,o.basePrice=t.basePrice,o.free=t.free,t.minigameLoaded&&("Temple"===t.name&&(Ie=t.minigame.slot[0],ze=t.minigame.slot[1],Ve=t.minigame.slot[2]),o.minigameLoaded=t.minigameLoaded,o.minigame=t.minigame),Zt[e]=o})),Object.keys(Game.Upgrades).forEach((e=>{const t=Game.Upgrades[e];let o=eo[e];void 0===o&&(eo[e]=xo(e),o=eo[e]),o.bought=t.bought,eo[e]=o})),Object.keys(Game.Achievements).forEach((e=>{const t=Game.Achievements[e];let o=to[e];void 0===o&&(to[e]=Go(e),o=to[e]),o.won=t.won,to[e]=o})),ko(),$e=Ye,Re=Ke}function Mo(e){const t=document.createElement("div");return t.style.fontWeight="bold",t.id=`${e}Title`,t.className="CMTextBlue",t.textContent=e,t}function So(e){e.appendChild(Mo("Bonus Income"));const t=document.createElement("div");t.style.marginBottom="4px",t.style.color="white",t.id="CMTooltipIncome",e.appendChild(t),e.appendChild(Mo("Bonus Cookies per Click")),e.lastChild.style.display="none";const o=document.createElement("div");o.style.marginBottom="4px",o.style.color="white",o.style.display="none",o.id="CMTooltipCookiePerClick",e.appendChild(o),e.appendChild(Mo("Payback Period"));const n=document.createElement("div");n.style.marginBottom="4px",n.id="CMTooltipPP",e.appendChild(n),e.appendChild(Mo("Time Left"));const i=document.createElement("div");if(i.id="CMTooltipTime",e.appendChild(i),"b"===ne){e.appendChild(Mo("Production left till next achievement")),e.lastChild.id="CMTooltipProductionHeader";const t=document.createElement("div");t.id="CMTooltipProduction",e.appendChild(t)}}function Bo(e,t,o){let n=e,i=0;for(;n{void 0!==Game.buffs[t].multCpS&&(e*=Game.buffs[t].multCpS)})),e}function Eo(){null!==l("CMDispTooltipWarningParent")&&(0===e.ToolWarnPos?(l("CMDispTooltipWarningParent").style.top="auto",l("CMDispTooltipWarningParent").style.margin="4px -4px",l("CMDispTooltipWarningParent").style.padding="3px 4px"):(l("CMDispTooltipWarningParent").style.right="auto",l("CMDispTooltipWarningParent").style.margin="4px",l("CMDispTooltipWarningParent").style.padding="4px 3px"))}function No(){if(To(),"none"!==l("tooltipAnchor").style.display&&l("CMTooltipArea")){l("CMTooltipArea").innerHTML="";const t=function(){l("tooltip").firstChild.style.paddingBottom="4px";const e=document.createElement("div");return e.style.border="1px solid",e.style.padding="4px",e.style.margin="0px -4px",e.id="CMTooltipBorder",e.className="CMTextGray",e}();l("CMTooltipArea").appendChild(t),"b"===ne?function(){if(1===e.TooltipBuildUpgrade&&1===Game.buyMode){let t;if(So(l("CMTooltipBorder")),1===Game.buyMode?K=t:t=K,1===Game.buyBulk?t=yt:10===Game.buyBulk?t=bt:100===Game.buyBulk&&(t=kt),te=Game.Objects[ie].bulkPrice,oe=t[ie].bonus,1===e.TooltipBuildUpgrade&&1===Game.buyMode){l("CMTooltipIncome").textContent=pe(oe,2);const o=Math.round(oe/Game.cookiesPs*1e4);Number.isFinite(o)&&0!==o?l("CMTooltipIncome").textContent+=` (${o/100}% of income)`:l("CMTooltipIncome").textContent+=` (<0${e.ScaleSeparator?",":"."}01% of income)`,l("CMTooltipBorder").className=E+t[ie].color,e.PPDisplayTime?l("CMTooltipPP").textContent=ue(t[ie].pp):l("CMTooltipPP").textContent=pe(t[ie].pp,2),l("CMTooltipPP").className=E+t[ie].color;const n=me((te-(Game.cookies+mo()))/uo());l("CMTooltipTime").textContent=n.text,"Done!"===n.text&&Game.cookiest.plantsById[t.plot[ie[1]][ie[0]][0]-1].mature,o=t.plantsById[t.plot[ie[1]][ie[0]][0]-1].name;l("CMTooltipBorder").appendChild(Mo("Reward (Current / Maximum)"));const n=document.createElement("div");n.id="CMTooltipPlantReward",l("CMTooltipBorder").appendChild(n),"Bakeberry"===o?l("CMTooltipPlantReward").textContent=`${e?pe(Math.min(.03*Game.cookies,60*Game.cookiesPs*30)):"0"} / ${pe(60*Game.cookiesPs*30)}`:"Chocoroot"===o||"White chocoroot"===o?l("CMTooltipPlantReward").textContent=`${e?pe(Math.min(.03*Game.cookies,60*Game.cookiesPs*3)):"0"} / ${pe(60*Game.cookiesPs*3)}`:"Queenbeet"===o?l("CMTooltipPlantReward").textContent=`${e?pe(Math.min(.04*Game.cookies,60*Game.cookiesPs*60)):"0"} / ${pe(60*Game.cookiesPs*60)}`:"Duketater"===o?l("CMTooltipPlantReward").textContent=`${e?pe(Math.min(.08*Game.cookies,60*Game.cookiesPs*120)):"0"} / ${pe(60*Game.cookiesPs*120)}`:l("CMTooltipArea").style.display="none"}else l("CMTooltipArea").style.display="none"}():"ha"===ne?function(){const{minigame:t}=Game.Objects.Farm;if(e.TooltipLump){l("CMTooltipBorder").appendChild(Mo("Cookies gained from harvesting:"));let e=0,o=0;Game.keys[16]&&Game.keys[17]&&(o=1);for(let n=0;n<6;n++)for(let i=0;i<6;i++)if(t.plot[n][i][0]>=1){const a=t.plot[n][i],r=t.plantsById[a[0]-1],l=r.name;let s=!0;o&&r.immortal&&(s=!1),a[1]0&&t=1?l("CMTimerBarGCMinBar").textContent=Math.ceil((Game.shimmerTypes.golden.minTime-Game.shimmerTypes.golden.time)/Game.fps):l("CMTimerBarGCMinBar").textContent="",Game.shimmerTypes.golden.minTime===Game.shimmerTypes.golden.maxTime?(l("CMTimerBarGCMinBar").style.borderTopRightRadius="10px",l("CMTimerBarGCMinBar").style.borderBottomRightRadius="10px"):(l("CMTimerBarGCMinBar").style.borderTopRightRadius="",l("CMTimerBarGCMinBar").style.borderBottomRightRadius=""),l("CMTimerBarGCBar").style.width=`${Math.round(Math.min(Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.minTime,Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.time)*t/Game.shimmerTypes.golden.maxTime)}px`,e.TimerBarOverlay>=1?l("CMTimerBarGCBar").textContent=Math.ceil(Math.min(Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.minTime,Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.time)/Game.fps):l("CMTimerBarGCBar").textContent="",l("CMTimerBarGCTime").textContent=Math.ceil((Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.time)/Game.fps),n+=1),"christmas"===Game.season&&0===Game.shimmerTypes.reindeer.spawned?(l("CMTimerBarRen").style.display="",l("CMTimerBarRenMinBar").style.width=`${Math.round(Math.max(0,Game.shimmerTypes.reindeer.minTime-Game.shimmerTypes.reindeer.time)*t/Game.shimmerTypes.reindeer.maxTime)}px`,e.TimerBarOverlay>=1?l("CMTimerBarRenMinBar").textContent=Math.ceil((Game.shimmerTypes.reindeer.minTime-Game.shimmerTypes.reindeer.time)/Game.fps):l("CMTimerBarRenMinBar").textContent="",l("CMTimerBarRenBar").style.width=`${Math.round(Math.min(Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.minTime,Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.time)*t/Game.shimmerTypes.reindeer.maxTime)}px`,e.TimerBarOverlay>=1?l("CMTimerBarRenBar").textContent=Math.ceil(Math.min(Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.minTime,Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.time)/Game.fps):l("CMTimerBarRenBar").textContent="",l("CMTimerBarRenTime").textContent=Math.ceil((Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.time)/Game.fps),n+=1):l("CMTimerBarRen").style.display="none";const i={};l("CMTimerBarBuffTimers").innerHTML="",Object.keys(Game.buffs).forEach((t=>{if(Game.buffs[t]){const a=ho(Game.buffs[t].name,Game.buffs[t].name,[{id:`${Game.buffs[t].name}Bar`}]);a.style.display="";let r="";r=void 0!==ee[Game.buffs[t].name]?ee[Game.buffs[t].name]:j,a.lastChild.children[1].className=N+r,a.lastChild.children[1].style.color="black",2===e.TimerBarOverlay?a.lastChild.children[1].textContent=`${Math.round(Game.buffs[t].time/Game.buffs[t].maxTime*100)}%`:a.lastChild.children[1].textContent="",a.lastChild.children[1].style.width=`${Math.round(Game.buffs[t].time*(o-8*Math.ceil(Game.buffs[t].time/Game.fps).toString().length)/Game.buffs[t].maxTime)}px`,a.lastChild.children[2].textContent=Math.ceil(Game.buffs[t].time/Game.fps),n+=1,i[Game.buffs[t].name]=a}})),Object.keys(i).forEach((e=>{l("CMTimerBarBuffTimers").appendChild(i[e])})),0!==n&&(l("CMTimerBar").style.height=12*n+2+"px"),le!==n&&(le=n,yo())}}(),fo(),No(),function(){if(1===e.TooltipWrink&&1===_){let e=!1;Object.keys(Game.wrinklers).forEach((t=>{const o=Game.wrinklers[t];if(o.phase>0&&o.selected){if(e=!0,0===X[t]||void 0===X[t]){const e=document.createElement("div"),o=document.createElement("div");o.style.minWidth="120px",o.style.marginBottom="4px";const n=document.createElement("div");n.style.textAlign="center",n.id="CMTooltipWrinkler",o.appendChild(n),e.appendChild(o),Game.tooltip.draw(this,escape(e.innerHTML)),Q=t,X[t]=1}}else X[t]=0})),e||Game.tooltip.hide()}}(),function(){if(1===e.TooltipWrink&&null!==l("CMTooltipWrinkler")){let{sucked:e}=Game.wrinklers[Q],t=1.1;if(Game.Has("Sacrilegious corruption")&&(t*=1.05),1===Game.wrinklers[Q].type&&(t*=3),e*=t,Game.Has("Wrinklerspawn")&&(e*=1.05),Zt.Temple.minigameLoaded){const t=Game.hasGod("scorn");1===t?e*=1.15:2===t?e*=1.1:3===t&&(e*=1.05)}l("CMTooltipWrinkler").textContent=pe(e)}}(),e.UpStats&&"stats"===Game.onMenu&&(Game.drawT-1)%(5*Game.fps)!=0&&(Game.drawT-1)%Game.fps==0&&Game.UpdateMenu(),t(),e.Scale){let e=l("cookies").innerHTML.replace(/.*(?=
)/i,pe(Game.cookies));Game.prefs.monospace&&(e=`${e}`),l("cookies").innerHTML=e}}function Fo(){he.addLatest(Game.computedMouseCps)}class Wo{constructor(e){this.maxLength=e,this.queue=[]}addLatest(e){this.queue.push(e)>this.maxLength&&this.queue.shift()}calcAverage(e){let t=e;t>this.maxLength&&(t=this.maxLength),t>this.queue.length&&(t=this.queue.length);let o=0;for(let e=this.queue.length-1;e>=0&&e>this.queue.length-1-t;e--)o+=this.queue[e];return 0===o?0:o/t}calcSum(e){let t=e;return t>this.maxLength&&(t=this.maxLength),t>this.queue.length&&(t=this.queue.length),0===t?0:this.queue.slice(-t).reduce(((e,t)=>e+t),0)}}function Lo(){const t=Math.floor(Date.now()/1e3);if(Game.T/Game.fps%1==0){let o=Game.cookies+Kt;Game.cpsSucked>0&&(o+=Gt),It=Math.max(Game.cookiesEarned,o),o*=.05;const n=t-Ge,i=Math.max(0,Game.cookies-ve)/n,a=Math.max(0,Gt-we)/n,r=Math.max(0,wt[0]-xe)/n,l=Math.max(0,o-Ct)/n,s=(Game.cookieClicks-Te)/n;for(let e=0;e0&&(n=A),n}function jo(t,o){Object.keys(t).forEach((n=>{if(e.PPRigidelMode&&1===o)t[n].color=D;else{t[n].color=Ao(t[n],Game.Objects[n].getSumPrice(o));for(let o=0;o{const i=Game.Objects[n].getSumPrice(o);Game.cookiesPs?t[n].pp=Math.max(i-(Game.cookies+mo()),0)/Game.cookiesPs+i/t[n].bonus:t[n].pp=i/t[n].bonus,e.PPRigidelMode&&1===o||qt.push([t[n].pp,o])}))}function Ho(){!function(){Xt=1/0,qt=[],void 0===e.PPExcludeTop&&(e.PPExcludeTop=0),Do(yt,1),Do(bt,10),Do(kt,100),qt.sort(((e,t)=>e[0]-t[0]));let t=0;if(e.PPOnlyConsiderBuyable)for(;qt[t][1]>Game.cookies&&(t+=1,qt.length!==t+1););Xt=qt[e.PPExcludeTop][t],jo(yt,1),jo(bt,10),jo(kt,100)}(),Object.keys(Mt).forEach((e=>{Game.cookiesPs?Mt[e].pp=Math.max(Game.Upgrades[e].getPrice()-(Game.cookies+mo()),0)/Game.cookiesPs+Game.Upgrades[e].getPrice()/Mt[e].bonus:Mt[e].pp=Game.Upgrades[e].getPrice()/Mt[e].bonus,Number.isNaN(Mt[e].pp)&&(Mt[e].pp=1/0),Mt[e].color=Ao(Mt[e],Game.Upgrades[e].getPrice())}))}function Uo(e,t,o,n,i){let a=o,r=0;for(let o=0;o{if(Game.Objects[e].minigameLoaded&&Game.Objects[e].minigame.effs){const o=Game.Objects[e].minigame.effs;Object.keys(o).forEach((e=>{t[e]?t[e]*=o[e]:t[e]=o[e]}))}})),Qe=t,1!==Game.ascensionMode&&(e+=.01*parseFloat(Ue)*He*function(){let e=0;if(ao("Heavenly chip secret")&&(e+=.05),ao("Heavenly cookie stand")&&(e+=.2),ao("Heavenly bakery")&&(e+=.25),ao("Heavenly confectionery")&&(e+=.25),ao("Heavenly key")&&(e+=.25),e*=1+.05*oo("Dragon God"),ao("Lucky digit")&&(e*=1.01),ao("Lucky number")&&(e*=1.01),ao("Lucky payout")&&(e*=1.01),Game.hasGod){const t=ro("creation");1===t?e*=.7:2===t?e*=.8:3===t&&(e*=.9)}return e}()),e*=io("cps"),ao("Heralds")&&1!==Game.ascensionMode&&(e*=1+.01*Game.heralds),Object.keys(Game.cookieUpgrades).forEach((t=>{const o=Game.cookieUpgrades[t];ao(o.name)&&("function"==typeof o.power?e*=1+.01*eo[o.name].power(eo[o.name]):e*=1+.01*o.power)})),ao("Specialized chocolate chips")&&(e*=1.01),ao("Designer cocoa beans")&&(e*=1.02),ao("Underworld ovens")&&(e*=1.03),ao("Exotic nuts")&&(e*=1.04),ao("Arcane sugar")&&(e*=1.05),ao("Increased merriness")&&(e*=1.15),ao("Improved jolliness")&&(e*=1.15),ao("A lump of coal")&&(e*=1.01),ao("An itchy sweater")&&(e*=1.01),ao("Santa's dominion")&&(e*=1.2),ao("Fortune #100")&&(e*=1.01),ao("Fortune #101")&&(e*=1.07),ao("Dragon scale")&&(e*=1.03);let o=1;if(ro){let t=ro("asceticism");1===t?e*=1.15:2===t?e*=1.1:3===t&&(e*=1.05),t=ro("ages"),1===t?e*=1+.15*Math.sin(B/1e3/10800*Math.PI*2):2===t?e*=1+.15*Math.sin(B/1e3/43200*Math.PI*2):3===t&&(e*=1+.15*Math.sin(B/1e3/86400*Math.PI*2)),t=ro("decadence"),1===t?o*=.93:2===t?o*=.95:3===t&&(o*=.98),t=ro("industry"),1===t?o*=1.1:2===t?o*=1.06:3===t&&(o*=1.03),t=ro("labor"),1===t?o*=.97:2===t?o*=.98:3===t&&(o*=.99)}ao("Santa's legacy")&&(e*=1+.03*(Game.santaLevel+1));const n=De/25;let i=1;if(ao("Santa's milk and cookies")&&(i*=1.05),i*=1+.05*oo("Breath of Milk"),ro){const e=ro("mother");1===e?i*=1.1:2===e?i*=1.05:3===e&&(i*=1.03)}i*=io("milk");let a=1;ao("Kitten helpers")&&(a*=1+.1*n*i),ao("Kitten workers")&&(a*=1+.125*n*i),ao("Kitten engineers")&&(a*=1+.15*n*i),ao("Kitten overseers")&&(a*=1+.175*n*i),ao("Kitten managers")&&(a*=1+.2*n*i),ao("Kitten accountants")&&(a*=1+.2*n*i),ao("Kitten specialists")&&(a*=1+.2*n*i),ao("Kitten experts")&&(a*=1+.2*n*i),ao("Kitten consultants")&&(a*=1+.2*n*i),ao("Kitten assistants to the regional manager")&&(a*=1+.175*n*i),ao("Kitten marketeers")&&(a*=1+.15*n*i),ao("Kitten analysts")&&(a*=1+.125*n*i),ao("Kitten executives")&&(a*=1+.115*n*i),ao("Kitten angels")&&(a*=1+.1*n*i),ao("Fortune #103")&&(a*=1+.05*n*i),Object.keys(Zt).forEach((e=>{const t=Zt[e];let a=t.cps(t);1!==Game.ascensionMode&&(a*=(1+.01*t.level)*o),"Grandma"===t.name&&ao("Milkhelp® lactose intolerance relief tablets")&&(a*=1+.05*n*i),Xe+=t.amount*a})),ao('"egg"')&&(Xe+=9),e*=a;let r=1;if(ao("Chicken egg")&&(r*=1.01),ao("Duck egg")&&(r*=1.01),ao("Turkey egg")&&(r*=1.01),ao("Quail egg")&&(r*=1.01),ao("Robin egg")&&(r*=1.01),ao("Ostrich egg")&&(r*=1.01),ao("Cassowary egg")&&(r*=1.01),ao("Salmon roe")&&(r*=1.01),ao("Frogspawn")&&(r*=1.01),ao("Shark egg")&&(r*=1.01),ao("Turtle egg")&&(r*=1.01),ao("Ant larva")&&(r*=1.01),ao("Century egg")){let e=10*Math.floor((P-Game.startDate)/1e3/10)/60/60/24;e=Math.min(e,100),gt=1+.1*(1-(1-e/100)**3),r*=gt}e*=r,ao("Sugar baking")&&(e*=1+.01*Math.min(100,Game.lumps)),e*=1+oo("Radiant Appetite");const l=Xe*e;Object.keys(Game.CpsAchievements).forEach((e=>{l>=Game.CpsAchievements[e].threshold&&$o(Game.CpsAchievements[e].name)})),qe=l;const{n:s}=Game.shimmerTypes.golden,c=oo("Dragon's Fortune");for(let t=0;t{ao(e[o])&&(t+=.1)}))}e*=t}if(ao("Shimmering veil [off]")){let t=.5;ao("Reinforced membrane")&&(t+=.1),e*=1+t}ao("Magic shenanigans")&&(e*=1e3),ao("Occult obstruction")&&(e*=0),Xe=Game.runModHookOnValue("cps",Xe),e*=Po(),Xe*=e}const Io=["Fortune #001","Fortune #002","Fortune #003","Fortune #004","Fortune #005","Fortune #006","Fortune #007","Fortune #008","Fortune #009","Fortune #010","Fortune #011","Fortune #012","Fortune #013","Fortune #014","Fortune #015","Fortune #016","Fortune #017","Fortune #018","Fortune #100","Fortune #101","Fortune #102","Fortune #103","Fortune #104"],zo=["Skull cookies","Ghost cookies","Bat cookies","Slime cookies","Pumpkin cookies","Eyeball cookies","Spider cookies"],Vo=["Christmas tree biscuits","Snowflake biscuits","Snowman biscuits","Holly biscuits","Candy cane biscuits","Bell biscuits","Present biscuits"],_o=["Pure heart biscuits","Ardent heart biscuits","Sour heart biscuits","Weeping heart biscuits","Golden heart biscuits","Eternal heart biscuits","Prism heart biscuits"],Qo=["Elderwort biscuits","Bakeberry cookies","Duketater cookies","Green yeast digestives","Wheat slims","Fern tea","Ichor syrup"];function Xo(e){return to[e]?to[e].won:0}function qo(){let e=0;Object.keys(Game.GrandmaSynergies).forEach((t=>{ao(Game.GrandmaSynergies[t])&&(e+=1)})),!Xo("Elder")&&e>=7&&$o("Elder"),!Xo("Veteran")&&e>=14&&$o("Veteran");let t=0,o=1,n=1,i=1e5;Object.keys(Zt).forEach((e=>{t+=Zt[e].amount,i=Math.min(Zt[e].amount,i),Xo("Mathematician")||Zt[e].amount=1&&$o("One with everything"),1===o&&$o("Mathematician"),1===n&&$o("Base 10"),i>=100&&$o("Centennial"),i>=150&&$o("Centennial and a half"),i>=200&&$o("Bicentennial"),i>=250&&$o("Bicentennial and a half"),i>=300&&$o("Tricentennial"),i>=350&&$o("Tricentennial and a half"),i>=400&&$o("Quadricentennial"),i>=450&&$o("Quadricentennial and a half"),i>=500&&$o("Quincentennial"),i>=550&&$o("Quincentennial and a half"),i>=600&&$o("Sexcentennial"),t>=100&&$o("Builder"),t>=500&&$o("Architect"),t>=1e3&&$o("Engineer"),t>=2e3&&$o("Lord of Constructs"),t>=4e3&&$o("Grand design"),t>=8e3&&$o("Ecumenopolis"),Ae>=20&&$o("Enhancer"),Ae>=50&&$o("Augmenter"),Ae>=100&&$o("Upgrader"),Ae>=200&&$o("Lord of Progress"),Ae>=300&&$o("The full picture"),Ae>=400&&$o("When there's nothing left to add"),t>=4e3&&Ae>=300&&$o("Polymath"),t>=8e3&&Ae>=400&&$o("Renaissance baker"),Zt.Cursor.amount+Zt.Grandma.amount>=777&&$o("The elder scrolls");let a=!0;Object.keys(zo).forEach((e=>{ao(zo[e])||(a=!1)})),a&&$o("Spooky cookies");let r=!0;if(Object.keys(Vo).forEach((e=>{ao(Vo[e])||(r=!1)})),r&&$o("Let it snow"),ao("Fortune cookies")){const e=Game.Tiers.fortune.upgrades;let t=0;Object.keys(e).forEach((o=>{ao(e[o].name)&&(t+=1)})),t>=e.length&&$o("O Fortuna")}}function Yo(e){const t={};return Object.keys(Game.Objects).forEach((o=>{t[o]={},t[o].bonus=function(e,t){To(),Zt[e].amount+=t;const o=Zt[e];"Cursor"===e?(o.amount>=1&&$o("Click"),o.amount>=2&&$o("Double-click"),o.amount>=50&&$o("Mouse wheel"),o.amount>=100&&$o("Of Mice and Men"),o.amount>=200&&$o("The Digital"),o.amount>=300&&$o("Extreme polydactyly"),o.amount>=400&&$o("Dr. T"),o.amount>=500&&$o("Thumbs, phalanges, metacarpals"),o.amount>=600&&$o("With her finger and her thumb"),o.amount>=700&&$o("Gotta hand it to you"),o.amount>=800&&$o("The devil's workshop")):Object.keys(Game.Objects[o.name].tieredAchievs).forEach((e=>{o.amount>=Game.Tiers[Game.Objects[o.name].tieredAchievs[e].tier].achievUnlock&&$o(Game.Objects[o.name].tieredAchievs[e].name)}));const n=De;return Ro(),qo(),n!==De&&Ro(),Xe-Game.cookiesPs}(o,e),1!==e&&(Fe=1)})),t}function Ko(){Object.keys(Game.Objects).forEach((e=>{yt[e].price=Uo(Game.Objects[e],Game.Objects[e].basePrice,Game.Objects[e].amount,Game.Objects[e].free,1),bt[e].price=Uo(Game.Objects[e],Game.Objects[e].basePrice,Game.Objects[e].amount,Game.Objects[e].free,10),kt[e].price=Uo(Game.Objects[e],Game.Objects[e].basePrice,Game.Objects[e].amount,Game.Objects[e].free,100)}))}function Jo(){yt=Yo(1),bt=Yo(10),kt=Yo(100),Mt=[],Object.keys(Game.Upgrades).forEach((t=>{const o=function(e){if("toggle"===Game.Upgrades[e].pool||0===Game.Upgrades[e].bought&&Game.Upgrades[e].unlocked&&"prestige"!==Game.Upgrades[e].pool){To(),"Shimmering veil [on]"===eo[e].name?eo["Shimmering veil [off]"].bought=0:"Golden switch [on]"===eo[e].name?eo["Golden switch [off]"].bought=0:eo[e].bought=(eo[e].bought+1)%2,Game.CountsAsUpgradeOwned(Game.Upgrades[e].pool)&&(Ae+=1),"Elder Pledge"===e?(je+=1,je>0&&$o("Elder nap"),je>=5&&$o("Elder slumber")):"Elder Covenant"===e?$o("Elder calm"):"Prism heart biscuits"===e?$o("Lovely cookies"):"Heavenly key"===e&&$o("Wholesome");const t=De;Ro(),qo(),t!==De&&Ro();const o=function(){let e=0;ao("Thousand fingers")&&(e+=.1),ao("Million fingers")&&(e*=5),ao("Billion fingers")&&(e*=10),ao("Trillion fingers")&&(e*=20),ao("Quadrillion fingers")&&(e*=20),ao("Quintillion fingers")&&(e*=20),ao("Sextillion fingers")&&(e*=20),ao("Septillion fingers")&&(e*=20),ao("Octillion fingers")&&(e*=20),ao("Nonillion fingers")&&(e*=20);let t=0;Object.keys(Zt).forEach((e=>{t+=Zt[e].amount})),t-=Zt.Cursor.amount,e*=t,ao("Plastic mouse")&&(e+=.01*Xe),ao("Iron mouse")&&(e+=.01*Xe),ao("Titanium mouse")&&(e+=.01*Xe),ao("Adamantium mouse")&&(e+=.01*Xe),ao("Unobtainium mouse")&&(e+=.01*Xe),ao("Eludium mouse")&&(e+=.01*Xe),ao("Wishalloy mouse")&&(e+=.01*Xe),ao("Fantasteel mouse")&&(e+=.01*Xe),ao("Nevercrack mouse")&&(e+=.01*Xe),ao("Armythril mouse")&&(e+=.01*Xe),ao("Technobsidian mouse")&&(e+=.01*Xe),ao("Plasmarble mouse")&&(e+=.01*Xe),ao("Miraculite mouse")&&(e+=.01*Xe),ao("Fortune #104")&&(e+=.01*Xe);let o=1;if(ao("Santa's helpers")&&(o*=1.1),ao("Cookie egg")&&(o*=1.1),ao("Halo gloves")&&(o*=1.1),ao("Dragon claw")&&(o*=1.03),ao("Aura gloves")&&(o*=1+.05*Math.min(Game.Objects.Cursor.level,ao("Luminous gloves")?20:10)),o*=io("click"),Zt.Temple.minigameLoaded&&ro){const e=ro("labor");1===e?o*=1.15:2===e?o*=1.1:3===e&&(o*=1.05)}Object.keys(Game.buffs).forEach((e=>{void 0!==Game.buffs[e].multClick&&(o*=Game.buffs[e].multClick)})),o*=1+.05*oo("Dragon Cursor");let n=o*Game.ComputeCps(1,ao("Reinforced index finger")+ao("Carpal tunnel prevention cream")+ao("Ambidextrous"),e);return n=Game.runModHookOnValue("cookiesPerClick",n),Game.hasBuff("Cursed finger")&&(n=Game.buffs["Cursed finger"].power),n}()-Game.computedMouseCps;return o?[Xe-Game.cookiesPs,o]:[Xe-Game.cookiesPs]}return[]}(t);"Elder Pledge"===t?(Mt[t]={bonus:Game.cookiesPs-Me},1===e.CalcWrink?Mt[t].bonus-=Se:2===e.CalcWrink&&(Mt[t].bonus-=Be),Number.isFinite(Mt[t].bonus)||(Mt[t].bonus=0)):(Mt[t]={},o[0]&&(Mt[t].bonus=o[0]),o[1]&&(Mt[t].bonusMouse=o[1]))}))}function Zo(e,t,o){let n=0,i=0,a=0,r=0,l=1+Math.max(0,Math.ceil(Math.log(Game.cookies)/Math.LN10)-10);for(;a0?e/=t:e=0,Ft=Zo(7,e,ut),Nt=2*Ft[1]/ut,Ot=Ft[2]/60/60/6/pt,At=Zo(6,e,mt),Wt=2*At[1]/mt,Lt=At[2]/60/60/6/pt,Ht=Zo(7,7*e,ut),jt=2*Ht[1]/ut,Dt=Ht[2]/60/60/6/pt,Rt=Zo(6,7*e,mt),Ut=2*Rt[1]/mt,$t=Rt[2]/60/60/6/pt}function tn(){const e=Math.floor(Date.now()/1e3);if(Game.T/Game.fps%1==0){const t=Game.HowMuchPrestige(Game.cookiesReset),o=Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned))-Math.floor(t),n=e-Ne,i=Math.max(0,o-Oe)/n;for(let e=0;e{e.push(Game.Upgrades[t])})),e.sort((function(e,t){return e.order>t.order?1:e.order{const o=e[t];if(0===o.bought){let e="";e+=function(e){let t="crate upgrade missing";"prestige"===e.pool&&(t+=" heavenly");let o=0;Game.prefs.crates||(o=1),o&&(t+=" noFrame");let{icon:n}=e;e.iconFunction&&(n=e.iconFunction());const i=`function() {return Game.crateTooltip(Game.UpgradesById[${e.id}], 'stats');}`;return`
\n\t
`}(o),"prestige"===o.pool?Pt+=e:"cookie"===o.pool?Et+=e:"toggle"!==o.pool&&"unused"!==o.pool&&"debug"!==o.pool&&(Bt+=e)}}))}function nn(){if("christmas"===Game.season){let e=60*Game.cookiesPs;Game.hasBuff("Elder frenzy")&&(e*=.5),Game.hasBuff("Frenzy")&&(e*=.75),ft=Math.max(25,e),Game.Has("Ho ho ho-flavored frosting")&&(ft*=2)}}function an(){et=900*dt/.15,et*=pt;const e=Po();e>0?et/=e:et=0,tt=ut*(.15*et)+13,ot=mt*(.15*et)+13,nt=7*et,it=ut*(.15*nt)+13,at=mt*(.15*nt)+13,rt=2*et,lt=.15*rt,st=0;let t=0,o=0;Object.keys(Game.Objects).forEach((e=>{Game.Objects[e].amount>t&&(t=Game.Objects[e].amount),Game.Objects[e].amount>0&&(o+=1)})),Object.keys(Game.Objects).forEach((e=>{(Game.Objects[e].amountst&&(st=2*Game.Objects[e].price,ct=e)}))}function rn(){let e=1,t=1,o=1;ao("Green yeast digestives")&&(o*=1.01),ao("Dragon fang")&&(o*=1.03),e*=1+.1*Game.auraMult("Ancestral Metamorphosis"),e*=Game.eff("goldenCookieGain"),t*=1+.1*Game.auraMult("Unholy Dominion"),t*=Game.eff("wrathCookieGain"),ut=o*e,mt=o*t,pt=1,0===Game.shimmerTypes.golden.n&&(pt*=1+1.23*Game.auraMult("Dragon's Fortune"))}function ln(){Gt=0,vt=0,wt=[0,null];for(let e=0;ewt[0]&&(wt=[t,e]))}}function sn(){ko(),ln(),an(),rn(),en(),on(),nn(),ge=new Wo(J[J.length-1]),fe=new Wo(J[J.length-1]),Ce=new Wo(J[J.length-1]),ye=new Wo(J[J.length-1]),be=new Wo(Z[Z.length-1]),ke=new Wo(5),he=new Wo(20*Z[Z.length-1]),tn(),Lo(),Jo(),Ko(),Ho()}const cn={CPSMode:1,AvgCPSHist:3,AvgClicksHist:0,CalcWrink:0,Scale:2,ScaleDecimals:2,ScaleSeparator:0,ScaleCutoff:999999,TimeFormat:0,DetailedTime:1,PPDisplayTime:0,BuildColour:1,PPOnlyConsiderBuyable:0,PPExcludeTop:0,PPRigidelMode:0,PPSecondsLowerLimit:0,ColourBlue:"#4bb8f0",ColourGreen:"#00ff00",ColourYellow:"#ffff00",ColourOrange:"#ff7f00",ColourRed:"#ff0000",ColourPurple:"#ff00ff",ColourGray:"#b3b3b3",ColourPink:"#ff1493",ColourBrown:"#8b4513",BotBar:1,TimerBar:1,TimerBarPos:0,TimerBarOverlay:2,UpBarColour:1,UpgradeBarFixedPos:1,SortBuildings:0,SortUpgrades:0,DragonAuraInfo:1,GrimoireBar:1,GCTimer:1,Favicon:1,WrinklerButtons:1,HideSectionsButtons:0,TooltipBuildUpgrade:1,TooltipAmor:0,ToolWarnLucky:1,ToolWarnLuckyFrenzy:1,ToolWarnConjure:1,ToolWarnConjureFrenzy:1,ToolWarnEdifice:1,ToolWarnUser:0,ToolWarnBon:1,ToolWarnPos:1,TooltipGrim:1,TooltipWrink:1,TooltipLump:1,TooltipPlots:1,TooltipPantheon:1,TooltipAscendButton:1,Stats:1,MissingUpgrades:1,MissingAchievements:0,UpStats:1,HeavenlyChipsTarget:1,ShowMissedGC:1,Title:1,GeneralSound:1,GCNotification:0,GCFlash:1,ColourGCFlash:"#ffffff",GCSound:1,GCVolume:100,GCSoundURL:"https://freesound.org/data/previews/66/66717_931655-lq.mp3",FortuneNotification:0,FortuneFlash:1,ColourFortuneFlash:"#ffffff",FortuneSound:1,FortuneVolume:100,FortuneSoundURL:"https://freesound.org/data/previews/174/174027_3242494-lq.mp3",SeaNotification:0,SeaFlash:1,ColourSeaFlash:"#ffffff",SeaSound:1,SeaVolume:100,SeaSoundURL:"https://www.freesound.org/data/previews/121/121099_2193266-lq.mp3",GardFlash:1,ColourGardFlash:"#ffffff",GardSound:1,GardVolume:100,GardSoundURL:"https://freesound.org/data/previews/103/103046_861714-lq.mp3",MagicNotification:0,MagicFlash:1,ColourMagicFlash:"#ffffff",MagicSound:1,MagicVolume:100,MagicSoundURL:"https://freesound.org/data/previews/221/221683_1015240-lq.mp3",WrinklerNotification:0,WrinklerFlash:1,ColourWrinklerFlash:"#ffffff",WrinklerSound:1,WrinklerVolume:100,WrinklerSoundURL:"https://freesound.org/data/previews/124/124186_8043-lq.mp3",WrinklerMaxNotification:0,WrinklerMaxFlash:1,ColourWrinklerMaxFlash:"#ffffff",WrinklerMaxSound:1,WrinklerMaxVolume:100,WrinklerMaxSoundURL:"https://freesound.org/data/previews/152/152743_15663-lq.mp3",BulkBuyBlock:0,FavouriteSettings:1,Header:{Favourite:1,Calculation:1,Notation:1,Colours:1,BarsDisplay:1,Tooltip:1,Statistics:1,Notification:1,NotificationGeneral:1,NotificationGC:1,NotificationFC:1,NotificationSea:1,NotificationGard:1,NotificationMagi:1,NotificationWrink:1,NotificationWrinkMax:1,Miscellaneous:1,Lucky:1,Chain:1,Spells:1,Garden:1,Prestige:1,Wrink:1,Sea:1,Misc:1,InfoTab:1}},dn=function(e){if(1===e){const e=function(){try{Notification.requestPermission().then()}catch(e){return!1}return!0};"Notification"in window?e()?Notification.requestPermission().then():Notification.requestPermission():console.log("This browser does not support notifications.")}};function pn(){1===e.BotBar?(l("CMBotBar").style.display="",fo()):l("CMBotBar").style.display="none",yo()}function un(){BeautifyAll(),Game.RefreshStore(),Game.RebuildUpgrades(),fo(),co(),po()}function mn(){1===e.Favicon&&y>0?Vt.wrath?l("CMFavicon").href="https://aktanusa.github.io/CookieMonster/favicon/wrathCookie.ico":l("CMFavicon").href="https://aktanusa.github.io/CookieMonster/favicon/goldenCookie.ico":l("CMFavicon").href="https://orteil.dashnet.org/cookieclicker/favicon.ico"}class hn{constructor(e,t){this.type=e,this.group=t}}class gn extends hn{constructor(e,t,o){super(e,t),this.desc=o}}class fn extends hn{constructor(e,t,o,n,i,a){super(e,t),this.label=o,this.desc=n,this.min=i,this.max=a}}class Cn extends hn{constructor(e,t,o,n,i,a){super(e,t),this.label=o,this.desc=n,this.toggle=i,void 0!==a&&(this.func=a)}}class yn extends hn{constructor(e,t,o,n){super(e,t),this.label=o,this.desc=n;for(let e=0;e<101;e++)this.label[e]=`${e}%`}}const bn={CPSMode:new Cn("bool","Calculation",["Current cookies per second","Average cookies per second"],"Calculate times using current cookies per second or average cookies per second",!1),AvgCPSHist:new Cn("bool","Calculation",["Average CPS in past 10s","Average CPS in past 15s","Average CPS in past 30s","Average CPS in past 1m","Average CPS in past 5m","Average CPS in past 10m","Average CPS in past 15m","Average CPS in past 30m"],"How much time average Cookies Per Second should consider",!1),AvgClicksHist:new Cn("bool","Calculation",["Average clicks in past 1s","Average clicks in past 5s","Average clicks in past 10s","Average clicks in past 15s","Average clicks in past 30s"],"How much time average Cookie Clicks should consider",!1),CalcWrink:new Cn("bool","Calculation",["Calculate with wrinklers OFF","Calculate with wrinklers ON","Calculate with single fattest wrinkler ON"],"Calculate times and average Cookies Per Second with (only the single non-shiny fattest) wrinklers",!0,(function(){_e=!0})),Scale:new Cn("bool","Notation",["Game's setting scale","Metric","Short scale","Short scale (Abbreviated)","Scientific notation","Engineering notation"],"Change how long numbers are formatted",!1,(function(){un()})),ScaleDecimals:new Cn("bool","Notation",["1 decimals","2 decimals","3 decimals"],'Set the number of decimals used when applicable. This only works with Cookie Monster scales and not with "Game\'s Setting Scale"',!1,(function(){un()})),ScaleSeparator:new Cn("bool","Notation",[". for decimals (standard)",". for thousands"],"Set the separator used for decimals and thousands",!1,(function(){un()})),ScaleCutoff:new fn("numscale","Notation","Notation cut-off point: ","The number from which Cookie Monster will start formatting numbers based on chosen scale. Standard is 999,999. Setting this above 999,999,999 might break certain notations",1,999999999),TimeFormat:new Cn("bool","Notation",["Time XXd, XXh, XXm, XXs","Time XX:XX:XX:XX:XX"],"Change the time format",!1),DetailedTime:new Cn("bool","Notation",["Detailed time OFF","Detailed time ON"],"Change how time is displayed in certain statistics and tooltips",!0,(function(){1===e.DetailedTime?Game.sayTime=V:Game.sayTime=S.sayTime})),PPDisplayTime:new Cn("bool","Notation",["PP as value (standard)","PP as time unit"],"Display PP as calculated value or as approximate time unit. Note that PP does not translate directly into a time unit and this is therefore only an approximation.",!1),BuildColour:new Cn("bool","Colours",["Building colours OFF","Building colours ON"],"Colour code buildings",!0,(function(){co()})),PPOnlyConsiderBuyable:new Cn("bool","Colours",["Don't ignore non-buyable","Ignore non-buyable"],"Makes Cookie Monster label buildings and upgrades you can't buy right now red, useful in those situations where you just want to spend your full bank 'most optimally'",!0),PPExcludeTop:new Cn("bool","Colours",["Don't ignore any","Ignore 1st best","Ignore 1st and 2nd best","Ignore 1st, 2nd and 3rd best"],"Makes Cookie Monster ignore the 1st, 2nd or 3rd best buildings in labeling and colouring PP values",!0),PPRigidelMode:new Cn("bool","Colours",["Rigidel mode OFF","Rigidel mode ON"],'Makes Cookie Monster ignore all "buy 1" options when colouring PP in order to stay at a total building count ending in 10 for pantheon god Rigidel',!0),PPSecondsLowerLimit:new fn("numscale","Colours","Lower limit for PP (in seconds): ",'If a building or upgrade costs less than the specified seconds of CPS it will also be considered optimal and label it as such ("PP is less than xx seconds of CPS"); setting to 0 ignores this option',0,1/0),ColourBlue:new gn("colour","Colours","Standard colour is blue. Used to show upgrades better than best PP building, for Click Frenzy bar, and for various labels"),ColourGreen:new gn("colour","Colours","Standard colour is green. Used to show best PP building, for Blood Frenzy bar, and for various labels"),ColourYellow:new gn("colour","Colours","Standard colour is yellow. Used to show buildings within the top 10 of PP, for Frenzy bar, and for various labels"),ColourOrange:new gn("colour","Colours","Standard colour is orange. Used to show buildings within the top 20 of PP, for Next Reindeer bar, and for various labels"),ColourRed:new gn("colour","Colours","Standard colour is Red. Used to show buildings within the top 30 of PP, for Clot bar, and for various labels"),ColourPurple:new gn("colour","Colours","Standard colour is purple. Used to show buildings outside of the top 30 of PP, for Next Cookie bar, and for various labels"),ColourGray:new gn("colour","Colours","Standard colour is gray. Used to show negative or infinity PP, and for Next Cookie/Next Reindeer bar"),ColourPink:new gn("colour","Colours","Standard colour is pink. Used for Dragonflight bar"),ColourBrown:new gn("colour","Colours","Standard colour is brown. Used for Dragon Harvest bar"),BotBar:new Cn("bool","BarsDisplay",["Bottom bar OFF","Bottom bar ON"],"Building information",!0,(function(){pn()})),TimerBar:new Cn("bool","BarsDisplay",["Timer bar OFF","Timer bar ON"],"Bar with timers for golden cookie, season popup, Frenzy (Normal, Clot, Elder), Click Frenzy",!0,(function(){bo()})),TimerBarPos:new Cn("bool","BarsDisplay",["Timer bar position (top left)","Timer bar position (bottom)"],"Placement of the timer bar",!1,(function(){0===e.TimerBarPos?(l("CMTimerBar").style.width="30%",l("CMTimerBar").style.bottom="",l("game").insertBefore(l("CMTimerBar"),l("sectionLeft"))):(l("CMTimerBar").style.width="100%",l("CMTimerBar").style.bottom="0px",l("wrapper").appendChild(l("CMTimerBar"))),yo()})),TimerBarOverlay:new Cn("bool","BarsDisplay",["Timer bar overlay OFF","Timer bar overlay only seconds","Timer bar overlay full"],"Overlay on timers displaying seconds and/or percentage left",!0),UpBarColour:new Cn("bool","BarsDisplay",["Upgrade colours/bar OFF","Upgrade colours with bar ON","Upgrade colours without bar ON"],"Colour code upgrades and optionally add a counter bar",!1,(function(){1===e.UpBarColor?(l("CMUpgradeBar").style.display="",po()):2===e.UpBarColor?(l("CMUpgradeBar").style.display="none",po()):(l("CMUpgradeBar").style.display="none",Game.RebuildUpgrades())})),UpgradeBarFixedPos:new Cn("bool","BarsDisplay",["Upgrade bar fixed position OFF","Upgrade bar fixed position ON"],"Lock the upgrade bar at top of the screen to prevent it from moving ofscreen when scrolling",!0,(function(){1===e.UpgradeBarFixedPos?(l("CMUpgradeBar").style.position="sticky",l("CMUpgradeBar").style.top="0px"):l("CMUpgradeBar").style.position=""})),SortBuildings:new Cn("bool","BarsDisplay",["Sort buildings: default","Sort buildings: PP of x1 purchase","Sort buildings: PP of selected bulk mode"],"Sort the display of buildings in either default order or by PP",!1,(function(){co()})),SortUpgrades:new Cn("bool","BarsDisplay",["Sort upgrades: default","Sort upgrades: PP"],"Sort the display of upgrades in either default order or by PP",!1,(function(){po()})),DragonAuraInfo:new Cn("bool","BarsDisplay",["Extra dragon aura info OFF","Extra dragon aura info ON"],"Shows information about changes in CPS and costs in the dragon aura interface.",!0),GrimoireBar:new Cn("bool","BarsDisplay",["Grimoire magic meter timer OFF","Grimoire magic meter timer ON"],"A timer on how long before the Grimoire magic meter is full",!0),GCTimer:new Cn("bool","BarsDisplay",["Golden cookie timer OFF","Golden cookie timer ON"],"A timer on the golden cookie when it has been spawned",!0,(function(){1===e.GCTimer?Object.keys(se).forEach((e=>{se[e].style.display="block",se[e].style.left=Yt[e].l.style.left,se[e].style.top=Yt[e].l.style.top})):Object.keys(se).forEach((e=>se[e].style.display="none"))})),Favicon:new Cn("bool","BarsDisplay",["Favicon OFF","Favicon ON"],"Update favicon with golden/wrath cookie",!0,(function(){mn()})),WrinklerButtons:new Cn("bool","BarsDisplay",["Extra wrinkler buttons OFF","Extra wrinkler buttons ON"],"Show buttons for popping wrinklers at bottom of cookie section",!0,(function(){t()})),HideSectionsButtons:new Cn("bool","BarsDisplay",["Hide buildings/upgrades button OFF","Hide buildings/upgrades button ON"],"Show buttons for hiding and showing the buildings and upgrades sections in the right column",!0,(function(){e.HideSectionsButtons?l("CMSectionHidButtons").style.display="":l("CMSectionHidButtons").style.display="none"})),TooltipBuildUpgrade:new Cn("bool","Tooltip",["Building/upgrade tooltip information OFF","Building/upgrade tooltip information ON"],"Extra information in building/upgrade tooltips",!0),TooltipAmor:new Cn("bool","Tooltip",["Buildings tooltip amortization information OFF","Buildings tooltip amortization information ON"],"Add amortization information to buildings tooltip",!0),ToolWarnLucky:new Cn("bool","Tooltip",["Tooltip lucky warning OFF","Tooltip lucky warning ON"],'A warning when buying if it will put the bank under the amount needed for max "Lucky!" rewards',!0),ToolWarnLuckyFrenzy:new Cn("bool","Tooltip",["Tooltip lucky frenzy warning OFF","Tooltip lucky frenzy warning ON"],'A warning when buying if it will put the bank under the amount needed for max "Lucky!" (Frenzy) rewards',!0),ToolWarnConjure:new Cn("bool","Tooltip",["Tooltip conjure warning OFF","Tooltip conjure warning ON"],'A warning when buying if it will put the bank under the amount needed for max "Conjure Baked Goods" rewards',!0),ToolWarnConjureFrenzy:new Cn("bool","Tooltip",["Tooltip conjure frenzy warning OFF","Tooltip conjure frenzy warning ON"],'A warning when buying if it will put the bank under the amount needed for max "Conjure Baked Goods" rewards with Frenzy active',!0),ToolWarnEdifice:new Cn("bool","Tooltip",["Tooltip edifice warning OFF","Tooltip edifice warning ON"],'A warning when buying if it will put the bank under the amount needed for "Spontaneous Edifice" to possibly give you your most expensive building',!0),ToolWarnUser:new fn("numscale","Tooltip","Tooltip warning at x times CPS: ","Use this to show a customized warning if buying it will put the bank under the amount equal to value times cps; setting to 0 disables the function altogether",0,1/0),ToolWarnBon:new Cn("bool","Tooltip",["Calculate tooltip warning with bonus CPS OFF","Calculate tooltip warning with bonus CPS ON"],"Calculate the warning with or without the bonus CPS you get from buying",!0),ToolWarnPos:new Cn("bool","Tooltip",["Tooltip warning position (left)","Tooltip warning position (bottom)"],"Placement of the warning boxes",!1,(function(){Eo()})),TooltipGrim:new Cn("bool","Tooltip",["Grimoire tooltip information OFF","Grimoire tooltip information ON"],"Extra information in tooltip for grimoire",!0),TooltipWrink:new Cn("bool","Tooltip",["Wrinkler tooltip OFF","Wrinkler tooltip ON"],"Shows the amount of cookies a wrinkler will give when popping it",!0),TooltipLump:new Cn("bool","Tooltip",["Sugar lump tooltip OFF","Sugar lump tooltip ON"],"Shows the current Sugar Lump type in Sugar lump tooltip.",!0),TooltipPlots:new Cn("bool","Tooltip",["Garden plots tooltip OFF","Garden plots tooltip ON"],"Shows a tooltip for plants that have a cookie reward.",!0),TooltipPantheon:new Cn("bool","Tooltip",["Pantheon tooltip OFF","Pantheon tooltip ON"],"Shows additional info in the pantheon tooltip",!0),TooltipAscendButton:new Cn("bool","Tooltip",["Show Extra Info Ascend Tooltip OFF","Show Extra Info Ascend Tooltip ON"],"Shows additional info in the ascend tooltip",!0),Stats:new Cn("bool","Statistics",["Statistics OFF","Statistics ON"],"Extra Cookie Monster statistics!",!0),MissingUpgrades:new Cn("bool","Statistics",["Missing upgrades OFF","Missing upgrades ON"],"Shows missing upgrades in statistics menu",!0),MissingAchievements:new Cn("bool","Statistics",["Missing Achievements OFF","Missing Normal Achievements ON"],"Shows missing normal achievements in statistics menu.",!0),UpStats:new Cn("bool","Statistics",["Statistics update rate (default)","Statistics update rate (1s)"],"Default rate is once every 5 seconds",!1),HeavenlyChipsTarget:new fn("numscale","Statistics","Heavenly chips target: ",'Use this to set a heavenly chips target that will be counted towards in the "prestige" statsistics sections',1,1/0),ShowMissedGC:new Cn("bool","Statistics",["Missed GC OFF","Missed GC ON"],"Show a stat in the statistics screen that counts how many golden cookies you have missed",!0),Title:new Cn("bool","NotificationGeneral",["Title OFF","Title ON","Title pinned tab highlight"],'Update title with colden cookie/season popup timers; pinned tab highlight only changes the title when a golden cookie/season popup spawns; "!" means that golden cookie/reindeer can spawn',!0),GeneralSound:new Cn("bool","NotificationGeneral",["Consider game volume setting OFF","Consider game volume setting ON"],'Turning this toggle to "off" makes Cookie Monster no longer consider the volume setting of the base game, allowing mod notifications to play with base game volume turned down',!0),GCNotification:new Cn("bool","NotificationGC",["Notification OFF","Notification ON"],"Create a notification when golden cookie spawns",!0,(function(){dn(e.GCNotification)})),GCFlash:new Cn("bool","NotificationGC",["Flash OFF","Flash ON"],"Flash screen on golden cookie",!0),ColourGCFlash:new gn("colour","NotificationGC","The colour of the GC flash, standard colour is white"),GCSound:new Cn("bool","NotificationGC",["Sound OFF","Sound ON"],"Play a sound on golden cookie",!0),GCVolume:new yn("vol","NotificationGC",[],"Volume"),GCSoundURL:new Cn("url","NotificationGC","Sound URL:","URL of the sound to be played when a golden cookie spawns"),FortuneNotification:new Cn("bool","NotificationFC",["Notification OFF","Notification ON"],"Create a notification when fortune cookie is on the ticker",!0,(function(){dn(e.FortuneNotification)})),FortuneFlash:new Cn("bool","NotificationFC",["Flash OFF","Flash ON"],"Flash screen on fortune cookie spawn",!0),ColourFortuneFlash:new gn("colour","NotificationFC","The colour of the fortune flash, standard colour is white"),FortuneSound:new Cn("bool","NotificationFC",["Sound OFF","Sound ON"],"Play a sound on fortune cookie spawn",!0),FortuneVolume:new yn("vol","NotificationFC",[],"Volume"),FortuneSoundURL:new Cn("url","NotificationFC","Sound URL:","URL of the sound to be played when the ticker has a fortune cookie"),SeaNotification:new Cn("bool","NotificationSea",["Notification OFF","Notification ON"],"Create a notification on season popup",!0,(function(){dn(e.SeaNotification)})),SeaFlash:new Cn("bool","NotificationSea",["Flash OFF","Flash ON"],"Flash screen on season popup",!0),ColourSeaFlash:new gn("colour","NotificationSea","The colour of the season popup flash, standard colour is white"),SeaSound:new Cn("bool","NotificationSea",["Sound OFF","Sound ON"],"Play a sound on season popup",!0),SeaVolume:new yn("vol","NotificationSea",[],"Volume"),SeaSoundURL:new Cn("url","NotificationSea","Sound URL:","URL of the sound to be played when on season popup spawns"),GardFlash:new Cn("bool","NotificationGard",["Garden Tick Flash OFF","Flash ON"],"Flash screen on garden tick",!0),ColourGardFlash:new gn("colour","NotificationGard","The colour of the garden flash, standard colour is white"),GardSound:new Cn("bool","NotificationGard",["Sound OFF","Sound ON"],"Play a sound on garden tick",!0),GardVolume:new yn("vol","NotificationGard",[],"Volume"),GardSoundURL:new Cn("url","NotificationGard","Garden Tick Sound URL:","URL of the sound to be played when the garden ticks"),MagicNotification:new Cn("bool","NotificationMagi",["Notification OFF","Notification ON"],"Create a notification when magic reaches maximum",!0,(function(){dn(e.MagicNotification)})),MagicFlash:new Cn("bool","NotificationMagi",["Flash OFF","Flash ON"],"Flash screen when magic reaches maximum",!0),ColourMagicFlash:new gn("colour","NotificationMagi","The colour of the magic flash, standard colour is white"),MagicSound:new Cn("bool","NotificationMagi",["Sound OFF","Sound ON"],"Play a sound when magic reaches maximum",!0),MagicVolume:new yn("vol","NotificationMagi",[],"Volume"),MagicSoundURL:new Cn("url","NotificationMagi","Sound URL:","URL of the sound to be played when magic reaches maxium"),WrinklerNotification:new Cn("bool","NotificationWrink",["Notification OFF","Notification ON"],"Create a notification when a wrinkler appears",!0,(function(){dn(e.WrinklerNotification)})),WrinklerFlash:new Cn("bool","NotificationWrink",["Flash OFF","Flash ON"],"Flash screen when a wrinkler appears",!0),ColourWrinklerFlash:new gn("colour","NotificationWrink","The colour of the wrinkler flash, standard colour is white"),WrinklerSound:new Cn("bool","NotificationWrink",["Sound OFF","Sound ON"],"Play a sound when a wrinkler appears",!0),WrinklerVolume:new yn("vol","NotificationWrink",[],"Volume"),WrinklerSoundURL:new Cn("url","NotificationWrink","Sound URL:","URL of the sound to be played when a wrinkler appears"),WrinklerMaxNotification:new Cn("bool","NotificationWrinkMax",["Notification OFF","Notification ON"],"Create a notification when the maximum amount of wrinklers has appeared",!0,(function(){dn(e.WrinklerMaxNotification)})),WrinklerMaxFlash:new Cn("bool","NotificationWrinkMax",["Flash OFF","Flash ON"],"Flash screen when the maximum amount of Wrinklers has appeared",!0),ColourWrinklerMaxFlash:new gn("colour","NotificationWrinkMax","The colour of the maximum wrinkler flash, standard colour is white"),WrinklerMaxSound:new Cn("bool","NotificationWrinkMax",["Sound OFF","Sound ON"],"Play a sound when the maximum amount of wrinklers has appeared",!0),WrinklerMaxVolume:new yn("vol","NotificationWrinkMax",[],"Volume"),WrinklerMaxSoundURL:new Cn("url","NotificationWrinkMax","Sound URL:","URL of the sound to be played when the maximum amount of wrinklers has appeared"),BulkBuyBlock:new Cn("bool","Miscellaneous",["Block bulk buying OFF","Block bulk buying ON"],"Block clicking bulk buying when you can't buy all. This prevents buying 7 of a building when you are in buy-10 or buy-100 mode.",!0),FavouriteSettings:new Cn("bool","Miscellaneous",["Favourite settings section OFF","Favourite settings section ON","Favourite settings section ON (Locked)"],"Show stars before each setting which allows selecting it for a 'favourites' section at the top of the Cookie Monster settings. Setting this to Locked removes the stars but shows the 'favourites' section",!0,(function(){Game.UpdateMenu()}))};function kn(){return JSON.stringify({favouriteSettings:de,settings:e,version:"2.031.7"})}function Gn(){if(Je!==Game.dragonLevel||_e){if(Game.dragonLevel<25&&Game.dragonLevels[Game.dragonLevel].buy.toString().includes("sacrifice")){let e=Game.dragonLevels[Game.dragonLevel].buy.toString().match(/Objects\[(.*)\]/)[1];const t=Game.dragonLevels[Game.dragonLevel].buy.toString().match(/sacrifice\((.*?)\)/)[1];if("i"!==e)if(e=e.replaceAll("'",""),Game.Objects[e].amount{if(e=n,Game.Objects[e].amount{Zt[e]=wo(e)})),eo=[],Object.keys(Game.Upgrades).forEach((e=>{eo[e]=xo(e)})),to=[],Object.keys(Game.Achievements).forEach((e=>{to[e]=Go(e)})),To()}let xn=!1;function Tn(t,o,n){(1===e[o]||n)&&3===t&&!1===xn||1===t?(l("CMFlashScreen").style.backgroundColor=e[`Colour${o}`],l("CMFlashScreen").style.opacity="0.5",3===t?(l("CMFlashScreen").style.display="inline",setTimeout((function(){Tn(2,o,!0)}),1e3/Game.fps)):setTimeout((function(){Tn(0,o,!0)}),1e3/Game.fps)):2===t?(l("CMFlashScreen").style.opacity="1",setTimeout((function(){Tn(1,o,!0)}),1e3/Game.fps)):0===t&&(l("CMFlashScreen").style.display="none")}function Mn(t,o,n,i){if((1===e[o]||i)&&!1===xn){const o=new Audio(t);e.GeneralSound?o.volume=e[n]/100*(Game.volume/100):o.volume=e[n]/100,o.play()}}function Sn(t,o,n){1===e[t]&&"hidden"===document.visibilityState&&!1===xn&&new Notification(o,{body:n,badge:"https://orteil.dashnet.org/cookieclicker/favicon.ico"})}function Bn(){if(re!==Game.OnAscend&&(re=Game.OnAscend,Game.OnAscend?(l("game").style.bottom="0px",1===e.BotBar&&(l("CMBotBar").style.display="none"),1===e.TimerBar&&(l("CMTimerBar").style.display="none")):(pn(),bo()),Co()),!Game.OnAscend&&0===Game.AscendTimer){r!==Object.keys(Game.mods).length&&(wn(),sn(),r=Object.keys(Game.mods).length),_e&&(Jo(),Game.Has("Golden switch [off]")?(To(),eo["Golden switch [off]"].bought=0,Ro(),dt=Xe):dt=Game.cookiesPs,rn(),an(),on(),en(),Gn(),function(){for(let e=0;e<11;e+=1)for(let t=0;t<3;t+=1)Jt[e][t]=vn(e,t)}(),nn(),function(){let e=0;if(Game.Objects.Bank.minigameLoaded){const t=Game.Objects.Bank.minigame.goods;let o=0;Object.keys(t).forEach((e=>{const n=t[e];o+=n.stock*n.val})),e+=o*Game.cookiesPsRawHighest}e+=function(){let e=0;To();let t=2;5!==$e&&18!==$e||(t-=1),5!==Re&&18!==Re||(t-=1),$e=5,Re=18;for(let e=0;e{Zt[t].amount>0&&(e=t)})),Zt[e].amount-=1,Le-=1}return Object.keys(Zt).forEach((t=>{const o=Zt[t];e+=so(Game.Objects[o.name],Game.Objects[t].basePrice,o.amount,Game.Objects[t].free,o.amount)})),e}(),Kt=e}(),_e=0);const t=Game.auraMult("Fierce Hoarder")>0;!We&&t?(We=!0,Fe=1):We&&!t&&(We=!1,Fe=1),Fe&&(Ko(),Fe=0),function(){ln(),Ho(),function(){xt=0;let e=0;Object.keys(Game.wrinklers).forEach((t=>{2===Game.wrinklers[t].phase&&(e+=1)}));let t=1;if(Zt.Temple.minigameLoaded){const e=Game.hasGod("scorn");1===e?t*=1.15:2===e?t*=1.1:3===e&&(t*=1.05)}Tt=e,xt=e*(.05*e*1.1)*(.05*Game.Has("Sacrilegious corruption")+1)*(.05*Game.Has("Wrinklerspawn")+1)*t}(),Lo(),tn();const e=Game.HowManyCookiesReset(Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned))+1)-(Game.cookiesEarned+Game.cookiesReset);Qt=ue(e/uo())}(),G=0,Yt={},Object.keys(Game.shimmers).forEach((e=>{Yt[Game.shimmers[e].id]=Game.shimmers[e],Game.shimmers[e].spawnLead&&"golden"===Game.shimmers[e].type&&(Vt=Game.shimmers[e],G+=1)})),Object.keys(se).forEach((e=>{void 0===Yt[e]&&(se[e].parentNode.removeChild(se[e]),delete se[e])})),y!==Game.shimmerTypes.golden.n?(y=Game.shimmerTypes.golden.n,y&&(b{void 0===se[Game.shimmers[t].id]&&function(t){const o=document.createElement("div");o.id=`GCTimer${t.id}`,o.style.width="96px",o.style.height="96px",o.style.position="absolute",o.style.zIndex="10000000001",o.style.textAlign="center",o.style.lineHeight="96px",o.style.fontFamily='"Kavoon", Georgia, serif',o.style.fontSize="35px",o.style.cursor="pointer",o.style.display="block",0===e.GCTimer&&(o.style.display="none"),o.style.left=t.l.style.left,o.style.top=t.l.style.top,o.onclick=function(){t.pop()},o.onmouseover=function(){t.l.style.filter="brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))",t.l.style.webkitFilter="brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))"},o.onmouseout=function(){t.l.style.filter="",t.l.style.webkitFilter=""},se[t.id]=o,l("shimmers").appendChild(o)}(Game.shimmers[t])}))),mn(),b=G,0===G&&(Vt=0)):1===e.GCTimer&&y&&Object.keys(se).forEach((e=>{se[e].style.opacity=Yt[e].l.style.opacity,se[e].style.transform=Yt[e].l.style.transform,se[e].textContent=Math.ceil(Yt[e].life/Game.fps)})),f!==(Game.TickerEffect&&"fortune"===Game.TickerEffect.type)&&(f=Game.TickerEffect&&"fortune"===Game.TickerEffect.type,f&&(Tn(3,"FortuneFlash",!1),Mn(e.FortuneSoundURL,"FortuneSound","FortuneVolume",!1),Sn("FortuneNotification","Fortune Cookie found","A Fortune Cookie has appeared on the Ticker."))),g!==Game.shimmerTypes.reindeer.spawned&&(g=Game.shimmerTypes.reindeer.spawned,Object.keys(Game.shimmers).forEach((e=>{Game.shimmers[e].spawnLead&&"reindeer"===Game.shimmers[e].type&&(_t=Game.shimmers[e])})),Tn(3,"SeaFlash",!1),Mn(e.SeaSoundURL,"SeaSound","SeaVolume",!1),Sn("SeaNotification","Reindeer sighted!","A Reindeer has spawned. Click it now!")),Game.Objects.Farm.minigameLoaded&&C!==Game.Objects.Farm.minigame.nextStep&&(0!==C&&C0){let t=0;Object.keys(Game.wrinklers).forEach((e=>{2===Game.wrinklers[e].phase&&(t+=1)})),t>v?(v=t,t===Game.getWrinklersMax()&&e.WrinklerMaxFlash?Tn(3,"WrinklerMaxFlash",!1):Tn(3,"WrinklerFlash",!1),t===Game.getWrinklersMax()&&e.WrinklerMaxSound?Mn(e.WrinklerMaxSoundURL,"WrinklerMaxSound","WrinklerMaxVolume",!1):Mn(e.WrinklerSoundURL,"WrinklerSound","WrinklerVolume",!1),t===Game.getWrinklersMax()&&e.WrinklerMaxNotification?Sn("WrinklerMaxNotification","Maximum Wrinklers Reached","You have reached your maximum ammount of wrinklers"):Sn("WrinklerNotification","A Wrinkler appeared","A new wrinkler has appeared")):v=t}}()}}function Pn(){let t="";for(let o=0;o<$.length;o++)t+=`.CMText${$[o]} { color: ${e[`Colour${$[o]}`]}; }\n`;for(let o=0;o<$.length;o++)t+=`.CMBack${$[o]} { background-color: ${e[`Colour${$[o]}`]}; }\n`;for(let o=0;o<$.length;o++)t+=`.CMBorder${$[o]} { border: 1px solid ${e[`Colour${$[o]}`]}; }\n`;l("CMCSS").textContent=t,co()}function En(){const e=b64_to_utf8(unescape(localStorage.getItem("CookieClickerGame")).split("!END!")[0]),t=e.match(/CookieMonster.*(;|$)/);if(null!==t){const o=e.replace(t[0],`CookieMonster:${kn()}`);localStorage.setItem("CookieClickerGame",escape(`${utf8_to_b64(o)}!END!`))}}function Nn(t){if(void 0!==localStorage.CMConfig&&delete localStorage.CMConfig,void 0!==t){e=t,void 0!==e.Colors&&delete e.Colors,void 0!==e.Colours&&delete e.Colours;let o=!1;Object.keys(cn).forEach((t=>{void 0===e[t]?(o=!0,e[t]=cn[t]):"Header"===t&&Object.keys(cn.Header).forEach((n=>{void 0!==e[t][n]&&e[t][n]>-1&&e[t][n]<2||(o=!0,e[t][n]=cn[t][n])}))})),o&&En(),Bn(),Object.keys(cn).forEach((e=>{"Header"!==e&&void 0!==bn[e].func&&bn[e].func()}))}else Nn(cn);Game.UpdateMenu(),Pn()}function On(){Object.keys(Game.wrinklers).forEach((e=>{Game.wrinklers[e].sucked>0&&0===Game.wrinklers[e].type&&(Game.wrinklers[e].hp=0)}))}function Fn(t,o){if("b"===t){if(l("tooltip").innerHTML=Game.Objects[o].tooltip(),1===e.TooltipAmor){const e=Uo(Game.Objects[o],Game.Objects[o].basePrice,0,Game.Objects[o].free,Game.Objects[o].amount),t=e-Game.Objects[o].totalCookies;t>0&&(l("tooltip").innerHTML=l("tooltip").innerHTML.split("so far").join(`so far
${pe(t)} ${1===Math.floor(t)?"cookie":"cookies"} left to amortize (${me((e-Game.Objects[o].totalCookies)/(Game.Objects[o].storedTotalCps*Game.globalCpsMult)).text})`))}-1===Game.buyMode&&(l("tooltip").innerHTML=l("tooltip").innerHTML.split(pe(Game.Objects[o].bulkPrice)).join(pe((Game.Objects[o],Game.Objects[o].basePrice,Game.Objects[o].amount,Game.Objects[o].free,Game.buyBulk,1))))}else if("u"===t){if(!Game.UpgradesInStore[o])return"";l("tooltip").innerHTML=Game.crateTooltip(Game.UpgradesInStore[o],"store")}else"s"===t?l("tooltip").innerHTML=Game.lumpTooltip():"g"===t?l("tooltip").innerHTML=Game.Objects["Wizard tower"].minigame.spellTooltip(o)():"p"===t?l("tooltip").innerHTML=Game.ObjectsById[2].minigame.tileTooltip(o[0],o[1])():"ha"===t?l("tooltip").innerHTML=Game.ObjectsById[2].minigame.toolTooltip(1)():"wb"===t?l("tooltip").innerHTML="":"pag"===t?l("tooltip").innerHTML=Game.Objects.Temple.minigame.godTooltip(o)():"pas"===t&&(l("tooltip").innerHTML=Game.Objects.Temple.minigame.slotTooltip(o[0])());if("b"===t&&1===Game.buyMode||"u"===t||"s"===t||"g"===t||"p"===t&&!Game.keys[16]||"ha"===t||"wb"===t||"pag"===t||"pas"===t&&-1!==o[1]){const e=document.createElement("div");e.id="CMTooltipArea",l("tooltip").appendChild(e)}return ne=t,ie=o,No(),l("tooltip").innerHTML}function Wn(){Game.Objects["Wizard tower"].minigameLoaded&&Object.keys(Game.Objects["Wizard tower"].minigame.spellsById).forEach((e=>{null!==l(`grimoireSpell${e}`).onmouseover&&(T[e]=l(`grimoireSpell${e}`).onmouseover,l(`grimoireSpell${e}`).onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Fn("g",`${e}`)}),"this"),Game.tooltip.wobble()})}))}function Ln(){if(!m&&Game.Objects["Wizard tower"].minigameLoaded){const{minigame:t}=Game.Objects["Wizard tower"];p=t.draw,Game.Objects["Wizard tower"].minigame.draw=function(){p(),1===e.GrimoireBar&&t.magic1&&(e.Header[t]=0),En()}function Rn(t,o){const n=document.createElement("div");n.className="title",n.style.padding="0px 16px",n.style.opacity="0.7",n.style.fontSize="17px",n.style.fontFamily='"Kavoon", Georgia, serif',n.appendChild(document.createTextNode(`${t} `));const i=document.createElement("span");return i.style.cursor="pointer",i.style.display="inline-block",i.style.height="14px",i.style.width="14px",i.style.borderRadius="7px",i.style.textAlign="center",i.style.backgroundColor="#C0C0C0",i.style.color="black",i.style.fontSize="13px",i.style.verticalAlign="middle",i.textContent=e.Header[o]?"-":"+",i.onclick=function(){$n(o),Game.UpdateMenu()},n.appendChild(i),n}function In(e,t,o,n){const i=document.createElement("div");i.className="listing";const a=document.createElement("b");if(a.textContent=t,i.appendChild(a),"withTooltip"===e){i.className="listing",i.appendChild(document.createTextNode(" "));const e=document.createElement("span");e.onmouseout=function(){Game.tooltip.hide()},e.onmouseover=function(){Game.tooltip.draw(this,escape(I[n].innerHTML))},e.style.cursor="default",e.style.display="inline-block",e.style.height="10px",e.style.width="10px",e.style.borderRadius="5px",e.style.textAlign="center",e.style.backgroundColor="#C0C0C0",e.style.color="black",e.style.fontSize="9px",e.style.verticalAlign="bottom",e.textContent="?",i.appendChild(e)}return i.appendChild(document.createTextNode(": ")),i.appendChild(o),i}function zn(e){const t=document.createDocumentFragment();t.appendChild(document.createTextNode(`${e.length} `));const o=document.createElement("span");o.onmouseout=function(){Game.tooltip.hide()};const n=document.createElement("div"),i=document.createElement("div");i.style.minWidth="140px",i.style.marginBottom="4px";const a=document.createElement("div");return a.className="name",a.style.marginBottom="4px",a.style.textAlign="center",a.textContent="Missing",i.appendChild(a),Object.keys(e).forEach((t=>{const o=document.createElement("div");o.style.textAlign="center",o.appendChild(document.createTextNode(e[t])),i.appendChild(o)})),n.appendChild(i),o.onmouseover=function(){Game.tooltip.draw(this,escape(n.innerHTML))},o.style.cursor="default",o.style.display="inline-block",o.style.height="10px",o.style.width="10px",o.style.borderRadius="5px",o.style.textAlign="center",o.style.backgroundColor="#C0C0C0",o.style.color="black",o.style.fontSize="9px",o.style.verticalAlign="bottom",o.textContent="?",t.appendChild(o),t}function Vn(t){const o=document.createElement("div");if(o.className="subsection",o.appendChild(t),o.appendChild(Rn("Lucky Cookies","Lucky")),e.Header.Lucky&&o.appendChild(function(){const e=Game.auraMult("Dragon's Fortune")?"GoldCookDragonsFortuneTooltipPlaceholder":"GoldCookTooltipPlaceholder",t=document.createElement("div");t.className="CMStatsLuckySection";const o=Game.cookies+mo(){Game.HasUnlocked(Qo[e])||c.push(Qo[e])})),0!==c.length&&e.appendChild(In("basic","Rare plant drops left to unlock",zn(c))),e}())),o.appendChild(Rn("Prestige","Prestige")),e.Header.Prestige&&o.appendChild(function(){const t=document.createElement("div");t.className="CMStatsPrestigeSection";const o=Math.floor(Game.HowMuchPrestige(It+Game.cookiesReset+Gt+(Game.HasUnlocked("Chocolate egg")&&!Game.Has("Chocolate egg")?Ct:0)));t.appendChild(In("withTooltip","Prestige level (cur / max)",document.createTextNode(`${pe(Game.prestige)} / ${pe(o)}`),"PrestMaxTooltipPlaceholder"));const n=Math.max(0,Game.HowManyCookiesReset(o+1)-(It+Game.cookiesReset+Gt+(Game.HasUnlocked("Chocolate egg")&&!Game.Has("Chocolate egg")&&Ct?Ct:0))),i=document.createDocumentFragment();i.appendChild(document.createTextNode(pe(n)));const a=document.createElement("small");a.textContent=` (${ue(n/zt,1)})`,i.appendChild(a),t.appendChild(In("withTooltip","Cookies to next level",i,"NextPrestTooltipPlaceholder")),t.appendChild(In("withTooltip","Heavenly chips (cur / max)",document.createTextNode(`${pe(Game.heavenlyChips)} / ${pe(o-Game.prestige+Game.heavenlyChips)}`),"HeavenChipMaxTooltipPlaceholder")),t.appendChild(In("basic","Heavenly chips per second (last 5 seconds)",document.createTextNode(pe(ht,2))));const r=Number(e.HeavenlyChipsTarget);if(!Number.isNaN(r)){const e=r-Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned));e>0&&(t.appendChild(In("basic","Heavenly chips to target set in settings (cur)",document.createTextNode(pe(e)))),t.appendChild(In("basic","Time till target (cur, current 5 second average)",document.createTextNode(ue(e/ht)))))}const l=function(e){let t=Game.cookiesPs;To(),0===eo["Heavenly key"].bought&&(eo["Heavenly chip secret"].bought=1,eo["Heavenly cookie stand"].bought=1,eo["Heavenly bakery"].bought=1,eo["Heavenly confectionery"].bought=1,eo["Heavenly key"].bought=1,Ro(),t=Xe,To()),It>=1e6&&$o("Sacrifice"),It>=1e9&&$o("Oblivion"),It>=1e12&&$o("From scratch"),It>=1e15&&$o("Nihilism"),It>=1e18&&$o("Dematerialize"),It>=1e21&&$o("Nil zero zilch"),It>=1e24&&$o("Transcendence"),It>=1e27&&$o("Obliterate"),It>=1e30&&$o("Negative void"),It>=1e33&&$o("To crumbs, you say?"),It>=1e36&&$o("You get nothing"),It>=1e39&&$o("Humble rebeginnings"),It>=1e42&&$o("The end of the world"),It>=1e45&&$o("Oh, you're back"),It>=1e48&&$o("Lazarus"),It>=1e51&&$o("Smurf account"),It>=1e54&&$o("If at first you don't succeed"),eo["Heavenly chip secret"].bought=1,eo["Heavenly cookie stand"].bought=1,eo["Heavenly bakery"].bought=1,eo["Heavenly confectionery"].bought=1,eo["Heavenly key"].bought=1,Ue=e;const o=De;Ro(),qo(),o!==De&&Ro();const n=Xe-t;return Ue=Game.prestige,n}(o),s=document.createDocumentFragment();s.appendChild(document.createTextNode(pe(l)));const c=Math.round(l/Game.cookiesPs*1e4);if(Number.isFinite(c)&&0!==c){const e=document.createElement("small");e.textContent=` (${c/100}% of income)`,s.appendChild(e)}t.appendChild(In("withTooltip","Reset bonus income",s,"ResetTooltipPlaceholder"));const d=Math.floor(Game.HowMuchPrestige(Game.cookiesReset)),p=Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned)),u=p-d;if(!Game.Has("Lucky digit")){let e=7-p%10;e<0&&(e+=10);const o=u+e,n=p+e,i=document.createDocumentFragment();i.appendChild(document.createTextNode(`${n.toLocaleString()} / ${o.toLocaleString()} (+${e})`)),t.appendChild(In("basic",'Next "Lucky Digit" (total / reset)',i))}if(!Game.Has("Lucky number")){let e=777-p%1e3;e<0&&(e+=1e3);const o=u+e,n=p+e,i=document.createDocumentFragment();i.appendChild(document.createTextNode(`${n.toLocaleString()} / ${o.toLocaleString()} (+${e})`)),t.appendChild(In("basic",'Next "Lucky Number" (total / reset)',i))}if(!Game.Has("Lucky payout")){let e=777777-p%1e6;e<0&&(e+=1e6);const o=u+e,n=p+e,i=document.createDocumentFragment();i.appendChild(document.createTextNode(`${n.toLocaleString()} / ${o.toLocaleString()} (+${e})`)),t.appendChild(In("basic",'Next "Lucky Payout" (total / reset)',i))}return t}()),Game.cpsSucked>0&&(o.appendChild(Rn("Wrinklers","Wrink")),e.Header.Wrink)){const e=document.createDocumentFragment();e.appendChild(document.createTextNode(`${pe(Gt)} / ${pe(vt)} `));const t=document.createElement("a");t.textContent="Pop All Normal",t.className="option",t.onclick=function(){On()},e.appendChild(t),o.appendChild(In("basic","Rewards of Popping (All/Normal)",e));const n=document.createDocumentFragment();n.appendChild(document.createTextNode(`${pe(wt[0])} `));const i=document.createElement("a");i.textContent="Pop Single Fattest",i.className="option",i.onclick=function(){null!==wt[1]&&(Game.wrinklers[wt[1]].hp=0)},n.appendChild(i),o.appendChild(In("basic",`Rewards of Popping Single Fattest Non-Shiny Wrinkler (id: ${null!==wt[1]?wt[1]:"None"})`,n))}if(o.appendChild(function(){const t=document.createElement("div");t.className="CMStatsSeasonSection";let o=!1;const n=[];Object.keys(zo).forEach((e=>{Game.Has(zo[e])||(n.push(zo[e]),o=!0)}));const i=[];Object.keys(Vo).forEach((e=>{Game.Has(Vo[e])||(i.push(Vo[e]),o=!0)}));const a=[];Object.keys(_o).forEach((e=>{Game.Has(_o[e])||(a.push(_o[e]),o=!0)}));const r=[];Object.keys(Game.eggDrops).forEach((e=>{Game.HasUnlocked(Game.eggDrops[e])||(r.push(Game.eggDrops[e]),o=!0)}));const l=[];Object.keys(Game.rareEggDrops).forEach((e=>{Game.HasUnlocked(Game.rareEggDrops[e])||(l.push(Game.rareEggDrops[e]),o=!0)}));const s=Game.HasUnlocked("Chocolate egg")&&!Game.Has("Chocolate egg"),c=Game.Has("Century egg");if(("christmas"===Game.season||o||s||c)&&(t.appendChild(Rn("Season Specials","Sea")),e.Header.Sea)){if(0!==n.length){t.appendChild(In("basic","Halloween cookies left to buy",zn(n)));let e=.95;if(Game.HasAchiev("Spooky cookies")&&(e=.8),Game.Has("Starterror")&&(e*=.9),e*=1/Game.dropRateMult(),Game.hasGod){const t=Game.hasGod("seasons");1===t?e*=.9:2===t?e*=.95:3===t&&(e*=.97)}const o=n.length/7;t.appendChild(In("basic","Chance of receiving a cookie from wrinkler/shiny wrinkler",document.createTextNode(`${pe((1-e)*o*100)}% / ${pe((1-.9*e)*o*100)}%`)))}if(0!==i.length){t.appendChild(In("basic","Christmas cookies left to buy",zn(i)));let e=.8;if(Game.HasAchiev("Let it snow")&&(e=.6),e*=1/Game.dropRateMult(),Game.Has("Starsnow")&&(e*=.95),Game.hasGod){const t=Game.hasGod("seasons");1===t?e*=.9:2===t?e*=.95:3===t&&(e*=.97)}const o=i.length/7;t.appendChild(In("basic","Chance of receiving a cookie from reindeer",document.createTextNode(`${pe((1-e)*o*100)}%`)))}0!==a.length&&t.appendChild(In("basic","Valentine cookies left to buy",zn(a)));const e=function(e){let t=e*(1/Game.dropRateMult());if(Game.HasAchiev("Hide & seek champion")&&(t*=.7),Game.Has("Omelette")&&(t*=.9),Game.Has("Starspawn")&&(t*=.9),Game.hasGod){const e=Game.hasGod("seasons");1===e?t*=.9:2===e?t*=.95:3===e&&(t*=.97)}const o=1-t,n=Game.eggDrops.length-r.length,i=Game.rareEggDrops.length-l.length,a=.9*o*(1-n/Game.eggDrops.length),s=.1*o*(1-i/Game.rareEggDrops.length),c=.9*o*(n/Game.eggDrops.length)+.1*o*(i/Game.rareEggDrops.length);return[a+.9*c*(1-n/Game.eggDrops.length),s+.1*c*(1-i/Game.rareEggDrops.length)]};0!==r.length&&(t.appendChild(In("basic","Normal easter eggs left to unlock",zn(r))),t.appendChild(In("basic","Chance of receiving an egg from wrinkler/golden cookie",document.createTextNode(`${pe(100*e(.98)[0])}% / ${pe(100*e(.9)[0])}%`)))),0!==l.length&&(t.appendChild(In("basic","Rare easter eggs left to unlock",zn(l))),t.appendChild(In("basic","Chance of receiving a rare egg from wrinkler/golden cookie",document.createTextNode(`${pe(100*e(.98)[1])}% / ${pe(100*e(.9)[1])}%`)))),"christmas"===Game.season&&t.appendChild(In("basic","Reindeer reward",document.createTextNode(pe(ft)))),s&&t.appendChild(In("withTooltip","Chocolate egg cookies",document.createTextNode(pe(Ct)),"ChoEggTooltipPlaceholder")),c&&t.appendChild(In("basic","Century egg multiplier",document.createTextNode(Math.round(1e4*(gt-1))/100+"%")))}return t}()),o.appendChild(Rn("Miscellaneous","Misc")),e.Header.Misc){if(o.appendChild(In("basic",`Average cookies per second (past ${J[e.AvgCPSHist]<60?`${J[e.AvgCPSHist]} seconds`:J[e.AvgCPSHist]/60+(3===e.AvgCPSHist?" minute":" minutes")})`,document.createTextNode(pe(uo(),3)))),o.appendChild(In("basic",`Average cookie clicks per second (past ${Z[e.AvgClicksHist]}${0===e.AvgClicksHist?" second":" seconds"})`,document.createTextNode(pe(St,1)))),o.appendChild(In("basic",`Cookies from clicking (past ${Z[e.AvgClicksHist]}${0===e.AvgClicksHist?" second":" seconds"})`,document.createTextNode(pe(he.calcSum(St*Z[e.AvgClicksHist]))))),Game.Has("Fortune cookies")){const e=[];Object.keys(Io).forEach((t=>{Game.Has(Io[t])||e.push(Io[t])})),0!==e.length&&o.appendChild(In("basic","Fortune Upgrades Left to Buy",zn(e)))}if(e.ShowMissedGC&&o.appendChild(In("basic","Missed golden cookies",document.createTextNode(pe(Game.missedGoldenClicks)))),Game.prefs.autosave){const e=document.createElement("span");e.id="CMStatsAutosaveTimer",e.innerText=Game.sayTime(60*Game.fps-(Game.OnAscend?0:Game.T%(60*Game.fps)),4),o.appendChild(In("basic","Time till autosave",e))}}l("menu").insertBefore(o,l("menu").childNodes[2]),e.MissingUpgrades&&l("menu").childNodes.forEach((e=>{if(e.children[0])if("Prestige"===e.children[0].innerHTML&&Pt){const t=Pt.match(new RegExp("div","g")||0).length/2,o=document.createElement("div");o.id="CMMissingUpgradesPrestigeTitle",o.className="listing";const n=document.createElement("div");n.innerHTML=`Missing Prestige upgrades: ${t}/${Game.PrestigeUpgrades.length} (${Math.floor(t/Game.PrestigeUpgrades.length*100)}%)`,o.appendChild(n),e.appendChild(o);const i=document.createElement("div");i.className="listing crateBox",i.innerHTML=Pt,e.appendChild(i)}else if("Upgrades"===e.children[0].innerHTML){if(Bt){const t=Bt.match(new RegExp("div","g")||0).length/2,o=document.createElement("div");o.id="CMMissingUpgradesTitle",o.className="listing";const n=document.createElement("div");n.innerHTML=`Missing normal upgrades: ${t}/${Game.UpgradesByPool[""].length+Game.UpgradesByPool.tech.length} (${Math.floor(t/(Game.UpgradesByPool[""].length+Game.UpgradesByPool.tech.length)*100)}%)`,o.appendChild(n),e.insertBefore(o,e.childNodes[3]);const i=document.createElement("div");i.className="listing crateBox",i.innerHTML=Bt,e.insertBefore(i,document.getElementById("CMMissingUpgradesTitle").nextSibling)}if(Et){const t=Et.match(new RegExp("div","g")||0).length/2,o=document.createElement("div");o.id="CMMissingUpgradesCookiesTitle",o.className="listing";const n=document.createElement("div");n.innerHTML=`Missing Cookie upgrades: ${t}/${Game.UpgradesByPool.cookie.length} (${Math.floor(t/Game.UpgradesByPool.cookie.length*100)}%)`,o.appendChild(n),e.appendChild(o);const i=document.createElement("div");i.className="listing crateBox",i.innerHTML=Et,e.appendChild(i)}}})),e.MissingAchievements&&function(){let t;Object.values(document.querySelectorAll("div.title")).forEach((e=>{e.textContent.includes("Achievements")&&(t=e.parentElement.querySelectorAll("div.listing.crateBox")[0])})),e.MissingAchievements&&Object.values(t.children).forEach((e=>{if(!e.className.includes("enabled")){const t=e.onclick.toString().split(/\[(.*)\]/gi)[1],{icon:o}=Game.AchievementsById[t];e.style.backgroundPosition=`${48*-o[0]}px ${48*-o[1]}px`,e.onmouseover=function(){Game.mouseDown||(Game.setOnCrate(this),Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return function(e){const t=[];"shadow"===e.pool?t.push("Shadow Achievement","#9700cf"):t.push("Achievement",0),t.push("Locked",0);let o=0;(Game.Has("Neuromancy")||Game.sesame&&"debug"===e.pool)&&(o=1),o&&0===e.won?t.push("Click to win!","#00c462"):o&&e.won>0&&t.push("Click to lose!","#00c462");let{icon:n}=e;e.iconFunction&&(n=e.iconFunction());let{desc:i}=e;e.descFunc&&(i=e.descFunc("stats"));let a="";for(let e=0;e[${t[e]}]`);return a=a.substring(1),`
\n
\n
${e.name}
\n ${a}
${i}
\n ${Game.sesame?`
Id : ${e.id} | Order : ${Math.floor(e.order)}${e.tier?` | Tier : ${e.tier}`:""}
`:""}`}(Game.AchievementsById[t])}),"top"),Game.tooltip.wobble())}}}))}()}const _n={Favourite:"Favourite Settings",Calculation:"Calculation",Notation:"Notation",Colours:"Colours and colour coding",BarsDisplay:"Infobars and visual settings",Tooltip:"Tooltips",Statistics:"Statistics",Notification:"Notifications",Miscellaneous:"Miscellaneous"},Qn={NotificationGeneral:"General Notifications",NotificationGC:"Golden Cookie",NotificationFC:"Fortune Cookie",NotificationSea:"Season Special",NotificationGard:"Garden Tick",NotificationMagi:"Full Magic Bar",NotificationWrink:"Wrinkler",NotificationWrinkMax:"Maximum Wrinklers"};function Xn(t,o){const n=document.createElement("div");n.className="title",n.style.opacity="0.7",n.style.fontSize="17px",n.appendChild(document.createTextNode(`${o} `));const i=document.createElement("span");return i.style.cursor="pointer",i.style.display="inline-block",i.style.height="14px",i.style.width="14px",i.style.borderRadius="7px",i.style.textAlign="center",i.style.backgroundColor="#C0C0C0",i.style.color="black",i.style.fontSize="13px",i.style.verticalAlign="middle",i.textContent=e.Header[t]?"-":"+",i.onclick=function(){$n(t),Game.UpdateMenu()},n.appendChild(i),n}function qn(t){const o=document.createElement("div");if(o.className="listing",1===e.FavouriteSettings&&o.appendChild(function(e){const t=document.createElement("a");return de.includes(e)?(t.innerText="★",t.style.color="yellow"):t.innerText="☆",t.className="option",t.onclick=function(){!function(e){de.includes(e)?de=de.filter((function(t){return t!==e})):de.push(e)}(e),En(),Game.UpdateMenu()},t.onmouseover=function(){Game.tooltip.draw(this,escape(I.FavouriteSettingPlaceholder.innerHTML))},t.onmouseout=function(){Game.tooltip.hide()},t.appendChild(document.createTextNode(" ")),t}(t)),"bool"===bn[t].type){const n=document.createElement("a");bn[t].toggle&&0===e[t]?n.className="option off":n.className="option",n.id=Hn+t,n.onclick=function(){!function(t){e[t]+=1,e[t]===bn[t].label.length?(e[t]=0,bn[t].toggle&&(l(Hn+t).className="option off")):l(Hn+t).className="option",void 0!==bn[t].func&&bn[t].func(),l(Hn+t).innerHTML=bn[t].label[e[t]],En()}(t)},n.textContent=bn[t].label[e[t]],o.appendChild(n);const i=document.createElement("label");return i.textContent=bn[t].desc,i.style.lineHeight="1.6",o.appendChild(i),o}if("vol"===bn[t].type){const n=document.createElement("div");n.className="sliderBox";const i=document.createElement("div");i.style.float="left",i.innerHTML=bn[t].desc,n.appendChild(i);const a=document.createElement("div");a.id=`slider${t}right`,a.style.float="right",a.innerHTML=`${e[t]}%`,n.appendChild(a);const r=document.createElement("input");r.className="slider",r.id=`slider${t}`,r.style.clear="both",r.type="range",r.min="0",r.max="100",r.step="1",r.value=e[t],r.oninput=function(){Un(t)},r.onchange=function(){Un(t)},n.appendChild(r),o.appendChild(n);const l=document.createElement("a");return l.className="option",l.onclick=function(){Mn(e[t.replace("Volume","SoundURL")],t.replace("Volume","Sound"),t,!0)},l.textContent="Test sound",o.appendChild(l),o}if("url"===bn[t].type){const n=document.createElement("span");n.className="option",n.textContent=`${bn[t].label} `,n.style.lineHeight="1.6",o.appendChild(n);const i=document.createElement("input");i.id=Hn+t,i.className="option",i.type="text",i.readOnly=!0,i.setAttribute("value",e[t]),i.style.width="300px",o.appendChild(i),o.appendChild(document.createTextNode(" "));const a=document.createElement("input");a.id=`${Hn+t}Prompt`,a.className="option",a.type="text",a.setAttribute("value",e[t]);const r=document.createElement("a");r.className="option",r.onclick=function(){!function(e,t){Game.promptWrapL.className="framed";const o=e;Game.promptL.innerHTML=`${o}
`,Object.keys(t).forEach((e=>{const o=document.createElement("a");o.id=`promptOption${e}`,o.className="option",o.onclick=function(){PlaySound("snd/tick.mp3"),t[e][1]()},o.textContent=t[e][0],Game.promptL.children[1].appendChild(o)})),Game.promptAnchorL.style.display="block",Game.darkenL.style.display="block",Game.promptL.focus(),Game.promptOn=1,Game.UpdatePrompt()}(a.outerHTML,[["Save",function(){e[t]=l(`CMConfig${t}Prompt`).value,En(),Game.ClosePrompt(),Game.UpdateMenu()}],["Cancel",function(){Game.ClosePrompt()}]])},r.textContent="Edit",o.appendChild(r);const s=document.createElement("label");return s.textContent=bn[t].desc,s.style.lineHeight="1.6",o.appendChild(s),o}if("colour"===bn[t].type){const n=document.createElement("span");n.className="option";const i=document.createElement("input");i.id=t,i.style.width="65px",i.setAttribute("value",e[t]),n.appendChild(i),new jn(i,{hash:!0,position:"right",onInput:function(){e[this.targetElement.id]=this.toHEXString(),Pn(),En(),Game.UpdateMenu()}});const a=document.createElement("label");if(a.textContent=bn[t].desc,a.style.lineHeight="1.6",n.appendChild(a),t.includes("Flash")){const e=document.createElement("a");e.className="option",e.onclick=function(){Tn(3,t.replace("Colour",""),!0)},e.textContent="Test flash",n.appendChild(e)}return o.appendChild(n),Dn().init(),o}if("numscale"===bn[t].type){const n=document.createElement("span");n.className="option",n.textContent=`${bn[t].label} `,n.style.lineHeight="1.6",o.appendChild(n);const i=document.createElement("input");i.id=Hn+t,i.className="option",i.type="number",i.value=e[t],i.min=bn[t].min,i.max=bn[t].max,i.oninput=function(){e[t]=this.value,En(),un()},o.appendChild(i),o.appendChild(document.createTextNode(" "));const a=document.createElement("label");return a.textContent=bn[t].desc,a.style.lineHeight="1.6",o.appendChild(a),o}return o}function Yn(t){if(1===e.TimerBar&&0===e.TimerBarPos){const e=parseInt(l("CMTimerBar").style.height,10);Game.mouseY-=e,t(),Game.mouseY+=e}else t()}function Kn(){S.Beautify=Beautify,Beautify=pe,S.CalculateGains=Game.CalculateGains,Game.CalculateGains=function(){S.CalculateGains(),_e=1,B=Date.now(),P=Date.now()},S.tooltip={},S.tooltip.draw=Game.tooltip.draw,S.tooltip.drawMod=new Function(`return ${Game.tooltip.draw.toString().split("this").join("Game.tooltip")}`)(),Game.tooltip.draw=function(e,t,o){S.tooltip.drawMod(e,t,o)},S.tooltip.update=Game.tooltip.update,S.tooltip.updateMod=new Function(`return ${Game.tooltip.update.toString().split("this.").join("Game.tooltip.")}`)(),Game.tooltip.update=function(){S.tooltip.updateMod(),function(){if("store"===Game.tooltip.origin){let t=0;1===e.ToolWarnLucky&&1===e.ToolWarnPos&&null!==l("CMDispTooltipWarningParent")&&(t=l("CMDispTooltipWarningParent").clientHeight-4),Game.tooltip.tta.style.top=`${Math.min(parseInt(Game.tooltip.tta.style.top,10),l("game").clientHeight+l("topBar").clientHeight-Game.tooltip.tt.clientHeight-t-46)}px`}}()},S.UpdateWrinklers=Game.UpdateWrinklers,Game.UpdateWrinklers=function(){Yn(S.UpdateWrinklers)},S.UpdateSpecial=Game.UpdateSpecial,Game.UpdateSpecial=function(){Yn(S.UpdateSpecial)},l("bigCookie").removeEventListener("click",Game.ClickCookie,!1),l("bigCookie").addEventListener("click",(function(){Yn(Game.ClickCookie)}),!1),S.RebuildUpgrades=Game.RebuildUpgrades,Game.RebuildUpgrades=function(){S.RebuildUpgrades(),M=[],Object.keys(Game.UpgradesInStore).forEach((e=>{null!==l(`upgrade${e}`).onmouseover&&(M[e]=l(`upgrade${e}`).onmouseover,l(`upgrade${e}`).onmouseover=function(){Game.mouseDown||(Game.setOnCrate(this),Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Fn("u",`${e}`)}),"store"),Game.tooltip.wobble())})})),Game.CalculateGains()},S.ClickProduct=Game.ClickProduct,Game.ClickProduct=function(t){(!e.BulkBuyBlock||Game.ObjectsById[t].bulkPrice-1;--e)if(Game.ObjectsById[e].amount>0){const o=Zt[Game.ObjectsById[e].name].name;Zt[o].amount-=1,Le-=1,t=Zt[o].basePrice*Game.priceIncrease**Math.max(0,Zt[o].amount-1-Zt[o].free),t=Game.modifyBuildingPrice(Zt[o],t),t=Math.ceil(t);break}const o=De;return Ro(),qo(),o!==De&&Ro(),[Xe-Game.cookiesPs,t]}(t),n=ue(o/(e+Game.cookiesPs));let i;i=0===Game.cookiesPs?pe(1/0):pe(e/Game.cookiesPs*100),l("dragonAuraInfo").style.minHeight="60px",l("dragonAuraInfo").style.margin="8px",l("dragonAuraInfo").appendChild(document.createElement("div")).className="line";const a=document.createElement("div");a.style.minWidth="200px",a.style.textAlign="center",a.textContent=`Picking this aura will change CPS by ${pe(e)} (${i}% of current CPS).`,l("dragonAuraInfo").appendChild(a);const r=document.createElement("div");r.style.minWidth="200px",r.style.textAlign="center",r.textContent=`It will take ${n} to recover the cost.`,l("dragonAuraInfo").appendChild(r)}}(t)},S.ToggleSpecialMenu=Game.ToggleSpecialMenu,Game.ToggleSpecialMenu=function(e){S.ToggleSpecialMenu(e),function(){if(null!==(l("specialPopup").className.match(/onScreen/)&&l("specialPopup").children[0].style.background.match(/dragon/)))for(let e=0;e${Ze}`,"this"),Game.tooltip.wobble()},l("specialPopup").children[e].onmouseout=function(){Game.tooltip.shouldHide=1})}()},S.UpdateMenu=Game.UpdateMenu,Game.UpdateMenu=function(){void 0!==Dn().picker&&void 0!==Dn().picker.owner||(S.UpdateMenu(),function(){const t=document.createElement("div");t.className="title","prefs"===Game.onMenu?(t.textContent="Cookie Monster Settings",function(t){const o=document.createDocumentFragment();o.appendChild(t),Object.keys(_n).forEach((t=>{if("Favourite"===t){if(0!==de.length&&e.FavouriteSettings>0&&(o.appendChild(Xn(t,_n[t])),e.Header[t]))for(let e=0;e{const n=Xn(t,Qn[t]);n.style.fontSize="15px",n.style.opacity="0.5",o.appendChild(n),e.Header[t]&&Object.keys(bn).forEach((e=>{bn[e].group===t&&o.appendChild(qn(e))}))})):Object.keys(bn).forEach((e=>{bn[e].group===t&&o.appendChild(qn(e))})))}));const n=document.createElement("div");n.className="listing";const i=document.createElement("a");i.className="option",i.onclick=function(){Nn(cn)},i.textContent="Restore Default",n.appendChild(i),o.appendChild(n),l("menu").childNodes[2].insertBefore(o,l("menu").childNodes[2].childNodes[l("menu").childNodes[2].childNodes.length-1])}(t)):"stats"===Game.onMenu?e.Stats&&(t.textContent="Cookie Monster Statistics",Vn(t)):"log"===Game.onMenu&&(t.textContent="Cookie Monster ",function(t){const o=document.createElement("div");o.className="subsection";const n=document.createElement("span");if(n.style.cursor="pointer",n.style.display="inline-block",n.style.height="14px",n.style.width="14px",n.style.borderRadius="7px",n.style.textAlign="center",n.style.backgroundColor="#C0C0C0",n.style.color="black",n.style.fontSize="13px",n.style.verticalAlign="middle",n.textContent=e.Header.InfoTab?"-":"+",n.onclick=function(){$n("InfoTab"),Game.UpdateMenu()},t.appendChild(n),o.appendChild(t),e.Header.InfoTab){const e=document.createElement("div");e.innerHTML='
\n Cookie Monster\n offers a wide range of tools and statistics to enhance your game experience.\n It is not a cheat interface – although it does offer helpers for golden cookies and such, everything can be toggled off at will to only leave how much information you want.
\n Progess on new updates and all previous release notes can be found on the GitHub page linked above!
\n Please also report any bugs you may find over there!
\n
\n ',o.appendChild(e);const t=document.createElement("div");t.innerHTML="
\nThese are the release notes for the latest update (v 2.031.7).
\n
\nThis update implements the following functions:
\n- Updated the ordering and description of all settings of Cookie Monster
\n- Colours of Flash notifications can now be set by the user
\n- You can now select a number of settings to be your 'favourite'. They will be displayed at the top of all other settings in a new section. This functionality is toggleable and you can find it in the miscellaneous section
\n- The statistics page now shows cookies earned by clicking for a selected time period
\n- The statistics page can now show missing normal achievements, this can be toggled in the settings
\n
\nThis update fixes the following bugs:
\n- Fixed some typo's
\n- No longer show the wrinkler pop buttons when wrinklers can't spawn
\n- Fixed incorrect calculation of plant maturity for relevant tooltips
\n- Fixed edit prompts not working in settings
\n- Fixed red and purple being switched around for PP colour coding
\n- Fixed incorrect notation of numbers in Dragon tooltip and interface
\n- Fixed incorrect calculation of changing Dragon aura cost
\n- Fixed incorrect calculation of changing Pantheon gods effect
\n- Fixed fluctuating PP values when god Cyclius was selected
\n- Fixed black flickering when Golden Cookies or buffs start
\n
\n",o.appendChild(t)}const i=l("menu").children[1];i.insertBefore(o,i.children[1])}(t))}())},S.sayTime=Game.sayTime,V=function(e,t){return Number.isNaN(e)||e<=0?S.sayTime(e,t):ue(e/Game.fps,1)},S.Logic=Game.Logic,Game.Logic=function(){S.Logic();let t="Cookie Clicker";"fools"===Game.season&&(t="Cookie Baker"),ce=`${Game.OnAscend?"Ascending! ":""}${pe(Game.cookies)} ${1===Game.cookies?"cookie":"cookies"} - ${t}`,function(){if(Game.OnAscend||0===e.Title)document.title=ce;else if(1===e.Title){let e,t,o,n=!1,i=!1;e=Vt?Vt.wrath?`[W${Math.ceil(Vt.life/Game.fps)}]`:`[G${Math.ceil(Vt.life/Game.fps)}]`:Game.Has("Golden switch [off]")?"[GS]":`[${Number(l("CMTimerBarGCMinBar").textContent)<0?"!":""}${Math.ceil((Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.time)/Game.fps)}]`,f&&(n=!0,t="[F]"),"christmas"===Game.season&&(i=!0,o=g?`[R${Math.ceil(_t.life/Game.fps)}]`:`[${Number(l("CMTimerBarRenMinBar").textContent)<0?"!":""}${Math.ceil((Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.time)/Game.fps)}]`);let a=ce;"["===a.charAt(0)&&(a=a.substring(a.lastIndexOf("]")+1)),document.title=`${e+(n?t:"")+(i?o:"")} ${a}`}else if(2===e.Title){let e="",t=!1;Vt&&(t=!0,Vt.wrath?e+=`[W${Math.ceil(Vt.life/Game.fps)}]`:e+=`[G${Math.ceil(Vt.life/Game.fps)}]`),f&&(t=!0,e+="[F]"),"christmas"===Game.season&&g&&(e+=`[R${Math.ceil(_t.life/Game.fps)}]`,t=!0),t&&(e+=" - ");let o="Cookie Clicker";"fools"===Game.season&&(o="Cookie Baker"),e+=o,document.title=e}}(),function(){const t=Math.max(0,Game.HowManyCookiesReset(Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned))+1)-(Game.cookiesEarned+Game.cookiesReset)),o=Game.sayTime((Date.now()-Game.startDate)/1e3*Game.fps,-1);let n="";n+=`You've been on this run for ${""===o?"not very long":o}.
`,n+='
',Game.prestige>0&&(n+=`Your prestige level is currently ${pe(Game.prestige)}.
(CpS +${pe(Game.prestige)}%)`,n+='
'),n+=Oe<1?"Ascending now would grant you no prestige.":Oe<2?"Ascending now would grant you
1 prestige level (+1% CpS)
and 1 heavenly chip to spend.":`Ascending now would grant you
${pe(Oe)} prestige levels (+${pe(Oe)}% CpS)
and ${pe(Oe)} heavenly chips to spend.`,n+='
',n+=`You need ${pe(t)} more cookies for the next level.
`,n+=e.TooltipAscendButton?`
It takes ${Qt} to reach the next level and you were making ${pe(ht,2)} chips on average in the last 5 seconds.
`:"",l("ascendTooltip").innerHTML=n}()}}function Jn(){wn(),an(),sn(),r=Object.keys(Game.mods).length,w=document.createElement("style"),w.type="text/css",w.id="CMCSS",document.head.appendChild(w),function(){const e=document.createElement("div");e.id="CMBotBar",e.style.height="69px",e.style.width="100%",e.style.position="absolute",e.style.display="none",e.style.backgroundColor="#262224",e.style.backgroundImage="linear-gradient(to bottom, #4d4548, #000000)",e.style.borderTop="1px solid black",e.style.overflow="auto",e.style.textShadow="-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black";const t=e.appendChild(document.createElement("table"));t.style.width="100%",t.style.textAlign="center",t.style.whiteSpace="nowrap";const o=t.appendChild(document.createElement("tbody")),n=function(e,t){const o=document.createElement("td");return o.style.textAlign="right",o.className=E+t,o.textContent=e,o},i=o.appendChild(document.createElement("tr"));i.style.fontWeight="bold",i.appendChild(n("CM 2.031.7",W)),o.appendChild(document.createElement("tr")).appendChild(n("Bonus Income",O)),o.appendChild(document.createElement("tr")).appendChild(n("Payback Period",O)),o.appendChild(document.createElement("tr")).appendChild(n("Time Left",O)),l("wrapper").appendChild(e),Object.keys(Game.Objects).forEach((e=>{go(e)}))}(),function(){const e=document.createElement("div");e.id="CMTimerBar",e.style.position="absolute",e.style.display="none",e.style.height="0px",e.style.fontSize="10px",e.style.fontWeight="bold",e.style.backgroundColor="black";const t=ho("CMTimerBarGC","Next Cookie",[{id:"CMTimerBarGCMinBar",color:D},{id:"CMTimerBarGCBar",color:j}]);e.appendChild(t);const o=ho("CMTimerBarRen","Next Reindeer",[{id:"CMTimerBarRenMinBar",color:D},{id:"CMTimerBarRenBar",color:L}]);e.appendChild(o);const n=document.createElement("div");n.id="CMTimerBarBuffTimers",e.appendChild(n),l("wrapper").appendChild(e)}(),function(){const e=document.createElement("div");e.id="CMUpgradeBar",e.style.width="100%",e.style.backgroundColor="black",e.style.textAlign="center",e.style.fontWeight="bold",e.style.display="none",e.style.zIndex="21",e.onmouseout=function(){Game.tooltip.hide()};const t=document.createElement("div");t.appendChild(function(){const e=document.createElement("div");e.style.minWidth="330px",e.style.marginBottom="4px";const t=document.createElement("div");t.className="name",t.style.marginBottom="4px",t.textContent="Legend",e.appendChild(t);const o=function(e,t){const o=document.createElement("div");o.style.verticalAlign="middle";const n=document.createElement("span");return n.className=N+e,n.style.display="inline-block",n.style.height="10px",n.style.width="10px",n.style.marginRight="4px",o.appendChild(n),o.appendChild(document.createTextNode(t)),o};return e.appendChild(o(O,"Better than the best PP of a building option")),e.appendChild(o(F,"Same as the best PP building option")),e.appendChild(o(W,"Within the top 10 of PP for buildings")),e.appendChild(o(L,"Within the top 20 of PP for buildings")),e.appendChild(o(A,"Within the top 30 of PP for buildings")),e.appendChild(o(j,"Outside of the top 30 of PP for buildings")),e.appendChild(o(D,"Negative or infinity PP")),e}()),e.onmouseover=function(){Game.tooltip.draw(this,escape(t.innerHTML),"store")};const o=function(e,t){const o=document.createElement("span");return o.id=e,o.className=E+t,o.style.width="14.28571428571429%",o.style.display="inline-block",o.textContent="0",o};e.appendChild(o("CMUpgradeBarBlue",O)),e.appendChild(o("CMUpgradeBarGreen",F)),e.appendChild(o("CMUpgradeBarYellow",W)),e.appendChild(o("CMUpgradeBarOrange",L)),e.appendChild(o("CMUpgradeBarRed",A)),e.appendChild(o("CMUpgradeBarPurple",j)),e.appendChild(o("CMUpgradeBarGray",D)),l("upgrades").parentNode.insertBefore(e,l("upgrades").parentNode.childNodes[3])}(),function(){const e=document.createElement("div");e.id="CMFlashScreen",e.style.width="100%",e.style.height="100%",e.style.backgroundColor="white",e.style.display="none",e.style.zIndex="9999999999",e.style.position="absolute",l("wrapper").appendChild(e)}(),function(){const e=document.createElement("div");e.id="CMSectionHidButtons",e.style.textAlign="center";const t=document.createElement("a");t.className="option",t.onclick=function(){"flex"===l("upgrades").style.display?(l("upgrades").style.display="none",l("toggleUpgrades").style.display="none",l("techUpgrades").style.display="none",l("vaultUpgrades").style.display="none"):(l("upgrades").style.display="flex",0!==l("toggleUpgrades").children.length&&(l("toggleUpgrades").style.display="block"),0!==l("techUpgrades").children.length&&(l("techUpgrades").style.display="block"),0!==l("vaultUpgrades").children.length&&(l("vaultUpgrades").style.display="block"))},t.textContent="Hide/Show Upgrades",e.appendChild(t);const o=document.createElement("a");o.className="option",o.onclick=function(){"grid"===l("products").style.display?l("products").style.display="none":l("products").style.display="grid"},o.textContent="Hide/Show Buildings",e.appendChild(o),l("store").insertBefore(e,l("store").childNodes[2])}(),function(){const e=document.createElement("link");e.id="CMFavicon",e.rel="shortcut icon",e.href="https://orteil.dashnet.org/cookieclicker/favicon.ico",document.getElementsByTagName("head")[0].appendChild(e)}(),Object.keys(R).forEach((e=>{!function(e,t,o){const n=document.createElement("div");n.id=e;const i=document.createElement("div");i.style.minWidth=o,i.style.marginBottom="4px";const a=document.createElement("div");a.style.textAlign="left",a.textContent=t,i.appendChild(a),n.appendChild(i),I[e]=n}(R[e][0],R[e][1],R[e][2])})),function(){const e=document.createElement("a");e.id="PopAllNormalWrinklerButton",e.textContent="Pop All Normal",e.className="option",e.onclick=function(){On()},e.onmouseout=function(){Game.tooltip.shouldHide=1},e.onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Fn("wb","PopAll")}),"this"),Game.tooltip.wobble()},l("sectionLeftExtra").children[0].append(e);const t=document.createElement("a");t.id="PopFattestWrinklerButton",t.textContent="Pop Single Fattest",t.className="option",t.onclick=function(){null!==wt[1]&&(Game.wrinklers[wt[1]].hp=0)},t.onmouseout=function(){Game.tooltip.shouldHide=1},t.onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Fn("wb","PopFattest")}),"this"),Game.tooltip.wobble()},l("sectionLeftExtra").children[0].append(t)}(),l("products").style.display="grid",l("storeBulk").style.gridRow="1/1",l("upgrades").style.display="flex",l("upgrades").style["flex-wrap"]="wrap",Object.keys(Game.Objects).forEach((e=>{const t=Game.Objects[e];null!==l(`product${t.id}`).onmouseover&&(x[e]=l(`product${t.id}`).onmouseover,l(`product${t.id}`).onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Fn("b",`${e}`)}),"store"),Game.tooltip.wobble()})})),Game.canLumps()&&(s=l("lumps").onmouseover,l("lumps").onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Fn("s","Lump")}),"this"),Game.tooltip.wobble()}),h=Game.LoadMinigames,Game.LoadMinigames=function(){h(),Game.Objects.Farm.minigameLoaded&&(l("gardenTool-1").onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Fn("ha","HarvestAllButton")}),"this"),Game.tooltip.wobble()},Array.from(l("gardenPlot").children).forEach((e=>{const t=e.id.slice(-3);e.onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Fn("p",[`${t[0]}`,`${t[2]}`])}),"this"),Game.tooltip.wobble()}}))),Wn(),function(){if(Game.Objects.Temple.minigameLoaded){for(let e=0;e<11;e+=1)l(`templeGod${e}`).onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Fn("pag",e)}),"this"),Game.tooltip.wobble()};for(let e=0;e<3;e+=1)l(`templeSlot${e}`).onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Fn("pas",[e,Game.Objects.Temple.minigame.slot[e]])}),"this"),Game.tooltip.wobble()}}}(),An()},Game.LoadMinigames(),l("backgroundLeftCanvas").onmouseover=function(){_=1},l("backgroundLeftCanvas").onmouseout=function(){_=0,Game.tooltip.hide(),Object.keys(Game.wrinklers).forEach((e=>{X[e]=0}))},Kn(),An(),Game.CalculateGains(),Nn(),z=Game.OnAscend,Game.prefs.popups?Game.Popup("Cookie Monster version 2.031.7 loaded!"):Game.Notify("Cookie Monster version 2.031.7 loaded!","","",1,1),Game.Win("Third-party")}const Zn={init:function(){xn=!0;let e=!0;Game.version!==Number("2.031")&&(e=confirm("Cookie Monster version 2.031.7 is meant for Game version 2.031. Loading a different version may cause errors. Do you still want to load Cookie Monster?")),e&&(Jn(),Game.registerHook("draw",Oo),Game.registerHook("logic",Bn),Game.registerHook("click",Fo),xn=!1)},load:function(e){const t=JSON.parse(e);wn(),void 0!==t.favouriteSettings&&(de=t.favouriteSettings),Nn(t.settings),"2.031.7"!==t.version&&(Game.prefs.popups?Game.Popup("A new version of Cookie Monster has been loaded, check out the release notes in the info tab!"):Game.Notify("A new version of Cookie Monster has been loaded, check out the release notes in the info tab!","","",0,1))},save:kn};Game.registerMod("CookieMonster",Zn)})()})(); +(()=>{var e={877:function(e){!function(t,o){"use strict";"object"!=typeof e.exports?o(t):e.exports=t.document?o(t):function(e){if(!e.document)throw new Error("jscolor needs a window with document");return o(e)}}("undefined"!=typeof window?window:this,(function(e){"use strict";var t,o,n,i,a=((i={initialized:!1,instances:[],readyQueue:[],register:function(){void 0!==e&&e.document&&e.document.addEventListener("DOMContentLoaded",i.pub.init,!1)},installBySelector:function(t,o){if(!(o=o?i.node(o):e.document))throw new Error("Missing root node");for(var n=o.querySelectorAll(t),a=new RegExp("(^|\\s)("+i.pub.lookupClass+")(\\s*(\\{[^}]*\\})|\\s|$)","i"),r=0;r-1},isButtonEmpty:function(e){switch(i.nodeName(e)){case"input":return!e.value||""===e.value.trim();case"button":return""===e.textContent.trim()}return null},isPassiveEventSupported:function(){var t=!1;try{var o=Object.defineProperty({},"passive",{get:function(){t=!0}});e.addEventListener("testPassive",null,o),e.removeEventListener("testPassive",null,o)}catch(e){}return t}(),isColorAttrSupported:(n=e.document.createElement("input"),!(!n.setAttribute||(n.setAttribute("type","color"),"color"!=n.type.toLowerCase()))),dataProp:"_data_jscolor",setData:function(){var e=arguments[0];if(3===arguments.length){var t=e.hasOwnProperty(i.dataProp)?e[i.dataProp]:e[i.dataProp]={},o=arguments[2];return t[a=arguments[1]]=o,!0}if(2===arguments.length&&"object"==typeof arguments[1]){t=e.hasOwnProperty(i.dataProp)?e[i.dataProp]:e[i.dataProp]={};var n=arguments[1];for(var a in n)n.hasOwnProperty(a)&&(t[a]=n[a]);return!0}throw new Error("Invalid arguments")},removeData:function(){var e=arguments[0];if(!e.hasOwnProperty(i.dataProp))return!0;for(var t=1;t=3&&(n=l[0].match(s))&&(i=l[1].match(s))&&(a=l[2].match(s)))return o.format="rgb",o.rgba=[parseFloat(n[1])||0,parseFloat(i[1])||0,parseFloat(a[1])||0,null],l.length>=4&&(r=l[3].match(s))&&(o.format="rgba",o.rgba[3]=parseFloat(r[1])||0),o}return!1},parsePaletteValue:function(e){var t=[];"string"==typeof e?e.replace(/#[0-9A-F]{3}([0-9A-F]{3})?|rgba?\(([^)]*)\)/gi,(function(e){t.push(e)})):Array.isArray(e)&&(t=e);for(var o=[],n=0;ns[n]&&-t[n]+e[n]+l[n]/2>s[n]/2&&e[n]+l[n]-d[n]>=0?e[n]+l[n]-d[n]:e[n],-t[a]+e[a]+l[a]+d[a]-p+p*r>s[a]?-t[a]+e[a]+l[a]/2>s[a]/2&&e[a]+l[a]-p-p*r>=0?e[a]+l[a]-p-p*r:e[a]+l[a]-p+p*r:e[a]+l[a]-p+p*r>=0?e[a]+l[a]-p+p*r:e[a]+l[a]-p-p*r];else var u=[e[n],e[a]+l[a]-p+p*r];var m=u[n],h=u[a],g=o.fixed?"fixed":"absolute",f=(u[0]+d[0]>e[0]||u[0]0?Math.ceil(l/o):0,i=Math.max(1,Math.floor((t-(o-1)*e.paletteSpacing)/o)),a=e.paletteHeight?Math.min(e.paletteHeight,i):i),n&&(r=n*a+(n-1)*e.paletteSpacing),{cols:o,rows:n,cellW:i,cellH:a,width:t,height:r}},getControlPadding:function(e){return Math.max(e.padding/2,2*e.pointerBorderWidth+e.pointerThickness-e.controlBorderWidth)},getPadYChannel:function(e){switch(e.mode.charAt(1).toLowerCase()){case"v":return"v"}return"s"},getSliderChannel:function(e){if(e.mode.length>2)switch(e.mode.charAt(2).toLowerCase()){case"s":return"s";case"v":return"v"}return null},triggerCallback:function(e,t){if(e[t]){var o=null;if("string"==typeof e[t])try{o=new Function(e[t])}catch(e){console.error(e)}else o=e[t];o&&o.call(e)}},triggerGlobal:function(e){for(var t=i.getInstances(),o=0;o0)for(var c=0;c=2&&"string"==typeof arguments[0]){try{if(!a(arguments[0],arguments[1]))return!1}catch(e){return console.warn(e),!1}return this.redraw(),this.exposeColor(),!0}if(1===arguments.length&&"object"==typeof arguments[0]){var e=arguments[0],t=!0;for(var o in e)if(e.hasOwnProperty(o))try{a(o,e[o])||(t=!1)}catch(e){console.warn(e),t=!1}return this.redraw(),this.exposeColor(),t}throw new Error("Invalid arguments")},this.channel=function(e,t){if("string"!=typeof e)throw new Error("Invalid value for channel name: "+e);if(void 0===t)return this.channels.hasOwnProperty(e.toLowerCase())?this.channels[e.toLowerCase()]:(console.warn("Getting unknown channel: "+e),!1);var o=!1;switch(e.toLowerCase()){case"r":o=this.fromRGBA(t,null,null,null);break;case"g":o=this.fromRGBA(null,t,null,null);break;case"b":o=this.fromRGBA(null,null,t,null);break;case"h":o=this.fromHSVA(t,null,null,null);break;case"s":o=this.fromHSVA(null,t,null,null);break;case"v":o=this.fromHSVA(null,null,t,null);break;case"a":o=this.fromHSVA(null,null,null,t);break;default:return console.warn("Setting unknown channel: "+e),!1}return!!o&&(this.redraw(),!0)},this.trigger=function(e){for(var t=i.strList(e),o=0;o127.5},this.hide=function(){p()&&(i.removeClass(n.targetElement,i.pub.activeClassName),i.picker.wrap.parentNode.removeChild(i.picker.wrap),delete i.picker.owner)},this.show=function(){l()},this.redraw=function(){p()&&l()},this.getFormat=function(){return this._currentFormat},this._setFormat=function(e){this._currentFormat=e.toLowerCase()},this.hasAlphaChannel=function(){return"auto"===this.alphaChannel?"any"===this.format.toLowerCase()||i.isAlphaFormat(this.getFormat())||void 0!==this.alpha||void 0!==this.alphaElement:this.alphaChannel},this.processValueInput=function(e){this.fromString(e)||this.exposeColor()},this.processAlphaInput=function(e){this.fromHSVA(null,null,null,parseFloat(e))||this.exposeColor()},this.exposeColor=function(e){var t=this.toString(),o=this.getFormat();if(i.setDataAttr(this.targetElement,"current-color",t),e&i.flags.leaveValue||!this.valueElement||("hex"!==o&&"hexa"!==o||(this.uppercase||(t=t.toLowerCase()),this.hash||(t=t.replace(/^#/,""))),this.setValueElementValue(t)),!(e&i.flags.leaveAlpha)&&this.alphaElement){var n=Math.round(100*this.channels.a)/100;this.setAlphaElementValue(n)}e&i.flags.leavePreview||!this.previewElement||((i.isTextInput(this.previewElement)||i.isButton(this.previewElement)&&!i.isButtonEmpty(this.previewElement))&&this.previewPosition,this.setPreviewElementBg(this.toRGBAString())),p()&&(s(),c(),d())},this.setPreviewElementBg=function(e){if(this.previewElement){var t=null,o=null;(i.isTextInput(this.previewElement)||i.isButton(this.previewElement)&&!i.isButtonEmpty(this.previewElement))&&(t=this.previewPosition,o=this.previewSize);var n=[];if(e){n.push({image:i.genColorPreviewGradient(e,t,o?o-i.pub.previewSeparator.length:null),position:"left top",size:"auto",repeat:t?"repeat-y":"repeat",origin:"padding-box"});var a=i.genColorPreviewCanvas("rgba(0,0,0,0)",t?{left:"right",right:"left"}[t]:null,o,!0);n.push({image:"url('"+a.canvas.toDataURL()+"')",position:(t||"left")+" top",size:a.width+"px "+a.height+"px",repeat:t?"repeat-y":"repeat",origin:"padding-box"})}else n.push({image:"none",position:"left top",size:"auto",repeat:"no-repeat",origin:"padding-box"});for(var r={image:[],position:[],size:[],repeat:[],origin:[]},l=0;l=0;h-=1){var g=m[h];if(g)if(i.pub.presets.hasOwnProperty(g)){for(var u in i.pub.presets[g])if(i.pub.presets[g].hasOwnProperty(u))try{a(u,i.pub.presets[g][u])}catch(e){console.warn(e)}}else console.warn("Unknown preset: %s",g)}var f=["preset"];for(var u in o)if(o.hasOwnProperty(u)&&-1===f.indexOf(u))try{a(u,o[u])}catch(e){console.warn(e)}if(void 0===this.container?this.container=e.document.body:this.container=i.node(this.container),!this.container)throw new Error("Cannot instantiate color picker without a container element");if(this.targetElement=i.node(t),!this.targetElement){if("string"==typeof t&&/^[a-zA-Z][\w:.-]*$/.test(t))throw new Error("If '"+t+"' is supposed to be an ID, please use '#"+t+"' or any valid CSS selector.");throw new Error("Cannot instantiate color picker without a target element")}if(this.targetElement.jscolor&&this.targetElement.jscolor instanceof i.pub)throw new Error("Color picker already installed on this element");if(this.targetElement.jscolor=this,i.addClass(this.targetElement,i.pub.className),i.instances.push(this),i.isButton(this.targetElement)&&("button"!==this.targetElement.type.toLowerCase()&&(this.targetElement.type="button"),i.isButtonEmpty(this.targetElement))){i.removeChildren(this.targetElement),this.targetElement.appendChild(e.document.createTextNode(" "));var C=i.getCompStyle(this.targetElement);(parseFloat(C["min-width"])||0)-1){var G=i.parseColorString(b);this._currentFormat=G?G.format:"hex"}else this._currentFormat=this.format.toLowerCase();this.processValueInput(b),void 0!==k&&this.processAlphaInput(k)}}).pub.className="jscolor",i.pub.activeClassName="jscolor-active",i.pub.looseJSON=!0,i.pub.presets={},i.pub.presets.default={},i.pub.presets.light={backgroundColor:"rgba(255,255,255,1)",controlBorderColor:"rgba(187,187,187,1)",buttonColor:"rgba(0,0,0,1)"},i.pub.presets.dark={backgroundColor:"rgba(51,51,51,1)",controlBorderColor:"rgba(153,153,153,1)",buttonColor:"rgba(240,240,240,1)"},i.pub.presets.small={width:101,height:101,padding:10,sliderSize:14,paletteCols:8},i.pub.presets.medium={width:181,height:101,padding:12,sliderSize:16,paletteCols:10},i.pub.presets.large={width:271,height:151,padding:12,sliderSize:24,paletteCols:15},i.pub.presets.thin={borderWidth:1,controlBorderWidth:1,pointerBorderWidth:1},i.pub.presets.thick={borderWidth:2,controlBorderWidth:2,pointerBorderWidth:2},i.pub.sliderInnerSpace=3,i.pub.chessboardSize=8,i.pub.chessboardColor1="#666666",i.pub.chessboardColor2="#999999",i.pub.previewSeparator=["rgba(255,255,255,.65)","rgba(128,128,128,.65)"],i.pub.init=function(){if(!i.initialized)for(e.document.addEventListener("mousedown",i.onDocumentMouseDown,!1),e.document.addEventListener("keyup",i.onDocumentKeyUp,!1),e.addEventListener("resize",i.onWindowResize,!1),e.addEventListener("scroll",i.onWindowScroll,!1),i.pub.install(),i.initialized=!0;i.readyQueue.length;)i.readyQueue.shift()()},i.pub.install=function(e){var t=!0;try{i.installBySelector("[data-jscolor]",e)}catch(e){t=!1,console.warn(e)}if(i.pub.lookupClass)try{i.installBySelector("input."+i.pub.lookupClass+", button."+i.pub.lookupClass,e)}catch(e){}return t},i.pub.ready=function(e){return"function"!=typeof e?(console.warn("Passed value is not a function"),!1):(i.initialized?e():i.readyQueue.push(e),!0)},i.pub.trigger=function(e){var t=function(){i.triggerGlobal(e)};i.initialized?t():i.pub.ready(t)},i.pub.hide=function(){i.picker&&i.picker.owner&&i.picker.owner.hide()},i.pub.chessboard=function(e){return e||(e="rgba(0,0,0,0)"),i.genColorPreviewCanvas(e).canvas.toDataURL()},i.pub.background=function(e){var t=[];t.push(i.genColorPreviewGradient(e));var o=i.genColorPreviewCanvas();return t.push(["url('"+o.canvas.toDataURL()+"')","left top","repeat"].join(" ")),t.join(", ")},i.pub.options={},i.pub.lookupClass="jscolor",i.pub.installByClassName=function(){return console.error('jscolor.installByClassName() is DEPRECATED. Use data-jscolor="" attribute instead of a class name.'+i.docsRef),!1},i.register(),i.pub);return void 0===e.jscolor&&(e.jscolor=e.JSColor=a),a}))}},t={};function o(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,o),a.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";let e={};function t(){e.WrinklerButtons&&Game.elderWrath?(l("PopAllNormalWrinklerButton").style.display="",l("PopFattestWrinklerButton").style.display=""):(l("PopAllNormalWrinklerButton").style.display="none",l("PopFattestWrinklerButton").style.display="none")}const n=["","","M","G","T","P","E","Z","Y"],i=["","","M","B","Tr","Quadr","Quint","Sext","Sept","Oct","Non","Dec","Undec","Duodec","Tredec","Quattuordec","Quindec","Sexdec","Septendec","Octodec","Novemdec","Vigint","Unvigint","Duovigint","Trevigint","Quattuorvigint"],a=["","K","M","B","T","Qa","Qi","Sx","Sp","Oc","No","De","UDe","DDe","TDe","QaDe","QiDe","SxDe","SpDe","ODe","NDe","Vi","UVi","DVi","TVi","QaVi","QiVi","SxVi","SpVi","OVi","NVi","Tr","UTr","DTr","TTr","QaTr","QiTr","SxTr","SpTr","OTr","NTr","Qaa","UQa","DQa","TQa","QaQa","QiQa","SxQa","SpQa","OQa","NQa","Qia","UQi","DQi","TQi","QaQi","QiQi","SxQi","SpQi","OQi","NQi","Sxa","USx","DSx","TSx","QaSx","QiSx","SxSx","SpSx","OSx","NSx","Spa","USp","DSp","TSp","QaSp","QiSp","SxSp","SpSp","OSp","NSp","Oco","UOc","DOc","TOc","QaOc","QiOc","SxOc","SpOc","OOc","NOc","Noa","UNo","DNo","TNo","QaNo","QiNo","SxNo","SpNo","ONo","NNo","Ct","UCt"];let r,s,c,d,p,u,m,h,g,f,C,y,b,k,G,v,w,x=[],T=[],M=[],S={},B=Date.now(),P=Date.now();const E="CMText",N="CMBack",O="Blue",F="Green",L="Yellow",W="Orange",A="Red",j="Purple",D="Gray",H="Pink",U="Brown",$=[D,O,F,L,W,A,j,H,U],R=[["GoldCookTooltipPlaceholder","Calculated with Golden Switch off","200px"],["GoldCookDragonsFortuneTooltipPlaceholder","Calculated with Golden Switch off and at least one golden cookie on-screen","240px"],["PrestMaxTooltipPlaceholder","The MAX prestige is calculated with the cookies gained from popping all wrinklers with Skruuia god in Diamond slot, selling all stock market goods, selling all buildings with Earth Shatterer and Reality Bending auras, and buying Chocolate egg","320px"],["NextPrestTooltipPlaceholder","Calculated with cookies gained from wrinklers and Chocolate egg","200px"],["HeavenChipMaxTooltipPlaceholder","The MAX heavenly chips is calculated with the cookies gained from popping all wrinklers with Skruuia god in Diamond slot, selling all stock market goods, selling all buildings with Earth Shatterer and Reality Bending auras, and buying Chocolate egg","330px"],["ResetTooltipPlaceholder","The bonus income you would get from new prestige levels unlocked at 100% of its potential and from ascension achievements if you have the same buildings/upgrades after reset","370px"],["ChoEggTooltipPlaceholder","The amount of cookies you would get from popping all wrinklers with Skruuia god in Diamond slot, selling all stock market goods, selling all buildings with Earth Shatterer and Reality Bending auras, and then buying Chocolate egg","300px"],["ChainNextLevelPlaceholder","Cheated cookies might break this formula","250px"],["FavouriteSettingPlaceholder","Click to set this setting as favourite and show it in 'favourite' settings at the top of the Cookie Monster Settings","250px"]],I={};let z,V,_=0,Q=-1,X=[],q=1,Y=1,K=1;const J=[10,15,30,60,300,600,900,1800],Z=[1,5,10,15,30],ee={Frenzy:L,"Dragon Harvest":U,"Elder frenzy":F,Clot:A,"Click frenzy":O,Dragonflight:H};let te,oe,ne,ie,ae,re,le,se={},ce="",de=[];function pe(t,o,r){const l=e.ScaleDecimals+1;if(t===1/0)return"Infinity";if(void 0===t)return"0";if(0===e.Scale)return S.Beautify(t,o);if(Number.isFinite(t)){if(t<0)return`-${pe(Math.abs(t))}`;let s="";if(0===t)return t.toString();if(t>.001&&t=.01&&t=.01&&t=.01&&t315576e4)return"XX:XX:XX:XX:XX";c+=(i<10?"0":"")+i+":",c+=(a<10?"0":"")+a+":",c+=(r<10?"0":"")+r+":",c+=(l<10?"0":"")+l+":",c+=(s<10?"0":"")+s}else{if(n>7776e5)return o?"Over 9000 days!":">9000d";c+=i>0?i+(o?1===i?" year":" years":"y")+", ":"",c+=a>0?a+(o?1===a?" day":" days":"d")+", ":"",(c.length>0||r>0)&&(c+=r+(o?1===r?" hour":" hours":"h")+", "),(c.length>0||l>0)&&(c+=l+(o?1===l?" minute":" minutes":"m")+", "),c+=s+(o?1===s?" second":" seconds":"s")}return c}function me(t){let o,n;return t<=0?(n=e.TimeFormat?"00:00:00:00:00":"Done!",o=F):(n=ue(t),o=t>300?A:t>60?W:L),{text:n,color:o}}let he,ge,fe,Ce,ye,be,ke,Ge,ve,we,xe,Te,Me,Se,Be,Pe,Ee,Ne,Oe,Fe,Le,We,Ae,je,De,He,Ue,$e,Re,Ie,ze,Ve,_e,Qe,Xe,qe,Ye=0,Ke=0,Je=0,Ze=0,et=0,tt=0,ot=0,nt=0,it=0,at=0,rt=0,lt=0,st=0,ct=0,dt=0,pt=1,ut=1,mt=1,ht=0,gt=0,ft=0,Ct=0,yt={},bt={},kt={},Gt={},vt=0,wt=0,xt=[0,null],Tt=0,Mt=0,St={},Bt={},Pt={},Et={},Nt={},Ot=0,Ft=0,Lt=[],Wt=0,At=0,jt=[],Dt=0,Ht=0,Ut=[],$t=0,Rt=0,It=[],zt=0,Vt=0,_t={},Qt={},Xt=0,qt=0,Yt=[],Kt={},Jt=0,Zt={0:[0,0,0],1:[0,0,0],2:[0,0,0],3:[0,0,0],4:[0,0,0],5:[0,0,0],6:[0,0,0],7:[0,0,0],8:[0,0,0],9:[0,0,0],10:[0,0,0]},eo=[],to=[],oo=[];function no(e){let t=0;return Game.dragonAuras[$e].name!==e&&Game.dragonAuras[Re].name!==e||(t=1),"Reality Bending"!==Game.dragonAuras[$e].name&&"Reality Bending"!==Game.dragonAuras[Re].name||(t+=.1),t}function io(){let e=.25;return e*=1+no("Earth Shatterer"),e}function ao(e,t){return void 0===Qe[e]?void 0===t?1:t:Qe[e]}function ro(e){const t=to[e];return(1!==Game.ascensionMode||"prestige"!==t.pool&&"fortune"!==t.tier)&&t?t.bought:0}function lo(e){if(Game.hasGod){void 0===eo.Temple.minigame&&(eo.Temple.minigame=Game.Objects.Temple.minigame);const t=eo.Temple.minigame.gods[e];if(Ie===t.id)return 1;if(ze===t.id)return 2;if(Ve===t.id)return 3}return!1}function so(e,t){let o=t;if(ro("Season savings")&&(o*=.99),ro("Santa's dominion")&&(o*=.99),ro("Faberge egg")&&(o*=.99),ro("Divine discount")&&(o*=.99),ro("Fortune #100")&&(o*=.99),o*=1-.02*no("Fierce Hoarder"),Game.hasBuff("Everything must go")&&(o*=.95),Game.hasBuff("Crafty pixies")&&(o*=.98),Game.hasBuff("Nasty goblins")&&(o*=1.02),e.fortune&&ro(e.fortune.name)&&(o*=.93),o*=ao("buildingCost"),eo.Temple.minigameLoaded){const e=lo("creation");1===e?o*=.93:2===e?o*=.95:3===e&&(o*=.98)}return o}function co(e,t,o,n,i,a){const r=void 0===a?0:a;let l=i,s=o,c=0;-1===i&&(l=s),i||(l=Game.buyBulk);for(let o=0;o0&&(c+=o,s-=1)}return c}function po(){let t=Game.buyBulk;if(1===Game.buyMode?Y=t:t=Y,1===t?t=yt:10===t?t=bt:100===t&&(t=kt),1===Game.buyMode?1===e.BuildColour?Object.keys(t).forEach((o=>{l(`productPrice${Game.Objects[o].id}`).style.color=e[`Colour${t[o].color}`]})):Object.keys(Game.Objects).forEach((e=>{l(`productPrice${Game.Objects[e].id}`).style.removeProperty("color")})):-1===Game.buyMode&&Object.keys(yt).forEach((e=>{const t=Game.Objects[e];l(`productPrice${t.id}`).style.color="",l(`productPrice${t.id}`).innerHTML=pe(co(t,t.basePrice,t.amount,t.free,Game.buyBulk,1))})),1===Game.buyMode&&e.SortBuildings){let o;1===e.SortBuildings?(o=Object.keys(yt).map((e=>{const t=yt[e];return t.name=e,t.id=Game.Objects[e].id,t})),o.sort((function(e,t){return $.indexOf(e.color)>$.indexOf(t.color)?1:$.indexOf(e.color)<$.indexOf(t.color)||e.pp{const o=t[e];return o.name=e,o.id=Game.Objects[e].id,o})),o.sort((function(e,t){return $.indexOf(e.color)>$.indexOf(t.color)?1:$.indexOf(e.color)<$.indexOf(t.color)||e.pp{const t=yt[e];return t.name=e,t.id=Game.Objects[e].id,t}));e.sort(((e,t)=>e.id-t.id));for(let t=0;t0){let e=0,t=0,o=0,n=0,i=0,a=0,r=0;Object.keys(Game.UpgradesInStore).forEach((s=>{const c=Game.UpgradesInStore[s];let d=!1;for(let e=0;e$.indexOf(t.color)?1:$.indexOf(e.color)<$.indexOf(t.color)||e.ppe.price-t.price));const o=function(e,t){return e.findIndex((e=>e.name===t.name))};for(let e=0;e{let n,i=Game.buyBulk;1===Game.buyMode?q=i:i=q,1===i&&(i=yt),10===i&&(i=bt),100===i&&(i=kt),t+=1,l("CMBotBar").firstChild.firstChild.childNodes[0].childNodes[t].childNodes[1].textContent=Game.Objects[o].amount,l("CMBotBar").firstChild.firstChild.childNodes[1].childNodes[t].textContent=pe(i[o].bonus,2),l("CMBotBar").firstChild.firstChild.childNodes[2].childNodes[t].className=E+i[o].color,n=e.PPDisplayTime?ue(Math.round(i[o].pp)):pe(Math.round(i[o].pp),2),l("CMBotBar").firstChild.firstChild.childNodes[2].childNodes[t].textContent=n;const a=me((Game.Objects[o].bulkPrice-(Game.cookies+ho()))/mo());l("CMBotBar").firstChild.firstChild.childNodes[3].childNodes[t].className=E+a.color,"Done!"===a.text&&Game.cookies{!Game.Tiers[e.tieredUpgrades[o].tier].special&&ro(e.tieredUpgrades[o].name)&&(t*=2)})),Object.keys(e.synergies).forEach((o=>{if(ro(e.synergies[o].name)){const n=e.synergies[o];n.buildingTie1.name===e.name?t*=1+.05*n.buildingTie2.amount:n.buildingTie2.name===e.name&&(t*=1+.001*n.buildingTie1.amount)}})),e.fortune&&ro(e.fortune.name)&&(t*=1.07),e.grandma&&ro(e.grandma.name)&&(t*=1+.01*eo.Grandma.amount*(1/(e.id-1))),"object"==typeof e.tieredUpgrades.misfortune&&1===e.vanilla&&ro(e.tieredUpgrades.misfortune.name))switch(Game.elderWrath){default:t*=1;break;case 1:t*=1.02;break;case 2:t*=1.04;break;case 3:t*=1.06}return t}function xo(e){const t=Game.Objects[e],o={};return"Cursor"===t.name?o.cps=function(e){let t=0;ro("Thousand fingers")&&(t+=.1),ro("Million fingers")&&(t*=5),ro("Billion fingers")&&(t*=10),ro("Trillion fingers")&&(t*=20),ro("Quadrillion fingers")&&(t*=20),ro("Quintillion fingers")&&(t*=20),ro("Sextillion fingers")&&(t*=20),ro("Septillion fingers")&&(t*=20),ro("Octillion fingers")&&(t*=20),ro("Nonillion fingers")&&(t*=20);let o=1,n=0;return Object.keys(eo).forEach((e=>{"Cursor"!==eo[e].name&&(n+=eo[e].amount)})),t*=n,o*=wo(e),o*=Game.magicCpS("Cursor"),o*=ao("cursorCps"),Game.ComputeCps(.1,ro("Reinforced index finger")+ro("Carpal tunnel prevention cream")+ro("Ambidextrous"),t)*o}:"Grandma"===t.name?o.cps=function(e){let o=1;if(Object.keys(Game.GrandmaSynergies).forEach((e=>{ro(Game.GrandmaSynergies[e])&&(o*=2)})),ro("Bingo center/Research facility")&&(o*=4),ro("Ritual rolling pins")&&(o*=2),ro("Naughty list")&&(o*=2),ro("Elderwort biscuits")&&(o*=1.02),o*=ao("grandmaCps"),ro("Cat ladies"))for(let e=0;e{"Grandma"!==eo[e].name&&(i+=eo[e].amount)})),o*=1+.01*no("Elder Battalion")*i,o*=Game.magicCpS(t.name),(t.baseCps+n)*o}:o.cps=function(e){let t=1;return t*=wo(e),t*=Game.magicCpS(e.name),e.baseCPS*t},o.baseCps=t.baseCps,o.name=t.name,o.tieredUpgrades=t.tieredUpgrades,o.synergies=t.synergies,o.fortune=t.fortune,o.grandma=t.grandma,o.baseCPS=t.baseCps,o.id=t.id,o.vanilla=t.vanilla,o}function To(e){const t=Game.Upgrades[e],o={};return o.power=t.power,"function"==typeof o.power&&("Sugar crystal cookies"===t.name?o.power=function(){let e=5;return Object.keys(eo).forEach((t=>{eo[t].level>=10&&(e+=1)})),e}:o.power=function(){let e=2;if(ro("Starlove")&&(e=3),Game.hasGod){const t=lo("seasons");1===t?e*=1.3:2===t?e*=1.2:3===t&&(e*=1.1)}return e}),o.pool=t.pool,o.name=t.name,o}function Mo(){Ae=Game.UpgradesOwned,je=Game.pledges,De=Game.AchievementsOwned,He=Game.heavenlyPower,Ue=Game.prestige,Object.keys(Game.Objects).forEach((e=>{const t=Game.Objects[e];let o=eo[e];void 0===o&&(eo[e]=xo(e),o=eo[e],fo(e)),o.amount=t.amount,o.level=t.level,o.totalCookies=t.totalCookies,o.basePrice=t.basePrice,o.free=t.free,t.minigameLoaded&&("Temple"===t.name&&(Ie=t.minigame.slot[0],ze=t.minigame.slot[1],Ve=t.minigame.slot[2]),o.minigameLoaded=t.minigameLoaded,o.minigame=t.minigame),eo[e]=o})),Object.keys(Game.Upgrades).forEach((e=>{const t=Game.Upgrades[e];let o=to[e];void 0===o&&(to[e]=To(e),o=to[e]),o.bought=t.bought,to[e]=o})),Object.keys(Game.Achievements).forEach((e=>{const t=Game.Achievements[e];let o=oo[e];void 0===o&&(oo[e]=vo(e),o=oo[e]),o.won=t.won,oo[e]=o})),Go(),$e=Ye,Re=Ke}function So(e){const t=document.createElement("div");return t.style.fontWeight="bold",t.id=`${e}Title`,t.className="CMTextBlue",t.textContent=e,t}function Bo(e){e.appendChild(So("Bonus Income"));const t=document.createElement("div");t.style.marginBottom="4px",t.style.color="white",t.id="CMTooltipIncome",e.appendChild(t),e.appendChild(So("Bonus Cookies per Click")),e.lastChild.style.display="none";const o=document.createElement("div");o.style.marginBottom="4px",o.style.color="white",o.style.display="none",o.id="CMTooltipCookiePerClick",e.appendChild(o),e.appendChild(So("Payback Period"));const n=document.createElement("div");n.style.marginBottom="4px",n.id="CMTooltipPP",e.appendChild(n),e.appendChild(So("Time Left"));const i=document.createElement("div");if(i.id="CMTooltipTime",e.appendChild(i),"b"===ne){e.appendChild(So("Production left till next achievement")),e.lastChild.id="CMTooltipProductionLeftHeader";const t=document.createElement("div");t.id="CMTooltipProductionLeft",e.appendChild(t)}if("b"===ne){e.appendChild(So("Buildings left till next additional achievement")),e.lastChild.id="CMTooltipNextAchievementHeader";const t=document.createElement("div");t.id="CMTooltipNextAchievement",e.appendChild(t)}}function Po(e,t,o){let n=e,i=0;for(;n{void 0!==Game.buffs[t].multCpS&&(e*=Game.buffs[t].multCpS)})),e}function No(){null!==l("CMDispTooltipWarningParent")&&(0===e.ToolWarnPos?(l("CMDispTooltipWarningParent").style.top="auto",l("CMDispTooltipWarningParent").style.margin="4px -4px",l("CMDispTooltipWarningParent").style.padding="3px 4px"):(l("CMDispTooltipWarningParent").style.right="auto",l("CMDispTooltipWarningParent").style.margin="4px",l("CMDispTooltipWarningParent").style.padding="4px 3px"))}function Oo(){if(Mo(),"none"!==l("tooltipAnchor").style.display&&l("CMTooltipArea")){l("CMTooltipArea").innerHTML="";const t=function(){l("tooltip").firstChild.style.paddingBottom="4px";const e=document.createElement("div");return e.style.border="1px solid",e.style.padding="4px",e.style.margin="0px -4px",e.id="CMTooltipBorder",e.className="CMTextGray",e}();l("CMTooltipArea").appendChild(t),"b"===ne?function(){if(1===e.TooltipBuildUpgrade&&1===Game.buyMode){let t;if(Bo(l("CMTooltipBorder")),1===Game.buyMode?K=t:t=K,1===Game.buyBulk?t=yt:10===Game.buyBulk?t=bt:100===Game.buyBulk&&(t=kt),te=Game.Objects[ie].bulkPrice,oe=t[ie].bonus,1===e.TooltipBuildUpgrade&&1===Game.buyMode){l("CMTooltipIncome").textContent=pe(oe,2);const o=Math.round(oe/Game.cookiesPs*1e4);Number.isFinite(o)&&0!==o?l("CMTooltipIncome").textContent+=` (${o/100}% of income)`:l("CMTooltipIncome").textContent+=` (<0${e.ScaleSeparator?",":"."}01% of income)`,l("CMTooltipBorder").className=E+t[ie].color,e.PPDisplayTime?l("CMTooltipPP").textContent=ue(t[ie].pp):l("CMTooltipPP").textContent=pe(t[ie].pp,2),l("CMTooltipPP").className=E+t[ie].color;const n=me((te-(Game.cookies+ho()))/mo());l("CMTooltipTime").textContent=n.text,"Done!"===n.text&&Game.cookiest.plantsById[t.plot[ie[1]][ie[0]][0]-1].mature,o=t.plantsById[t.plot[ie[1]][ie[0]][0]-1].name;l("CMTooltipBorder").appendChild(So("Reward (Current / Maximum)"));const n=document.createElement("div");n.id="CMTooltipPlantReward",l("CMTooltipBorder").appendChild(n),"Bakeberry"===o?l("CMTooltipPlantReward").textContent=`${e?pe(Math.min(.03*Game.cookies,60*Game.cookiesPs*30)):"0"} / ${pe(60*Game.cookiesPs*30)}`:"Chocoroot"===o||"White chocoroot"===o?l("CMTooltipPlantReward").textContent=`${e?pe(Math.min(.03*Game.cookies,60*Game.cookiesPs*3)):"0"} / ${pe(60*Game.cookiesPs*3)}`:"Queenbeet"===o?l("CMTooltipPlantReward").textContent=`${e?pe(Math.min(.04*Game.cookies,60*Game.cookiesPs*60)):"0"} / ${pe(60*Game.cookiesPs*60)}`:"Duketater"===o?l("CMTooltipPlantReward").textContent=`${e?pe(Math.min(.08*Game.cookies,60*Game.cookiesPs*120)):"0"} / ${pe(60*Game.cookiesPs*120)}`:l("CMTooltipArea").style.display="none"}else l("CMTooltipArea").style.display="none"}():"ha"===ne?function(){const{minigame:t}=Game.Objects.Farm;if(e.TooltipLump){l("CMTooltipBorder").appendChild(So("Cookies gained from harvesting:"));let e=0,o=0;Game.keys[16]&&Game.keys[17]&&(o=1);for(let n=0;n<6;n++)for(let i=0;i<6;i++)if(t.plot[n][i][0]>=1){const a=t.plot[n][i],r=t.plantsById[a[0]-1],l=r.name;let s=!0;o&&r.immortal&&(s=!1),a[1]0&&t=1?l("CMTimerBarGCMinBar").textContent=Math.ceil((Game.shimmerTypes.golden.minTime-Game.shimmerTypes.golden.time)/Game.fps):l("CMTimerBarGCMinBar").textContent="",Game.shimmerTypes.golden.minTime===Game.shimmerTypes.golden.maxTime?(l("CMTimerBarGCMinBar").style.borderTopRightRadius="10px",l("CMTimerBarGCMinBar").style.borderBottomRightRadius="10px"):(l("CMTimerBarGCMinBar").style.borderTopRightRadius="",l("CMTimerBarGCMinBar").style.borderBottomRightRadius=""),l("CMTimerBarGCBar").style.width=`${Math.round(Math.min(Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.minTime,Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.time)*t/Game.shimmerTypes.golden.maxTime)}px`,e.TimerBarOverlay>=1?l("CMTimerBarGCBar").textContent=Math.ceil(Math.min(Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.minTime,Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.time)/Game.fps):l("CMTimerBarGCBar").textContent="",l("CMTimerBarGCTime").textContent=Math.ceil((Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.time)/Game.fps),n+=1),"christmas"===Game.season&&0===Game.shimmerTypes.reindeer.spawned?(l("CMTimerBarRen").style.display="",l("CMTimerBarRenMinBar").style.width=`${Math.round(Math.max(0,Game.shimmerTypes.reindeer.minTime-Game.shimmerTypes.reindeer.time)*t/Game.shimmerTypes.reindeer.maxTime)}px`,e.TimerBarOverlay>=1?l("CMTimerBarRenMinBar").textContent=Math.ceil((Game.shimmerTypes.reindeer.minTime-Game.shimmerTypes.reindeer.time)/Game.fps):l("CMTimerBarRenMinBar").textContent="",l("CMTimerBarRenBar").style.width=`${Math.round(Math.min(Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.minTime,Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.time)*t/Game.shimmerTypes.reindeer.maxTime)}px`,e.TimerBarOverlay>=1?l("CMTimerBarRenBar").textContent=Math.ceil(Math.min(Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.minTime,Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.time)/Game.fps):l("CMTimerBarRenBar").textContent="",l("CMTimerBarRenTime").textContent=Math.ceil((Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.time)/Game.fps),n+=1):l("CMTimerBarRen").style.display="none";const i={};l("CMTimerBarBuffTimers").innerHTML="",Object.keys(Game.buffs).forEach((t=>{if(Game.buffs[t]){const a=go(Game.buffs[t].name,Game.buffs[t].name,[{id:`${Game.buffs[t].name}Bar`}]);a.style.display="";let r="";r=void 0!==ee[Game.buffs[t].name]?ee[Game.buffs[t].name]:j,a.lastChild.children[1].className=N+r,a.lastChild.children[1].style.color="black",2===e.TimerBarOverlay?a.lastChild.children[1].textContent=`${Math.round(Game.buffs[t].time/Game.buffs[t].maxTime*100)}%`:a.lastChild.children[1].textContent="",a.lastChild.children[1].style.width=`${Math.round(Game.buffs[t].time*(o-8*Math.ceil(Game.buffs[t].time/Game.fps).toString().length)/Game.buffs[t].maxTime)}px`,a.lastChild.children[2].textContent=Math.ceil(Game.buffs[t].time/Game.fps),n+=1,i[Game.buffs[t].name]=a}})),Object.keys(i).forEach((e=>{l("CMTimerBarBuffTimers").appendChild(i[e])})),0!==n&&(l("CMTimerBar").style.height=12*n+2+"px"),le!==n&&(le=n,bo())}}(),Co(),Oo(),function(){if(1===e.TooltipWrink&&1===_){let e=!1;Object.keys(Game.wrinklers).forEach((t=>{const o=Game.wrinklers[t];if(o.phase>0&&o.selected){if(e=!0,0===X[t]||void 0===X[t]){const e=document.createElement("div"),o=document.createElement("div");o.style.minWidth="120px",o.style.marginBottom="4px";const n=document.createElement("div");n.style.textAlign="center",n.id="CMTooltipWrinkler",o.appendChild(n),e.appendChild(o),Game.tooltip.draw(this,escape(e.innerHTML)),Q=t,X[t]=1}}else X[t]=0})),e||Game.tooltip.hide()}}(),function(){if(1===e.TooltipWrink&&null!==l("CMTooltipWrinkler")){let{sucked:e}=Game.wrinklers[Q],t=1.1;if(Game.Has("Sacrilegious corruption")&&(t*=1.05),1===Game.wrinklers[Q].type&&(t*=3),e*=t,Game.Has("Wrinklerspawn")&&(e*=1.05),eo.Temple.minigameLoaded){const t=Game.hasGod("scorn");1===t?e*=1.15:2===t?e*=1.1:3===t&&(e*=1.05)}l("CMTooltipWrinkler").textContent=pe(e)}}(),e.UpStats&&"stats"===Game.onMenu&&(Game.drawT-1)%(5*Game.fps)!=0&&(Game.drawT-1)%Game.fps==0&&Game.UpdateMenu(),t(),e.Scale){let e=l("cookies").innerHTML.replace(/.*(?=
)/i,pe(Game.cookies));Game.prefs.monospace&&(e=`${e}`),l("cookies").innerHTML=e}}function Lo(){he.addLatest(Game.computedMouseCps)}class Wo{constructor(e){this.maxLength=e,this.queue=[]}addLatest(e){this.queue.push(e)>this.maxLength&&this.queue.shift()}calcAverage(e){let t=e;t>this.maxLength&&(t=this.maxLength),t>this.queue.length&&(t=this.queue.length);let o=0;for(let e=this.queue.length-1;e>=0&&e>this.queue.length-1-t;e--)o+=this.queue[e];return 0===o?0:o/t}calcSum(e){let t=e;return t>this.maxLength&&(t=this.maxLength),t>this.queue.length&&(t=this.queue.length),0===t?0:this.queue.slice(-t).reduce(((e,t)=>e+t),0)}}function Ao(){const t=Math.floor(Date.now()/1e3);if(Game.T/Game.fps%1==0){let o=Game.cookies+Jt;Game.cpsSucked>0&&(o+=vt),zt=Math.max(Game.cookiesEarned,o),o*=.05;const n=t-Ge,i=Math.max(0,Game.cookies-ve)/n,a=Math.max(0,vt-we)/n,r=Math.max(0,xt[0]-xe)/n,l=Math.max(0,o-Ct)/n,s=(Game.cookieClicks-Te)/n;for(let e=0;e0&&(n=A),n}function Do(t,o){Object.keys(t).forEach((n=>{if(e.PPRigidelMode&&1===o)t[n].color=D;else{t[n].color=jo(t[n],Game.Objects[n].getSumPrice(o));for(let o=0;o{const i=Game.Objects[n].getSumPrice(o);Game.cookiesPs?t[n].pp=Math.max(i-(Game.cookies+ho()),0)/Game.cookiesPs+i/t[n].bonus:t[n].pp=i/t[n].bonus,e.PPRigidelMode&&1===o||Yt.push([t[n].pp,o])}))}function Uo(){!function(){qt=1/0,Yt=[],void 0===e.PPExcludeTop&&(e.PPExcludeTop=0),Ho(yt,1),Ho(bt,10),Ho(kt,100),Yt.sort(((e,t)=>e[0]-t[0]));let t=0;if(e.PPOnlyConsiderBuyable)for(;Yt[t][1]>Game.cookies&&(t+=1,Yt.length!==t+1););qt=Yt[e.PPExcludeTop][t],Do(yt,1),Do(bt,10),Do(kt,100)}(),Object.keys(St).forEach((e=>{Game.cookiesPs?St[e].pp=Math.max(Game.Upgrades[e].getPrice()-(Game.cookies+ho()),0)/Game.cookiesPs+Game.Upgrades[e].getPrice()/St[e].bonus:St[e].pp=Game.Upgrades[e].getPrice()/St[e].bonus,Number.isNaN(St[e].pp)&&(St[e].pp=1/0),St[e].color=jo(St[e],Game.Upgrades[e].getPrice())}))}function $o(e,t,o,n,i){let a=o,r=0;for(let o=0;o{if(Game.Objects[e].minigameLoaded&&Game.Objects[e].minigame.effs){const o=Game.Objects[e].minigame.effs;Object.keys(o).forEach((e=>{t[e]?t[e]*=o[e]:t[e]=o[e]}))}})),Qe=t,1!==Game.ascensionMode&&(e+=.01*parseFloat(Ue)*He*function(){let e=0;if(ro("Heavenly chip secret")&&(e+=.05),ro("Heavenly cookie stand")&&(e+=.2),ro("Heavenly bakery")&&(e+=.25),ro("Heavenly confectionery")&&(e+=.25),ro("Heavenly key")&&(e+=.25),e*=1+.05*no("Dragon God"),ro("Lucky digit")&&(e*=1.01),ro("Lucky number")&&(e*=1.01),ro("Lucky payout")&&(e*=1.01),Game.hasGod){const t=lo("creation");1===t?e*=.7:2===t?e*=.8:3===t&&(e*=.9)}return e}()),e*=ao("cps"),ro("Heralds")&&1!==Game.ascensionMode&&(e*=1+.01*Game.heralds),Object.keys(Game.cookieUpgrades).forEach((t=>{const o=Game.cookieUpgrades[t];ro(o.name)&&("function"==typeof o.power?e*=1+.01*to[o.name].power(to[o.name]):e*=1+.01*o.power)})),ro("Specialized chocolate chips")&&(e*=1.01),ro("Designer cocoa beans")&&(e*=1.02),ro("Underworld ovens")&&(e*=1.03),ro("Exotic nuts")&&(e*=1.04),ro("Arcane sugar")&&(e*=1.05),ro("Increased merriness")&&(e*=1.15),ro("Improved jolliness")&&(e*=1.15),ro("A lump of coal")&&(e*=1.01),ro("An itchy sweater")&&(e*=1.01),ro("Santa's dominion")&&(e*=1.2),ro("Fortune #100")&&(e*=1.01),ro("Fortune #101")&&(e*=1.07),ro("Dragon scale")&&(e*=1.03);let o=1;if(lo){let t=lo("asceticism");1===t?e*=1.15:2===t?e*=1.1:3===t&&(e*=1.05),t=lo("ages"),1===t?e*=1+.15*Math.sin(B/1e3/10800*Math.PI*2):2===t?e*=1+.15*Math.sin(B/1e3/43200*Math.PI*2):3===t&&(e*=1+.15*Math.sin(B/1e3/86400*Math.PI*2)),t=lo("decadence"),1===t?o*=.93:2===t?o*=.95:3===t&&(o*=.98),t=lo("industry"),1===t?o*=1.1:2===t?o*=1.06:3===t&&(o*=1.03),t=lo("labor"),1===t?o*=.97:2===t?o*=.98:3===t&&(o*=.99)}ro("Santa's legacy")&&(e*=1+.03*(Game.santaLevel+1));const n=De/25;let i=1;if(ro("Santa's milk and cookies")&&(i*=1.05),i*=1+.05*no("Breath of Milk"),lo){const e=lo("mother");1===e?i*=1.1:2===e?i*=1.05:3===e&&(i*=1.03)}i*=ao("milk");let a=1;ro("Kitten helpers")&&(a*=1+.1*n*i),ro("Kitten workers")&&(a*=1+.125*n*i),ro("Kitten engineers")&&(a*=1+.15*n*i),ro("Kitten overseers")&&(a*=1+.175*n*i),ro("Kitten managers")&&(a*=1+.2*n*i),ro("Kitten accountants")&&(a*=1+.2*n*i),ro("Kitten specialists")&&(a*=1+.2*n*i),ro("Kitten experts")&&(a*=1+.2*n*i),ro("Kitten consultants")&&(a*=1+.2*n*i),ro("Kitten assistants to the regional manager")&&(a*=1+.175*n*i),ro("Kitten marketeers")&&(a*=1+.15*n*i),ro("Kitten analysts")&&(a*=1+.125*n*i),ro("Kitten executives")&&(a*=1+.115*n*i),ro("Kitten angels")&&(a*=1+.1*n*i),ro("Fortune #103")&&(a*=1+.05*n*i),Object.keys(eo).forEach((e=>{const t=eo[e];let a=t.cps(t);1!==Game.ascensionMode&&(a*=(1+.01*t.level)*o),"Grandma"===t.name&&ro("Milkhelp® lactose intolerance relief tablets")&&(a*=1+.05*n*i),Xe+=t.amount*a})),ro('"egg"')&&(Xe+=9),e*=a;let r=1;if(ro("Chicken egg")&&(r*=1.01),ro("Duck egg")&&(r*=1.01),ro("Turkey egg")&&(r*=1.01),ro("Quail egg")&&(r*=1.01),ro("Robin egg")&&(r*=1.01),ro("Ostrich egg")&&(r*=1.01),ro("Cassowary egg")&&(r*=1.01),ro("Salmon roe")&&(r*=1.01),ro("Frogspawn")&&(r*=1.01),ro("Shark egg")&&(r*=1.01),ro("Turtle egg")&&(r*=1.01),ro("Ant larva")&&(r*=1.01),ro("Century egg")){let e=10*Math.floor((P-Game.startDate)/1e3/10)/60/60/24;e=Math.min(e,100),gt=1+.1*(1-(1-e/100)**3),r*=gt}e*=r,ro("Sugar baking")&&(e*=1+.01*Math.min(100,Game.lumps)),e*=1+no("Radiant Appetite");const l=Xe*e;Object.keys(Game.CpsAchievements).forEach((e=>{l>=Game.CpsAchievements[e].threshold&&Ro(Game.CpsAchievements[e].name)})),qe=l;const{n:s}=Game.shimmerTypes.golden,c=no("Dragon's Fortune");for(let t=0;t{ro(e[o])&&(t+=.1)}))}e*=t}if(ro("Shimmering veil [off]")){let t=.5;ro("Reinforced membrane")&&(t+=.1),e*=1+t}ro("Magic shenanigans")&&(e*=1e3),ro("Occult obstruction")&&(e*=0),Xe=Game.runModHookOnValue("cps",Xe),e*=Eo(),Xe*=e}const zo=["Fortune #001","Fortune #002","Fortune #003","Fortune #004","Fortune #005","Fortune #006","Fortune #007","Fortune #008","Fortune #009","Fortune #010","Fortune #011","Fortune #012","Fortune #013","Fortune #014","Fortune #015","Fortune #016","Fortune #017","Fortune #018","Fortune #100","Fortune #101","Fortune #102","Fortune #103","Fortune #104"],Vo=["Skull cookies","Ghost cookies","Bat cookies","Slime cookies","Pumpkin cookies","Eyeball cookies","Spider cookies"],_o=["Christmas tree biscuits","Snowflake biscuits","Snowman biscuits","Holly biscuits","Candy cane biscuits","Bell biscuits","Present biscuits"],Qo=["Pure heart biscuits","Ardent heart biscuits","Sour heart biscuits","Weeping heart biscuits","Golden heart biscuits","Eternal heart biscuits","Prism heart biscuits"],Xo=["Elderwort biscuits","Bakeberry cookies","Duketater cookies","Green yeast digestives","Wheat slims","Fern tea","Ichor syrup"];function qo(e){return oo[e]?oo[e].won:0}function Yo(){let e=0;Object.keys(Game.GrandmaSynergies).forEach((t=>{ro(Game.GrandmaSynergies[t])&&(e+=1)})),!qo("Elder")&&e>=7&&Ro("Elder"),!qo("Veteran")&&e>=14&&Ro("Veteran");let t=0,o=1,n=1,i=1e5;Object.keys(eo).forEach((e=>{t+=eo[e].amount,i=Math.min(eo[e].amount,i),qo("Mathematician")||eo[e].amount=1&&Ro("One with everything"),1===o&&Ro("Mathematician"),1===n&&Ro("Base 10"),i>=100&&Ro("Centennial"),i>=150&&Ro("Centennial and a half"),i>=200&&Ro("Bicentennial"),i>=250&&Ro("Bicentennial and a half"),i>=300&&Ro("Tricentennial"),i>=350&&Ro("Tricentennial and a half"),i>=400&&Ro("Quadricentennial"),i>=450&&Ro("Quadricentennial and a half"),i>=500&&Ro("Quincentennial"),i>=550&&Ro("Quincentennial and a half"),i>=600&&Ro("Sexcentennial"),t>=100&&Ro("Builder"),t>=500&&Ro("Architect"),t>=1e3&&Ro("Engineer"),t>=2e3&&Ro("Lord of Constructs"),t>=4e3&&Ro("Grand design"),t>=8e3&&Ro("Ecumenopolis"),Ae>=20&&Ro("Enhancer"),Ae>=50&&Ro("Augmenter"),Ae>=100&&Ro("Upgrader"),Ae>=200&&Ro("Lord of Progress"),Ae>=300&&Ro("The full picture"),Ae>=400&&Ro("When there's nothing left to add"),t>=4e3&&Ae>=300&&Ro("Polymath"),t>=8e3&&Ae>=400&&Ro("Renaissance baker"),eo.Cursor.amount+eo.Grandma.amount>=777&&Ro("The elder scrolls");let a=!0;Object.keys(Vo).forEach((e=>{ro(Vo[e])||(a=!1)})),a&&Ro("Spooky cookies");let r=!0;if(Object.keys(_o).forEach((e=>{ro(_o[e])||(r=!1)})),r&&Ro("Let it snow"),ro("Fortune cookies")){const e=Game.Tiers.fortune.upgrades;let t=0;Object.keys(e).forEach((o=>{ro(e[o].name)&&(t+=1)})),t>=e.length&&Ro("O Fortuna")}}function Ko(e,t){Mo(),eo[e].amount+=t;const o=eo[e];"Cursor"===e?(o.amount>=1&&Ro("Click"),o.amount>=2&&Ro("Double-click"),o.amount>=50&&Ro("Mouse wheel"),o.amount>=100&&Ro("Of Mice and Men"),o.amount>=200&&Ro("The Digital"),o.amount>=300&&Ro("Extreme polydactyly"),o.amount>=400&&Ro("Dr. T"),o.amount>=500&&Ro("Thumbs, phalanges, metacarpals"),o.amount>=600&&Ro("With her finger and her thumb"),o.amount>=700&&Ro("Gotta hand it to you"),o.amount>=800&&Ro("The devil's workshop")):Object.keys(Game.Objects[o.name].tieredAchievs).forEach((e=>{o.amount>=Game.Tiers[Game.Objects[o.name].tieredAchievs[e].tier].achievUnlock&&Ro(Game.Objects[o.name].tieredAchievs[e].name)}));const n=De;return Io(),Yo(),n!==De&&Io(),Xe-Game.cookiesPs}function Jo(e){const t={};return Object.keys(Game.Objects).forEach((o=>{t[o]={},t[o].bonus=Ko(o,e),1!==e&&(Fe=1)})),t}function Zo(){Object.keys(Game.Objects).forEach((e=>{yt[e].price=$o(Game.Objects[e],Game.Objects[e].basePrice,Game.Objects[e].amount,Game.Objects[e].free,1),bt[e].price=$o(Game.Objects[e],Game.Objects[e].basePrice,Game.Objects[e].amount,Game.Objects[e].free,10),kt[e].price=$o(Game.Objects[e],Game.Objects[e].basePrice,Game.Objects[e].amount,Game.Objects[e].free,100)}))}function en(){yt=Jo(1),bt=Jo(10),kt=Jo(100),St=[],Object.keys(Game.Upgrades).forEach((t=>{const o=function(e){if("toggle"===Game.Upgrades[e].pool||0===Game.Upgrades[e].bought&&Game.Upgrades[e].unlocked&&"prestige"!==Game.Upgrades[e].pool){Mo(),"Shimmering veil [on]"===to[e].name?to["Shimmering veil [off]"].bought=0:"Golden switch [on]"===to[e].name?to["Golden switch [off]"].bought=0:to[e].bought=(to[e].bought+1)%2,Game.CountsAsUpgradeOwned(Game.Upgrades[e].pool)&&(Ae+=1),"Elder Pledge"===e?(je+=1,je>0&&Ro("Elder nap"),je>=5&&Ro("Elder slumber")):"Elder Covenant"===e?Ro("Elder calm"):"Prism heart biscuits"===e?Ro("Lovely cookies"):"Heavenly key"===e&&Ro("Wholesome");const t=De;Io(),Yo(),t!==De&&Io();const o=function(){let e=0;ro("Thousand fingers")&&(e+=.1),ro("Million fingers")&&(e*=5),ro("Billion fingers")&&(e*=10),ro("Trillion fingers")&&(e*=20),ro("Quadrillion fingers")&&(e*=20),ro("Quintillion fingers")&&(e*=20),ro("Sextillion fingers")&&(e*=20),ro("Septillion fingers")&&(e*=20),ro("Octillion fingers")&&(e*=20),ro("Nonillion fingers")&&(e*=20);let t=0;Object.keys(eo).forEach((e=>{t+=eo[e].amount})),t-=eo.Cursor.amount,e*=t,ro("Plastic mouse")&&(e+=.01*Xe),ro("Iron mouse")&&(e+=.01*Xe),ro("Titanium mouse")&&(e+=.01*Xe),ro("Adamantium mouse")&&(e+=.01*Xe),ro("Unobtainium mouse")&&(e+=.01*Xe),ro("Eludium mouse")&&(e+=.01*Xe),ro("Wishalloy mouse")&&(e+=.01*Xe),ro("Fantasteel mouse")&&(e+=.01*Xe),ro("Nevercrack mouse")&&(e+=.01*Xe),ro("Armythril mouse")&&(e+=.01*Xe),ro("Technobsidian mouse")&&(e+=.01*Xe),ro("Plasmarble mouse")&&(e+=.01*Xe),ro("Miraculite mouse")&&(e+=.01*Xe),ro("Fortune #104")&&(e+=.01*Xe);let o=1;if(ro("Santa's helpers")&&(o*=1.1),ro("Cookie egg")&&(o*=1.1),ro("Halo gloves")&&(o*=1.1),ro("Dragon claw")&&(o*=1.03),ro("Aura gloves")&&(o*=1+.05*Math.min(Game.Objects.Cursor.level,ro("Luminous gloves")?20:10)),o*=ao("click"),eo.Temple.minigameLoaded&&lo){const e=lo("labor");1===e?o*=1.15:2===e?o*=1.1:3===e&&(o*=1.05)}Object.keys(Game.buffs).forEach((e=>{void 0!==Game.buffs[e].multClick&&(o*=Game.buffs[e].multClick)})),o*=1+.05*no("Dragon Cursor");let n=o*Game.ComputeCps(1,ro("Reinforced index finger")+ro("Carpal tunnel prevention cream")+ro("Ambidextrous"),e);return n=Game.runModHookOnValue("cookiesPerClick",n),Game.hasBuff("Cursed finger")&&(n=Game.buffs["Cursed finger"].power),n}()-Game.computedMouseCps;return o?[Xe-Game.cookiesPs,o]:[Xe-Game.cookiesPs]}return[]}(t);"Elder Pledge"===t?(St[t]={bonus:Game.cookiesPs-Me},1===e.CalcWrink?St[t].bonus-=Se:2===e.CalcWrink&&(St[t].bonus-=Be),Number.isFinite(St[t].bonus)||(St[t].bonus=0)):(St[t]={},o[0]&&(St[t].bonus=o[0]),o[1]&&(St[t].bonusMouse=o[1]))}))}function tn(e,t,o){let n=0,i=0,a=0,r=0,l=1+Math.max(0,Math.ceil(Math.log(Game.cookies)/Math.LN10)-10);for(;a0?e/=t:e=0,Lt=tn(7,e,ut),Ot=2*Lt[1]/ut,Ft=Lt[2]/60/60/6/pt,jt=tn(6,e,mt),Wt=2*jt[1]/mt,At=jt[2]/60/60/6/pt,Ut=tn(7,7*e,ut),Dt=2*Ut[1]/ut,Ht=Ut[2]/60/60/6/pt,It=tn(6,7*e,mt),$t=2*It[1]/mt,Rt=It[2]/60/60/6/pt}function nn(){const e=Math.floor(Date.now()/1e3);if(Game.T/Game.fps%1==0){const t=Game.HowMuchPrestige(Game.cookiesReset),o=Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned))-Math.floor(t),n=e-Ne,i=Math.max(0,o-Oe)/n;for(let e=0;e{e.push(Game.Upgrades[t])})),e.sort((function(e,t){return e.order>t.order?1:e.order{const o=e[t];if(0===o.bought){let e="";e+=function(e){let t="crate upgrade missing";"prestige"===e.pool&&(t+=" heavenly");let o=0;Game.prefs.crates||(o=1),o&&(t+=" noFrame");let{icon:n}=e;e.iconFunction&&(n=e.iconFunction());const i=`function() {return Game.crateTooltip(Game.UpgradesById[${e.id}], 'stats');}`;return`
\n\t
`}(o),"prestige"===o.pool?Et+=e:"cookie"===o.pool?Nt+=e:"toggle"!==o.pool&&"unused"!==o.pool&&"debug"!==o.pool&&(Pt+=e)}}))}function rn(){if("christmas"===Game.season){let e=60*Game.cookiesPs;Game.hasBuff("Elder frenzy")&&(e*=.5),Game.hasBuff("Frenzy")&&(e*=.75),ft=Math.max(25,e),Game.Has("Ho ho ho-flavored frosting")&&(ft*=2)}}function ln(){et=900*dt/.15,et*=pt;const e=Eo();e>0?et/=e:et=0,tt=ut*(.15*et)+13,ot=mt*(.15*et)+13,nt=7*et,it=ut*(.15*nt)+13,at=mt*(.15*nt)+13,rt=2*et,lt=.15*rt,st=0;let t=0,o=0;Object.keys(Game.Objects).forEach((e=>{Game.Objects[e].amount>t&&(t=Game.Objects[e].amount),Game.Objects[e].amount>0&&(o+=1)})),Object.keys(Game.Objects).forEach((e=>{(Game.Objects[e].amountst&&(st=2*Game.Objects[e].price,ct=e)}))}function sn(){let e=1,t=1,o=1;ro("Green yeast digestives")&&(o*=1.01),ro("Dragon fang")&&(o*=1.03),e*=1+.1*Game.auraMult("Ancestral Metamorphosis"),e*=Game.eff("goldenCookieGain"),t*=1+.1*Game.auraMult("Unholy Dominion"),t*=Game.eff("wrathCookieGain"),ut=o*e,mt=o*t,pt=1,0===Game.shimmerTypes.golden.n&&(pt*=1+1.23*Game.auraMult("Dragon's Fortune"))}function cn(){vt=0,wt=0,xt=[0,null];for(let e=0;ext[0]&&(xt=[t,e]))}}function dn(){Go(),cn(),ln(),sn(),on(),an(),rn(),ge=new Wo(J[J.length-1]),fe=new Wo(J[J.length-1]),Ce=new Wo(J[J.length-1]),ye=new Wo(J[J.length-1]),be=new Wo(Z[Z.length-1]),ke=new Wo(5),he=new Wo(20*Z[Z.length-1]),nn(),Ao(),en(),Zo(),Uo()}const pn={CPSMode:1,AvgCPSHist:3,AvgClicksHist:0,CalcWrink:0,Scale:2,ScaleDecimals:2,ScaleSeparator:0,ScaleCutoff:999999,TimeFormat:0,DetailedTime:1,PPDisplayTime:0,BuildColour:1,PPOnlyConsiderBuyable:0,PPExcludeTop:0,PPRigidelMode:0,PPSecondsLowerLimit:0,ColourBlue:"#4bb8f0",ColourGreen:"#00ff00",ColourYellow:"#ffff00",ColourOrange:"#ff7f00",ColourRed:"#ff0000",ColourPurple:"#ff00ff",ColourGray:"#b3b3b3",ColourPink:"#ff1493",ColourBrown:"#8b4513",BotBar:1,TimerBar:1,TimerBarPos:0,TimerBarOverlay:2,UpBarColour:1,UpgradeBarFixedPos:1,SortBuildings:0,SortUpgrades:0,DragonAuraInfo:1,GrimoireBar:1,GCTimer:1,Favicon:1,WrinklerButtons:1,HideSectionsButtons:0,TooltipBuildUpgrade:1,TooltipAmor:0,ToolWarnLucky:1,ToolWarnLuckyFrenzy:1,ToolWarnConjure:1,ToolWarnConjureFrenzy:1,ToolWarnEdifice:1,ToolWarnUser:0,ToolWarnBon:1,ToolWarnPos:1,TooltipGrim:1,TooltipWrink:1,TooltipLump:1,TooltipPlots:1,TooltipPantheon:1,TooltipAscendButton:1,Stats:1,MissingUpgrades:1,MissingAchievements:0,UpStats:1,HeavenlyChipsTarget:1,ShowMissedGC:1,Title:1,GeneralSound:1,GCNotification:0,GCFlash:1,ColourGCFlash:"#ffffff",GCSound:1,GCVolume:100,GCSoundURL:"https://freesound.org/data/previews/66/66717_931655-lq.mp3",FortuneNotification:0,FortuneFlash:1,ColourFortuneFlash:"#ffffff",FortuneSound:1,FortuneVolume:100,FortuneSoundURL:"https://freesound.org/data/previews/174/174027_3242494-lq.mp3",SeaNotification:0,SeaFlash:1,ColourSeaFlash:"#ffffff",SeaSound:1,SeaVolume:100,SeaSoundURL:"https://www.freesound.org/data/previews/121/121099_2193266-lq.mp3",GardFlash:1,ColourGardFlash:"#ffffff",GardSound:1,GardVolume:100,GardSoundURL:"https://freesound.org/data/previews/103/103046_861714-lq.mp3",MagicNotification:0,MagicFlash:1,ColourMagicFlash:"#ffffff",MagicSound:1,MagicVolume:100,MagicSoundURL:"https://freesound.org/data/previews/221/221683_1015240-lq.mp3",WrinklerNotification:0,WrinklerFlash:1,ColourWrinklerFlash:"#ffffff",WrinklerSound:1,WrinklerVolume:100,WrinklerSoundURL:"https://freesound.org/data/previews/124/124186_8043-lq.mp3",WrinklerMaxNotification:0,WrinklerMaxFlash:1,ColourWrinklerMaxFlash:"#ffffff",WrinklerMaxSound:1,WrinklerMaxVolume:100,WrinklerMaxSoundURL:"https://freesound.org/data/previews/152/152743_15663-lq.mp3",BulkBuyBlock:0,FavouriteSettings:1,Header:{Favourite:1,Calculation:1,Notation:1,Colours:1,BarsDisplay:1,Tooltip:1,Statistics:1,Notification:1,NotificationGeneral:1,NotificationGC:1,NotificationFC:1,NotificationSea:1,NotificationGard:1,NotificationMagi:1,NotificationWrink:1,NotificationWrinkMax:1,Miscellaneous:1,Lucky:1,Chain:1,Spells:1,Garden:1,Prestige:1,Wrink:1,Sea:1,Misc:1,InfoTab:1}},un=function(e){if(1===e){const e=function(){try{Notification.requestPermission().then()}catch(e){return!1}return!0};"Notification"in window?e()?Notification.requestPermission().then():Notification.requestPermission():console.log("This browser does not support notifications.")}};function mn(){1===e.BotBar?(l("CMBotBar").style.display="",Co()):l("CMBotBar").style.display="none",bo()}function hn(){BeautifyAll(),Game.RefreshStore(),Game.RebuildUpgrades(),Co(),po(),uo()}function gn(){1===e.Favicon&&y>0?_t.wrath?l("CMFavicon").href="https://aktanusa.github.io/CookieMonster/favicon/wrathCookie.ico":l("CMFavicon").href="https://aktanusa.github.io/CookieMonster/favicon/goldenCookie.ico":l("CMFavicon").href="https://orteil.dashnet.org/cookieclicker/favicon.ico"}class fn{constructor(e,t){this.type=e,this.group=t}}class Cn extends fn{constructor(e,t,o){super(e,t),this.desc=o}}class yn extends fn{constructor(e,t,o,n,i,a){super(e,t),this.label=o,this.desc=n,this.min=i,this.max=a}}class bn extends fn{constructor(e,t,o,n,i,a){super(e,t),this.label=o,this.desc=n,this.toggle=i,void 0!==a&&(this.func=a)}}class kn extends fn{constructor(e,t,o,n){super(e,t),this.label=o,this.desc=n;for(let e=0;e<101;e++)this.label[e]=`${e}%`}}const Gn={CPSMode:new bn("bool","Calculation",["Current cookies per second","Average cookies per second"],"Calculate times using current cookies per second or average cookies per second",!1),AvgCPSHist:new bn("bool","Calculation",["Average CPS in past 10s","Average CPS in past 15s","Average CPS in past 30s","Average CPS in past 1m","Average CPS in past 5m","Average CPS in past 10m","Average CPS in past 15m","Average CPS in past 30m"],"How much time average Cookies Per Second should consider",!1),AvgClicksHist:new bn("bool","Calculation",["Average clicks in past 1s","Average clicks in past 5s","Average clicks in past 10s","Average clicks in past 15s","Average clicks in past 30s"],"How much time average Cookie Clicks should consider",!1),CalcWrink:new bn("bool","Calculation",["Calculate with wrinklers OFF","Calculate with wrinklers ON","Calculate with single fattest wrinkler ON"],"Calculate times and average Cookies Per Second with (only the single non-shiny fattest) wrinklers",!0,(function(){_e=!0})),Scale:new bn("bool","Notation",["Game's setting scale","Metric","Short scale","Short scale (Abbreviated)","Scientific notation","Engineering notation"],"Change how long numbers are formatted",!1,(function(){hn()})),ScaleDecimals:new bn("bool","Notation",["1 decimals","2 decimals","3 decimals"],'Set the number of decimals used when applicable. This only works with Cookie Monster scales and not with "Game\'s Setting Scale"',!1,(function(){hn()})),ScaleSeparator:new bn("bool","Notation",[". for decimals (standard)",". for thousands"],"Set the separator used for decimals and thousands",!1,(function(){hn()})),ScaleCutoff:new yn("numscale","Notation","Notation cut-off point: ","The number from which Cookie Monster will start formatting numbers based on chosen scale. Standard is 999,999. Setting this above 999,999,999 might break certain notations",1,999999999),TimeFormat:new bn("bool","Notation",["Time XXd, XXh, XXm, XXs","Time XX:XX:XX:XX:XX"],"Change the time format",!1),DetailedTime:new bn("bool","Notation",["Detailed time OFF","Detailed time ON"],"Change how time is displayed in certain statistics and tooltips",!0,(function(){1===e.DetailedTime?Game.sayTime=V:Game.sayTime=S.sayTime})),PPDisplayTime:new bn("bool","Notation",["PP as value (standard)","PP as time unit"],"Display PP as calculated value or as approximate time unit. Note that PP does not translate directly into a time unit and this is therefore only an approximation.",!1),BuildColour:new bn("bool","Colours",["Building colours OFF","Building colours ON"],"Colour code buildings",!0,(function(){po()})),PPOnlyConsiderBuyable:new bn("bool","Colours",["Don't ignore non-buyable","Ignore non-buyable"],"Makes Cookie Monster label buildings and upgrades you can't buy right now red, useful in those situations where you just want to spend your full bank 'most optimally'",!0),PPExcludeTop:new bn("bool","Colours",["Don't ignore any","Ignore 1st best","Ignore 1st and 2nd best","Ignore 1st, 2nd and 3rd best"],"Makes Cookie Monster ignore the 1st, 2nd or 3rd best buildings in labeling and colouring PP values",!0),PPRigidelMode:new bn("bool","Colours",["Rigidel mode OFF","Rigidel mode ON"],'Makes Cookie Monster ignore all "buy 1" options when colouring PP in order to stay at a total building count ending in 10 for pantheon god Rigidel',!0),PPSecondsLowerLimit:new yn("numscale","Colours","Lower limit for PP (in seconds): ",'If a building or upgrade costs less than the specified seconds of CPS it will also be considered optimal and label it as such ("PP is less than xx seconds of CPS"); setting to 0 ignores this option',0,1/0),ColourBlue:new Cn("colour","Colours","Standard colour is blue. Used to show upgrades better than best PP building, for Click Frenzy bar, and for various labels"),ColourGreen:new Cn("colour","Colours","Standard colour is green. Used to show best PP building, for Blood Frenzy bar, and for various labels"),ColourYellow:new Cn("colour","Colours","Standard colour is yellow. Used to show buildings within the top 10 of PP, for Frenzy bar, and for various labels"),ColourOrange:new Cn("colour","Colours","Standard colour is orange. Used to show buildings within the top 20 of PP, for Next Reindeer bar, and for various labels"),ColourRed:new Cn("colour","Colours","Standard colour is Red. Used to show buildings within the top 30 of PP, for Clot bar, and for various labels"),ColourPurple:new Cn("colour","Colours","Standard colour is purple. Used to show buildings outside of the top 30 of PP, for Next Cookie bar, and for various labels"),ColourGray:new Cn("colour","Colours","Standard colour is gray. Used to show negative or infinity PP, and for Next Cookie/Next Reindeer bar"),ColourPink:new Cn("colour","Colours","Standard colour is pink. Used for Dragonflight bar"),ColourBrown:new Cn("colour","Colours","Standard colour is brown. Used for Dragon Harvest bar"),BotBar:new bn("bool","BarsDisplay",["Bottom bar OFF","Bottom bar ON"],"Building information",!0,(function(){mn()})),TimerBar:new bn("bool","BarsDisplay",["Timer bar OFF","Timer bar ON"],"Bar with timers for golden cookie, season popup, Frenzy (Normal, Clot, Elder), Click Frenzy",!0,(function(){ko()})),TimerBarPos:new bn("bool","BarsDisplay",["Timer bar position (top left)","Timer bar position (bottom)"],"Placement of the timer bar",!1,(function(){0===e.TimerBarPos?(l("CMTimerBar").style.width="30%",l("CMTimerBar").style.bottom="",l("game").insertBefore(l("CMTimerBar"),l("sectionLeft"))):(l("CMTimerBar").style.width="100%",l("CMTimerBar").style.bottom="0px",l("wrapper").appendChild(l("CMTimerBar"))),bo()})),TimerBarOverlay:new bn("bool","BarsDisplay",["Timer bar overlay OFF","Timer bar overlay only seconds","Timer bar overlay full"],"Overlay on timers displaying seconds and/or percentage left",!0),UpBarColour:new bn("bool","BarsDisplay",["Upgrade colours/bar OFF","Upgrade colours with bar ON","Upgrade colours without bar ON"],"Colour code upgrades and optionally add a counter bar",!1,(function(){1===e.UpBarColor?(l("CMUpgradeBar").style.display="",uo()):2===e.UpBarColor?(l("CMUpgradeBar").style.display="none",uo()):(l("CMUpgradeBar").style.display="none",Game.RebuildUpgrades())})),UpgradeBarFixedPos:new bn("bool","BarsDisplay",["Upgrade bar fixed position OFF","Upgrade bar fixed position ON"],"Lock the upgrade bar at top of the screen to prevent it from moving ofscreen when scrolling",!0,(function(){1===e.UpgradeBarFixedPos?(l("CMUpgradeBar").style.position="sticky",l("CMUpgradeBar").style.top="0px"):l("CMUpgradeBar").style.position=""})),SortBuildings:new bn("bool","BarsDisplay",["Sort buildings: default","Sort buildings: PP of x1 purchase","Sort buildings: PP of selected bulk mode"],"Sort the display of buildings in either default order or by PP",!1,(function(){po()})),SortUpgrades:new bn("bool","BarsDisplay",["Sort upgrades: default","Sort upgrades: PP"],"Sort the display of upgrades in either default order or by PP",!1,(function(){uo()})),DragonAuraInfo:new bn("bool","BarsDisplay",["Extra dragon aura info OFF","Extra dragon aura info ON"],"Shows information about changes in CPS and costs in the dragon aura interface.",!0),GrimoireBar:new bn("bool","BarsDisplay",["Grimoire magic meter timer OFF","Grimoire magic meter timer ON"],"A timer on how long before the Grimoire magic meter is full",!0),GCTimer:new bn("bool","BarsDisplay",["Golden cookie timer OFF","Golden cookie timer ON"],"A timer on the golden cookie when it has been spawned",!0,(function(){1===e.GCTimer?Object.keys(se).forEach((e=>{se[e].style.display="block",se[e].style.left=Kt[e].l.style.left,se[e].style.top=Kt[e].l.style.top})):Object.keys(se).forEach((e=>se[e].style.display="none"))})),Favicon:new bn("bool","BarsDisplay",["Favicon OFF","Favicon ON"],"Update favicon with golden/wrath cookie",!0,(function(){gn()})),WrinklerButtons:new bn("bool","BarsDisplay",["Extra wrinkler buttons OFF","Extra wrinkler buttons ON"],"Show buttons for popping wrinklers at bottom of cookie section",!0,(function(){t()})),HideSectionsButtons:new bn("bool","BarsDisplay",["Hide buildings/upgrades button OFF","Hide buildings/upgrades button ON"],"Show buttons for hiding and showing the buildings and upgrades sections in the right column",!0,(function(){e.HideSectionsButtons?l("CMSectionHidButtons").style.display="":l("CMSectionHidButtons").style.display="none"})),TooltipBuildUpgrade:new bn("bool","Tooltip",["Building/upgrade tooltip information OFF","Building/upgrade tooltip information ON"],"Extra information in building/upgrade tooltips",!0),TooltipAmor:new bn("bool","Tooltip",["Buildings tooltip amortization information OFF","Buildings tooltip amortization information ON"],"Add amortization information to buildings tooltip",!0),ToolWarnLucky:new bn("bool","Tooltip",["Tooltip lucky warning OFF","Tooltip lucky warning ON"],'A warning when buying if it will put the bank under the amount needed for max "Lucky!" rewards',!0),ToolWarnLuckyFrenzy:new bn("bool","Tooltip",["Tooltip lucky frenzy warning OFF","Tooltip lucky frenzy warning ON"],'A warning when buying if it will put the bank under the amount needed for max "Lucky!" (Frenzy) rewards',!0),ToolWarnConjure:new bn("bool","Tooltip",["Tooltip conjure warning OFF","Tooltip conjure warning ON"],'A warning when buying if it will put the bank under the amount needed for max "Conjure Baked Goods" rewards',!0),ToolWarnConjureFrenzy:new bn("bool","Tooltip",["Tooltip conjure frenzy warning OFF","Tooltip conjure frenzy warning ON"],'A warning when buying if it will put the bank under the amount needed for max "Conjure Baked Goods" rewards with Frenzy active',!0),ToolWarnEdifice:new bn("bool","Tooltip",["Tooltip edifice warning OFF","Tooltip edifice warning ON"],'A warning when buying if it will put the bank under the amount needed for "Spontaneous Edifice" to possibly give you your most expensive building',!0),ToolWarnUser:new yn("numscale","Tooltip","Tooltip warning at x times CPS: ","Use this to show a customized warning if buying it will put the bank under the amount equal to value times cps; setting to 0 disables the function altogether",0,1/0),ToolWarnBon:new bn("bool","Tooltip",["Calculate tooltip warning with bonus CPS OFF","Calculate tooltip warning with bonus CPS ON"],"Calculate the warning with or without the bonus CPS you get from buying",!0),ToolWarnPos:new bn("bool","Tooltip",["Tooltip warning position (left)","Tooltip warning position (bottom)"],"Placement of the warning boxes",!1,(function(){No()})),TooltipGrim:new bn("bool","Tooltip",["Grimoire tooltip information OFF","Grimoire tooltip information ON"],"Extra information in tooltip for grimoire",!0),TooltipWrink:new bn("bool","Tooltip",["Wrinkler tooltip OFF","Wrinkler tooltip ON"],"Shows the amount of cookies a wrinkler will give when popping it",!0),TooltipLump:new bn("bool","Tooltip",["Sugar lump tooltip OFF","Sugar lump tooltip ON"],"Shows the current Sugar Lump type in Sugar lump tooltip.",!0),TooltipPlots:new bn("bool","Tooltip",["Garden plots tooltip OFF","Garden plots tooltip ON"],"Shows a tooltip for plants that have a cookie reward.",!0),TooltipPantheon:new bn("bool","Tooltip",["Pantheon tooltip OFF","Pantheon tooltip ON"],"Shows additional info in the pantheon tooltip",!0),TooltipAscendButton:new bn("bool","Tooltip",["Show Extra Info Ascend Tooltip OFF","Show Extra Info Ascend Tooltip ON"],"Shows additional info in the ascend tooltip",!0),Stats:new bn("bool","Statistics",["Statistics OFF","Statistics ON"],"Extra Cookie Monster statistics!",!0),MissingUpgrades:new bn("bool","Statistics",["Missing upgrades OFF","Missing upgrades ON"],"Shows missing upgrades in statistics menu",!0),MissingAchievements:new bn("bool","Statistics",["Missing Achievements OFF","Missing Normal Achievements ON"],"Shows missing normal achievements in statistics menu.",!0),UpStats:new bn("bool","Statistics",["Statistics update rate (default)","Statistics update rate (1s)"],"Default rate is once every 5 seconds",!1),HeavenlyChipsTarget:new yn("numscale","Statistics","Heavenly chips target: ",'Use this to set a heavenly chips target that will be counted towards in the "prestige" statsistics sections',1,1/0),ShowMissedGC:new bn("bool","Statistics",["Missed GC OFF","Missed GC ON"],"Show a stat in the statistics screen that counts how many golden cookies you have missed",!0),Title:new bn("bool","NotificationGeneral",["Title OFF","Title ON","Title pinned tab highlight"],'Update title with colden cookie/season popup timers; pinned tab highlight only changes the title when a golden cookie/season popup spawns; "!" means that golden cookie/reindeer can spawn',!0),GeneralSound:new bn("bool","NotificationGeneral",["Consider game volume setting OFF","Consider game volume setting ON"],'Turning this toggle to "off" makes Cookie Monster no longer consider the volume setting of the base game, allowing mod notifications to play with base game volume turned down',!0),GCNotification:new bn("bool","NotificationGC",["Notification OFF","Notification ON"],"Create a notification when golden cookie spawns",!0,(function(){un(e.GCNotification)})),GCFlash:new bn("bool","NotificationGC",["Flash OFF","Flash ON"],"Flash screen on golden cookie",!0),ColourGCFlash:new Cn("colour","NotificationGC","The colour of the GC flash, standard colour is white"),GCSound:new bn("bool","NotificationGC",["Sound OFF","Sound ON"],"Play a sound on golden cookie",!0),GCVolume:new kn("vol","NotificationGC",[],"Volume"),GCSoundURL:new bn("url","NotificationGC","Sound URL:","URL of the sound to be played when a golden cookie spawns"),FortuneNotification:new bn("bool","NotificationFC",["Notification OFF","Notification ON"],"Create a notification when fortune cookie is on the ticker",!0,(function(){un(e.FortuneNotification)})),FortuneFlash:new bn("bool","NotificationFC",["Flash OFF","Flash ON"],"Flash screen on fortune cookie spawn",!0),ColourFortuneFlash:new Cn("colour","NotificationFC","The colour of the fortune flash, standard colour is white"),FortuneSound:new bn("bool","NotificationFC",["Sound OFF","Sound ON"],"Play a sound on fortune cookie spawn",!0),FortuneVolume:new kn("vol","NotificationFC",[],"Volume"),FortuneSoundURL:new bn("url","NotificationFC","Sound URL:","URL of the sound to be played when the ticker has a fortune cookie"),SeaNotification:new bn("bool","NotificationSea",["Notification OFF","Notification ON"],"Create a notification on season popup",!0,(function(){un(e.SeaNotification)})),SeaFlash:new bn("bool","NotificationSea",["Flash OFF","Flash ON"],"Flash screen on season popup",!0),ColourSeaFlash:new Cn("colour","NotificationSea","The colour of the season popup flash, standard colour is white"),SeaSound:new bn("bool","NotificationSea",["Sound OFF","Sound ON"],"Play a sound on season popup",!0),SeaVolume:new kn("vol","NotificationSea",[],"Volume"),SeaSoundURL:new bn("url","NotificationSea","Sound URL:","URL of the sound to be played when on season popup spawns"),GardFlash:new bn("bool","NotificationGard",["Garden Tick Flash OFF","Flash ON"],"Flash screen on garden tick",!0),ColourGardFlash:new Cn("colour","NotificationGard","The colour of the garden flash, standard colour is white"),GardSound:new bn("bool","NotificationGard",["Sound OFF","Sound ON"],"Play a sound on garden tick",!0),GardVolume:new kn("vol","NotificationGard",[],"Volume"),GardSoundURL:new bn("url","NotificationGard","Garden Tick Sound URL:","URL of the sound to be played when the garden ticks"),MagicNotification:new bn("bool","NotificationMagi",["Notification OFF","Notification ON"],"Create a notification when magic reaches maximum",!0,(function(){un(e.MagicNotification)})),MagicFlash:new bn("bool","NotificationMagi",["Flash OFF","Flash ON"],"Flash screen when magic reaches maximum",!0),ColourMagicFlash:new Cn("colour","NotificationMagi","The colour of the magic flash, standard colour is white"),MagicSound:new bn("bool","NotificationMagi",["Sound OFF","Sound ON"],"Play a sound when magic reaches maximum",!0),MagicVolume:new kn("vol","NotificationMagi",[],"Volume"),MagicSoundURL:new bn("url","NotificationMagi","Sound URL:","URL of the sound to be played when magic reaches maxium"),WrinklerNotification:new bn("bool","NotificationWrink",["Notification OFF","Notification ON"],"Create a notification when a wrinkler appears",!0,(function(){un(e.WrinklerNotification)})),WrinklerFlash:new bn("bool","NotificationWrink",["Flash OFF","Flash ON"],"Flash screen when a wrinkler appears",!0),ColourWrinklerFlash:new Cn("colour","NotificationWrink","The colour of the wrinkler flash, standard colour is white"),WrinklerSound:new bn("bool","NotificationWrink",["Sound OFF","Sound ON"],"Play a sound when a wrinkler appears",!0),WrinklerVolume:new kn("vol","NotificationWrink",[],"Volume"),WrinklerSoundURL:new bn("url","NotificationWrink","Sound URL:","URL of the sound to be played when a wrinkler appears"),WrinklerMaxNotification:new bn("bool","NotificationWrinkMax",["Notification OFF","Notification ON"],"Create a notification when the maximum amount of wrinklers has appeared",!0,(function(){un(e.WrinklerMaxNotification)})),WrinklerMaxFlash:new bn("bool","NotificationWrinkMax",["Flash OFF","Flash ON"],"Flash screen when the maximum amount of Wrinklers has appeared",!0),ColourWrinklerMaxFlash:new Cn("colour","NotificationWrinkMax","The colour of the maximum wrinkler flash, standard colour is white"),WrinklerMaxSound:new bn("bool","NotificationWrinkMax",["Sound OFF","Sound ON"],"Play a sound when the maximum amount of wrinklers has appeared",!0),WrinklerMaxVolume:new kn("vol","NotificationWrinkMax",[],"Volume"),WrinklerMaxSoundURL:new bn("url","NotificationWrinkMax","Sound URL:","URL of the sound to be played when the maximum amount of wrinklers has appeared"),BulkBuyBlock:new bn("bool","Miscellaneous",["Block bulk buying OFF","Block bulk buying ON"],"Block clicking bulk buying when you can't buy all. This prevents buying 7 of a building when you are in buy-10 or buy-100 mode.",!0),FavouriteSettings:new bn("bool","Miscellaneous",["Favourite settings section OFF","Favourite settings section ON","Favourite settings section ON (Locked)"],"Show stars before each setting which allows selecting it for a 'favourites' section at the top of the Cookie Monster settings. Setting this to Locked removes the stars but shows the 'favourites' section",!0,(function(){Game.UpdateMenu()}))};function vn(){return JSON.stringify({favouriteSettings:de,settings:e,version:"2.031.7"})}function wn(){if(Je!==Game.dragonLevel||_e){if(Game.dragonLevel<25&&Game.dragonLevels[Game.dragonLevel].buy.toString().includes("sacrifice")){let e=Game.dragonLevels[Game.dragonLevel].buy.toString().match(/Objects\[(.*)\]/)[1];const t=Game.dragonLevels[Game.dragonLevel].buy.toString().match(/sacrifice\((.*?)\)/)[1];if("i"!==e)if(e=e.replaceAll("'",""),Game.Objects[e].amount{if(e=n,Game.Objects[e].amount{eo[e]=xo(e)})),to=[],Object.keys(Game.Upgrades).forEach((e=>{to[e]=To(e)})),oo=[],Object.keys(Game.Achievements).forEach((e=>{oo[e]=vo(e)})),Mo()}let Mn=!1;function Sn(t,o,n){(1===e[o]||n)&&3===t&&!1===Mn||1===t?(l("CMFlashScreen").style.backgroundColor=e[`Colour${o}`],l("CMFlashScreen").style.opacity="0.5",3===t?(l("CMFlashScreen").style.display="inline",setTimeout((function(){Sn(2,o,!0)}),1e3/Game.fps)):setTimeout((function(){Sn(0,o,!0)}),1e3/Game.fps)):2===t?(l("CMFlashScreen").style.opacity="1",setTimeout((function(){Sn(1,o,!0)}),1e3/Game.fps)):0===t&&(l("CMFlashScreen").style.display="none")}function Bn(t,o,n,i){if((1===e[o]||i)&&!1===Mn){const o=new Audio(t);e.GeneralSound?o.volume=e[n]/100*(Game.volume/100):o.volume=e[n]/100,o.play()}}function Pn(t,o,n){1===e[t]&&"hidden"===document.visibilityState&&!1===Mn&&new Notification(o,{body:n,badge:"https://orteil.dashnet.org/cookieclicker/favicon.ico"})}function En(){if(re!==Game.OnAscend&&(re=Game.OnAscend,Game.OnAscend?(l("game").style.bottom="0px",1===e.BotBar&&(l("CMBotBar").style.display="none"),1===e.TimerBar&&(l("CMTimerBar").style.display="none")):(mn(),ko()),yo()),!Game.OnAscend&&0===Game.AscendTimer){r!==Object.keys(Game.mods).length&&(Tn(),dn(),r=Object.keys(Game.mods).length),_e&&(function(){const e={};Object.keys(Game.Objects).forEach((t=>{if(0!==Object.keys(Gt).length&&Gt[t].TotalNeeded>Game.Objects[t].amount)e[t]={AmountNeeded:Gt[t].TotalNeeded-Game.Objects[t].amount,TotalNeeded:Gt[t].TotalNeeded};else{const o=function(e){const t=Game.AchievementsOwned;for(let o=0;o<101;o++)if(Ko(e,o),De>t)return o;return 101}(t);e[t]={AmountNeeded:o,TotalNeeded:Game.Objects[t].amount+o}}})),Gt=e}(),en(),Game.Has("Golden switch [off]")?(Mo(),to["Golden switch [off]"].bought=0,Io(),dt=Xe):dt=Game.cookiesPs,sn(),ln(),an(),on(),wn(),function(){for(let e=0;e<11;e+=1)for(let t=0;t<3;t+=1)Zt[e][t]=xn(e,t)}(),rn(),function(){let e=0;if(Game.Objects.Bank.minigameLoaded){const t=Game.Objects.Bank.minigame.goods;let o=0;Object.keys(t).forEach((e=>{const n=t[e];o+=n.stock*n.val})),e+=o*Game.cookiesPsRawHighest}e+=function(){let e=0;Mo();let t=2;5!==$e&&18!==$e||(t-=1),5!==Re&&18!==Re||(t-=1),$e=5,Re=18;for(let e=0;e{eo[t].amount>0&&(e=t)})),eo[e].amount-=1,We-=1}return Object.keys(eo).forEach((t=>{const o=eo[t];e+=co(Game.Objects[o.name],Game.Objects[t].basePrice,o.amount,Game.Objects[t].free,o.amount)})),e}(),Jt=e}(),_e=0);const t=Game.auraMult("Fierce Hoarder")>0;!Le&&t?(Le=!0,Fe=1):Le&&!t&&(Le=!1,Fe=1),Fe&&(Zo(),Fe=0),function(){cn(),Uo(),function(){Tt=0;let e=0;Object.keys(Game.wrinklers).forEach((t=>{2===Game.wrinklers[t].phase&&(e+=1)}));let t=1;if(eo.Temple.minigameLoaded){const e=Game.hasGod("scorn");1===e?t*=1.15:2===e?t*=1.1:3===e&&(t*=1.05)}Mt=e,Tt=e*(.05*e*1.1)*(.05*Game.Has("Sacrilegious corruption")+1)*(.05*Game.Has("Wrinklerspawn")+1)*t}(),Ao(),nn();const e=Game.HowManyCookiesReset(Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned))+1)-(Game.cookiesEarned+Game.cookiesReset);Xt=ue(e/mo())}(),G=0,Kt={},Object.keys(Game.shimmers).forEach((e=>{Kt[Game.shimmers[e].id]=Game.shimmers[e],Game.shimmers[e].spawnLead&&"golden"===Game.shimmers[e].type&&(_t=Game.shimmers[e],G+=1)})),Object.keys(se).forEach((e=>{void 0===Kt[e]&&(se[e].parentNode.removeChild(se[e]),delete se[e])})),y!==Game.shimmerTypes.golden.n?(y=Game.shimmerTypes.golden.n,y&&(b{void 0===se[Game.shimmers[t].id]&&function(t){const o=document.createElement("div");o.id=`GCTimer${t.id}`,o.style.width="96px",o.style.height="96px",o.style.position="absolute",o.style.zIndex="10000000001",o.style.textAlign="center",o.style.lineHeight="96px",o.style.fontFamily='"Kavoon", Georgia, serif',o.style.fontSize="35px",o.style.cursor="pointer",o.style.display="block",0===e.GCTimer&&(o.style.display="none"),o.style.left=t.l.style.left,o.style.top=t.l.style.top,o.onclick=function(){t.pop()},o.onmouseover=function(){t.l.style.filter="brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))",t.l.style.webkitFilter="brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))"},o.onmouseout=function(){t.l.style.filter="",t.l.style.webkitFilter=""},se[t.id]=o,l("shimmers").appendChild(o)}(Game.shimmers[t])}))),gn(),b=G,0===G&&(_t=0)):1===e.GCTimer&&y&&Object.keys(se).forEach((e=>{se[e].style.opacity=Kt[e].l.style.opacity,se[e].style.transform=Kt[e].l.style.transform,se[e].textContent=Math.ceil(Kt[e].life/Game.fps)})),f!==(Game.TickerEffect&&"fortune"===Game.TickerEffect.type)&&(f=Game.TickerEffect&&"fortune"===Game.TickerEffect.type,f&&(Sn(3,"FortuneFlash",!1),Bn(e.FortuneSoundURL,"FortuneSound","FortuneVolume",!1),Pn("FortuneNotification","Fortune Cookie found","A Fortune Cookie has appeared on the Ticker."))),g!==Game.shimmerTypes.reindeer.spawned&&(g=Game.shimmerTypes.reindeer.spawned,Object.keys(Game.shimmers).forEach((e=>{Game.shimmers[e].spawnLead&&"reindeer"===Game.shimmers[e].type&&(Qt=Game.shimmers[e])})),Sn(3,"SeaFlash",!1),Bn(e.SeaSoundURL,"SeaSound","SeaVolume",!1),Pn("SeaNotification","Reindeer sighted!","A Reindeer has spawned. Click it now!")),Game.Objects.Farm.minigameLoaded&&C!==Game.Objects.Farm.minigame.nextStep&&(0!==C&&C0){let t=0;Object.keys(Game.wrinklers).forEach((e=>{2===Game.wrinklers[e].phase&&(t+=1)})),t>v?(v=t,t===Game.getWrinklersMax()&&e.WrinklerMaxFlash?Sn(3,"WrinklerMaxFlash",!1):Sn(3,"WrinklerFlash",!1),t===Game.getWrinklersMax()&&e.WrinklerMaxSound?Bn(e.WrinklerMaxSoundURL,"WrinklerMaxSound","WrinklerMaxVolume",!1):Bn(e.WrinklerSoundURL,"WrinklerSound","WrinklerVolume",!1),t===Game.getWrinklersMax()&&e.WrinklerMaxNotification?Pn("WrinklerMaxNotification","Maximum Wrinklers Reached","You have reached your maximum ammount of wrinklers"):Pn("WrinklerNotification","A Wrinkler appeared","A new wrinkler has appeared")):v=t}}()}}function Nn(){let t="";for(let o=0;o<$.length;o++)t+=`.CMText${$[o]} { color: ${e[`Colour${$[o]}`]}; }\n`;for(let o=0;o<$.length;o++)t+=`.CMBack${$[o]} { background-color: ${e[`Colour${$[o]}`]}; }\n`;for(let o=0;o<$.length;o++)t+=`.CMBorder${$[o]} { border: 1px solid ${e[`Colour${$[o]}`]}; }\n`;l("CMCSS").textContent=t,po()}function On(){const e=b64_to_utf8(unescape(localStorage.getItem("CookieClickerGame")).split("!END!")[0]),t=e.match(/CookieMonster.*(;|$)/);if(null!==t){const o=e.replace(t[0],`CookieMonster:${vn()}`);localStorage.setItem("CookieClickerGame",escape(`${utf8_to_b64(o)}!END!`))}}function Fn(t){if(void 0!==localStorage.CMConfig&&delete localStorage.CMConfig,void 0!==t){e=t,void 0!==e.Colors&&delete e.Colors,void 0!==e.Colours&&delete e.Colours;let o=!1;Object.keys(pn).forEach((t=>{void 0===e[t]?(o=!0,e[t]=pn[t]):"Header"===t&&Object.keys(pn.Header).forEach((n=>{void 0!==e[t][n]&&e[t][n]>-1&&e[t][n]<2||(o=!0,e[t][n]=pn[t][n])}))})),o&&On(),En(),Object.keys(pn).forEach((e=>{"Header"!==e&&void 0!==Gn[e].func&&Gn[e].func()}))}else Fn(pn);Game.UpdateMenu(),Nn()}function Ln(){Object.keys(Game.wrinklers).forEach((e=>{Game.wrinklers[e].sucked>0&&0===Game.wrinklers[e].type&&(Game.wrinklers[e].hp=0)}))}function Wn(t,o){if("b"===t){if(l("tooltip").innerHTML=Game.Objects[o].tooltip(),1===e.TooltipAmor){const e=$o(Game.Objects[o],Game.Objects[o].basePrice,0,Game.Objects[o].free,Game.Objects[o].amount),t=e-Game.Objects[o].totalCookies;t>0&&(l("tooltip").innerHTML=l("tooltip").innerHTML.split("so far").join(`so far
${pe(t)} ${1===Math.floor(t)?"cookie":"cookies"} left to amortize (${me((e-Game.Objects[o].totalCookies)/(Game.Objects[o].storedTotalCps*Game.globalCpsMult)).text})`))}-1===Game.buyMode&&(l("tooltip").innerHTML=l("tooltip").innerHTML.split(pe(Game.Objects[o].bulkPrice)).join(pe((Game.Objects[o],Game.Objects[o].basePrice,Game.Objects[o].amount,Game.Objects[o].free,Game.buyBulk,1))))}else if("u"===t){if(!Game.UpgradesInStore[o])return"";l("tooltip").innerHTML=Game.crateTooltip(Game.UpgradesInStore[o],"store")}else"s"===t?l("tooltip").innerHTML=Game.lumpTooltip():"g"===t?l("tooltip").innerHTML=Game.Objects["Wizard tower"].minigame.spellTooltip(o)():"p"===t?l("tooltip").innerHTML=Game.ObjectsById[2].minigame.tileTooltip(o[0],o[1])():"ha"===t?l("tooltip").innerHTML=Game.ObjectsById[2].minigame.toolTooltip(1)():"wb"===t?l("tooltip").innerHTML="":"pag"===t?l("tooltip").innerHTML=Game.Objects.Temple.minigame.godTooltip(o)():"pas"===t&&(l("tooltip").innerHTML=Game.Objects.Temple.minigame.slotTooltip(o[0])());if("b"===t&&1===Game.buyMode||"u"===t||"s"===t||"g"===t||"p"===t&&!Game.keys[16]||"ha"===t||"wb"===t||"pag"===t||"pas"===t&&-1!==o[1]){const e=document.createElement("div");e.id="CMTooltipArea",l("tooltip").appendChild(e)}return ne=t,ie=o,Oo(),l("tooltip").innerHTML}function An(){Game.Objects["Wizard tower"].minigameLoaded&&Object.keys(Game.Objects["Wizard tower"].minigame.spellsById).forEach((e=>{null!==l(`grimoireSpell${e}`).onmouseover&&(T[e]=l(`grimoireSpell${e}`).onmouseover,l(`grimoireSpell${e}`).onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Wn("g",`${e}`)}),"this"),Game.tooltip.wobble()})}))}function jn(){if(!m&&Game.Objects["Wizard tower"].minigameLoaded){const{minigame:t}=Game.Objects["Wizard tower"];p=t.draw,Game.Objects["Wizard tower"].minigame.draw=function(){p(),1===e.GrimoireBar&&t.magic1&&(e.Header[t]=0),On()}function zn(t,o){const n=document.createElement("div");n.className="title",n.style.padding="0px 16px",n.style.opacity="0.7",n.style.fontSize="17px",n.style.fontFamily='"Kavoon", Georgia, serif',n.appendChild(document.createTextNode(`${t} `));const i=document.createElement("span");return i.style.cursor="pointer",i.style.display="inline-block",i.style.height="14px",i.style.width="14px",i.style.borderRadius="7px",i.style.textAlign="center",i.style.backgroundColor="#C0C0C0",i.style.color="black",i.style.fontSize="13px",i.style.verticalAlign="middle",i.textContent=e.Header[o]?"-":"+",i.onclick=function(){In(o),Game.UpdateMenu()},n.appendChild(i),n}function Vn(e,t,o,n){const i=document.createElement("div");i.className="listing";const a=document.createElement("b");if(a.textContent=t,i.appendChild(a),"withTooltip"===e){i.className="listing",i.appendChild(document.createTextNode(" "));const e=document.createElement("span");e.onmouseout=function(){Game.tooltip.hide()},e.onmouseover=function(){Game.tooltip.draw(this,escape(I[n].innerHTML))},e.style.cursor="default",e.style.display="inline-block",e.style.height="10px",e.style.width="10px",e.style.borderRadius="5px",e.style.textAlign="center",e.style.backgroundColor="#C0C0C0",e.style.color="black",e.style.fontSize="9px",e.style.verticalAlign="bottom",e.textContent="?",i.appendChild(e)}return i.appendChild(document.createTextNode(": ")),i.appendChild(o),i}function _n(e){const t=document.createDocumentFragment();t.appendChild(document.createTextNode(`${e.length} `));const o=document.createElement("span");o.onmouseout=function(){Game.tooltip.hide()};const n=document.createElement("div"),i=document.createElement("div");i.style.minWidth="140px",i.style.marginBottom="4px";const a=document.createElement("div");return a.className="name",a.style.marginBottom="4px",a.style.textAlign="center",a.textContent="Missing",i.appendChild(a),Object.keys(e).forEach((t=>{const o=document.createElement("div");o.style.textAlign="center",o.appendChild(document.createTextNode(e[t])),i.appendChild(o)})),n.appendChild(i),o.onmouseover=function(){Game.tooltip.draw(this,escape(n.innerHTML))},o.style.cursor="default",o.style.display="inline-block",o.style.height="10px",o.style.width="10px",o.style.borderRadius="5px",o.style.textAlign="center",o.style.backgroundColor="#C0C0C0",o.style.color="black",o.style.fontSize="9px",o.style.verticalAlign="bottom",o.textContent="?",t.appendChild(o),t}function Qn(t){const o=document.createElement("div");if(o.className="subsection",o.appendChild(t),o.appendChild(zn("Lucky Cookies","Lucky")),e.Header.Lucky&&o.appendChild(function(){const e=Game.auraMult("Dragon's Fortune")?"GoldCookDragonsFortuneTooltipPlaceholder":"GoldCookTooltipPlaceholder",t=document.createElement("div");t.className="CMStatsLuckySection";const o=Game.cookies+ho(){Game.HasUnlocked(Xo[e])||c.push(Xo[e])})),0!==c.length&&e.appendChild(Vn("basic","Rare plant drops left to unlock",_n(c))),e}())),o.appendChild(zn("Prestige","Prestige")),e.Header.Prestige&&o.appendChild(function(){const t=document.createElement("div");t.className="CMStatsPrestigeSection";const o=Math.floor(Game.HowMuchPrestige(zt+Game.cookiesReset+vt+(Game.HasUnlocked("Chocolate egg")&&!Game.Has("Chocolate egg")?Ct:0)));t.appendChild(Vn("withTooltip","Prestige level (cur / max)",document.createTextNode(`${pe(Game.prestige)} / ${pe(o)}`),"PrestMaxTooltipPlaceholder"));const n=Math.max(0,Game.HowManyCookiesReset(o+1)-(zt+Game.cookiesReset+vt+(Game.HasUnlocked("Chocolate egg")&&!Game.Has("Chocolate egg")&&Ct?Ct:0))),i=document.createDocumentFragment();i.appendChild(document.createTextNode(pe(n)));const a=document.createElement("small");a.textContent=` (${ue(n/Vt,1)})`,i.appendChild(a),t.appendChild(Vn("withTooltip","Cookies to next level",i,"NextPrestTooltipPlaceholder")),t.appendChild(Vn("withTooltip","Heavenly chips (cur / max)",document.createTextNode(`${pe(Game.heavenlyChips)} / ${pe(o-Game.prestige+Game.heavenlyChips)}`),"HeavenChipMaxTooltipPlaceholder")),t.appendChild(Vn("basic","Heavenly chips per second (last 5 seconds)",document.createTextNode(pe(ht,2))));const r=Number(e.HeavenlyChipsTarget);if(!Number.isNaN(r)){const e=r-Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned));e>0&&(t.appendChild(Vn("basic","Heavenly chips to target set in settings (cur)",document.createTextNode(pe(e)))),t.appendChild(Vn("basic","Time till target (cur, current 5 second average)",document.createTextNode(ue(e/ht)))))}const l=function(e){let t=Game.cookiesPs;Mo(),0===to["Heavenly key"].bought&&(to["Heavenly chip secret"].bought=1,to["Heavenly cookie stand"].bought=1,to["Heavenly bakery"].bought=1,to["Heavenly confectionery"].bought=1,to["Heavenly key"].bought=1,Io(),t=Xe,Mo()),zt>=1e6&&Ro("Sacrifice"),zt>=1e9&&Ro("Oblivion"),zt>=1e12&&Ro("From scratch"),zt>=1e15&&Ro("Nihilism"),zt>=1e18&&Ro("Dematerialize"),zt>=1e21&&Ro("Nil zero zilch"),zt>=1e24&&Ro("Transcendence"),zt>=1e27&&Ro("Obliterate"),zt>=1e30&&Ro("Negative void"),zt>=1e33&&Ro("To crumbs, you say?"),zt>=1e36&&Ro("You get nothing"),zt>=1e39&&Ro("Humble rebeginnings"),zt>=1e42&&Ro("The end of the world"),zt>=1e45&&Ro("Oh, you're back"),zt>=1e48&&Ro("Lazarus"),zt>=1e51&&Ro("Smurf account"),zt>=1e54&&Ro("If at first you don't succeed"),to["Heavenly chip secret"].bought=1,to["Heavenly cookie stand"].bought=1,to["Heavenly bakery"].bought=1,to["Heavenly confectionery"].bought=1,to["Heavenly key"].bought=1,Ue=e;const o=De;Io(),Yo(),o!==De&&Io();const n=Xe-t;return Ue=Game.prestige,n}(o),s=document.createDocumentFragment();s.appendChild(document.createTextNode(pe(l)));const c=Math.round(l/Game.cookiesPs*1e4);if(Number.isFinite(c)&&0!==c){const e=document.createElement("small");e.textContent=` (${c/100}% of income)`,s.appendChild(e)}t.appendChild(Vn("withTooltip","Reset bonus income",s,"ResetTooltipPlaceholder"));const d=Math.floor(Game.HowMuchPrestige(Game.cookiesReset)),p=Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned)),u=p-d;if(!Game.Has("Lucky digit")){let e=7-p%10;e<0&&(e+=10);const o=u+e,n=p+e,i=document.createDocumentFragment();i.appendChild(document.createTextNode(`${n.toLocaleString()} / ${o.toLocaleString()} (+${e})`)),t.appendChild(Vn("basic",'Next "Lucky Digit" (total / reset)',i))}if(!Game.Has("Lucky number")){let e=777-p%1e3;e<0&&(e+=1e3);const o=u+e,n=p+e,i=document.createDocumentFragment();i.appendChild(document.createTextNode(`${n.toLocaleString()} / ${o.toLocaleString()} (+${e})`)),t.appendChild(Vn("basic",'Next "Lucky Number" (total / reset)',i))}if(!Game.Has("Lucky payout")){let e=777777-p%1e6;e<0&&(e+=1e6);const o=u+e,n=p+e,i=document.createDocumentFragment();i.appendChild(document.createTextNode(`${n.toLocaleString()} / ${o.toLocaleString()} (+${e})`)),t.appendChild(Vn("basic",'Next "Lucky Payout" (total / reset)',i))}return t}()),Game.cpsSucked>0&&(o.appendChild(zn("Wrinklers","Wrink")),e.Header.Wrink)){const e=document.createDocumentFragment();e.appendChild(document.createTextNode(`${pe(vt)} / ${pe(wt)} `));const t=document.createElement("a");t.textContent="Pop All Normal",t.className="option",t.onclick=function(){Ln()},e.appendChild(t),o.appendChild(Vn("basic","Rewards of Popping (All/Normal)",e));const n=document.createDocumentFragment();n.appendChild(document.createTextNode(`${pe(xt[0])} `));const i=document.createElement("a");i.textContent="Pop Single Fattest",i.className="option",i.onclick=function(){null!==xt[1]&&(Game.wrinklers[xt[1]].hp=0)},n.appendChild(i),o.appendChild(Vn("basic",`Rewards of Popping Single Fattest Non-Shiny Wrinkler (id: ${null!==xt[1]?xt[1]:"None"})`,n))}if(o.appendChild(function(){const t=document.createElement("div");t.className="CMStatsSeasonSection";let o=!1;const n=[];Object.keys(Vo).forEach((e=>{Game.Has(Vo[e])||(n.push(Vo[e]),o=!0)}));const i=[];Object.keys(_o).forEach((e=>{Game.Has(_o[e])||(i.push(_o[e]),o=!0)}));const a=[];Object.keys(Qo).forEach((e=>{Game.Has(Qo[e])||(a.push(Qo[e]),o=!0)}));const r=[];Object.keys(Game.eggDrops).forEach((e=>{Game.HasUnlocked(Game.eggDrops[e])||(r.push(Game.eggDrops[e]),o=!0)}));const l=[];Object.keys(Game.rareEggDrops).forEach((e=>{Game.HasUnlocked(Game.rareEggDrops[e])||(l.push(Game.rareEggDrops[e]),o=!0)}));const s=Game.HasUnlocked("Chocolate egg")&&!Game.Has("Chocolate egg"),c=Game.Has("Century egg");if(("christmas"===Game.season||o||s||c)&&(t.appendChild(zn("Season Specials","Sea")),e.Header.Sea)){if(0!==n.length){t.appendChild(Vn("basic","Halloween cookies left to buy",_n(n)));let e=.95;if(Game.HasAchiev("Spooky cookies")&&(e=.8),Game.Has("Starterror")&&(e*=.9),e*=1/Game.dropRateMult(),Game.hasGod){const t=Game.hasGod("seasons");1===t?e*=.9:2===t?e*=.95:3===t&&(e*=.97)}const o=n.length/7;t.appendChild(Vn("basic","Chance of receiving a cookie from wrinkler/shiny wrinkler",document.createTextNode(`${pe((1-e)*o*100)}% / ${pe((1-.9*e)*o*100)}%`)))}if(0!==i.length){t.appendChild(Vn("basic","Christmas cookies left to buy",_n(i)));let e=.8;if(Game.HasAchiev("Let it snow")&&(e=.6),e*=1/Game.dropRateMult(),Game.Has("Starsnow")&&(e*=.95),Game.hasGod){const t=Game.hasGod("seasons");1===t?e*=.9:2===t?e*=.95:3===t&&(e*=.97)}const o=i.length/7;t.appendChild(Vn("basic","Chance of receiving a cookie from reindeer",document.createTextNode(`${pe((1-e)*o*100)}%`)))}0!==a.length&&t.appendChild(Vn("basic","Valentine cookies left to buy",_n(a)));const e=function(e){let t=e*(1/Game.dropRateMult());if(Game.HasAchiev("Hide & seek champion")&&(t*=.7),Game.Has("Omelette")&&(t*=.9),Game.Has("Starspawn")&&(t*=.9),Game.hasGod){const e=Game.hasGod("seasons");1===e?t*=.9:2===e?t*=.95:3===e&&(t*=.97)}const o=1-t,n=Game.eggDrops.length-r.length,i=Game.rareEggDrops.length-l.length,a=.9*o*(1-n/Game.eggDrops.length),s=.1*o*(1-i/Game.rareEggDrops.length),c=.9*o*(n/Game.eggDrops.length)+.1*o*(i/Game.rareEggDrops.length);return[a+.9*c*(1-n/Game.eggDrops.length),s+.1*c*(1-i/Game.rareEggDrops.length)]};0!==r.length&&(t.appendChild(Vn("basic","Normal easter eggs left to unlock",_n(r))),t.appendChild(Vn("basic","Chance of receiving an egg from wrinkler/golden cookie",document.createTextNode(`${pe(100*e(.98)[0])}% / ${pe(100*e(.9)[0])}%`)))),0!==l.length&&(t.appendChild(Vn("basic","Rare easter eggs left to unlock",_n(l))),t.appendChild(Vn("basic","Chance of receiving a rare egg from wrinkler/golden cookie",document.createTextNode(`${pe(100*e(.98)[1])}% / ${pe(100*e(.9)[1])}%`)))),"christmas"===Game.season&&t.appendChild(Vn("basic","Reindeer reward",document.createTextNode(pe(ft)))),s&&t.appendChild(Vn("withTooltip","Chocolate egg cookies",document.createTextNode(pe(Ct)),"ChoEggTooltipPlaceholder")),c&&t.appendChild(Vn("basic","Century egg multiplier",document.createTextNode(Math.round(1e4*(gt-1))/100+"%")))}return t}()),o.appendChild(zn("Miscellaneous","Misc")),e.Header.Misc){if(o.appendChild(Vn("basic",`Average cookies per second (past ${J[e.AvgCPSHist]<60?`${J[e.AvgCPSHist]} seconds`:J[e.AvgCPSHist]/60+(3===e.AvgCPSHist?" minute":" minutes")})`,document.createTextNode(pe(mo(),3)))),o.appendChild(Vn("basic",`Average cookie clicks per second (past ${Z[e.AvgClicksHist]}${0===e.AvgClicksHist?" second":" seconds"})`,document.createTextNode(pe(Bt,1)))),o.appendChild(Vn("basic",`Cookies from clicking (past ${Z[e.AvgClicksHist]}${0===e.AvgClicksHist?" second":" seconds"})`,document.createTextNode(pe(he.calcSum(Bt*Z[e.AvgClicksHist]))))),Game.Has("Fortune cookies")){const e=[];Object.keys(zo).forEach((t=>{Game.Has(zo[t])||e.push(zo[t])})),0!==e.length&&o.appendChild(Vn("basic","Fortune Upgrades Left to Buy",_n(e)))}if(e.ShowMissedGC&&o.appendChild(Vn("basic","Missed golden cookies",document.createTextNode(pe(Game.missedGoldenClicks)))),Game.prefs.autosave){const e=document.createElement("span");e.id="CMStatsAutosaveTimer",e.innerText=Game.sayTime(60*Game.fps-(Game.OnAscend?0:Game.T%(60*Game.fps)),4),o.appendChild(Vn("basic","Time till autosave",e))}}l("menu").insertBefore(o,l("menu").childNodes[2]),e.MissingUpgrades&&l("menu").childNodes.forEach((e=>{if(e.children[0])if("Prestige"===e.children[0].innerHTML&&Et){const t=Et.match(new RegExp("div","g")||0).length/2,o=document.createElement("div");o.id="CMMissingUpgradesPrestigeTitle",o.className="listing";const n=document.createElement("div");n.innerHTML=`Missing Prestige upgrades: ${t}/${Game.PrestigeUpgrades.length} (${Math.floor(t/Game.PrestigeUpgrades.length*100)}%)`,o.appendChild(n),e.appendChild(o);const i=document.createElement("div");i.className="listing crateBox",i.innerHTML=Et,e.appendChild(i)}else if("Upgrades"===e.children[0].innerHTML){if(Pt){const t=Pt.match(new RegExp("div","g")||0).length/2,o=document.createElement("div");o.id="CMMissingUpgradesTitle",o.className="listing";const n=document.createElement("div");n.innerHTML=`Missing normal upgrades: ${t}/${Game.UpgradesByPool[""].length+Game.UpgradesByPool.tech.length} (${Math.floor(t/(Game.UpgradesByPool[""].length+Game.UpgradesByPool.tech.length)*100)}%)`,o.appendChild(n),e.insertBefore(o,e.childNodes[3]);const i=document.createElement("div");i.className="listing crateBox",i.innerHTML=Pt,e.insertBefore(i,document.getElementById("CMMissingUpgradesTitle").nextSibling)}if(Nt){const t=Nt.match(new RegExp("div","g")||0).length/2,o=document.createElement("div");o.id="CMMissingUpgradesCookiesTitle",o.className="listing";const n=document.createElement("div");n.innerHTML=`Missing Cookie upgrades: ${t}/${Game.UpgradesByPool.cookie.length} (${Math.floor(t/Game.UpgradesByPool.cookie.length*100)}%)`,o.appendChild(n),e.appendChild(o);const i=document.createElement("div");i.className="listing crateBox",i.innerHTML=Nt,e.appendChild(i)}}})),e.MissingAchievements&&function(){let t;Object.values(document.querySelectorAll("div.title")).forEach((e=>{e.textContent.includes("Achievements")&&(t=e.parentElement.querySelectorAll("div.listing.crateBox")[0])})),e.MissingAchievements&&Object.values(t.children).forEach((e=>{if(!e.className.includes("enabled")){const t=e.onclick.toString().split(/\[(.*)\]/gi)[1],{icon:o}=Game.AchievementsById[t];e.style.backgroundPosition=`${48*-o[0]}px ${48*-o[1]}px`,e.onmouseover=function(){Game.mouseDown||(Game.setOnCrate(this),Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return function(e){const t=[];"shadow"===e.pool?t.push("Shadow Achievement","#9700cf"):t.push("Achievement",0),t.push("Locked",0);let o=0;(Game.Has("Neuromancy")||Game.sesame&&"debug"===e.pool)&&(o=1),o&&0===e.won?t.push("Click to win!","#00c462"):o&&e.won>0&&t.push("Click to lose!","#00c462");let{icon:n}=e;e.iconFunction&&(n=e.iconFunction());let{desc:i}=e;e.descFunc&&(i=e.descFunc("stats"));let a="";for(let e=0;e[${t[e]}]`);return a=a.substring(1),`
\n
\n
${e.name}
\n ${a}
${i}
\n ${Game.sesame?`
Id : ${e.id} | Order : ${Math.floor(e.order)}${e.tier?` | Tier : ${e.tier}`:""}
`:""}`}(Game.AchievementsById[t])}),"top"),Game.tooltip.wobble())}}}))}()}const Xn={Favourite:"Favourite Settings",Calculation:"Calculation",Notation:"Notation",Colours:"Colours and colour coding",BarsDisplay:"Infobars and visual settings",Tooltip:"Tooltips",Statistics:"Statistics",Notification:"Notifications",Miscellaneous:"Miscellaneous"},qn={NotificationGeneral:"General Notifications",NotificationGC:"Golden Cookie",NotificationFC:"Fortune Cookie",NotificationSea:"Season Special",NotificationGard:"Garden Tick",NotificationMagi:"Full Magic Bar",NotificationWrink:"Wrinkler",NotificationWrinkMax:"Maximum Wrinklers"};function Yn(t,o){const n=document.createElement("div");n.className="title",n.style.opacity="0.7",n.style.fontSize="17px",n.appendChild(document.createTextNode(`${o} `));const i=document.createElement("span");return i.style.cursor="pointer",i.style.display="inline-block",i.style.height="14px",i.style.width="14px",i.style.borderRadius="7px",i.style.textAlign="center",i.style.backgroundColor="#C0C0C0",i.style.color="black",i.style.fontSize="13px",i.style.verticalAlign="middle",i.textContent=e.Header[t]?"-":"+",i.onclick=function(){In(t),Game.UpdateMenu()},n.appendChild(i),n}function Kn(t){const o=document.createElement("div");if(o.className="listing",1===e.FavouriteSettings&&o.appendChild(function(e){const t=document.createElement("a");return de.includes(e)?(t.innerText="★",t.style.color="yellow"):t.innerText="☆",t.className="option",t.onclick=function(){!function(e){de.includes(e)?de=de.filter((function(t){return t!==e})):de.push(e)}(e),On(),Game.UpdateMenu()},t.onmouseover=function(){Game.tooltip.draw(this,escape(I.FavouriteSettingPlaceholder.innerHTML))},t.onmouseout=function(){Game.tooltip.hide()},t.appendChild(document.createTextNode(" ")),t}(t)),"bool"===Gn[t].type){const n=document.createElement("a");Gn[t].toggle&&0===e[t]?n.className="option off":n.className="option",n.id=$n+t,n.onclick=function(){!function(t){e[t]+=1,e[t]===Gn[t].label.length?(e[t]=0,Gn[t].toggle&&(l($n+t).className="option off")):l($n+t).className="option",void 0!==Gn[t].func&&Gn[t].func(),l($n+t).innerHTML=Gn[t].label[e[t]],On()}(t)},n.textContent=Gn[t].label[e[t]],o.appendChild(n);const i=document.createElement("label");return i.textContent=Gn[t].desc,i.style.lineHeight="1.6",o.appendChild(i),o}if("vol"===Gn[t].type){const n=document.createElement("div");n.className="sliderBox";const i=document.createElement("div");i.style.float="left",i.innerHTML=Gn[t].desc,n.appendChild(i);const a=document.createElement("div");a.id=`slider${t}right`,a.style.float="right",a.innerHTML=`${e[t]}%`,n.appendChild(a);const r=document.createElement("input");r.className="slider",r.id=`slider${t}`,r.style.clear="both",r.type="range",r.min="0",r.max="100",r.step="1",r.value=e[t],r.oninput=function(){Rn(t)},r.onchange=function(){Rn(t)},n.appendChild(r),o.appendChild(n);const l=document.createElement("a");return l.className="option",l.onclick=function(){Bn(e[t.replace("Volume","SoundURL")],t.replace("Volume","Sound"),t,!0)},l.textContent="Test sound",o.appendChild(l),o}if("url"===Gn[t].type){const n=document.createElement("span");n.className="option",n.textContent=`${Gn[t].label} `,n.style.lineHeight="1.6",o.appendChild(n);const i=document.createElement("input");i.id=$n+t,i.className="option",i.type="text",i.readOnly=!0,i.setAttribute("value",e[t]),i.style.width="300px",o.appendChild(i),o.appendChild(document.createTextNode(" "));const a=document.createElement("input");a.id=`${$n+t}Prompt`,a.className="option",a.type="text",a.setAttribute("value",e[t]);const r=document.createElement("a");r.className="option",r.onclick=function(){!function(e,t){Game.promptWrapL.className="framed";const o=e;Game.promptL.innerHTML=`${o}
`,Object.keys(t).forEach((e=>{const o=document.createElement("a");o.id=`promptOption${e}`,o.className="option",o.onclick=function(){PlaySound("snd/tick.mp3"),t[e][1]()},o.textContent=t[e][0],Game.promptL.children[1].appendChild(o)})),Game.promptAnchorL.style.display="block",Game.darkenL.style.display="block",Game.promptL.focus(),Game.promptOn=1,Game.UpdatePrompt()}(a.outerHTML,[["Save",function(){e[t]=l(`CMConfig${t}Prompt`).value,On(),Game.ClosePrompt(),Game.UpdateMenu()}],["Cancel",function(){Game.ClosePrompt()}]])},r.textContent="Edit",o.appendChild(r);const s=document.createElement("label");return s.textContent=Gn[t].desc,s.style.lineHeight="1.6",o.appendChild(s),o}if("colour"===Gn[t].type){const n=document.createElement("span");n.className="option";const i=document.createElement("input");i.id=t,i.style.width="65px",i.setAttribute("value",e[t]),n.appendChild(i),new Hn(i,{hash:!0,position:"right",onInput:function(){e[this.targetElement.id]=this.toHEXString(),Nn(),On(),Game.UpdateMenu()}});const a=document.createElement("label");if(a.textContent=Gn[t].desc,a.style.lineHeight="1.6",n.appendChild(a),t.includes("Flash")){const e=document.createElement("a");e.className="option",e.onclick=function(){Sn(3,t.replace("Colour",""),!0)},e.textContent="Test flash",n.appendChild(e)}return o.appendChild(n),Un().init(),o}if("numscale"===Gn[t].type){const n=document.createElement("span");n.className="option",n.textContent=`${Gn[t].label} `,n.style.lineHeight="1.6",o.appendChild(n);const i=document.createElement("input");i.id=$n+t,i.className="option",i.type="number",i.value=e[t],i.min=Gn[t].min,i.max=Gn[t].max,i.oninput=function(){e[t]=this.value,On(),hn()},o.appendChild(i),o.appendChild(document.createTextNode(" "));const a=document.createElement("label");return a.textContent=Gn[t].desc,a.style.lineHeight="1.6",o.appendChild(a),o}return o}function Jn(t){if(1===e.TimerBar&&0===e.TimerBarPos){const e=parseInt(l("CMTimerBar").style.height,10);Game.mouseY-=e,t(),Game.mouseY+=e}else t()}function Zn(){S.Beautify=Beautify,Beautify=pe,S.CalculateGains=Game.CalculateGains,Game.CalculateGains=function(){S.CalculateGains(),_e=1,B=Date.now(),P=Date.now()},S.tooltip={},S.tooltip.draw=Game.tooltip.draw,S.tooltip.drawMod=new Function(`return ${Game.tooltip.draw.toString().split("this").join("Game.tooltip")}`)(),Game.tooltip.draw=function(e,t,o){S.tooltip.drawMod(e,t,o)},S.tooltip.update=Game.tooltip.update,S.tooltip.updateMod=new Function(`return ${Game.tooltip.update.toString().split("this.").join("Game.tooltip.")}`)(),Game.tooltip.update=function(){S.tooltip.updateMod(),function(){if("store"===Game.tooltip.origin){let t=0;1===e.ToolWarnLucky&&1===e.ToolWarnPos&&null!==l("CMDispTooltipWarningParent")&&(t=l("CMDispTooltipWarningParent").clientHeight-4),Game.tooltip.tta.style.top=`${Math.min(parseInt(Game.tooltip.tta.style.top,10),l("game").clientHeight+l("topBar").clientHeight-Game.tooltip.tt.clientHeight-t-46)}px`}}()},S.UpdateWrinklers=Game.UpdateWrinklers,Game.UpdateWrinklers=function(){Jn(S.UpdateWrinklers)},S.UpdateSpecial=Game.UpdateSpecial,Game.UpdateSpecial=function(){Jn(S.UpdateSpecial)},l("bigCookie").removeEventListener("click",Game.ClickCookie,!1),l("bigCookie").addEventListener("click",(function(){Jn(Game.ClickCookie)}),!1),S.RebuildUpgrades=Game.RebuildUpgrades,Game.RebuildUpgrades=function(){S.RebuildUpgrades(),M=[],Object.keys(Game.UpgradesInStore).forEach((e=>{null!==l(`upgrade${e}`).onmouseover&&(M[e]=l(`upgrade${e}`).onmouseover,l(`upgrade${e}`).onmouseover=function(){Game.mouseDown||(Game.setOnCrate(this),Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Wn("u",`${e}`)}),"store"),Game.tooltip.wobble())})})),Game.CalculateGains()},S.ClickProduct=Game.ClickProduct,Game.ClickProduct=function(t){(!e.BulkBuyBlock||Game.ObjectsById[t].bulkPrice-1;--e)if(Game.ObjectsById[e].amount>0){const o=eo[Game.ObjectsById[e].name].name;eo[o].amount-=1,We-=1,t=eo[o].basePrice*Game.priceIncrease**Math.max(0,eo[o].amount-1-eo[o].free),t=Game.modifyBuildingPrice(eo[o],t),t=Math.ceil(t);break}const o=De;return Io(),Yo(),o!==De&&Io(),[Xe-Game.cookiesPs,t]}(t),n=ue(o/(e+Game.cookiesPs));let i;i=0===Game.cookiesPs?pe(1/0):pe(e/Game.cookiesPs*100),l("dragonAuraInfo").style.minHeight="60px",l("dragonAuraInfo").style.margin="8px",l("dragonAuraInfo").appendChild(document.createElement("div")).className="line";const a=document.createElement("div");a.style.minWidth="200px",a.style.textAlign="center",a.textContent=`Picking this aura will change CPS by ${pe(e)} (${i}% of current CPS).`,l("dragonAuraInfo").appendChild(a);const r=document.createElement("div");r.style.minWidth="200px",r.style.textAlign="center",r.textContent=`It will take ${n} to recover the cost.`,l("dragonAuraInfo").appendChild(r)}}(t)},S.ToggleSpecialMenu=Game.ToggleSpecialMenu,Game.ToggleSpecialMenu=function(e){S.ToggleSpecialMenu(e),function(){if(null!==(l("specialPopup").className.match(/onScreen/)&&l("specialPopup").children[0].style.background.match(/dragon/)))for(let e=0;e${Ze}`,"this"),Game.tooltip.wobble()},l("specialPopup").children[e].onmouseout=function(){Game.tooltip.shouldHide=1})}()},S.UpdateMenu=Game.UpdateMenu,Game.UpdateMenu=function(){void 0!==Un().picker&&void 0!==Un().picker.owner||(S.UpdateMenu(),function(){const t=document.createElement("div");t.className="title","prefs"===Game.onMenu?(t.textContent="Cookie Monster Settings",function(t){const o=document.createDocumentFragment();o.appendChild(t),Object.keys(Xn).forEach((t=>{if("Favourite"===t){if(0!==de.length&&e.FavouriteSettings>0&&(o.appendChild(Yn(t,Xn[t])),e.Header[t]))for(let e=0;e{const n=Yn(t,qn[t]);n.style.fontSize="15px",n.style.opacity="0.5",o.appendChild(n),e.Header[t]&&Object.keys(Gn).forEach((e=>{Gn[e].group===t&&o.appendChild(Kn(e))}))})):Object.keys(Gn).forEach((e=>{Gn[e].group===t&&o.appendChild(Kn(e))})))}));const n=document.createElement("div");n.className="listing";const i=document.createElement("a");i.className="option",i.onclick=function(){Fn(pn)},i.textContent="Restore Default",n.appendChild(i),o.appendChild(n),l("menu").childNodes[2].insertBefore(o,l("menu").childNodes[2].childNodes[l("menu").childNodes[2].childNodes.length-1])}(t)):"stats"===Game.onMenu?e.Stats&&(t.textContent="Cookie Monster Statistics",Qn(t)):"log"===Game.onMenu&&(t.textContent="Cookie Monster ",function(t){const o=document.createElement("div");o.className="subsection";const n=document.createElement("span");if(n.style.cursor="pointer",n.style.display="inline-block",n.style.height="14px",n.style.width="14px",n.style.borderRadius="7px",n.style.textAlign="center",n.style.backgroundColor="#C0C0C0",n.style.color="black",n.style.fontSize="13px",n.style.verticalAlign="middle",n.textContent=e.Header.InfoTab?"-":"+",n.onclick=function(){In("InfoTab"),Game.UpdateMenu()},t.appendChild(n),o.appendChild(t),e.Header.InfoTab){const e=document.createElement("div");e.innerHTML='
\n Cookie Monster\n offers a wide range of tools and statistics to enhance your game experience.\n It is not a cheat interface – although it does offer helpers for golden cookies and such, everything can be toggled off at will to only leave how much information you want.
\n Progess on new updates and all previous release notes can be found on the GitHub page linked above!
\n Please also report any bugs you may find over there!
\n
\n ',o.appendChild(e);const t=document.createElement("div");t.innerHTML="
\nThese are the release notes for the latest update (v 2.031.7).
\n
\nThis update implements the following functions:
\n- Updated the ordering and description of all settings of Cookie Monster
\n- Colours of Flash notifications can now be set by the user
\n- You can now select a number of settings to be your 'favourite'. They will be displayed at the top of all other settings in a new section. This functionality is toggleable and you can find it in the miscellaneous section
\n- The statistics page now shows cookies earned by clicking for a selected time period
\n- The statistics page can now show missing normal achievements, this can be toggled in the settings
\n
\nThis update fixes the following bugs:
\n- Fixed some typo's
\n- No longer show the wrinkler pop buttons when wrinklers can't spawn
\n- Fixed incorrect calculation of plant maturity for relevant tooltips
\n- Fixed edit prompts not working in settings
\n- Fixed red and purple being switched around for PP colour coding
\n- Fixed incorrect notation of numbers in Dragon tooltip and interface
\n- Fixed incorrect calculation of changing Dragon aura cost
\n- Fixed incorrect calculation of changing Pantheon gods effect
\n- Fixed fluctuating PP values when god Cyclius was selected
\n- Fixed black flickering when Golden Cookies or buffs start
\n
\n",o.appendChild(t)}const i=l("menu").children[1];i.insertBefore(o,i.children[1])}(t))}())},S.sayTime=Game.sayTime,V=function(e,t){return Number.isNaN(e)||e<=0?S.sayTime(e,t):ue(e/Game.fps,1)},S.Logic=Game.Logic,Game.Logic=function(){S.Logic();let t="Cookie Clicker";"fools"===Game.season&&(t="Cookie Baker"),ce=`${Game.OnAscend?"Ascending! ":""}${pe(Game.cookies)} ${1===Game.cookies?"cookie":"cookies"} - ${t}`,function(){if(Game.OnAscend||0===e.Title)document.title=ce;else if(1===e.Title){let e,t,o,n=!1,i=!1;e=_t?_t.wrath?`[W${Math.ceil(_t.life/Game.fps)}]`:`[G${Math.ceil(_t.life/Game.fps)}]`:Game.Has("Golden switch [off]")?"[GS]":`[${Number(l("CMTimerBarGCMinBar").textContent)<0?"!":""}${Math.ceil((Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.time)/Game.fps)}]`,f&&(n=!0,t="[F]"),"christmas"===Game.season&&(i=!0,o=g?`[R${Math.ceil(Qt.life/Game.fps)}]`:`[${Number(l("CMTimerBarRenMinBar").textContent)<0?"!":""}${Math.ceil((Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.time)/Game.fps)}]`);let a=ce;"["===a.charAt(0)&&(a=a.substring(a.lastIndexOf("]")+1)),document.title=`${e+(n?t:"")+(i?o:"")} ${a}`}else if(2===e.Title){let e="",t=!1;_t&&(t=!0,_t.wrath?e+=`[W${Math.ceil(_t.life/Game.fps)}]`:e+=`[G${Math.ceil(_t.life/Game.fps)}]`),f&&(t=!0,e+="[F]"),"christmas"===Game.season&&g&&(e+=`[R${Math.ceil(Qt.life/Game.fps)}]`,t=!0),t&&(e+=" - ");let o="Cookie Clicker";"fools"===Game.season&&(o="Cookie Baker"),e+=o,document.title=e}}(),function(){const t=Math.max(0,Game.HowManyCookiesReset(Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned))+1)-(Game.cookiesEarned+Game.cookiesReset)),o=Game.sayTime((Date.now()-Game.startDate)/1e3*Game.fps,-1);let n="";n+=`You've been on this run for ${""===o?"not very long":o}.
`,n+='
',Game.prestige>0&&(n+=`Your prestige level is currently ${pe(Game.prestige)}.
(CpS +${pe(Game.prestige)}%)`,n+='
'),n+=Oe<1?"Ascending now would grant you no prestige.":Oe<2?"Ascending now would grant you
1 prestige level (+1% CpS)
and 1 heavenly chip to spend.":`Ascending now would grant you
${pe(Oe)} prestige levels (+${pe(Oe)}% CpS)
and ${pe(Oe)} heavenly chips to spend.`,n+='
',n+=`You need ${pe(t)} more cookies for the next level.
`,n+=e.TooltipAscendButton?`
It takes ${Xt} to reach the next level and you were making ${pe(ht,2)} chips on average in the last 5 seconds.
`:"",l("ascendTooltip").innerHTML=n}()}}function ei(){Tn(),ln(),dn(),r=Object.keys(Game.mods).length,w=document.createElement("style"),w.type="text/css",w.id="CMCSS",document.head.appendChild(w),function(){const e=document.createElement("div");e.id="CMBotBar",e.style.height="69px",e.style.width="100%",e.style.position="absolute",e.style.display="none",e.style.backgroundColor="#262224",e.style.backgroundImage="linear-gradient(to bottom, #4d4548, #000000)",e.style.borderTop="1px solid black",e.style.overflow="auto",e.style.textShadow="-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black";const t=e.appendChild(document.createElement("table"));t.style.width="100%",t.style.textAlign="center",t.style.whiteSpace="nowrap";const o=t.appendChild(document.createElement("tbody")),n=function(e,t){const o=document.createElement("td");return o.style.textAlign="right",o.className=E+t,o.textContent=e,o},i=o.appendChild(document.createElement("tr"));i.style.fontWeight="bold",i.appendChild(n("CM 2.031.7",L)),o.appendChild(document.createElement("tr")).appendChild(n("Bonus Income",O)),o.appendChild(document.createElement("tr")).appendChild(n("Payback Period",O)),o.appendChild(document.createElement("tr")).appendChild(n("Time Left",O)),l("wrapper").appendChild(e),Object.keys(Game.Objects).forEach((e=>{fo(e)}))}(),function(){const e=document.createElement("div");e.id="CMTimerBar",e.style.position="absolute",e.style.display="none",e.style.height="0px",e.style.fontSize="10px",e.style.fontWeight="bold",e.style.backgroundColor="black";const t=go("CMTimerBarGC","Next Cookie",[{id:"CMTimerBarGCMinBar",color:D},{id:"CMTimerBarGCBar",color:j}]);e.appendChild(t);const o=go("CMTimerBarRen","Next Reindeer",[{id:"CMTimerBarRenMinBar",color:D},{id:"CMTimerBarRenBar",color:W}]);e.appendChild(o);const n=document.createElement("div");n.id="CMTimerBarBuffTimers",e.appendChild(n),l("wrapper").appendChild(e)}(),function(){const e=document.createElement("div");e.id="CMUpgradeBar",e.style.width="100%",e.style.backgroundColor="black",e.style.textAlign="center",e.style.fontWeight="bold",e.style.display="none",e.style.zIndex="21",e.onmouseout=function(){Game.tooltip.hide()};const t=document.createElement("div");t.appendChild(function(){const e=document.createElement("div");e.style.minWidth="330px",e.style.marginBottom="4px";const t=document.createElement("div");t.className="name",t.style.marginBottom="4px",t.textContent="Legend",e.appendChild(t);const o=function(e,t){const o=document.createElement("div");o.style.verticalAlign="middle";const n=document.createElement("span");return n.className=N+e,n.style.display="inline-block",n.style.height="10px",n.style.width="10px",n.style.marginRight="4px",o.appendChild(n),o.appendChild(document.createTextNode(t)),o};return e.appendChild(o(O,"Better than the best PP of a building option")),e.appendChild(o(F,"Same as the best PP building option")),e.appendChild(o(L,"Within the top 10 of PP for buildings")),e.appendChild(o(W,"Within the top 20 of PP for buildings")),e.appendChild(o(A,"Within the top 30 of PP for buildings")),e.appendChild(o(j,"Outside of the top 30 of PP for buildings")),e.appendChild(o(D,"Negative or infinity PP")),e}()),e.onmouseover=function(){Game.tooltip.draw(this,escape(t.innerHTML),"store")};const o=function(e,t){const o=document.createElement("span");return o.id=e,o.className=E+t,o.style.width="14.28571428571429%",o.style.display="inline-block",o.textContent="0",o};e.appendChild(o("CMUpgradeBarBlue",O)),e.appendChild(o("CMUpgradeBarGreen",F)),e.appendChild(o("CMUpgradeBarYellow",L)),e.appendChild(o("CMUpgradeBarOrange",W)),e.appendChild(o("CMUpgradeBarRed",A)),e.appendChild(o("CMUpgradeBarPurple",j)),e.appendChild(o("CMUpgradeBarGray",D)),l("upgrades").parentNode.insertBefore(e,l("upgrades").parentNode.childNodes[3])}(),function(){const e=document.createElement("div");e.id="CMFlashScreen",e.style.width="100%",e.style.height="100%",e.style.backgroundColor="white",e.style.display="none",e.style.zIndex="9999999999",e.style.position="absolute",l("wrapper").appendChild(e)}(),function(){const e=document.createElement("div");e.id="CMSectionHidButtons",e.style.textAlign="center";const t=document.createElement("a");t.className="option",t.onclick=function(){"flex"===l("upgrades").style.display?(l("upgrades").style.display="none",l("toggleUpgrades").style.display="none",l("techUpgrades").style.display="none",l("vaultUpgrades").style.display="none"):(l("upgrades").style.display="flex",0!==l("toggleUpgrades").children.length&&(l("toggleUpgrades").style.display="block"),0!==l("techUpgrades").children.length&&(l("techUpgrades").style.display="block"),0!==l("vaultUpgrades").children.length&&(l("vaultUpgrades").style.display="block"))},t.textContent="Hide/Show Upgrades",e.appendChild(t);const o=document.createElement("a");o.className="option",o.onclick=function(){"grid"===l("products").style.display?l("products").style.display="none":l("products").style.display="grid"},o.textContent="Hide/Show Buildings",e.appendChild(o),l("store").insertBefore(e,l("store").childNodes[2])}(),function(){const e=document.createElement("link");e.id="CMFavicon",e.rel="shortcut icon",e.href="https://orteil.dashnet.org/cookieclicker/favicon.ico",document.getElementsByTagName("head")[0].appendChild(e)}(),Object.keys(R).forEach((e=>{!function(e,t,o){const n=document.createElement("div");n.id=e;const i=document.createElement("div");i.style.minWidth=o,i.style.marginBottom="4px";const a=document.createElement("div");a.style.textAlign="left",a.textContent=t,i.appendChild(a),n.appendChild(i),I[e]=n}(R[e][0],R[e][1],R[e][2])})),function(){const e=document.createElement("a");e.id="PopAllNormalWrinklerButton",e.textContent="Pop All Normal",e.className="option",e.onclick=function(){Ln()},e.onmouseout=function(){Game.tooltip.shouldHide=1},e.onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Wn("wb","PopAll")}),"this"),Game.tooltip.wobble()},l("sectionLeftExtra").children[0].append(e);const t=document.createElement("a");t.id="PopFattestWrinklerButton",t.textContent="Pop Single Fattest",t.className="option",t.onclick=function(){null!==xt[1]&&(Game.wrinklers[xt[1]].hp=0)},t.onmouseout=function(){Game.tooltip.shouldHide=1},t.onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Wn("wb","PopFattest")}),"this"),Game.tooltip.wobble()},l("sectionLeftExtra").children[0].append(t)}(),l("products").style.display="grid",l("storeBulk").style.gridRow="1/1",l("upgrades").style.display="flex",l("upgrades").style["flex-wrap"]="wrap",Object.keys(Game.Objects).forEach((e=>{const t=Game.Objects[e];null!==l(`product${t.id}`).onmouseover&&(x[e]=l(`product${t.id}`).onmouseover,l(`product${t.id}`).onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Wn("b",`${e}`)}),"store"),Game.tooltip.wobble()})})),Game.canLumps()&&(s=l("lumps").onmouseover,l("lumps").onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Wn("s","Lump")}),"this"),Game.tooltip.wobble()}),h=Game.LoadMinigames,Game.LoadMinigames=function(){h(),Game.Objects.Farm.minigameLoaded&&(l("gardenTool-1").onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Wn("ha","HarvestAllButton")}),"this"),Game.tooltip.wobble()},Array.from(l("gardenPlot").children).forEach((e=>{const t=e.id.slice(-3);e.onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Wn("p",[`${t[0]}`,`${t[2]}`])}),"this"),Game.tooltip.wobble()}}))),An(),function(){if(Game.Objects.Temple.minigameLoaded){for(let e=0;e<11;e+=1)l(`templeGod${e}`).onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Wn("pag",e)}),"this"),Game.tooltip.wobble()};for(let e=0;e<3;e+=1)l(`templeSlot${e}`).onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return Wn("pas",[e,Game.Objects.Temple.minigame.slot[e]])}),"this"),Game.tooltip.wobble()}}}(),Dn()},Game.LoadMinigames(),l("backgroundLeftCanvas").onmouseover=function(){_=1},l("backgroundLeftCanvas").onmouseout=function(){_=0,Game.tooltip.hide(),Object.keys(Game.wrinklers).forEach((e=>{X[e]=0}))},Zn(),Dn(),Game.CalculateGains(),Fn(),z=Game.OnAscend,Game.prefs.popups?Game.Popup("Cookie Monster version 2.031.7 loaded!"):Game.Notify("Cookie Monster version 2.031.7 loaded!","","",1,1),Game.Win("Third-party")}const ti={init:function(){Mn=!0;let e=!0;Game.version!==Number("2.031")&&(e=confirm("Cookie Monster version 2.031.7 is meant for Game version 2.031. Loading a different version may cause errors. Do you still want to load Cookie Monster?")),e&&(ei(),Game.registerHook("draw",Fo),Game.registerHook("logic",En),Game.registerHook("click",Lo),Mn=!1)},load:function(e){const t=JSON.parse(e);Tn(),void 0!==t.favouriteSettings&&(de=t.favouriteSettings),Fn(t.settings),"2.031.7"!==t.version&&(Game.prefs.popups?Game.Popup("A new version of Cookie Monster has been loaded, check out the release notes in the info tab!"):Game.Notify("A new version of Cookie Monster has been loaded, check out the release notes in the info tab!","","",0,1))},save:vn};Game.registerMod("CookieMonster",ti)})()})(); diff --git a/dist/CookieMonster.js.map b/dist/CookieMonster.js.map index acbc587..dadf8ef 100644 --- a/dist/CookieMonster.js.map +++ b/dist/CookieMonster.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://cookiemonster-mod/./node_modules/@eastdesire/jscolor/jscolor.js","webpack://cookiemonster-mod/webpack/bootstrap","webpack://cookiemonster-mod/webpack/runtime/compat get default export","webpack://cookiemonster-mod/webpack/runtime/define property getters","webpack://cookiemonster-mod/webpack/runtime/hasOwnProperty shorthand","webpack://cookiemonster-mod/./src/Config/VariablesAndData.js","webpack://cookiemonster-mod/./src/Config/Toggles/ToggleWrinklerButtons.js","webpack://cookiemonster-mod/./src/Data/Scales.ts","webpack://cookiemonster-mod/./src/Main/VariablesAndData.js","webpack://cookiemonster-mod/./src/Disp/VariablesAndData.js","webpack://cookiemonster-mod/./src/Disp/BeautifyAndFormatting/BeautifyFormatting.js","webpack://cookiemonster-mod/./src/Cache/VariablesAndData.js","webpack://cookiemonster-mod/./src/Sim/VariablesAndData.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimAuraMult.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimGetSellMultiplier.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimEff.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimHas.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimHasGod.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimModifyBuidlingPrice.js","webpack://cookiemonster-mod/./src/Sim/SimulationEvents/SellBuilding.js","webpack://cookiemonster-mod/./src/Disp/BuildingsUpgrades/Buildings.js","webpack://cookiemonster-mod/./src/Disp/BuildingsUpgrades/Upgrades.js","webpack://cookiemonster-mod/./src/Disp/HelperFunctions/GetCPS.js","webpack://cookiemonster-mod/./src/Disp/HelperFunctions/GetWrinkConfigBank.js","webpack://cookiemonster-mod/./src/Disp/InfoBars/CreateDOMElements.js","webpack://cookiemonster-mod/./src/Disp/InfoBars/BottomBar.js","webpack://cookiemonster-mod/./src/Disp/HelperFunctions/UpdateBackground.js","webpack://cookiemonster-mod/./src/Config/SpecificToggles.js","webpack://cookiemonster-mod/./src/Cache/Dragon/CacheDragonAuras.js","webpack://cookiemonster-mod/./src/Sim/InitializeData/InitAchievement.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimGetTieredCpsMult.js","webpack://cookiemonster-mod/./src/Sim/InitializeData/InitialBuildingData.js","webpack://cookiemonster-mod/./src/Sim/InitializeData/InitUpgrade.js","webpack://cookiemonster-mod/./src/Sim/SimulationData/CopyData.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/CreateTooltip.js","webpack://cookiemonster-mod/./src/Disp/HelperFunctions/CalculateGrimoireRefillTime.js","webpack://cookiemonster-mod/./src/Cache/CPS/GetCPSBuffMult.js","webpack://cookiemonster-mod/./src/Config/Toggles/ToggleToolWarnPos.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/UpdateTooltips.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/Building.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/Upgrade.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/SugarLump.js","webpack://cookiemonster-mod/./src/Disp/HelperFunctions/GetLumpColour.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/Grimoire.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/GardenPlots.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/HarvestAll.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/WrinklerButton.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/PantheonGods.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/Warnings.js","webpack://cookiemonster-mod/./src/Disp/DrawHook.js","webpack://cookiemonster-mod/./src/Disp/InfoBars/TimerBar.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/WrinklerTooltips.js","webpack://cookiemonster-mod/./src/Disp/MenuSections/Refreshmenu.js","webpack://cookiemonster-mod/./src/Main/ClickHook.js","webpack://cookiemonster-mod/./src/Cache/CPS/AverageQueue.js","webpack://cookiemonster-mod/./src/Cache/CPS/CPS.js","webpack://cookiemonster-mod/./src/Cache/PP/ColourOfPP.js","webpack://cookiemonster-mod/./src/Cache/PP/Building.js","webpack://cookiemonster-mod/./src/Cache/PP/PP.js","webpack://cookiemonster-mod/./src/Cache/PP/Upgrade.js","webpack://cookiemonster-mod/./src/Sim/SimulationEvents/BuyBuilding.js","webpack://cookiemonster-mod/./src/Sim/SimulationData/SimWin.js","webpack://cookiemonster-mod/./src/Sim/Calculations/CalculateGains.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimGetHeavenlyMultiplier.js","webpack://cookiemonster-mod/./src/Data/Gamedata.ts","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimHasAchiev.js","webpack://cookiemonster-mod/./src/Sim/Calculations/CheckOtherAchiev.js","webpack://cookiemonster-mod/./src/Cache/PriceAndIncome/PriceAndIncome.js","webpack://cookiemonster-mod/./src/Sim/SimulationEvents/BuyBuildingBonusIncome.js","webpack://cookiemonster-mod/./src/Sim/SimulationEvents/BuyUpgrades.js","webpack://cookiemonster-mod/./src/Cache/Stats/ChainCookies.js","webpack://cookiemonster-mod/./src/Cache/Stats/HeavenlyChips.js","webpack://cookiemonster-mod/./src/Cache/Stats/MissingUpgrades.js","webpack://cookiemonster-mod/./src/Disp/MenuSections/Statistics/CreateMissingUpgrades.js","webpack://cookiemonster-mod/./src/Cache/Stats/Reindeer.js","webpack://cookiemonster-mod/./src/Cache/Stats/Stats.js","webpack://cookiemonster-mod/./src/Cache/Wrinklers/Wrinklers.js","webpack://cookiemonster-mod/./src/Cache/CacheInit.js","webpack://cookiemonster-mod/./src/Data/SettingsDefault.ts","webpack://cookiemonster-mod/./src/Config/CheckNotificationPermissions.js","webpack://cookiemonster-mod/./src/Config/Toggles/ToggleBotBar.js","webpack://cookiemonster-mod/./src/Disp/HelperFunctions/RefreshScale.js","webpack://cookiemonster-mod/./src/Disp/TabTitle/FavIcon.js","webpack://cookiemonster-mod/./src/Data/SettingClasses/BaseSetting.ts","webpack://cookiemonster-mod/./src/Data/SettingClasses/SettingColours.ts","webpack://cookiemonster-mod/./src/Data/SettingClasses/SettingInputNumber.ts","webpack://cookiemonster-mod/./src/Data/SettingClasses/SettingStandard.ts","webpack://cookiemonster-mod/./src/Data/SettingClasses/SettingVolume.ts","webpack://cookiemonster-mod/./src/Data/SettingsData.js","webpack://cookiemonster-mod/./src/Config/Toggles/ToggleDetailedTime.js","webpack://cookiemonster-mod/./src/Config/Toggles/ToggleUpgradeBarAndColour.js","webpack://cookiemonster-mod/./src/Config/Toggles/ToggleUpgradeBarFixedPos.js","webpack://cookiemonster-mod/./src/Config/Toggles/ToggleGCTimer.js","webpack://cookiemonster-mod/./src/Config/Toggles/ToggleSectionHideButtons.js","webpack://cookiemonster-mod/./src/InitSaveLoad/save.js","webpack://cookiemonster-mod/./src/Cache/Dragon/Dragon.js","webpack://cookiemonster-mod/./src/Sim/SimulationEvents/GodChange.js","webpack://cookiemonster-mod/./src/Sim/InitializeData/InitData.js","webpack://cookiemonster-mod/./src/InitSaveLoad/Variables.js","webpack://cookiemonster-mod/./src/Disp/Notifications/Flash.js","webpack://cookiemonster-mod/./src/Disp/Notifications/Sound.js","webpack://cookiemonster-mod/./src/Disp/Notifications/Notification.js","webpack://cookiemonster-mod/./src/Main/LoopHook.js","webpack://cookiemonster-mod/./src/Disp/HelperFunctions/UpdateAscendState.js","webpack://cookiemonster-mod/./src/Cache/CPS/NoGoldSwitchCPS.js","webpack://cookiemonster-mod/./src/Sim/Calculations/NoGoldenSwitchCalc.js","webpack://cookiemonster-mod/./src/Cache/PantheonGods/CacheGods.js","webpack://cookiemonster-mod/./src/Cache/CPS/SellChoEgg.js","webpack://cookiemonster-mod/./src/Sim/SimulationEvents/SellBuildingForChoEgg.js","webpack://cookiemonster-mod/./src/Cache/CacheLoop.js","webpack://cookiemonster-mod/./src/Cache/CPS/CurrWrinklerCPS.js","webpack://cookiemonster-mod/./src/Main/CheckStates/GoldenCookie.js","webpack://cookiemonster-mod/./src/Disp/GoldenCookieTimers/GoldenCookieTimers.js","webpack://cookiemonster-mod/./src/Main/CheckStates/Ticker.js","webpack://cookiemonster-mod/./src/Main/CheckStates/Season.js","webpack://cookiemonster-mod/./src/Main/CheckStates/Garden.js","webpack://cookiemonster-mod/./src/Main/CheckStates/Grimoire.js","webpack://cookiemonster-mod/./src/Main/CheckStates/Wrinkler.js","webpack://cookiemonster-mod/./src/Disp/HelperFunctions/UpdateColours.js","webpack://cookiemonster-mod/./src/Config/SaveLoadReload/SaveLoadReloadSettings.js","webpack://cookiemonster-mod/./src/Disp/HelperFunctions/PopWrinklers.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/Tooltip.js","webpack://cookiemonster-mod/./src/Main/ReplaceGameElements/TooltipGrimoire.js","webpack://cookiemonster-mod/./src/Main/ReplaceGameElements/NativeGrimoire.js","webpack://cookiemonster-mod/./src/Config/ToggleSetting.js","webpack://cookiemonster-mod/./src/Disp/MenuSections/Statistics/CreateDOMElements.js","webpack://cookiemonster-mod/./src/Disp/MenuSections/Statistics/AddStatsPage.js","webpack://cookiemonster-mod/./src/Disp/MenuSections/Statistics/CreateStatsSections.js","webpack://cookiemonster-mod/./src/Sim/SimulationEvents/ResetAscension.js","webpack://cookiemonster-mod/./src/Disp/MenuSections/Statistics/CreateMissingAchievements.js","webpack://cookiemonster-mod/./src/Data/Sectionheaders.ts","webpack://cookiemonster-mod/./src/Disp/MenuSections/Settings/CreateHeader.js","webpack://cookiemonster-mod/./src/Disp/MenuSections/Settings/CreateOption.js","webpack://cookiemonster-mod/./src/Config/Toggles/ToggleFavourites.js","webpack://cookiemonster-mod/./src/Disp/MenuSections/Prompt.js","webpack://cookiemonster-mod/./src/Main/ReplaceGameFunctions/FixMouse.js","webpack://cookiemonster-mod/./src/Main/ReplaceGameFunctions/ReplaceNative.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/PositionLocation.js","webpack://cookiemonster-mod/./src/Main/ReplaceGameElements/TooltipUpgrades.js","webpack://cookiemonster-mod/./src/Disp/Dragon/Dragon.js","webpack://cookiemonster-mod/./src/Sim/SimulationEvents/AuraChange.js","webpack://cookiemonster-mod/./src/Disp/MenuSections/AddMenus.js","webpack://cookiemonster-mod/./src/Disp/MenuSections/Settings/SettingsPage.js","webpack://cookiemonster-mod/./src/Disp/MenuSections/Info/InfoPage.js","webpack://cookiemonster-mod/./src/Data/Moddata.ts","webpack://cookiemonster-mod/./src/Disp/TabTitle/TabTitle.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/AscendButton.js","webpack://cookiemonster-mod/./src/Main/Initialization.js","webpack://cookiemonster-mod/./src/Disp/Initialization/CssArea.js","webpack://cookiemonster-mod/./src/Disp/BuildingsUpgrades/UpgradeBar.js","webpack://cookiemonster-mod/./src/Disp/Initialization/FlashScreen.js","webpack://cookiemonster-mod/./src/Disp/Initialization/CreateSectionHideButtons.js","webpack://cookiemonster-mod/./src/Disp/Initialization/CreateWrinklerButton.js","webpack://cookiemonster-mod/./src/Disp/Initialization/UpdateBuildingUpgradeStyle.js","webpack://cookiemonster-mod/./src/Main/ReplaceGameElements/Tooltips.js","webpack://cookiemonster-mod/./src/Main/WrinklerArea/AddDetectArea.js","webpack://cookiemonster-mod/./src/CookieMonster.js","webpack://cookiemonster-mod/./src/InitSaveLoad/init.js","webpack://cookiemonster-mod/./src/InitSaveLoad/load.js"],"names":["global","factory","module","exports","document","win","Error","window","this","BoxShadow","funcName","elm","jsc","jscolor","initialized","instances","readyQueue","register","addEventListener","pub","init","installBySelector","selector","rootNode","node","elms","querySelectorAll","matchClass","RegExp","lookupClass","i","length","dataOpts","m","undefined","type","toLowerCase","isColorAttrSupported","getDataAttr","className","match","targetElm","optsStr","console","warn","docsRef","opts","trim","parseOptionsStr","e","str","JSON","parse","eParse","looseJSON","Function","eEval","getInstances","inst","targetElement","push","createEl","tagName","el","createElement","setData","nodeOrSelector","sel","querySelector","isNode","val","Node","nodeType","nodeName","removeChildren","firstChild","removeChild","isTextInput","isButton","n","indexOf","isButtonEmpty","value","textContent","isPassiveEventSupported","supported","Object","defineProperty","get","removeEventListener","setAttribute","dataProp","obj","arguments","data","hasOwnProperty","prop","map","removeData","getData","setDefault","name","attrName","getAttribute","setDataAttr","_attachedGroupEvents","attachGroupEvent","groupName","evnt","func","detachGroupEvents","evt","preventDefault","returnValue","captureTarget","target","setCapture","_capturedTarget","releaseTarget","releaseCapture","triggerEvent","eventName","bubbles","cancelable","ev","Event","createEvent","initEvent","dispatchEvent","triggerInputEvent","eventKey","keys","9","13","27","code","keyCode","strList","replace","split","hasClass","classList","contains","addClass","classNames","add","removeClass","repl","remove","getCompStyle","getComputedStyle","currentStyle","setStyle","styles","important","reversible","priority","origStyle","setVal","style","setProperty","hexColor","r","g","b","Math","round","toString","substr","toUpperCase","hexaColor","a","rgbColor","rgbaColor","linearGradient","stdName","prefixes","helper","tryFunc","tryVal","background","getFuncName","Array","prototype","join","call","setBorderRadius","setBoxShadow","getElementPos","relativeToViewport","x","y","rect","getBoundingClientRect","left","top","viewPos","getViewPos","getElementSize","offsetWidth","offsetHeight","getAbsPointerPos","changedTouches","clientX","clientY","getRelPointerPos","targetRect","srcElement","doc","documentElement","pageXOffset","scrollLeft","clientLeft","pageYOffset","scrollTop","clientTop","getViewSize","innerWidth","clientWidth","innerHeight","clientHeight","RGB_HSV","min","v","max","h","HSV_RGB","s","u","floor","parseColorString","ret","rgba","format","parseInt","charAt","mR","mG","mB","mA","par","re","parseFloat","parsePaletteValue","mixed","vals","isArray","colors","color","containsTranparentColor","isAlphaFormat","scaleCanvasForHighDPR","canvas","dpr","devicePixelRatio","width","height","getContext","scale","genColorPreviewCanvas","separatorPos","specWidth","scaleForHighDPR","sepW","previewSeparator","sqSize","chessboardSize","sqColor1","chessboardColor1","sqColor2","chessboardColor2","cWidth","cHeight","ctx","fillStyle","fillRect","start","clearRect","lineWidth","beginPath","strokeStyle","moveTo","lineTo","stroke","genColorPreviewGradient","position","params","apply","redrawPosition","picker","owner","tp","vp","thisObj","fixed","c","ts","vs","pd","getPickerDims","ps","borderW","borderH","l","smartPosition","pp","positionValue","contractShadow","_drawPosition","vShadow","shadowBlur","wrap","boxS","shadow","shadowColor","w","controlBorderWidth","sliderSpace","getControlPadding","sliderSize","getSliderChannel","hasAlphaChannel","pal","getPaletteDims","padding","closeButton","buttonHeight","pW","pH","contentW","contentH","paddedW","paddedH","borderWidth","palette","cols","rows","cellW","cellH","sampleCount","_palette","paletteCols","ceil","paletteSpacing","paletteHeight","pointerBorderWidth","pointerThickness","getPadYChannel","mode","triggerCallback","callback","error","triggerGlobal","eventNames","trigger","_pointerMoveEvent","mouse","touch","_pointerEndEvent","_pointerOrigin","onDocumentKeyUp","tryHide","onWindowResize","onWindowScroll","onParentScroll","onDocumentMouseDown","showOnClick","disabled","show","onControlPointerStart","onPickerTouchStart","controlName","pointerType","registerDragEvents","offset","onDocumentPointerMove","onDocumentPointerEnd","parent","frameElement","ofs","abs","rel","channels","fromHSVA","setPad","setSld","setASld","onPaletteSampleClick","currentTarget","_setFormat","getFormat","paletteSetsAlpha","_paletteHasTransparency","fromRGBA","hideOnPaletteClick","hide","ofsX","ofsY","pointerAbs","xVal","yVal","fmt","createPadCanvas","draw","hGrad","createLinearGradient","addColorStop","vGrad","createSliderGradient","color1","color2","grad","createASliderGradient","hShadow","blur","spread","inset","flags","leaveValue","leaveAlpha","leavePreview","enumOpts","previewPosition","alphaChannel","deprecatedOpts","THIS","setOption","option","oldOpt","newOpt","setter","getOption","getter","drawPicker","_processParentElementsInDOM","box","boxB","pad","padB","padM","padCanvas","cross","crossBY","crossBX","crossLY","crossLX","sld","sldB","sldM","sldGrad","sldPtrS","sldPtrIB","sldPtrMB","sldPtrOB","asld","asldB","asldM","asldGrad","asldPtrS","asldPtrIB","asldPtrMB","asldPtrOB","btn","btnT","appendChild","passive","insetColors","outsetColor","p","displaySlider","displayAlphaSlider","pickerDims","crossOuterSize","crossSize","controlPadding","borderRadius","PI","clear","zIndex","border","borderColor","backgroundColor","opacity","controlBorderColor","cursor","instance","control","pointerBorderColor","pointerColor","overflow","display","sliderInnerSpace","innerHTML","chessboard","si","sampleColor","sampleCssColor","sc","sw","backgroundImage","toDataURL","backgroundRepeat","backgroundPosition","bottom","maxWidth","whiteSpace","buttonColor","font","textAlign","onmousedown","lineHeight","createTextNode","closeText","redrawPad","redrawSld","redrawASld","activeClassName","container","body","parentNode","yChannel","rgb1","rgb2","rgb","toHEXString","sldChannel","isPickerOwner","alpha","onChange","onInput","valueElement","alphaElement","previewElement","previewSize","previewPadding","required","hash","uppercase","forceStyle","hideOnLeave","minS","maxS","minV","maxV","minA","maxA","redraw","exposeColor","success","opt","channel","res","evs","callbackProp","isNaN","hsv","fromHSV","fromRGB","fromString","setPreviewElementBg","setValueElementValue","toHEXAString","toRGBString","toRGBAString","toGrayscale","toCanvas","toBackground","isLight","_currentFormat","processValueInput","processAlphaInput","colorStr","alphaVal","setAlphaElementValue","backgrounds","image","size","repeat","origin","preview","bg","sty","right","_parentElementsProcessed","compStyle","set__palette","options","presetsArr","preset","slice","pres","presets","nonProperties","test","valueElementOrigEvents","oninput","oldVal","initValue","initAlpha","install","shift","ready","triggerNow","installByClassName","JSColor","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","__esModule","d","definition","key","o","enumerable","CMOptions","ToggleWrinklerButtons","WrinklerButtons","Game","elderWrath","metric","shortScale","shortScaleAbbreviated","LastModCount","TooltipLumpBackup","BackupGrimoireLaunch","BackupGrimoireLaunchMod","BackupGrimoireDraw","HasReplaceNativeGrimoireLaunch","HasReplaceNativeGrimoireDraw","LoadMinigames","LastSeasonPopupState","LastTickerFortuneState","LastGardenNextStep","LastGoldenCookieState","LastSpawnedGoldenCookieState","LastMagicBarFull","CurrSpawnedGoldenCookieState","LastWrinklerCount","DispCSS","TooltipBuildBackup","TooltipGrimoireBackup","TooltipUpgradeBackup","BackupFunctions","CycliusDateAtBeginLoop","Date","now","CenturyDateAtBeginLoop","ColourTextPre","ColourBackPre","ColourBlue","ColourGreen","ColourYellow","ColourOrange","ColourRed","ColourPurple","ColourGray","ColourPink","ColourBrown","ColoursOrdering","TooltipText","SimpleTooltipElements","CMLastAscendState","CMSayTime","TooltipWrinklerArea","TooltipWrinkler","TooltipWrinklerBeingShown","LastTargetBotBar","LastTargetBuildings","LastTargetTooltipBuilding","CookieTimes","ClickTimes","BuffColours","Frenzy","Clot","Dragonflight","TooltipPrice","TooltipBonusIncome","TooltipType","TooltipName","TooltipBonusMouse","LastAscendState","LastNumberOfTimers","GCTimers","Title","FavouriteSettings","num","floats","forced","decimals","ScaleDecimals","Infinity","Scale","Beautify","Number","isFinite","answer","ScaleCutoff","ScaleSeparator","toLocaleString","toExponential","exponential","AmountOfTenPowerThree","toFixed","log","FormatTime","time","longFormat","formattedTime","TimeFormat","GetTimeColour","text","CacheAverageCookiesFromClicks","CookiesDiff","WrinkDiff","WrinkFattestDiff","ChoEggDiff","ClicksDiff","HeavenlyChipsDiff","CacheLastCPSCheck","CacheLastCookies","CacheLastWrinkCookies","CacheLastWrinkFattestCookies","CacheLastClicks","CacheAverageGainBank","CacheAverageGainWrink","CacheAverageGainWrinkFattest","CacheAverageGainChoEgg","CacheAverageCPS","CacheLastHeavenlyCheck","CacheLastHeavenlyChips","CacheDoRemakeBuildPrices","CacheHadBuildAura","SimBuildingsOwned","SimUpgradesOwned","SimPledges","SimAchievementsOwned","SimHeavenlyPower","SimPrestige","SimDragonAura","SimDragonAura2","SimGod1","SimGod2","SimGod3","SimDoSims","SimEffs","SimCookiesPs","SimCookiesPsRaw","CacheDragonAura","CacheDragonAura2","CacheLastDragonLevel","CacheCostDragonUpgrade","CacheLucky","CacheLuckyReward","CacheLuckyWrathReward","CacheLuckyFrenzy","CacheLuckyRewardFrenzy","CacheLuckyWrathRewardFrenzy","CacheConjure","CacheConjureReward","CacheEdifice","CacheEdificeBuilding","CacheNoGoldSwitchCookiesPS","CacheDragonsFortuneMultAdjustment","CacheGoldenCookiesMult","CacheWrathCookiesMult","CacheHCPerSecond","CacheCentEgg","CacheSeaSpec","CacheLastChoEgg","CacheObjects1","CacheObjects10","CacheObjects100","CacheWrinklersTotal","CacheWrinklersNormal","CacheWrinklersFattest","CacheCurrWrinklerCPSMult","CacheCurrWrinklerCount","CacheUpgrades","CacheAverageClicks","CacheMissingUpgrades","CacheMissingUpgradesPrestige","CacheMissingUpgradesCookies","CacheChainRequired","CacheChainRequiredNext","CacheChainMaxReward","CacheChainWrathRequired","CacheChainWrathRequiredNext","CacheChainWrathMaxReward","CacheChainFrenzyRequired","CacheChainFrenzyRequiredNext","CacheChainFrenzyMaxReward","CacheChainFrenzyWrathRequired","CacheChainFrenzyWrathRequiredNext","CacheChainFrenzyWrathMaxReward","CacheRealCookiesEarned","CacheAvgCPSWithChoEgg","CacheSpawnedGoldenShimmer","CacheSeasonPopShimmer","CacheTimeTillNextPrestige","CacheMinPP","CachePPArray","CacheGoldenShimmersByID","CacheSellForChoEgg","CacheGods","0","1","2","3","4","5","6","7","8","10","SimObjects","SimUpgrades","SimAchievements","SimAuraMult","what","dragonAuras","SimGetSellMultiplier","giveBack","SimEff","def","SimHas","it","ascensionMode","pool","tier","bought","SimHasGod","hasGod","Temple","minigame","Objects","god","gods","id","SimModifyBuildingPrice","building","price","ModifiedPrice","hasBuff","fortune","minigameLoaded","godLvl","BuildingSell","build","basePrice","free","amount","noSim","noSimRes","toChange","startingAmount","moni","buyBulk","priceIncrease","modifyBuildingPrice","getSellMultiplier","UpdateBuildings","buyMode","BuildColour","forEach","removeProperty","SortBuildings","arr","k","sort","gridRow","UpdateUpgrades","UpBarColour","blue","green","yellow","orange","red","purple","gray","UpgradesInStore","me","addedColour","j","childNodes","div","SortUpgrades","nameChecker","arr2","upgrade","findIndex","order","GetCPS","CPSMode","CalcWrink","cookiesPs","cpsSucked","wrinklers","GetWrinkConfigBank","CreateTimer","bars","timerBar","margin","fontSize","marginRight","verticalAlign","colorBar","borderTopRightRadius","borderBottomRightRadius","timer","marginLeft","CreateBotBarBuildingColumn","buildingName","bonus","header","substring","lastChild","paddingLeft","UpdateBotBar","BotBar","count","PPString","PPDisplayTime","timeColour","bulkPrice","cookies","UpdateBackground","Background","LeftBackground","DrawBackground","UpdateBotTimerBarPosition","TimerBar","TimerBarPos","ToggleTimerBar","CacheDragonAuras","dragonAura","dragonAura2","InitAchievement","achievementName","Achievements","you","SimGetTieredCpsMult","mult","tieredUpgrades","Tiers","special","synergies","syn","buildingTie1","buildingTie2","grandma","Grandma","misfortune","vanilla","InitialBuildingData","cps","magicCpS","ComputeCps","GrandmaSynergies","UpgradesByPool","kitten","Portal","baseCps","baseCPS","InitUpgrade","upgradeName","Upgrades","power","level","pow","CopyData","UpgradesOwned","pledges","AchievementsOwned","heavenlyPower","prestige","totalCookies","slot","won","TooltipCreateHeader","fontWeight","TooltipCreateCalculationSection","tooltip","income","marginBottom","click","production","CalculateGrimoireRefillTime","currentMagic","maxMagic","targetMagic","magic","fps","GetCPSBuffMult","buffs","multCpS","ToggleToolWarnPos","ToolWarnPos","UpdateTooltips","tooltipBox","paddingBottom","TooltipBuildUpgrade","increase","productionAchievs","HasAchiev","achiev","nextProductionAchiev","Building","getPrice","bonusMouse","previousSibling","chocolate","Upgrade","TooltipLump","lumpType","lumpColour","lumpCurrentType","SugarLump","spellCost","getSpellCost","spellsById","TooltipGrim","magicM","recover","recoverColour","conjure","reward","seperator","loss","Grimoire","Farm","TooltipPlots","plot","mature","plantsById","plantName","GardenPlots","totalGain","mortal","tile","immortal","matureBase","HarvestAll","WrinklerReward","WrinklerButton","TooltipPantheon","GodID","cps1","cps2","cps3","PantheonGods","getElementById","TooltipWarn","create","boxId","labelTextFront","labelTextBack","deficitId","transition","labelDiv","labelSpan","deficitDiv","deficitSpan","ToolWarnUser","bonusIncomeUsed","ToolWarnBon","limitLucky","bonusNoFren","ToolWarnLucky","ToolWarnLuckyFrenzy","limitLuckyFrenzy","ToolWarnConjure","limitConjure","ToolWarnConjureFrenzy","limitConjureFrenzy","ToolWarnEdifice","children","Warnings","CMDrawHook","prefs","autosave","drawT","onMenu","Stats","innerText","sayTime","T","maxWidthTwoBar","maxWidthOneBar","numberOfTimers","shimmerTypes","golden","spawned","Has","minTime","maxTime","TimerBarOverlay","season","reindeer","BuffTimerBars","classColour","UpdateTimerBar","TooltipWrink","showingTooltip","phase","selected","placeholder","wrinkler","minWidth","escape","CheckWrinklerTooltip","sucked","toSuck","UpdateWrinklerTooltip","UpStats","UpdateMenu","monospace","CMClickHook","addLatest","computedMouseCps","CMAvgQueue","maxLength","queue","newValue","timePeriod","reduce","CacheAvgCPS","currDate","choEggTotal","cookiesEarned","timeDiff","bankDiffAvg","wrinkDiffAvg","wrinkFattestDiffAvg","choEggDiffAvg","clicksDiffAvg","cookieClicks","cpsLength","AvgCPSHist","calcAverage","choEgg","HasUnlocked","AvgClicksHist","ColourOfPP","PPSecondsLowerLimit","PPOnlyConsiderBuyable","CacheColour","PPRigidelMode","getSumPrice","PPExcludeTop","CachePP","indexOfMin","CacheBuildingsPP","BuildingGetPrice","SimWin","CalculateGains","effs","myEffs","ii","heavenlyMult","SimGetHeavenlyMultiplier","heralds","cookieUpgrades","buildMult","sin","santaLevel","milkProgress","milkMult","catMult","storedCps","eggMult","day","startDate","lumps","rawCookiesPs","CpsAchievements","threshold","auraMult","bakeryName","goldenSwitchMult","upgrades","goldenCookieUpgrades","veilMult","runModHookOnValue","Fortunes","HalloCookies","ChristCookies","ValCookies","PlantDrops","SimHasAchiev","CheckOtherAchiev","grandmas","buildingsOwned","mathematician","base10","minAmount","ObjectsById","Cursor","hasAllHalloCook","hasAllChristCook","list","fortunes","CacheBuildingIncome","result","tieredAchievs","achievUnlock","lastAchievementsOwned","BuyBuildingsBonusIncome","CacheBuildingsPrices","CacheIncome","bonusIncome","unlocked","CountsAsUpgradeOwned","diffMouseCPS","multClick","out","MouseCps","BuyUpgradesBonusIncome","MaxChainCookieReward","digit","maxPayout","totalFromChain","nextMoni","nextRequired","chain","LN10","CacheChain","cpsBuffMult","CacheHeavenlyChipsPS","chipsOwned","HowMuchPrestige","cookiesReset","ascendNowToGet","heavenlyChipsDiffAvg","CacheAllMissingUpgrades","classes","noFrame","crates","icon","iconFunction","getDynamicTooltip","crateMissing","CacheSeasonSpec","CacheStatsCookies","CacheGoldenAndWrathCookiesMults","goldenMult","wrathMult","eff","CacheWrinklers","InitCache","DetailedTime","UpgradeBarFixedPos","DragonAuraInfo","GrimoireBar","GCTimer","Favicon","HideSectionsButtons","TooltipAmor","TooltipAscendButton","MissingUpgrades","MissingAchievements","HeavenlyChipsTarget","ShowMissedGC","GeneralSound","GCNotification","GCFlash","ColourGCFlash","GCSound","GCVolume","GCSoundURL","FortuneNotification","FortuneFlash","ColourFortuneFlash","FortuneSound","FortuneVolume","FortuneSoundURL","SeaNotification","SeaFlash","ColourSeaFlash","SeaSound","SeaVolume","SeaSoundURL","GardFlash","ColourGardFlash","GardSound","GardVolume","GardSoundURL","MagicNotification","MagicFlash","ColourMagicFlash","MagicSound","MagicVolume","MagicSoundURL","WrinklerNotification","WrinklerFlash","ColourWrinklerFlash","WrinklerSound","WrinklerVolume","WrinklerSoundURL","WrinklerMaxNotification","WrinklerMaxFlash","ColourWrinklerMaxFlash","WrinklerMaxSound","WrinklerMaxVolume","WrinklerMaxSoundURL","BulkBuyBlock","Header","Favourite","Calculation","Notation","Colours","BarsDisplay","Tooltip","Statistics","Notification","NotificationGeneral","NotificationGC","NotificationFC","NotificationSea","NotificationGard","NotificationMagi","NotificationWrink","NotificationWrinkMax","Miscellaneous","Lucky","Chain","Spells","Garden","Prestige","Wrink","Sea","Misc","InfoTab","ToggleOnOff","checkNotificationPromise","requestPermission","then","ToggleBotBar","RefreshScale","BeautifyAll","RefreshStore","RebuildUpgrades","UpdateFavicon","wrath","href","Setting","group","SettingColours","desc","super","SettingInputNumber","label","SettingStandard","toggle","SettingVolume","insertBefore","UpBarColor","save","stringify","favouriteSettings","settings","version","CacheDragonCost","dragonLevel","dragonLevels","buy","includes","replaceAll","cost","CalculateChangeGod","CurrentSlot","godsById","InitData","isInitializing","Flash","config","setTimeout","url","sndConfig","volConfig","sound","Audio","volume","play","CreateNotification","notifyConfig","title","message","visibilityState","badge","CMLoopHook","OnAscend","AscendTimer","mods","CachePantheonGods","sellTotal","Bank","marketGoods","goods","goodsVal","marketGood","stock","cookiesPsRawHighest","buildingsToSacrifice","highestBuilding","SellBuildingsForChoEgg","CacheSellAllForChoEgg","hasBuildAura","godMult","CacheCurrWrinklerCPS","cookiesToNext","HowManyCookiesReset","LoopCache","shimmers","spawnLead","cookie","fontFamily","onclick","pop","onmouseover","filter","webkitFilter","onmouseout","CreateGCTimer","transform","life","TickerEffect","nextStep","CheckMagicMeter","CurrentWrinklers","getWrinklersMax","CheckWrinklerCount","UpdateColours","SaveConfig","saveString","b64_to_utf8","unescape","localStorage","getItem","CookieMonsterSave","newSaveString","setItem","utf8_to_b64","LoadConfig","CMConfig","Colors","mod","PopAllNormalWrinklers","hp","CreateTooltip","buildPrice","amortizeAmount","storedTotalCps","globalCpsMult","crateTooltip","lumpTooltip","spellTooltip","tileTooltip","toolTooltip","godTooltip","slotTooltip","area","ReplaceTooltipGrimoire","dynamic","wobble","ReplaceNativeGrimoireDraw","magicBarTextL","ReplaceNativeGrimoire","launch","ReplaceNativeGrimoireLaunch","ToggleConfigVolume","ToggleHeader","StatsHeader","span","StatsListing","listingName","StatsMissDisp","theMissDisp","frag","createDocumentFragment","missing","AddMenuStats","stats","goldCookTooltip","section","luckyColour","luckyTime","luckyReqFrag","luckyReqSpan","luckyReqSmall","luckyColourFrenzy","luckyTimeFrenzy","luckyReqFrenFrag","luckyReqFrenSpan","luckyReqFrenSmall","luckySplit","luckyRewardMaxSpan","luckyRewardFrenzyMaxSpan","luckyCurBase","luckyCurSpan","chainColour","chainTime","chainReqFrag","chainReqSpan","chainReqSmall","chainWrathColour","chainWrathTime","chainWrathReqFrag","chainWrathReqSpan","chainWrathReqSmall","chainColourFrenzy","chainTimeFrenzy","chainReqFrenFrag","chainReqFrenSpan","chainReqFrenSmall","chainWrathColourFrenzy","chainWrathTimeFrenzy","chainWrathReqFrenFrag","chainWrathReqFrenSpan","chainWrathReqFrenSmall","chainCurMax","chainCur","chainCurWrath","conjureColour","conjureTime","conjureReqFrag","conjureReqSpan","conjureReqSmall","conjureFrenzyColour","conjureFrenzyCur","conjureFrenzyTime","conjureFrenzyReqFrag","conjureFrenzyReqSpan","conjureFrenzyReqSmall","bakeberryColour","bakeberryFrag","chocorootColour","chocorootFrag","queenbeetColour","queenbeetFrag","duketaterColour","duketaterFrag","missingPlantDrops","possiblePresMax","neededCook","cookiesNextFrag","cookiesNextSmall","heavenlyChips","HCTarget","CookiesTillTarget","resetBonus","newHeavenlyChips","curCPS","ResetCPS","ResetBonus","resetFrag","resetSmall","currentPrestige","willHave","willGet","delta7","next7Reset","next7Total","frag7","delta777","next777Reset","next777Total","frag777","delta777777","next777777Reset","next777777Total","frag777777","popAllFrag","popAllA","popFattestFrag","popFattestA","specDisp","missingHalloweenCookies","missingChristmasCookies","missingValentineCookies","missingNormalEggs","eggDrops","missingRareEggs","rareEggDrops","centEgg","failRateHalloween","dropRateMult","obtainedCookiesChance","failRateChristmas","dropRateEgg","StartingFailRate","failRateEgg","succesRateEgg","obtainedEggs","obtainedRareEggs","pNormal1","pRare1","pRedrop","calcSum","missedGoldenClicks","menuSection","prestigeUpgradesMissing","titlefrag","PrestigeUpgrades","normalUpgradesMissing","tech","nextSibling","cookieUpgradesMissing","achievs","values","parentElement","achievsCrate","AchievementsById","mouseDown","setOnCrate","tags","neuromancy","sesame","descFunc","tagsStr","CrateTooltipLockedAchievements","AddMissingAchievements","ConfigGroups","ConfigGroupsNotification","CreatePrefHeader","CreatePrefOption","FavStar","ele","ToggleFavouriteSetting","FavouriteSettingPlaceholder","CreateFavouriteStar","ToggleConfig","float","percent","slider","step","onchange","input","readOnly","inputPrompt","content","promptWrapL","promptL","PlaySound","promptAnchorL","darkenL","focus","promptOn","UpdatePrompt","CookieMonsterPrompt","outerHTML","ClosePrompt","innerSpan","FixMouseY","timerBarHeight","mouseY","ReplaceNative","drawMod","from","update","updateMod","warnOffset","tta","tt","UpdateTooltipLocation","UpdateWrinklers","UpdateSpecial","ClickCookie","ClickProduct","DescribeDragonAura","aura","bonusCPS","priceOfChange","CalculateChangeAura","timeToRecover","bonusCPSPercentage","minHeight","div2","AddAuraInfo","ToggleSpecialMenu","on","shouldHide","AddDragonLevelUpTooltip","index","subGroup","subGroupObject","resDef","resDefBut","AddMenuPref","info","description","notes","menu","AddMenuInfo","AddMenu","detail","Logic","titleGC","titleFC","titleSP","addFC","addSP","lastIndexOf","spawn","UpdateTitle","ReplaceAscendTooltip","InitializeCookieMonster","head","borderTop","textShadow","table","tbody","firstCol","td","CreateBotBar","CMTimerBarGC","CMTimerBarRen","TimerBarBuffTimers","CreateTimerBar","UpgradeBar","legend","legendLine","CreateUpgradeBarLegend","upgradeNumber","CreateUpgradeBar","WhiteScreen","CreateFlashScreen","CreateSectionHideButtons","getElementsByTagName","CreateFavicon","CreateSimpleTooltip","append","CreateWrinklerButtons","canLumps","child","coords","ReplaceTooltipPantheon","popups","Popup","Notify","Win","CM","proceed","confirm","registerHook","load","registerMod"],"mappings":";8BAYA,SAAWA,EAAQC,GAElB,aAE4D,iBAAnBC,EAAOC,QAchDF,EAAQD,GAZPE,EAAOC,QAAUH,EAAOI,SACvBH,EAASD,GACT,SAAUK,GACT,IAAKA,EAAID,SACR,MAAM,IAAIE,MAAM,wCAEjB,OAAOL,EAAQI,IAZnB,CAoBqB,oBAAXE,OAAyBA,OAASC,MAAM,SAAUD,GAK5D,aAGA,IAwgDME,EAt7BAC,EAzXAC,EAvNFC,EAFAC,IAEAD,EAAM,CAGTE,aAAc,EAEdC,UAAY,GAEZC,WAAa,GAGbC,SAAW,gBACY,IAAXV,GAA0BA,EAAOH,UAC3CG,EAAOH,SAASc,iBAAiB,mBA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,MACA,OACA,OACA,OACA,OACA,MACA,MACA,KACA,MACA,MACA,MACA,OACA,OACA,OACA,OACA,MACA,MACA,MACA,MACA,MACA,MACA,OACA,OACA,OACA,OACA,MACA,MACA,MACA,MACA,MACA,MACA,OACA,OACA,OACA,OACA,MACA,MACA,MACA,MACA,MACA,MACA,OACA,OACA,OACA,OACA,MACA,MACA,MACA,MACA,MACA,MACA,OACA,OACA,OACA,OACA,MACA,MACA,MACA,MACA,MACA,MACA,OACA,OACA,OACA,OACA,MACA,MACA,MACA,MACA,MACA,MACA,OACA,OACA,OACA,OACA,MACA,MACA,KACA,OC3IK,IAAIC,EAEAC,EAGAC,EACAC,EACAC,EACAC,EACAC,EACAC,EAGAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,ECjBAC,EDFAC,EAAqB,GAErBC,EAAwB,GACxBC,EAAuB,GAOvBC,EAAkB,GAalBC,EAAyBC,KAAKC,MAI9BC,EAAyBF,KAAKC,MCpBlC,MAAME,EAAgB,SAChBC,EAAgB,SAMhBC,EAAa,OACbC,EAAc,QACdC,EAAe,SACfC,EAAe,SACfC,EAAY,MACZC,EAAe,SACfC,EAAa,OACbC,EAAa,OACbC,EAAc,QACdC,EAAkB,CAC7BH,EACAN,EACAC,EACAC,EACAC,EACAC,EACAC,EACAE,EACAC,GAUWE,EAAc,CACzB,CAAC,6BAA8B,oCAAqC,SACpE,CACE,2CACA,6EACA,SAEF,CACE,6BACA,qPACA,SAEF,CACE,8BACA,kEACA,SAEF,CACE,kCACA,2PACA,SAEF,CACE,0BACA,gLACA,SAEF,CACE,2BACA,uOACA,SAEF,CACE,4BACA,2CACA,SAEF,CACE,8BACA,uHACA,UAGSC,EAAwB,GAM9B,IAUIC,EACAC,EAXAC,EAAsB,EACtBC,GAAmB,EAOnBC,EAA4B,GAQ5BC,EAAmB,EACnBC,EAAsB,EACtBC,EAA4B,EAMhC,MAAMC,EAAc,CAAC,GAAI,GAAI,GAAI,GAAI,IAAK,IAAK,IAA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AK4W,QAAQpkB,KACX3Y,MACA,WACE,OAAOk6C,GAAc,MAAO,CAC1B54C,EACA6kB,KAAKyN,QAAQF,OAAOC,SAAS+I,KAAKp7B,OAGtC,QAEF6kB,KAAK4W,QAAQke,WAqBjBgR,GACA7Q,MAEFj1B,KAAKY,gBClILxU,EAAE,wBAAwB6lC,YAAc,WACtCnvB,EAAsB,GAExB1W,EAAE,wBAAwBgmC,WAAa,WACrCtvB,EAAsB,EACtB9C,KAAK4W,QAAQ5kB,OACbrT,OAAO6C,KAAKwe,KAAKuR,WAAWjC,SAASn0B,IACnC6nB,EAA0B7nB,GAAK,MRsCnC2lD,KACA7L,KACAj1B,KAAKyhB,iBAELgS,KACA7wB,EAAoB5C,KAAKqwB,SAErBrwB,KAAK6c,MAAMkpB,OACb/lC,KAAKgmC,MACH,0CAGFhmC,KAAKimC,OACH,yCACA,GACA,GACA,EACA,GAGJjmC,KAAKkmC,IAAI,eSvEX,MAAMC,GAAK,CACT1rD,KCQa,WACb00C,IAAiB,EACjB,IAAIiX,GAAU,EACVpmC,KAAKuuB,UAAY3pB,ObdK,WagBxBwhC,EAAUC,QACR,4JAGAD,IACFpC,KACAhkC,KAAKsmC,aAAa,OAAQ1pB,IAC1B5c,KAAKsmC,aAAa,QAASlW,IAC3BpwB,KAAKsmC,aAAa,QAASnnB,IAC3BgQ,IAAiB,IDrBnBoX,KEGa,SAAchqD,GAC3B,MAAM4xC,EAAO3xC,KAAKC,MAAMF,GACxB2yC,UAEsC,IAA3Bf,EAAKE,oBACdlqB,GAAoBgqB,EAAKE,mBAC3BoF,GAAWtF,EAAKG,UACK,YAAjBH,EAAKI,UACHvuB,KAAK6c,MAAMkpB,OACb/lC,KAAKgmC,MACH,iGAGFhmC,KAAKimC,OACH,gGACA,GACA,GACA,EACA,KFpBN9X,KAAI,IAGNnuB,KAAKwmC,YAAY,gBAAiBL,K","file":"CookieMonster.js","sourcesContent":["/**\r\n * jscolor - JavaScript Color Picker\r\n *\r\n * @link http://jscolor.com\r\n * @license For open source use: GPLv3\r\n * For commercial use: JSColor Commercial License\r\n * @author Jan Odvarko - East Desire\r\n *\r\n * See usage examples at http://jscolor.com/examples/\r\n */\r\n\r\n\r\n(function (global, factory) {\r\n\r\n\t'use strict';\r\n\r\n\tif (typeof module === 'object' && typeof module.exports === 'object') {\r\n\t\t// Export jscolor as a module\r\n\t\tmodule.exports = global.document ?\r\n\t\t\tfactory (global) :\r\n\t\t\tfunction (win) {\r\n\t\t\t\tif (!win.document) {\r\n\t\t\t\t\tthrow new Error('jscolor needs a window with document');\r\n\t\t\t\t}\r\n\t\t\t\treturn factory(win);\r\n\t\t\t}\r\n\t\treturn;\r\n\t}\r\n\r\n\t// Default use (no module export)\r\n\tfactory(global);\r\n\r\n})(typeof window !== 'undefined' ? window : this, function (window) { // BEGIN factory\r\n\r\n// BEGIN jscolor code\r\n\r\n\r\n'use strict';\r\n\r\n\r\nvar jscolor = (function () { // BEGIN jscolor\r\n\r\nvar jsc = {\r\n\r\n\r\n\tinitialized : false,\r\n\r\n\tinstances : [], // created instances of jscolor\r\n\r\n\treadyQueue : [], // functions waiting to be called after init\r\n\r\n\r\n\tregister : function () {\r\n\t\tif (typeof window !== 'undefined' && window.document) {\r\n\t\t\twindow.document.addEventListener('DOMContentLoaded', jsc.pub.init, false);\r\n\t\t}\r\n\t},\r\n\r\n\r\n\tinstallBySelector : function (selector, rootNode) {\r\n\t\trootNode = rootNode ? jsc.node(rootNode) : window.document;\r\n\t\tif (!rootNode) {\r\n\t\t\tthrow new Error('Missing root node');\r\n\t\t}\r\n\r\n\t\tvar elms = rootNode.querySelectorAll(selector);\r\n\r\n\t\t// for backward compatibility with DEPRECATED installation/configuration using className\r\n\t\tvar matchClass = new RegExp('(^|\\\\s)(' + jsc.pub.lookupClass + ')(\\\\s*(\\\\{[^}]*\\\\})|\\\\s|$)', 'i');\r\n\r\n\t\tfor (var i = 0; i < elms.length; i += 1) {\r\n\r\n\t\t\tif (elms[i].jscolor && elms[i].jscolor instanceof jsc.pub) {\r\n\t\t\t\tcontinue; // jscolor already installed on this element\r\n\t\t\t}\r\n\r\n\t\t\tif (elms[i].type !== undefined && elms[i].type.toLowerCase() == 'color' && jsc.isColorAttrSupported) {\r\n\t\t\t\tcontinue; // skips inputs of type 'color' if supported by the browser\r\n\t\t\t}\r\n\r\n\t\t\tvar dataOpts, m;\r\n\r\n\t\t\tif (\r\n\t\t\t\t(dataOpts = jsc.getDataAttr(elms[i], 'jscolor')) !== null ||\r\n\t\t\t\t(elms[i].className && (m = elms[i].className.match(matchClass))) // installation using className (DEPRECATED)\r\n\t\t\t) {\r\n\t\t\t\tvar targetElm = elms[i];\r\n\r\n\t\t\t\tvar optsStr = '';\r\n\t\t\t\tif (dataOpts !== null) {\r\n\t\t\t\t\toptsStr = dataOpts;\r\n\r\n\t\t\t\t} else if (m) { // installation using className (DEPRECATED)\r\n\t\t\t\t\tconsole.warn('Installation using class name is DEPRECATED. Use data-jscolor=\"\" attribute instead.' + jsc.docsRef);\r\n\t\t\t\t\tif (m[4]) {\r\n\t\t\t\t\t\toptsStr = m[4];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar opts = null;\r\n\t\t\t\tif (optsStr.trim()) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\topts = jsc.parseOptionsStr(optsStr);\r\n\t\t\t\t\t} catch (e) {\r\n\t\t\t\t\t\tconsole.warn(e + '\\n' + optsStr);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttry {\r\n\t\t\t\t\tnew jsc.pub(targetElm, opts);\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\tconsole.warn(e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\r\n\tparseOptionsStr : function (str) {\r\n\t\tvar opts = null;\r\n\r\n\t\ttry {\r\n\t\t\topts = JSON.parse(str);\r\n\r\n\t\t} catch (eParse) {\r\n\t\t\tif (!jsc.pub.looseJSON) {\r\n\t\t\t\tthrow new Error('Could not parse jscolor options as JSON: ' + eParse);\r\n\t\t\t} else {\r\n\t\t\t\t// loose JSON syntax is enabled -> try to evaluate the options string as JavaScript object\r\n\t\t\t\ttry {\r\n\t\t\t\t\topts = (new Function ('var opts = (' + str + '); return typeof opts === \"object\" ? opts : {};'))();\r\n\t\t\t\t} catch (eEval) {\r\n\t\t\t\t\tthrow new Error('Could not evaluate jscolor options: ' + eEval);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn opts;\r\n\t},\r\n\r\n\r\n\tgetInstances : function () {\r\n\t\tvar inst = [];\r\n\t\tfor (var i = 0; i < jsc.instances.length; i += 1) {\r\n\t\t\t// if the targetElement still exists, the instance is considered \"alive\"\r\n\t\t\tif (jsc.instances[i] && jsc.instances[i].targetElement) {\r\n\t\t\t\tinst.push(jsc.instances[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn inst;\r\n\t},\r\n\r\n\r\n\tcreateEl : function (tagName) {\r\n\t\tvar el = window.document.createElement(tagName);\r\n\t\tjsc.setData(el, 'gui', true);\r\n\t\treturn el;\r\n\t},\r\n\r\n\r\n\tnode : function (nodeOrSelector) {\r\n\t\tif (!nodeOrSelector) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tif (typeof nodeOrSelector === 'string') {\r\n\t\t\t// query selector\r\n\t\t\tvar sel = nodeOrSelector;\r\n\t\t\tvar el = null;\r\n\t\t\ttry {\r\n\t\t\t\tel = window.document.querySelector(sel);\r\n\t\t\t} catch (e) {\r\n\t\t\t\tconsole.warn(e);\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t\tif (!el) {\r\n\t\t\t\tconsole.warn('No element matches the selector: %s', sel);\r\n\t\t\t}\r\n\t\t\treturn el;\r\n\t\t}\r\n\r\n\t\tif (jsc.isNode(nodeOrSelector)) {\r\n\t\t\t// DOM node\r\n\t\t\treturn nodeOrSelector;\r\n\t\t}\r\n\r\n\t\tconsole.warn('Invalid node of type %s: %s', typeof nodeOrSelector, nodeOrSelector);\r\n\t\treturn null;\r\n\t},\r\n\r\n\r\n\t// See https://stackoverflow.com/questions/384286/\r\n\tisNode : function (val) {\r\n\t\tif (typeof Node === 'object') {\r\n\t\t\treturn val instanceof Node;\r\n\t\t}\r\n\t\treturn val && typeof val === 'object' && typeof val.nodeType === 'number' && typeof val.nodeName === 'string';\r\n\t},\r\n\r\n\r\n\tnodeName : function (node) {\r\n\t\tif (node && node.nodeName) {\r\n\t\t\treturn node.nodeName.toLowerCase();\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\r\n\r\n\tremoveChildren : function (node) {\r\n\t\twhile (node.firstChild) {\r\n\t\t\tnode.removeChild(node.firstChild);\r\n\t\t}\r\n\t},\r\n\r\n\r\n\tisTextInput : function (el) {\r\n\t\treturn el && jsc.nodeName(el) === 'input' && el.type.toLowerCase() === 'text';\r\n\t},\r\n\r\n\r\n\tisButton : function (el) {\r\n\t\tif (!el) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tvar n = jsc.nodeName(el);\r\n\t\treturn (\r\n\t\t\t(n === 'button') ||\r\n\t\t\t(n === 'input' && ['button', 'submit', 'reset'].indexOf(el.type.toLowerCase()) > -1)\r\n\t\t);\r\n\t},\r\n\r\n\r\n\tisButtonEmpty : function (el) {\r\n\t\tswitch (jsc.nodeName(el)) {\r\n\t\t\tcase 'input': return (!el.value || el.value.trim() === '');\r\n\t\t\tcase 'button': return (el.textContent.trim() === '');\r\n\t\t}\r\n\t\treturn null; // could not determine element's text\r\n\t},\r\n\r\n\r\n\t// See https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md\r\n\tisPassiveEventSupported : (function () {\r\n\t\tvar supported = false;\r\n\r\n\t\ttry {\r\n\t\t\tvar opts = Object.defineProperty({}, 'passive', {\r\n\t\t\t\tget: function () { supported = true; }\r\n\t\t\t});\r\n\t\t\twindow.addEventListener('testPassive', null, opts);\r\n\t\t\twindow.removeEventListener('testPassive', null, opts);\r\n\t\t} catch (e) {}\r\n\r\n\t\treturn supported;\r\n\t})(),\r\n\r\n\r\n\tisColorAttrSupported : (function () {\r\n\t\tvar elm = window.document.createElement('input');\r\n\t\tif (elm.setAttribute) {\r\n\t\t\telm.setAttribute('type', 'color');\r\n\t\t\tif (elm.type.toLowerCase() == 'color') {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t})(),\r\n\r\n\r\n\tdataProp : '_data_jscolor',\r\n\r\n\r\n\t// usage:\r\n\t// setData(obj, prop, value)\r\n\t// setData(obj, {prop:value, ...})\r\n\t//\r\n\tsetData : function () {\r\n\t\tvar obj = arguments[0];\r\n\r\n\t\tif (arguments.length === 3) {\r\n\t\t\t// setting a single property\r\n\t\t\tvar data = obj.hasOwnProperty(jsc.dataProp) ? obj[jsc.dataProp] : (obj[jsc.dataProp] = {});\r\n\t\t\tvar prop = arguments[1];\r\n\t\t\tvar value = arguments[2];\r\n\r\n\t\t\tdata[prop] = value;\r\n\t\t\treturn true;\r\n\r\n\t\t} else if (arguments.length === 2 && typeof arguments[1] === 'object') {\r\n\t\t\t// setting multiple properties\r\n\t\t\tvar data = obj.hasOwnProperty(jsc.dataProp) ? obj[jsc.dataProp] : (obj[jsc.dataProp] = {});\r\n\t\t\tvar map = arguments[1];\r\n\r\n\t\t\tfor (var prop in map) {\r\n\t\t\t\tif (map.hasOwnProperty(prop)) {\r\n\t\t\t\t\tdata[prop] = map[prop];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tthrow new Error('Invalid arguments');\r\n\t},\r\n\r\n\r\n\t// usage:\r\n\t// removeData(obj, prop, [prop...])\r\n\t//\r\n\tremoveData : function () {\r\n\t\tvar obj = arguments[0];\r\n\t\tif (!obj.hasOwnProperty(jsc.dataProp)) {\r\n\t\t\treturn true; // data object does not exist\r\n\t\t}\r\n\t\tfor (var i = 1; i < arguments.length; i += 1) {\r\n\t\t\tvar prop = arguments[i];\r\n\t\t\tdelete obj[jsc.dataProp][prop];\r\n\t\t}\r\n\t\treturn true;\r\n\t},\r\n\r\n\r\n\tgetData : function (obj, prop, setDefault) {\r\n\t\tif (!obj.hasOwnProperty(jsc.dataProp)) {\r\n\t\t\t// data object does not exist\r\n\t\t\tif (setDefault !== undefined) {\r\n\t\t\t\tobj[jsc.dataProp] = {}; // create data object\r\n\t\t\t} else {\r\n\t\t\t\treturn undefined; // no value to return\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar data = obj[jsc.dataProp];\r\n\r\n\t\tif (!data.hasOwnProperty(prop) && setDefault !== undefined) {\r\n\t\t\tdata[prop] = setDefault;\r\n\t\t}\r\n\t\treturn data[prop];\r\n\t},\r\n\r\n\r\n\tgetDataAttr : function (el, name) {\r\n\t\tvar attrName = 'data-' + name;\r\n\t\tvar attrValue = el.getAttribute(attrName);\r\n\t\treturn attrValue;\r\n\t},\r\n\r\n\r\n\tsetDataAttr : function (el, name, value) {\r\n\t\tvar attrName = 'data-' + name;\r\n\t\tel.setAttribute(attrName, value);\r\n\t},\r\n\r\n\r\n\t_attachedGroupEvents : {},\r\n\r\n\r\n\tattachGroupEvent : function (groupName, el, evnt, func) {\r\n\t\tif (!jsc._attachedGroupEvents.hasOwnProperty(groupName)) {\r\n\t\t\tjsc._attachedGroupEvents[groupName] = [];\r\n\t\t}\r\n\t\tjsc._attachedGroupEvents[groupName].push([el, evnt, func]);\r\n\t\tel.addEventListener(evnt, func, false);\r\n\t},\r\n\r\n\r\n\tdetachGroupEvents : function (groupName) {\r\n\t\tif (jsc._attachedGroupEvents.hasOwnProperty(groupName)) {\r\n\t\t\tfor (var i = 0; i < jsc._attachedGroupEvents[groupName].length; i += 1) {\r\n\t\t\t\tvar evt = jsc._attachedGroupEvents[groupName][i];\r\n\t\t\t\tevt[0].removeEventListener(evt[1], evt[2], false);\r\n\t\t\t}\r\n\t\t\tdelete jsc._attachedGroupEvents[groupName];\r\n\t\t}\r\n\t},\r\n\r\n\r\n\tpreventDefault : function (e) {\r\n\t\tif (e.preventDefault) { e.preventDefault(); }\r\n\t\te.returnValue = false;\r\n\t},\r\n\r\n\r\n\tcaptureTarget : function (target) {\r\n\t\t// IE\r\n\t\tif (target.setCapture) {\r\n\t\t\tjsc._capturedTarget = target;\r\n\t\t\tjsc._capturedTarget.setCapture();\r\n\t\t}\r\n\t},\r\n\r\n\r\n\treleaseTarget : function () {\r\n\t\t// IE\r\n\t\tif (jsc._capturedTarget) {\r\n\t\t\tjsc._capturedTarget.releaseCapture();\r\n\t\t\tjsc._capturedTarget = null;\r\n\t\t}\r\n\t},\r\n\r\n\r\n\ttriggerEvent : function (el, eventName, bubbles, cancelable) {\r\n\t\tif (!el) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar ev = null;\r\n\r\n\t\tif (typeof Event === 'function') {\r\n\t\t\tev = new Event(eventName, {\r\n\t\t\t\tbubbles: bubbles,\r\n\t\t\t\tcancelable: cancelable\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\t// IE\r\n\t\t\tev = window.document.createEvent('Event');\r\n\t\t\tev.initEvent(eventName, bubbles, cancelable);\r\n\t\t}\r\n\r\n\t\tif (!ev) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// so that we know that the event was triggered internally\r\n\t\tjsc.setData(ev, 'internal', true);\r\n\r\n\t\tel.dispatchEvent(ev);\r\n\t\treturn true;\r\n\t},\r\n\r\n\r\n\ttriggerInputEvent : function (el, eventName, bubbles, cancelable) {\r\n\t\tif (!el) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (jsc.isTextInput(el)) {\r\n\t\t\tjsc.triggerEvent(el, eventName, bubbles, cancelable);\r\n\t\t}\r\n\t},\r\n\r\n\r\n\teventKey : function (ev) {\r\n\t\tvar keys = {\r\n\t\t\t9: 'Tab',\r\n\t\t\t13: 'Enter',\r\n\t\t\t27: 'Escape',\r\n\t\t};\r\n\t\tif (typeof ev.code === 'string') {\r\n\t\t\treturn ev.code;\r\n\t\t} else if (ev.keyCode !== undefined && keys.hasOwnProperty(ev.keyCode)) {\r\n\t\t\treturn keys[ev.keyCode];\r\n\t\t}\r\n\t\treturn null;\r\n\t},\r\n\r\n\r\n\tstrList : function (str) {\r\n\t\tif (!str) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\t\treturn str.replace(/^\\s+|\\s+$/g, '').split(/\\s+/);\r\n\t},\r\n\r\n\r\n\t// The className parameter (str) can only contain a single class name\r\n\thasClass : function (elm, className) {\r\n\t\tif (!className) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (elm.classList !== undefined) {\r\n\t\t\treturn elm.classList.contains(className);\r\n\t\t}\r\n\t\t// polyfill\r\n\t\treturn -1 != (' ' + elm.className.replace(/\\s+/g, ' ') + ' ').indexOf(' ' + className + ' ');\r\n\t},\r\n\r\n\r\n\t// The className parameter (str) can contain multiple class names separated by whitespace\r\n\taddClass : function (elm, className) {\r\n\t\tvar classNames = jsc.strList(className);\r\n\r\n\t\tif (elm.classList !== undefined) {\r\n\t\t\tfor (var i = 0; i < classNames.length; i += 1) {\r\n\t\t\t\telm.classList.add(classNames[i]);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// polyfill\r\n\t\tfor (var i = 0; i < classNames.length; i += 1) {\r\n\t\t\tif (!jsc.hasClass(elm, classNames[i])) {\r\n\t\t\t\telm.className += (elm.className ? ' ' : '') + classNames[i];\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\r\n\t// The className parameter (str) can contain multiple class names separated by whitespace\r\n\tremoveClass : function (elm, className) {\r\n\t\tvar classNames = jsc.strList(className);\r\n\r\n\t\tif (elm.classList !== undefined) {\r\n\t\t\tfor (var i = 0; i < classNames.length; i += 1) {\r\n\t\t\t\telm.classList.remove(classNames[i]);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// polyfill\r\n\t\tfor (var i = 0; i < classNames.length; i += 1) {\r\n\t\t\tvar repl = new RegExp(\r\n\t\t\t\t'^\\\\s*' + classNames[i] + '\\\\s*|' +\r\n\t\t\t\t'\\\\s*' + classNames[i] + '\\\\s*$|' +\r\n\t\t\t\t'\\\\s+' + classNames[i] + '(\\\\s+)',\r\n\t\t\t\t'g'\r\n\t\t\t);\r\n\t\t\telm.className = elm.className.replace(repl, '$1');\r\n\t\t}\r\n\t},\r\n\r\n\r\n\tgetCompStyle : function (elm) {\r\n\t\tvar compStyle = window.getComputedStyle ? window.getComputedStyle(elm) : elm.currentStyle;\r\n\r\n\t\t// Note: In Firefox, getComputedStyle returns null in a hidden iframe,\r\n\t\t// that's why we need to check if the returned value is non-empty\r\n\t\tif (!compStyle) {\r\n\t\t\treturn {};\r\n\t\t}\r\n\t\treturn compStyle;\r\n\t},\r\n\r\n\r\n\t// Note:\r\n\t// Setting a property to NULL reverts it to the state before it was first set\r\n\t// with the 'reversible' flag enabled\r\n\t//\r\n\tsetStyle : function (elm, styles, important, reversible) {\r\n\t\t// using '' for standard priority (IE10 apparently doesn't like value undefined)\r\n\t\tvar priority = important ? 'important' : '';\r\n\t\tvar origStyle = null;\r\n\r\n\t\tfor (var prop in styles) {\r\n\t\t\tif (styles.hasOwnProperty(prop)) {\r\n\t\t\t\tvar setVal = null;\r\n\r\n\t\t\t\tif (styles[prop] === null) {\r\n\t\t\t\t\t// reverting a property value\r\n\r\n\t\t\t\t\tif (!origStyle) {\r\n\t\t\t\t\t\t// get the original style object, but dont't try to create it if it doesn't exist\r\n\t\t\t\t\t\torigStyle = jsc.getData(elm, 'origStyle');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (origStyle && origStyle.hasOwnProperty(prop)) {\r\n\t\t\t\t\t\t// we have property's original value -> use it\r\n\t\t\t\t\t\tsetVal = origStyle[prop];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// setting a property value\r\n\r\n\t\t\t\t\tif (reversible) {\r\n\t\t\t\t\t\tif (!origStyle) {\r\n\t\t\t\t\t\t\t// get the original style object and if it doesn't exist, create it\r\n\t\t\t\t\t\t\torigStyle = jsc.getData(elm, 'origStyle', {});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (!origStyle.hasOwnProperty(prop)) {\r\n\t\t\t\t\t\t\t// original property value not yet stored -> store it\r\n\t\t\t\t\t\t\torigStyle[prop] = elm.style[prop];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tsetVal = styles[prop];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (setVal !== null) {\r\n\t\t\t\t\telm.style.setProperty(prop, setVal, priority);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\r\n\thexColor : function (r, g, b) {\r\n\t\treturn '#' + (\r\n\t\t\t('0' + Math.round(r).toString(16)).substr(-2) +\r\n\t\t\t('0' + Math.round(g).toString(16)).substr(-2) +\r\n\t\t\t('0' + Math.round(b).toString(16)).substr(-2)\r\n\t\t).toUpperCase();\r\n\t},\r\n\r\n\r\n\thexaColor : function (r, g, b, a) {\r\n\t\treturn '#' + (\r\n\t\t\t('0' + Math.round(r).toString(16)).substr(-2) +\r\n\t\t\t('0' + Math.round(g).toString(16)).substr(-2) +\r\n\t\t\t('0' + Math.round(b).toString(16)).substr(-2) +\r\n\t\t\t('0' + Math.round(a * 255).toString(16)).substr(-2)\r\n\t\t).toUpperCase();\r\n\t},\r\n\r\n\r\n\trgbColor : function (r, g, b) {\r\n\t\treturn 'rgb(' +\r\n\t\t\tMath.round(r) + ',' +\r\n\t\t\tMath.round(g) + ',' +\r\n\t\t\tMath.round(b) +\r\n\t\t')';\r\n\t},\r\n\r\n\r\n\trgbaColor : function (r, g, b, a) {\r\n\t\treturn 'rgba(' +\r\n\t\t\tMath.round(r) + ',' +\r\n\t\t\tMath.round(g) + ',' +\r\n\t\t\tMath.round(b) + ',' +\r\n\t\t\t(Math.round((a===undefined || a===null ? 1 : a) * 100) / 100) +\r\n\t\t')';\r\n\t},\r\n\r\n\r\n\tlinearGradient : (function () {\r\n\r\n\t\tfunction getFuncName () {\r\n\t\t\tvar stdName = 'linear-gradient';\r\n\t\t\tvar prefixes = ['', '-webkit-', '-moz-', '-o-', '-ms-'];\r\n\t\t\tvar helper = window.document.createElement('div');\r\n\r\n\t\t\tfor (var i = 0; i < prefixes.length; i += 1) {\r\n\t\t\t\tvar tryFunc = prefixes[i] + stdName;\r\n\t\t\t\tvar tryVal = tryFunc + '(to right, rgba(0,0,0,0), rgba(0,0,0,0))';\r\n\r\n\t\t\t\thelper.style.background = tryVal;\r\n\t\t\t\tif (helper.style.background) { // CSS background successfully set -> function name is supported\r\n\t\t\t\t\treturn tryFunc;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn stdName; // fallback to standard 'linear-gradient' without vendor prefix\r\n\t\t}\r\n\r\n\t\tvar funcName = getFuncName();\r\n\r\n\t\treturn function () {\r\n\t\t\treturn funcName + '(' + Array.prototype.join.call(arguments, ', ') + ')';\r\n\t\t};\r\n\r\n\t})(),\r\n\r\n\r\n\tsetBorderRadius : function (elm, value) {\r\n\t\tjsc.setStyle(elm, {'border-radius' : value || '0'});\r\n\t},\r\n\r\n\r\n\tsetBoxShadow : function (elm, value) {\r\n\t\tjsc.setStyle(elm, {'box-shadow': value || 'none'});\r\n\t},\r\n\r\n\r\n\tgetElementPos : function (e, relativeToViewport) {\r\n\t\tvar x=0, y=0;\r\n\t\tvar rect = e.getBoundingClientRect();\r\n\t\tx = rect.left;\r\n\t\ty = rect.top;\r\n\t\tif (!relativeToViewport) {\r\n\t\t\tvar viewPos = jsc.getViewPos();\r\n\t\t\tx += viewPos[0];\r\n\t\t\ty += viewPos[1];\r\n\t\t}\r\n\t\treturn [x, y];\r\n\t},\r\n\r\n\r\n\tgetElementSize : function (e) {\r\n\t\treturn [e.offsetWidth, e.offsetHeight];\r\n\t},\r\n\r\n\r\n\t// get pointer's X/Y coordinates relative to viewport\r\n\tgetAbsPointerPos : function (e) {\r\n\t\tvar x = 0, y = 0;\r\n\t\tif (typeof e.changedTouches !== 'undefined' && e.changedTouches.length) {\r\n\t\t\t// touch devices\r\n\t\t\tx = e.changedTouches[0].clientX;\r\n\t\t\ty = e.changedTouches[0].clientY;\r\n\t\t} else if (typeof e.clientX === 'number') {\r\n\t\t\tx = e.clientX;\r\n\t\t\ty = e.clientY;\r\n\t\t}\r\n\t\treturn { x: x, y: y };\r\n\t},\r\n\r\n\r\n\t// get pointer's X/Y coordinates relative to target element\r\n\tgetRelPointerPos : function (e) {\r\n\t\tvar target = e.target || e.srcElement;\r\n\t\tvar targetRect = target.getBoundingClientRect();\r\n\r\n\t\tvar x = 0, y = 0;\r\n\r\n\t\tvar clientX = 0, clientY = 0;\r\n\t\tif (typeof e.changedTouches !== 'undefined' && e.changedTouches.length) {\r\n\t\t\t// touch devices\r\n\t\t\tclientX = e.changedTouches[0].clientX;\r\n\t\t\tclientY = e.changedTouches[0].clientY;\r\n\t\t} else if (typeof e.clientX === 'number') {\r\n\t\t\tclientX = e.clientX;\r\n\t\t\tclientY = e.clientY;\r\n\t\t}\r\n\r\n\t\tx = clientX - targetRect.left;\r\n\t\ty = clientY - targetRect.top;\r\n\t\treturn { x: x, y: y };\r\n\t},\r\n\r\n\r\n\tgetViewPos : function () {\r\n\t\tvar doc = window.document.documentElement;\r\n\t\treturn [\r\n\t\t\t(window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0),\r\n\t\t\t(window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0)\r\n\t\t];\r\n\t},\r\n\r\n\r\n\tgetViewSize : function () {\r\n\t\tvar doc = window.document.documentElement;\r\n\t\treturn [\r\n\t\t\t(window.innerWidth || doc.clientWidth),\r\n\t\t\t(window.innerHeight || doc.clientHeight),\r\n\t\t];\r\n\t},\r\n\r\n\r\n\t// r: 0-255\r\n\t// g: 0-255\r\n\t// b: 0-255\r\n\t//\r\n\t// returns: [ 0-360, 0-100, 0-100 ]\r\n\t//\r\n\tRGB_HSV : function (r, g, b) {\r\n\t\tr /= 255;\r\n\t\tg /= 255;\r\n\t\tb /= 255;\r\n\t\tvar n = Math.min(Math.min(r,g),b);\r\n\t\tvar v = Math.max(Math.max(r,g),b);\r\n\t\tvar m = v - n;\r\n\t\tif (m === 0) { return [ null, 0, 100 * v ]; }\r\n\t\tvar h = r===n ? 3+(b-g)/m : (g===n ? 5+(r-b)/m : 1+(g-r)/m);\r\n\t\treturn [\r\n\t\t\t60 * (h===6?0:h),\r\n\t\t\t100 * (m/v),\r\n\t\t\t100 * v\r\n\t\t];\r\n\t},\r\n\r\n\r\n\t// h: 0-360\r\n\t// s: 0-100\r\n\t// v: 0-100\r\n\t//\r\n\t// returns: [ 0-255, 0-255, 0-255 ]\r\n\t//\r\n\tHSV_RGB : function (h, s, v) {\r\n\t\tvar u = 255 * (v / 100);\r\n\r\n\t\tif (h === null) {\r\n\t\t\treturn [ u, u, u ];\r\n\t\t}\r\n\r\n\t\th /= 60;\r\n\t\ts /= 100;\r\n\r\n\t\tvar i = Math.floor(h);\r\n\t\tvar f = i%2 ? h-i : 1-(h-i);\r\n\t\tvar m = u * (1 - s);\r\n\t\tvar n = u * (1 - s * f);\r\n\t\tswitch (i) {\r\n\t\t\tcase 6:\r\n\t\t\tcase 0: return [u,n,m];\r\n\t\t\tcase 1: return [n,u,m];\r\n\t\t\tcase 2: return [m,u,n];\r\n\t\t\tcase 3: return [m,n,u];\r\n\t\t\tcase 4: return [n,m,u];\r\n\t\t\tcase 5: return [u,m,n];\r\n\t\t}\r\n\t},\r\n\r\n\r\n\tparseColorString : function (str) {\r\n\t\tvar ret = {\r\n\t\t\trgba: null,\r\n\t\t\tformat: null // 'hex' | 'hexa' | 'rgb' | 'rgba'\r\n\t\t};\r\n\r\n\t\tvar m;\r\n\r\n\t\tif (m = str.match(/^\\W*([0-9A-F]{3,8})\\W*$/i)) {\r\n\t\t\t// HEX notation\r\n\r\n\t\t\tif (m[1].length === 8) {\r\n\t\t\t\t// 8-char notation (= with alpha)\r\n\t\t\t\tret.format = 'hexa';\r\n\t\t\t\tret.rgba = [\r\n\t\t\t\t\tparseInt(m[1].substr(0,2),16),\r\n\t\t\t\t\tparseInt(m[1].substr(2,2),16),\r\n\t\t\t\t\tparseInt(m[1].substr(4,2),16),\r\n\t\t\t\t\tparseInt(m[1].substr(6,2),16) / 255\r\n\t\t\t\t];\r\n\r\n\t\t\t} else if (m[1].length === 6) {\r\n\t\t\t\t// 6-char notation\r\n\t\t\t\tret.format = 'hex';\r\n\t\t\t\tret.rgba = [\r\n\t\t\t\t\tparseInt(m[1].substr(0,2),16),\r\n\t\t\t\t\tparseInt(m[1].substr(2,2),16),\r\n\t\t\t\t\tparseInt(m[1].substr(4,2),16),\r\n\t\t\t\t\tnull\r\n\t\t\t\t];\r\n\r\n\t\t\t} else if (m[1].length === 3) {\r\n\t\t\t\t// 3-char notation\r\n\t\t\t\tret.format = 'hex';\r\n\t\t\t\tret.rgba = [\r\n\t\t\t\t\tparseInt(m[1].charAt(0) + m[1].charAt(0),16),\r\n\t\t\t\t\tparseInt(m[1].charAt(1) + m[1].charAt(1),16),\r\n\t\t\t\t\tparseInt(m[1].charAt(2) + m[1].charAt(2),16),\r\n\t\t\t\t\tnull\r\n\t\t\t\t];\r\n\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\treturn ret;\r\n\t\t}\r\n\r\n\t\tif (m = str.match(/^\\W*rgba?\\(([^)]*)\\)\\W*$/i)) {\r\n\t\t\t// rgb(...) or rgba(...) notation\r\n\r\n\t\t\tvar par = m[1].split(',');\r\n\t\t\tvar re = /^\\s*(\\d+|\\d*\\.\\d+|\\d+\\.\\d*)\\s*$/;\r\n\t\t\tvar mR, mG, mB, mA;\r\n\t\t\tif (\r\n\t\t\t\tpar.length >= 3 &&\r\n\t\t\t\t(mR = par[0].match(re)) &&\r\n\t\t\t\t(mG = par[1].match(re)) &&\r\n\t\t\t\t(mB = par[2].match(re))\r\n\t\t\t) {\r\n\t\t\t\tret.format = 'rgb';\r\n\t\t\t\tret.rgba = [\r\n\t\t\t\t\tparseFloat(mR[1]) || 0,\r\n\t\t\t\t\tparseFloat(mG[1]) || 0,\r\n\t\t\t\t\tparseFloat(mB[1]) || 0,\r\n\t\t\t\t\tnull\r\n\t\t\t\t];\r\n\r\n\t\t\t\tif (\r\n\t\t\t\t\tpar.length >= 4 &&\r\n\t\t\t\t\t(mA = par[3].match(re))\r\n\t\t\t\t) {\r\n\t\t\t\t\tret.format = 'rgba';\r\n\t\t\t\t\tret.rgba[3] = parseFloat(mA[1]) || 0;\r\n\t\t\t\t}\r\n\t\t\t\treturn ret;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n\r\n\r\n\tparsePaletteValue : function (mixed) {\r\n\t\tvar vals = [];\r\n\r\n\t\tif (typeof mixed === 'string') { // input is a string of space separated color values\r\n\t\t\t// rgb() and rgba() may contain spaces too, so let's find all color values by regex\r\n\t\t\tmixed.replace(/#[0-9A-F]{3}([0-9A-F]{3})?|rgba?\\(([^)]*)\\)/ig, function (val) {\r\n\t\t\t\tvals.push(val);\r\n\t\t\t});\r\n\t\t} else if (Array.isArray(mixed)) { // input is an array of color values\r\n\t\t\tvals = mixed;\r\n\t\t}\r\n\r\n\t\t// convert all values into uniform color format\r\n\r\n\t\tvar colors = [];\r\n\r\n\t\tfor (var i = 0; i < vals.length; i++) {\r\n\t\t\tvar color = jsc.parseColorString(vals[i]);\r\n\t\t\tif (color) {\r\n\t\t\t\tcolors.push(color);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn colors;\r\n\t},\r\n\r\n\r\n\tcontainsTranparentColor : function (colors) {\r\n\t\tfor (var i = 0; i < colors.length; i++) {\r\n\t\t\tvar a = colors[i].rgba[3];\r\n\t\t\tif (a !== null && a < 1.0) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\r\n\r\n\tisAlphaFormat : function (format) {\r\n\t\tswitch (format.toLowerCase()) {\r\n\t\tcase 'hexa':\r\n\t\tcase 'rgba':\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\r\n\r\n\t// Canvas scaling for retina displays\r\n\t//\r\n\t// adapted from https://www.html5rocks.com/en/tutorials/canvas/hidpi/\r\n\t//\r\n\tscaleCanvasForHighDPR : function (canvas) {\r\n\t\tvar dpr = window.devicePixelRatio || 1;\r\n\t\tcanvas.width *= dpr;\r\n\t\tcanvas.height *= dpr;\r\n\t\tvar ctx = canvas.getContext('2d');\r\n\t\tctx.scale(dpr, dpr);\r\n\t},\r\n\r\n\r\n\tgenColorPreviewCanvas : function (color, separatorPos, specWidth, scaleForHighDPR) {\r\n\r\n\t\tvar sepW = Math.round(jsc.pub.previewSeparator.length);\r\n\t\tvar sqSize = jsc.pub.chessboardSize;\r\n\t\tvar sqColor1 = jsc.pub.chessboardColor1;\r\n\t\tvar sqColor2 = jsc.pub.chessboardColor2;\r\n\r\n\t\tvar cWidth = specWidth ? specWidth : sqSize * 2;\r\n\t\tvar cHeight = sqSize * 2;\r\n\r\n\t\tvar canvas = jsc.createEl('canvas');\r\n\t\tvar ctx = canvas.getContext('2d');\r\n\r\n\t\tcanvas.width = cWidth;\r\n\t\tcanvas.height = cHeight;\r\n\t\tif (scaleForHighDPR) {\r\n\t\t\tjsc.scaleCanvasForHighDPR(canvas);\r\n\t\t}\r\n\r\n\t\t// transparency chessboard - background\r\n\t\tctx.fillStyle = sqColor1;\r\n\t\tctx.fillRect(0, 0, cWidth, cHeight);\r\n\r\n\t\t// transparency chessboard - squares\r\n\t\tctx.fillStyle = sqColor2;\r\n\t\tfor (var x = 0; x < cWidth; x += sqSize * 2) {\r\n\t\t\tctx.fillRect(x, 0, sqSize, sqSize);\r\n\t\t\tctx.fillRect(x + sqSize, sqSize, sqSize, sqSize);\r\n\t\t}\r\n\r\n\t\tif (color) {\r\n\t\t\t// actual color in foreground\r\n\t\t\tctx.fillStyle = color;\r\n\t\t\tctx.fillRect(0, 0, cWidth, cHeight);\r\n\t\t}\r\n\r\n\t\tvar start = null;\r\n\t\tswitch (separatorPos) {\r\n\t\t\tcase 'left':\r\n\t\t\t\tstart = 0;\r\n\t\t\t\tctx.clearRect(0, 0, sepW/2, cHeight);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'right':\r\n\t\t\t\tstart = cWidth - sepW;\r\n\t\t\t\tctx.clearRect(cWidth - (sepW/2), 0, sepW/2, cHeight);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\tif (start !== null) {\r\n\t\t\tctx.lineWidth = 1;\r\n\t\t\tfor (var i = 0; i < jsc.pub.previewSeparator.length; i += 1) {\r\n\t\t\t\tctx.beginPath();\r\n\t\t\t\tctx.strokeStyle = jsc.pub.previewSeparator[i];\r\n\t\t\t\tctx.moveTo(0.5 + start + i, 0);\r\n\t\t\t\tctx.lineTo(0.5 + start + i, cHeight);\r\n\t\t\t\tctx.stroke();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tcanvas: canvas,\r\n\t\t\twidth: cWidth,\r\n\t\t\theight: cHeight,\r\n\t\t};\r\n\t},\r\n\r\n\r\n\t// if position or width is not set => fill the entire element (0%-100%)\r\n\tgenColorPreviewGradient : function (color, position, width) {\r\n\t\tvar params = [];\r\n\r\n\t\tif (position && width) {\r\n\t\t\tparams = [\r\n\t\t\t\t'to ' + {'left':'right', 'right':'left'}[position],\r\n\t\t\t\tcolor + ' 0%',\r\n\t\t\t\tcolor + ' ' + width + 'px',\r\n\t\t\t\t'rgba(0,0,0,0) ' + (width + 1) + 'px',\r\n\t\t\t\t'rgba(0,0,0,0) 100%',\r\n\t\t\t];\r\n\t\t} else {\r\n\t\t\tparams = [\r\n\t\t\t\t'to right',\r\n\t\t\t\tcolor + ' 0%',\r\n\t\t\t\tcolor + ' 100%',\r\n\t\t\t];\r\n\t\t}\r\n\r\n\t\treturn jsc.linearGradient.apply(this, params);\r\n\t},\r\n\r\n\r\n\tredrawPosition : function () {\r\n\r\n\t\tif (!jsc.picker || !jsc.picker.owner) {\r\n\t\t\treturn; // picker is not shown\r\n\t\t}\r\n\r\n\t\tvar thisObj = jsc.picker.owner;\r\n\r\n\t\tvar tp, vp;\r\n\r\n\t\tif (thisObj.fixed) {\r\n\t\t\t// Fixed elements are positioned relative to viewport,\r\n\t\t\t// therefore we can ignore the scroll offset\r\n\t\t\ttp = jsc.getElementPos(thisObj.targetElement, true); // target pos\r\n\t\t\tvp = [0, 0]; // view pos\r\n\t\t} else {\r\n\t\t\ttp = jsc.getElementPos(thisObj.targetElement); // target pos\r\n\t\t\tvp = jsc.getViewPos(); // view pos\r\n\t\t}\r\n\r\n\t\tvar ts = jsc.getElementSize(thisObj.targetElement); // target size\r\n\t\tvar vs = jsc.getViewSize(); // view size\r\n\t\tvar pd = jsc.getPickerDims(thisObj);\r\n\t\tvar ps = [pd.borderW, pd.borderH]; // picker outer size\r\n\t\tvar a, b, c;\r\n\t\tswitch (thisObj.position.toLowerCase()) {\r\n\t\t\tcase 'left': a=1; b=0; c=-1; break;\r\n\t\t\tcase 'right':a=1; b=0; c=1; break;\r\n\t\t\tcase 'top': a=0; b=1; c=-1; break;\r\n\t\t\tdefault: a=0; b=1; c=1; break;\r\n\t\t}\r\n\t\tvar l = (ts[b]+ps[b])/2;\r\n\r\n\t\t// compute picker position\r\n\t\tif (!thisObj.smartPosition) {\r\n\t\t\tvar pp = [\r\n\t\t\t\ttp[a],\r\n\t\t\t\ttp[b]+ts[b]-l+l*c\r\n\t\t\t];\r\n\t\t} else {\r\n\t\t\tvar pp = [\r\n\t\t\t\t-vp[a]+tp[a]+ps[a] > vs[a] ?\r\n\t\t\t\t\t(-vp[a]+tp[a]+ts[a]/2 > vs[a]/2 && tp[a]+ts[a]-ps[a] >= 0 ? tp[a]+ts[a]-ps[a] : tp[a]) :\r\n\t\t\t\t\ttp[a],\r\n\t\t\t\t-vp[b]+tp[b]+ts[b]+ps[b]-l+l*c > vs[b] ?\r\n\t\t\t\t\t(-vp[b]+tp[b]+ts[b]/2 > vs[b]/2 && tp[b]+ts[b]-l-l*c >= 0 ? tp[b]+ts[b]-l-l*c : tp[b]+ts[b]-l+l*c) :\r\n\t\t\t\t\t(tp[b]+ts[b]-l+l*c >= 0 ? tp[b]+ts[b]-l+l*c : tp[b]+ts[b]-l-l*c)\r\n\t\t\t];\r\n\t\t}\r\n\r\n\t\tvar x = pp[a];\r\n\t\tvar y = pp[b];\r\n\t\tvar positionValue = thisObj.fixed ? 'fixed' : 'absolute';\r\n\t\tvar contractShadow =\r\n\t\t\t(pp[0] + ps[0] > tp[0] || pp[0] < tp[0] + ts[0]) &&\r\n\t\t\t(pp[1] + ps[1] < tp[1] + ts[1]);\r\n\r\n\t\tjsc._drawPosition(thisObj, x, y, positionValue, contractShadow);\r\n\t},\r\n\r\n\r\n\t_drawPosition : function (thisObj, x, y, positionValue, contractShadow) {\r\n\t\tvar vShadow = contractShadow ? 0 : thisObj.shadowBlur; // px\r\n\r\n\t\tjsc.picker.wrap.style.position = positionValue;\r\n\t\tjsc.picker.wrap.style.left = x + 'px';\r\n\t\tjsc.picker.wrap.style.top = y + 'px';\r\n\r\n\t\tjsc.setBoxShadow(\r\n\t\t\tjsc.picker.boxS,\r\n\t\t\tthisObj.shadow ?\r\n\t\t\t\tnew jsc.BoxShadow(0, vShadow, thisObj.shadowBlur, 0, thisObj.shadowColor) :\r\n\t\t\t\tnull);\r\n\t},\r\n\r\n\r\n\tgetPickerDims : function (thisObj) {\r\n\t\tvar w = 2 * thisObj.controlBorderWidth + thisObj.width;\r\n\t\tvar h = 2 * thisObj.controlBorderWidth + thisObj.height;\r\n\r\n\t\tvar sliderSpace = 2 * thisObj.controlBorderWidth + 2 * jsc.getControlPadding(thisObj) + thisObj.sliderSize;\r\n\r\n\t\tif (jsc.getSliderChannel(thisObj)) {\r\n\t\t\tw += sliderSpace;\r\n\t\t}\r\n\t\tif (thisObj.hasAlphaChannel()) {\r\n\t\t\tw += sliderSpace;\r\n\t\t}\r\n\r\n\t\tvar pal = jsc.getPaletteDims(thisObj, w);\r\n\r\n\t\tif (pal.height) {\r\n\t\t\th += pal.height + thisObj.padding;\r\n\t\t}\r\n\t\tif (thisObj.closeButton) {\r\n\t\t\th += 2 * thisObj.controlBorderWidth + thisObj.padding + thisObj.buttonHeight;\r\n\t\t}\r\n\r\n\t\tvar pW = w + (2 * thisObj.padding);\r\n\t\tvar pH = h + (2 * thisObj.padding);\r\n\r\n\t\treturn {\r\n\t\t\tcontentW: w,\r\n\t\t\tcontentH: h,\r\n\t\t\tpaddedW: pW,\r\n\t\t\tpaddedH: pH,\r\n\t\t\tborderW: pW + (2 * thisObj.borderWidth),\r\n\t\t\tborderH: pH + (2 * thisObj.borderWidth),\r\n\t\t\tpalette: pal,\r\n\t\t};\r\n\t},\r\n\r\n\r\n\tgetPaletteDims : function (thisObj, width) {\r\n\t\tvar cols = 0, rows = 0, cellW = 0, cellH = 0, height = 0;\r\n\t\tvar sampleCount = thisObj._palette ? thisObj._palette.length : 0;\r\n\r\n\t\tif (sampleCount) {\r\n\t\t\tcols = thisObj.paletteCols;\r\n\t\t\trows = cols > 0 ? Math.ceil(sampleCount / cols) : 0;\r\n\r\n\t\t\t// color sample's dimensions (includes border)\r\n\t\t\tcellW = Math.max(1, Math.floor((width - ((cols - 1) * thisObj.paletteSpacing)) / cols));\r\n\t\t\tcellH = thisObj.paletteHeight ? Math.min(thisObj.paletteHeight, cellW) : cellW;\r\n\t\t}\r\n\r\n\t\tif (rows) {\r\n\t\t\theight =\r\n\t\t\t\trows * cellH +\r\n\t\t\t\t(rows - 1) * thisObj.paletteSpacing;\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tcols: cols,\r\n\t\t\trows: rows,\r\n\t\t\tcellW: cellW,\r\n\t\t\tcellH: cellH,\r\n\t\t\twidth: width,\r\n\t\t\theight: height,\r\n\t\t};\r\n\t},\r\n\r\n\r\n\tgetControlPadding : function (thisObj) {\r\n\t\treturn Math.max(\r\n\t\t\tthisObj.padding / 2,\r\n\t\t\t(2 * thisObj.pointerBorderWidth + thisObj.pointerThickness) - thisObj.controlBorderWidth\r\n\t\t);\r\n\t},\r\n\r\n\r\n\tgetPadYChannel : function (thisObj) {\r\n\t\tswitch (thisObj.mode.charAt(1).toLowerCase()) {\r\n\t\t\tcase 'v': return 'v'; break;\r\n\t\t}\r\n\t\treturn 's';\r\n\t},\r\n\r\n\r\n\tgetSliderChannel : function (thisObj) {\r\n\t\tif (thisObj.mode.length > 2) {\r\n\t\t\tswitch (thisObj.mode.charAt(2).toLowerCase()) {\r\n\t\t\t\tcase 's': return 's'; break;\r\n\t\t\t\tcase 'v': return 'v'; break;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t},\r\n\r\n\r\n\t// calls function specified in picker's property\r\n\ttriggerCallback : function (thisObj, prop) {\r\n\t\tif (!thisObj[prop]) {\r\n\t\t\treturn; // callback func not specified\r\n\t\t}\r\n\t\tvar callback = null;\r\n\r\n\t\tif (typeof thisObj[prop] === 'string') {\r\n\t\t\t// string with code\r\n\t\t\ttry {\r\n\t\t\t\tcallback = new Function (thisObj[prop]);\r\n\t\t\t} catch (e) {\r\n\t\t\t\tconsole.error(e);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// function\r\n\t\t\tcallback = thisObj[prop];\r\n\t\t}\r\n\r\n\t\tif (callback) {\r\n\t\t\tcallback.call(thisObj);\r\n\t\t}\r\n\t},\r\n\r\n\r\n\t// Triggers a color change related event(s) on all picker instances.\r\n\t// It is possible to specify multiple events separated with a space.\r\n\ttriggerGlobal : function (eventNames) {\r\n\t\tvar inst = jsc.getInstances();\r\n\t\tfor (var i = 0; i < inst.length; i += 1) {\r\n\t\t\tinst[i].trigger(eventNames);\r\n\t\t}\r\n\t},\r\n\r\n\r\n\t_pointerMoveEvent : {\r\n\t\tmouse: 'mousemove',\r\n\t\ttouch: 'touchmove'\r\n\t},\r\n\t_pointerEndEvent : {\r\n\t\tmouse: 'mouseup',\r\n\t\ttouch: 'touchend'\r\n\t},\r\n\r\n\r\n\t_pointerOrigin : null,\r\n\t_capturedTarget : null,\r\n\r\n\r\n\tonDocumentKeyUp : function (e) {\r\n\t\tif (['Tab', 'Escape'].indexOf(jsc.eventKey(e)) !== -1) {\r\n\t\t\tif (jsc.picker && jsc.picker.owner) {\r\n\t\t\t\tjsc.picker.owner.tryHide();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\r\n\tonWindowResize : function (e) {\r\n\t\tjsc.redrawPosition();\r\n\t},\r\n\r\n\r\n\tonWindowScroll : function (e) {\r\n\t\tjsc.redrawPosition();\r\n\t},\r\n\r\n\r\n\tonParentScroll : function (e) {\r\n\t\t// hide the picker when one of the parent elements is scrolled\r\n\t\tif (jsc.picker && jsc.picker.owner) {\r\n\t\t\tjsc.picker.owner.tryHide();\r\n\t\t}\r\n\t},\r\n\r\n\r\n\tonDocumentMouseDown : function (e) {\r\n\t\tvar target = e.target || e.srcElement;\r\n\r\n\t\tif (target.jscolor && target.jscolor instanceof jsc.pub) { // clicked targetElement -> show picker\r\n\t\t\tif (target.jscolor.showOnClick && !target.disabled) {\r\n\t\t\t\ttarget.jscolor.show();\r\n\t\t\t}\r\n\t\t} else if (jsc.getData(target, 'gui')) { // clicked jscolor's GUI element\r\n\t\t\tvar control = jsc.getData(target, 'control');\r\n\t\t\tif (control) {\r\n\t\t\t\t// jscolor's control\r\n\t\t\t\tjsc.onControlPointerStart(e, target, jsc.getData(target, 'control'), 'mouse');\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// mouse is outside the picker's controls -> hide the color picker!\r\n\t\t\tif (jsc.picker && jsc.picker.owner) {\r\n\t\t\t\tjsc.picker.owner.tryHide();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\r\n\tonPickerTouchStart : function (e) {\r\n\t\tvar target = e.target || e.srcElement;\r\n\r\n\t\tif (jsc.getData(target, 'control')) {\r\n\t\t\tjsc.onControlPointerStart(e, target, jsc.getData(target, 'control'), 'touch');\r\n\t\t}\r\n\t},\r\n\r\n\r\n\tonControlPointerStart : function (e, target, controlName, pointerType) {\r\n\t\tvar thisObj = jsc.getData(target, 'instance');\r\n\r\n\t\tjsc.preventDefault(e);\r\n\t\tjsc.captureTarget(target);\r\n\r\n\t\tvar registerDragEvents = function (doc, offset) {\r\n\t\t\tjsc.attachGroupEvent('drag', doc, jsc._pointerMoveEvent[pointerType],\r\n\t\t\t\tjsc.onDocumentPointerMove(e, target, controlName, pointerType, offset));\r\n\t\t\tjsc.attachGroupEvent('drag', doc, jsc._pointerEndEvent[pointerType],\r\n\t\t\t\tjsc.onDocumentPointerEnd(e, target, controlName, pointerType));\r\n\t\t};\r\n\r\n\t\tregisterDragEvents(window.document, [0, 0]);\r\n\r\n\t\tif (window.parent && window.frameElement) {\r\n\t\t\tvar rect = window.frameElement.getBoundingClientRect();\r\n\t\t\tvar ofs = [-rect.left, -rect.top];\r\n\t\t\tregisterDragEvents(window.parent.window.document, ofs);\r\n\t\t}\r\n\r\n\t\tvar abs = jsc.getAbsPointerPos(e);\r\n\t\tvar rel = jsc.getRelPointerPos(e);\r\n\t\tjsc._pointerOrigin = {\r\n\t\t\tx: abs.x - rel.x,\r\n\t\t\ty: abs.y - rel.y\r\n\t\t};\r\n\r\n\t\tswitch (controlName) {\r\n\t\tcase 'pad':\r\n\t\t\t// if the value slider is at the bottom, move it up\r\n\t\t\tif (jsc.getSliderChannel(thisObj) === 'v' && thisObj.channels.v === 0) {\r\n\t\t\t\tthisObj.fromHSVA(null, null, 100, null);\r\n\t\t\t}\r\n\t\t\tjsc.setPad(thisObj, e, 0, 0);\r\n\t\t\tbreak;\r\n\r\n\t\tcase 'sld':\r\n\t\t\tjsc.setSld(thisObj, e, 0);\r\n\t\t\tbreak;\r\n\r\n\t\tcase 'asld':\r\n\t\t\tjsc.setASld(thisObj, e, 0);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tthisObj.trigger('input');\r\n\t},\r\n\r\n\r\n\tonDocumentPointerMove : function (e, target, controlName, pointerType, offset) {\r\n\t\treturn function (e) {\r\n\t\t\tvar thisObj = jsc.getData(target, 'instance');\r\n\t\t\tswitch (controlName) {\r\n\t\t\tcase 'pad':\r\n\t\t\t\tjsc.setPad(thisObj, e, offset[0], offset[1]);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'sld':\r\n\t\t\t\tjsc.setSld(thisObj, e, offset[1]);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'asld':\r\n\t\t\t\tjsc.setASld(thisObj, e, offset[1]);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tthisObj.trigger('input');\r\n\t\t}\r\n\t},\r\n\r\n\r\n\tonDocumentPointerEnd : function (e, target, controlName, pointerType) {\r\n\t\treturn function (e) {\r\n\t\t\tvar thisObj = jsc.getData(target, 'instance');\r\n\t\t\tjsc.detachGroupEvents('drag');\r\n\t\t\tjsc.releaseTarget();\r\n\r\n\t\t\t// Always trigger changes AFTER detaching outstanding mouse handlers,\r\n\t\t\t// in case some color change that occured in user-defined onChange/onInput handler\r\n\t\t\t// intruded into current mouse events\r\n\t\t\tthisObj.trigger('input');\r\n\t\t\tthisObj.trigger('change');\r\n\t\t};\r\n\t},\r\n\r\n\r\n\tonPaletteSampleClick : function (e) {\r\n\t\tvar target = e.currentTarget;\r\n\t\tvar thisObj = jsc.getData(target, 'instance');\r\n\t\tvar color = jsc.getData(target, 'color');\r\n\r\n\t\t// when format is flexible, use the original format of this color sample\r\n\t\tif (thisObj.format.toLowerCase() === 'any') {\r\n\t\t\tthisObj._setFormat(color.format); // adapt format\r\n\t\t\tif (!jsc.isAlphaFormat(thisObj.getFormat())) {\r\n\t\t\t\tcolor.rgba[3] = 1.0; // when switching to a format that doesn't support alpha, set full opacity\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// if this color doesn't specify alpha, use alpha of 1.0 (if applicable)\r\n\t\tif (color.rgba[3] === null) {\r\n\t\t\tif (thisObj.paletteSetsAlpha === true || (thisObj.paletteSetsAlpha === 'auto' && thisObj._paletteHasTransparency)) {\r\n\t\t\t\tcolor.rgba[3] = 1.0;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthisObj.fromRGBA.apply(thisObj, color.rgba);\r\n\r\n\t\tthisObj.trigger('input');\r\n\t\tthisObj.trigger('change');\r\n\r\n\t\tif (thisObj.hideOnPaletteClick) {\r\n\t\t\tthisObj.hide();\r\n\t\t}\r\n\t},\r\n\r\n\r\n\tsetPad : function (thisObj, e, ofsX, ofsY) {\r\n\t\tvar pointerAbs = jsc.getAbsPointerPos(e);\r\n\t\tvar x = ofsX + pointerAbs.x - jsc._pointerOrigin.x - thisObj.padding - thisObj.controlBorderWidth;\r\n\t\tvar y = ofsY + pointerAbs.y - jsc._pointerOrigin.y - thisObj.padding - thisObj.controlBorderWidth;\r\n\r\n\t\tvar xVal = x * (360 / (thisObj.width - 1));\r\n\t\tvar yVal = 100 - (y * (100 / (thisObj.height - 1)));\r\n\r\n\t\tswitch (jsc.getPadYChannel(thisObj)) {\r\n\t\tcase 's': thisObj.fromHSVA(xVal, yVal, null, null); break;\r\n\t\tcase 'v': thisObj.fromHSVA(xVal, null, yVal, null); break;\r\n\t\t}\r\n\t},\r\n\r\n\r\n\tsetSld : function (thisObj, e, ofsY) {\r\n\t\tvar pointerAbs = jsc.getAbsPointerPos(e);\r\n\t\tvar y = ofsY + pointerAbs.y - jsc._pointerOrigin.y - thisObj.padding - thisObj.controlBorderWidth;\r\n\t\tvar yVal = 100 - (y * (100 / (thisObj.height - 1)));\r\n\r\n\t\tswitch (jsc.getSliderChannel(thisObj)) {\r\n\t\tcase 's': thisObj.fromHSVA(null, yVal, null, null); break;\r\n\t\tcase 'v': thisObj.fromHSVA(null, null, yVal, null); break;\r\n\t\t}\r\n\t},\r\n\r\n\r\n\tsetASld : function (thisObj, e, ofsY) {\r\n\t\tvar pointerAbs = jsc.getAbsPointerPos(e);\r\n\t\tvar y = ofsY + pointerAbs.y - jsc._pointerOrigin.y - thisObj.padding - thisObj.controlBorderWidth;\r\n\t\tvar yVal = 1.0 - (y * (1.0 / (thisObj.height - 1)));\r\n\r\n\t\tif (yVal < 1.0) {\r\n\t\t\t// if format is flexible and the current format doesn't support alpha, switch to a suitable one\r\n\t\t\tvar fmt = thisObj.getFormat();\r\n\t\t\tif (thisObj.format.toLowerCase() === 'any' && !jsc.isAlphaFormat(fmt)) {\r\n\t\t\t\tthisObj._setFormat(fmt === 'hex' ? 'hexa' : 'rgba');\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthisObj.fromHSVA(null, null, null, yVal);\r\n\t},\r\n\r\n\r\n\tcreatePadCanvas : function () {\r\n\r\n\t\tvar ret = {\r\n\t\t\telm: null,\r\n\t\t\tdraw: null\r\n\t\t};\r\n\r\n\t\tvar canvas = jsc.createEl('canvas');\r\n\t\tvar ctx = canvas.getContext('2d');\r\n\r\n\t\tvar drawFunc = function (width, height, type) {\r\n\t\t\tcanvas.width = width;\r\n\t\t\tcanvas.height = height;\r\n\r\n\t\t\tctx.clearRect(0, 0, canvas.width, canvas.height);\r\n\r\n\t\t\tvar hGrad = ctx.createLinearGradient(0, 0, canvas.width, 0);\r\n\t\t\thGrad.addColorStop(0 / 6, '#F00');\r\n\t\t\thGrad.addColorStop(1 / 6, '#FF0');\r\n\t\t\thGrad.addColorStop(2 / 6, '#0F0');\r\n\t\t\thGrad.addColorStop(3 / 6, '#0FF');\r\n\t\t\thGrad.addColorStop(4 / 6, '#00F');\r\n\t\t\thGrad.addColorStop(5 / 6, '#F0F');\r\n\t\t\thGrad.addColorStop(6 / 6, '#F00');\r\n\r\n\t\t\tctx.fillStyle = hGrad;\r\n\t\t\tctx.fillRect(0, 0, canvas.width, canvas.height);\r\n\r\n\t\t\tvar vGrad = ctx.createLinearGradient(0, 0, 0, canvas.height);\r\n\t\t\tswitch (type.toLowerCase()) {\r\n\t\t\tcase 's':\r\n\t\t\t\tvGrad.addColorStop(0, 'rgba(255,255,255,0)');\r\n\t\t\t\tvGrad.addColorStop(1, 'rgba(255,255,255,1)');\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'v':\r\n\t\t\t\tvGrad.addColorStop(0, 'rgba(0,0,0,0)');\r\n\t\t\t\tvGrad.addColorStop(1, 'rgba(0,0,0,1)');\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tctx.fillStyle = vGrad;\r\n\t\t\tctx.fillRect(0, 0, canvas.width, canvas.height);\r\n\t\t};\r\n\r\n\t\tret.elm = canvas;\r\n\t\tret.draw = drawFunc;\r\n\r\n\t\treturn ret;\r\n\t},\r\n\r\n\r\n\tcreateSliderGradient : function () {\r\n\r\n\t\tvar ret = {\r\n\t\t\telm: null,\r\n\t\t\tdraw: null\r\n\t\t};\r\n\r\n\t\tvar canvas = jsc.createEl('canvas');\r\n\t\tvar ctx = canvas.getContext('2d');\r\n\r\n\t\tvar drawFunc = function (width, height, color1, color2) {\r\n\t\t\tcanvas.width = width;\r\n\t\t\tcanvas.height = height;\r\n\r\n\t\t\tctx.clearRect(0, 0, canvas.width, canvas.height);\r\n\r\n\t\t\tvar grad = ctx.createLinearGradient(0, 0, 0, canvas.height);\r\n\t\t\tgrad.addColorStop(0, color1);\r\n\t\t\tgrad.addColorStop(1, color2);\r\n\r\n\t\t\tctx.fillStyle = grad;\r\n\t\t\tctx.fillRect(0, 0, canvas.width, canvas.height);\r\n\t\t};\r\n\r\n\t\tret.elm = canvas;\r\n\t\tret.draw = drawFunc;\r\n\r\n\t\treturn ret;\r\n\t},\r\n\r\n\r\n\tcreateASliderGradient : function () {\r\n\r\n\t\tvar ret = {\r\n\t\t\telm: null,\r\n\t\t\tdraw: null\r\n\t\t};\r\n\r\n\t\tvar canvas = jsc.createEl('canvas');\r\n\t\tvar ctx = canvas.getContext('2d');\r\n\r\n\t\tvar drawFunc = function (width, height, color) {\r\n\t\t\tcanvas.width = width;\r\n\t\t\tcanvas.height = height;\r\n\r\n\t\t\tctx.clearRect(0, 0, canvas.width, canvas.height);\r\n\r\n\t\t\tvar sqSize = canvas.width / 2;\r\n\t\t\tvar sqColor1 = jsc.pub.chessboardColor1;\r\n\t\t\tvar sqColor2 = jsc.pub.chessboardColor2;\r\n\r\n\t\t\t// dark gray background\r\n\t\t\tctx.fillStyle = sqColor1;\r\n\t\t\tctx.fillRect(0, 0, canvas.width, canvas.height);\r\n\r\n\t\t\tif (sqSize > 0) { // to avoid infinite loop\r\n\t\t\t\tfor (var y = 0; y < canvas.height; y += sqSize * 2) {\r\n\t\t\t\t\t// light gray squares\r\n\t\t\t\t\tctx.fillStyle = sqColor2;\r\n\t\t\t\t\tctx.fillRect(0, y, sqSize, sqSize);\r\n\t\t\t\t\tctx.fillRect(sqSize, y + sqSize, sqSize, sqSize);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar grad = ctx.createLinearGradient(0, 0, 0, canvas.height);\r\n\t\t\tgrad.addColorStop(0, color);\r\n\t\t\tgrad.addColorStop(1, 'rgba(0,0,0,0)');\r\n\r\n\t\t\tctx.fillStyle = grad;\r\n\t\t\tctx.fillRect(0, 0, canvas.width, canvas.height);\r\n\t\t};\r\n\r\n\t\tret.elm = canvas;\r\n\t\tret.draw = drawFunc;\r\n\r\n\t\treturn ret;\r\n\t},\r\n\r\n\r\n\tBoxShadow : (function () {\r\n\t\tvar BoxShadow = function (hShadow, vShadow, blur, spread, color, inset) {\r\n\t\t\tthis.hShadow = hShadow;\r\n\t\t\tthis.vShadow = vShadow;\r\n\t\t\tthis.blur = blur;\r\n\t\t\tthis.spread = spread;\r\n\t\t\tthis.color = color;\r\n\t\t\tthis.inset = !!inset;\r\n\t\t};\r\n\r\n\t\tBoxShadow.prototype.toString = function () {\r\n\t\t\tvar vals = [\r\n\t\t\t\tMath.round(this.hShadow) + 'px',\r\n\t\t\t\tMath.round(this.vShadow) + 'px',\r\n\t\t\t\tMath.round(this.blur) + 'px',\r\n\t\t\t\tMath.round(this.spread) + 'px',\r\n\t\t\t\tthis.color\r\n\t\t\t];\r\n\t\t\tif (this.inset) {\r\n\t\t\t\tvals.push('inset');\r\n\t\t\t}\r\n\t\t\treturn vals.join(' ');\r\n\t\t};\r\n\r\n\t\treturn BoxShadow;\r\n\t})(),\r\n\r\n\r\n\tflags : {\r\n\t\tleaveValue : 1 << 0,\r\n\t\tleaveAlpha : 1 << 1,\r\n\t\tleavePreview : 1 << 2,\r\n\t},\r\n\r\n\r\n\tenumOpts : {\r\n\t\tformat: ['auto', 'any', 'hex', 'hexa', 'rgb', 'rgba'],\r\n\t\tpreviewPosition: ['left', 'right'],\r\n\t\tmode: ['hsv', 'hvs', 'hs', 'hv'],\r\n\t\tposition: ['left', 'right', 'top', 'bottom'],\r\n\t\talphaChannel: ['auto', true, false],\r\n\t\tpaletteSetsAlpha: ['auto', true, false],\r\n\t},\r\n\r\n\r\n\tdeprecatedOpts : {\r\n\t\t// : ( can be null)\r\n\t\t'styleElement': 'previewElement',\r\n\t\t'onFineChange': 'onInput',\r\n\t\t'overwriteImportant': 'forceStyle',\r\n\t\t'closable': 'closeButton',\r\n\t\t'insetWidth': 'controlBorderWidth',\r\n\t\t'insetColor': 'controlBorderColor',\r\n\t\t'refine': null,\r\n\t},\r\n\r\n\r\n\tdocsRef : ' ' + 'See https://jscolor.com/docs/',\r\n\r\n\r\n\t//\r\n\t// Usage:\r\n\t// var myPicker = new JSColor( [, ])\r\n\t//\r\n\t// (constructor is accessible via both 'jscolor' and 'JSColor' name)\r\n\t//\r\n\r\n\tpub : function (targetElement, opts) {\r\n\r\n\t\tvar THIS = this;\r\n\r\n\t\tif (!opts) {\r\n\t\t\topts = {};\r\n\t\t}\r\n\r\n\t\tthis.channels = {\r\n\t\t\tr: 255, // red [0-255]\r\n\t\t\tg: 255, // green [0-255]\r\n\t\t\tb: 255, // blue [0-255]\r\n\t\t\th: 0, // hue [0-360]\r\n\t\t\ts: 0, // saturation [0-100]\r\n\t\t\tv: 100, // value (brightness) [0-100]\r\n\t\t\ta: 1.0, // alpha (opacity) [0.0 - 1.0]\r\n\t\t};\r\n\r\n\t\t// General options\r\n\t\t//\r\n\t\tthis.format = 'auto'; // 'auto' | 'any' | 'hex' | 'hexa' | 'rgb' | 'rgba' - Format of the input/output value\r\n\t\tthis.value = undefined; // INITIAL color value in any supported format. To change it later, use method fromString(), fromHSVA(), fromRGBA() or channel()\r\n\t\tthis.alpha = undefined; // INITIAL alpha value. To change it later, call method channel('A', )\r\n\t\tthis.onChange = undefined; // called when color changes. Value can be either a function or a string with JS code.\r\n\t\tthis.onInput = undefined; // called repeatedly as the color is being changed, e.g. while dragging a slider. Value can be either a function or a string with JS code.\r\n\t\tthis.valueElement = undefined; // element that will be used to display and input the color value\r\n\t\tthis.alphaElement = undefined; // element that will be used to display and input the alpha (opacity) value\r\n\t\tthis.previewElement = undefined; // element that will preview the picked color using CSS background\r\n\t\tthis.previewPosition = 'left'; // 'left' | 'right' - position of the color preview in previewElement\r\n\t\tthis.previewSize = 32; // (px) width of the color preview displayed in previewElement\r\n\t\tthis.previewPadding = 8; // (px) space between color preview and content of the previewElement\r\n\t\tthis.required = true; // whether the associated text input must always contain a color value. If false, the input can be left empty.\r\n\t\tthis.hash = true; // whether to prefix the HEX color code with # symbol (only applicable for HEX format)\r\n\t\tthis.uppercase = true; // whether to show the HEX color code in upper case (only applicable for HEX format)\r\n\t\tthis.forceStyle = true; // whether to overwrite CSS style of the previewElement using !important flag\r\n\r\n\t\t// Color Picker options\r\n\t\t//\r\n\t\tthis.width = 181; // width of the color spectrum (in px)\r\n\t\tthis.height = 101; // height of the color spectrum (in px)\r\n\t\tthis.mode = 'HSV'; // 'HSV' | 'HVS' | 'HS' | 'HV' - layout of the color picker controls\r\n\t\tthis.alphaChannel = 'auto'; // 'auto' | true | false - if alpha channel is enabled, the alpha slider will be visible. If 'auto', it will be determined according to color format\r\n\t\tthis.position = 'bottom'; // 'left' | 'right' | 'top' | 'bottom' - position relative to the target element\r\n\t\tthis.smartPosition = true; // automatically change picker position when there is not enough space for it\r\n\t\tthis.showOnClick = true; // whether to show the picker when user clicks its target element\r\n\t\tthis.hideOnLeave = true; // whether to automatically hide the picker when user leaves its target element (e.g. upon clicking the document)\r\n\t\tthis.palette = []; // colors to be displayed in the palette, specified as an array or a string of space separated color values (in any supported format)\r\n\t\tthis.paletteCols = 10; // number of columns in the palette\r\n\t\tthis.paletteSetsAlpha = 'auto'; // 'auto' | true | false - if true, palette colors that don't specify alpha will set alpha to 1.0\r\n\t\tthis.paletteHeight = 16; // maximum height (px) of a row in the palette\r\n\t\tthis.paletteSpacing = 4; // distance (px) between color samples in the palette\r\n\t\tthis.hideOnPaletteClick = false; // when set to true, clicking the palette will also hide the color picker\r\n\t\tthis.sliderSize = 16; // px\r\n\t\tthis.crossSize = 8; // px\r\n\t\tthis.closeButton = false; // whether to display the Close button\r\n\t\tthis.closeText = 'Close';\r\n\t\tthis.buttonColor = 'rgba(0,0,0,1)'; // CSS color\r\n\t\tthis.buttonHeight = 18; // px\r\n\t\tthis.padding = 12; // px\r\n\t\tthis.backgroundColor = 'rgba(255,255,255,1)'; // CSS color\r\n\t\tthis.borderWidth = 1; // px\r\n\t\tthis.borderColor = 'rgba(187,187,187,1)'; // CSS color\r\n\t\tthis.borderRadius = 8; // px\r\n\t\tthis.controlBorderWidth = 1; // px\r\n\t\tthis.controlBorderColor = 'rgba(187,187,187,1)'; // CSS color\r\n\t\tthis.shadow = true; // whether to display a shadow\r\n\t\tthis.shadowBlur = 15; // px\r\n\t\tthis.shadowColor = 'rgba(0,0,0,0.2)'; // CSS color\r\n\t\tthis.pointerColor = 'rgba(76,76,76,1)'; // CSS color\r\n\t\tthis.pointerBorderWidth = 1; // px\r\n\t\tthis.pointerBorderColor = 'rgba(255,255,255,1)'; // CSS color\r\n\t\tthis.pointerThickness = 2; // px\r\n\t\tthis.zIndex = 5000;\r\n\t\tthis.container = undefined; // where to append the color picker (BODY element by default)\r\n\r\n\t\t// Experimental\r\n\t\t//\r\n\t\tthis.minS = 0; // min allowed saturation (0 - 100)\r\n\t\tthis.maxS = 100; // max allowed saturation (0 - 100)\r\n\t\tthis.minV = 0; // min allowed value (brightness) (0 - 100)\r\n\t\tthis.maxV = 100; // max allowed value (brightness) (0 - 100)\r\n\t\tthis.minA = 0.0; // min allowed alpha (opacity) (0.0 - 1.0)\r\n\t\tthis.maxA = 1.0; // max allowed alpha (opacity) (0.0 - 1.0)\r\n\r\n\r\n\t\t// Getter: option(name)\r\n\t\t// Setter: option(name, value)\r\n\t\t// option({name:value, ...})\r\n\t\t//\r\n\t\tthis.option = function () {\r\n\t\t\tif (!arguments.length) {\r\n\t\t\t\tthrow new Error('No option specified');\r\n\t\t\t}\r\n\r\n\t\t\tif (arguments.length === 1 && typeof arguments[0] === 'string') {\r\n\t\t\t\t// getting a single option\r\n\t\t\t\ttry {\r\n\t\t\t\t\treturn getOption(arguments[0]);\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\tconsole.warn(e);\r\n\t\t\t\t}\r\n\t\t\t\treturn false;\r\n\r\n\t\t\t} else if (arguments.length >= 2 && typeof arguments[0] === 'string') {\r\n\t\t\t\t// setting a single option\r\n\t\t\t\ttry {\r\n\t\t\t\t\tif (!setOption(arguments[0], arguments[1])) {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\tconsole.warn(e);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tthis.redraw(); // immediately redraws the picker, if it's displayed\r\n\t\t\t\tthis.exposeColor(); // in case some preview-related or format-related option was changed\r\n\t\t\t\treturn true;\r\n\r\n\t\t\t} else if (arguments.length === 1 && typeof arguments[0] === 'object') {\r\n\t\t\t\t// setting multiple options\r\n\t\t\t\tvar opts = arguments[0];\r\n\t\t\t\tvar success = true;\r\n\t\t\t\tfor (var opt in opts) {\r\n\t\t\t\t\tif (opts.hasOwnProperty(opt)) {\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tif (!setOption(opt, opts[opt])) {\r\n\t\t\t\t\t\t\t\tsuccess = false;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} catch (e) {\r\n\t\t\t\t\t\t\tconsole.warn(e);\r\n\t\t\t\t\t\t\tsuccess = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tthis.redraw(); // immediately redraws the picker, if it's displayed\r\n\t\t\t\tthis.exposeColor(); // in case some preview-related or format-related option was changed\r\n\t\t\t\treturn success;\r\n\t\t\t}\r\n\r\n\t\t\tthrow new Error('Invalid arguments');\r\n\t\t}\r\n\r\n\r\n\t\t// Getter: channel(name)\r\n\t\t// Setter: channel(name, value)\r\n\t\t//\r\n\t\tthis.channel = function (name, value) {\r\n\t\t\tif (typeof name !== 'string') {\r\n\t\t\t\tthrow new Error('Invalid value for channel name: ' + name);\r\n\t\t\t}\r\n\r\n\t\t\tif (value === undefined) {\r\n\t\t\t\t// getting channel value\r\n\t\t\t\tif (!this.channels.hasOwnProperty(name.toLowerCase())) {\r\n\t\t\t\t\tconsole.warn('Getting unknown channel: ' + name);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\treturn this.channels[name.toLowerCase()];\r\n\r\n\t\t\t} else {\r\n\t\t\t\t// setting channel value\r\n\t\t\t\tvar res = false;\r\n\t\t\t\tswitch (name.toLowerCase()) {\r\n\t\t\t\t\tcase 'r': res = this.fromRGBA(value, null, null, null); break;\r\n\t\t\t\t\tcase 'g': res = this.fromRGBA(null, value, null, null); break;\r\n\t\t\t\t\tcase 'b': res = this.fromRGBA(null, null, value, null); break;\r\n\t\t\t\t\tcase 'h': res = this.fromHSVA(value, null, null, null); break;\r\n\t\t\t\t\tcase 's': res = this.fromHSVA(null, value, null, null); break;\r\n\t\t\t\t\tcase 'v': res = this.fromHSVA(null, null, value, null); break;\r\n\t\t\t\t\tcase 'a': res = this.fromHSVA(null, null, null, value); break;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tconsole.warn('Setting unknown channel: ' + name);\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tif (res) {\r\n\t\t\t\t\tthis.redraw(); // immediately redraws the picker, if it's displayed\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\r\n\t\t// Triggers given input event(s) by:\r\n\t\t// - executing on callback specified as picker's option\r\n\t\t// - triggering standard DOM event listeners attached to the value element\r\n\t\t//\r\n\t\t// It is possible to specify multiple events separated with a space.\r\n\t\t//\r\n\t\tthis.trigger = function (eventNames) {\r\n\t\t\tvar evs = jsc.strList(eventNames);\r\n\t\t\tfor (var i = 0; i < evs.length; i += 1) {\r\n\t\t\t\tvar ev = evs[i].toLowerCase();\r\n\r\n\t\t\t\t// trigger a callback\r\n\t\t\t\tvar callbackProp = null;\r\n\t\t\t\tswitch (ev) {\r\n\t\t\t\t\tcase 'input': callbackProp = 'onInput'; break;\r\n\t\t\t\t\tcase 'change': callbackProp = 'onChange'; break;\r\n\t\t\t\t}\r\n\t\t\t\tif (callbackProp) {\r\n\t\t\t\t\tjsc.triggerCallback(this, callbackProp);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// trigger standard DOM event listeners on the value element\r\n\t\t\t\tjsc.triggerInputEvent(this.valueElement, ev, true, true);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\r\n\t\t// h: 0-360\r\n\t\t// s: 0-100\r\n\t\t// v: 0-100\r\n\t\t// a: 0.0-1.0\r\n\t\t//\r\n\t\tthis.fromHSVA = function (h, s, v, a, flags) { // null = don't change\r\n\t\t\tif (h === undefined) { h = null; }\r\n\t\t\tif (s === undefined) { s = null; }\r\n\t\t\tif (v === undefined) { v = null; }\r\n\t\t\tif (a === undefined) { a = null; }\r\n\r\n\t\t\tif (h !== null) {\r\n\t\t\t\tif (isNaN(h)) { return false; }\r\n\t\t\t\tthis.channels.h = Math.max(0, Math.min(360, h));\r\n\t\t\t}\r\n\t\t\tif (s !== null) {\r\n\t\t\t\tif (isNaN(s)) { return false; }\r\n\t\t\t\tthis.channels.s = Math.max(0, Math.min(100, this.maxS, s), this.minS);\r\n\t\t\t}\r\n\t\t\tif (v !== null) {\r\n\t\t\t\tif (isNaN(v)) { return false; }\r\n\t\t\t\tthis.channels.v = Math.max(0, Math.min(100, this.maxV, v), this.minV);\r\n\t\t\t}\r\n\t\t\tif (a !== null) {\r\n\t\t\t\tif (isNaN(a)) { return false; }\r\n\t\t\t\tthis.channels.a = this.hasAlphaChannel() ?\r\n\t\t\t\t\tMath.max(0, Math.min(1, this.maxA, a), this.minA) :\r\n\t\t\t\t\t1.0; // if alpha channel is disabled, the color should stay 100% opaque\r\n\t\t\t}\r\n\r\n\t\t\tvar rgb = jsc.HSV_RGB(\r\n\t\t\t\tthis.channels.h,\r\n\t\t\t\tthis.channels.s,\r\n\t\t\t\tthis.channels.v\r\n\t\t\t);\r\n\t\t\tthis.channels.r = rgb[0];\r\n\t\t\tthis.channels.g = rgb[1];\r\n\t\t\tthis.channels.b = rgb[2];\r\n\r\n\t\t\tthis.exposeColor(flags);\r\n\t\t\treturn true;\r\n\t\t};\r\n\r\n\r\n\t\t// r: 0-255\r\n\t\t// g: 0-255\r\n\t\t// b: 0-255\r\n\t\t// a: 0.0-1.0\r\n\t\t//\r\n\t\tthis.fromRGBA = function (r, g, b, a, flags) { // null = don't change\r\n\t\t\tif (r === undefined) { r = null; }\r\n\t\t\tif (g === undefined) { g = null; }\r\n\t\t\tif (b === undefined) { b = null; }\r\n\t\t\tif (a === undefined) { a = null; }\r\n\r\n\t\t\tif (r !== null) {\r\n\t\t\t\tif (isNaN(r)) { return false; }\r\n\t\t\t\tr = Math.max(0, Math.min(255, r));\r\n\t\t\t}\r\n\t\t\tif (g !== null) {\r\n\t\t\t\tif (isNaN(g)) { return false; }\r\n\t\t\t\tg = Math.max(0, Math.min(255, g));\r\n\t\t\t}\r\n\t\t\tif (b !== null) {\r\n\t\t\t\tif (isNaN(b)) { return false; }\r\n\t\t\t\tb = Math.max(0, Math.min(255, b));\r\n\t\t\t}\r\n\t\t\tif (a !== null) {\r\n\t\t\t\tif (isNaN(a)) { return false; }\r\n\t\t\t\tthis.channels.a = this.hasAlphaChannel() ?\r\n\t\t\t\t\tMath.max(0, Math.min(1, this.maxA, a), this.minA) :\r\n\t\t\t\t\t1.0; // if alpha channel is disabled, the color should stay 100% opaque\r\n\t\t\t}\r\n\r\n\t\t\tvar hsv = jsc.RGB_HSV(\r\n\t\t\t\tr===null ? this.channels.r : r,\r\n\t\t\t\tg===null ? this.channels.g : g,\r\n\t\t\t\tb===null ? this.channels.b : b\r\n\t\t\t);\r\n\t\t\tif (hsv[0] !== null) {\r\n\t\t\t\tthis.channels.h = Math.max(0, Math.min(360, hsv[0]));\r\n\t\t\t}\r\n\t\t\tif (hsv[2] !== 0) { // fully black color stays black through entire saturation range, so let's not change saturation\r\n\t\t\t\tthis.channels.s = Math.max(0, this.minS, Math.min(100, this.maxS, hsv[1]));\r\n\t\t\t}\r\n\t\t\tthis.channels.v = Math.max(0, this.minV, Math.min(100, this.maxV, hsv[2]));\r\n\r\n\t\t\t// update RGB according to final HSV, as some values might be trimmed\r\n\t\t\tvar rgb = jsc.HSV_RGB(this.channels.h, this.channels.s, this.channels.v);\r\n\t\t\tthis.channels.r = rgb[0];\r\n\t\t\tthis.channels.g = rgb[1];\r\n\t\t\tthis.channels.b = rgb[2];\r\n\r\n\t\t\tthis.exposeColor(flags);\r\n\t\t\treturn true;\r\n\t\t};\r\n\r\n\r\n\t\t// DEPRECATED. Use .fromHSVA() instead\r\n\t\t//\r\n\t\tthis.fromHSV = function (h, s, v, flags) {\r\n\t\t\tconsole.warn('fromHSV() method is DEPRECATED. Using fromHSVA() instead.' + jsc.docsRef);\r\n\t\t\treturn this.fromHSVA(h, s, v, null, flags);\r\n\t\t};\r\n\r\n\r\n\t\t// DEPRECATED. Use .fromRGBA() instead\r\n\t\t//\r\n\t\tthis.fromRGB = function (r, g, b, flags) {\r\n\t\t\tconsole.warn('fromRGB() method is DEPRECATED. Using fromRGBA() instead.' + jsc.docsRef);\r\n\t\t\treturn this.fromRGBA(r, g, b, null, flags);\r\n\t\t};\r\n\r\n\r\n\t\tthis.fromString = function (str, flags) {\r\n\t\t\tif (!this.required && str.trim() === '') {\r\n\t\t\t\t// setting empty string to an optional color input\r\n\t\t\t\tthis.setPreviewElementBg(null);\r\n\t\t\t\tthis.setValueElementValue('');\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\tvar color = jsc.parseColorString(str);\r\n\t\t\tif (!color) {\r\n\t\t\t\treturn false; // could not parse\r\n\t\t\t}\r\n\t\t\tif (this.format.toLowerCase() === 'any') {\r\n\t\t\t\tthis._setFormat(color.format); // adapt format\r\n\t\t\t\tif (!jsc.isAlphaFormat(this.getFormat())) {\r\n\t\t\t\t\tcolor.rgba[3] = 1.0; // when switching to a format that doesn't support alpha, set full opacity\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis.fromRGBA(\r\n\t\t\t\tcolor.rgba[0],\r\n\t\t\t\tcolor.rgba[1],\r\n\t\t\t\tcolor.rgba[2],\r\n\t\t\t\tcolor.rgba[3],\r\n\t\t\t\tflags\r\n\t\t\t);\r\n\t\t\treturn true;\r\n\t\t};\r\n\r\n\r\n\t\tthis.toString = function (format) {\r\n\t\t\tif (format === undefined) {\r\n\t\t\t\tformat = this.getFormat(); // format not specified -> use the current format\r\n\t\t\t}\r\n\t\t\tswitch (format.toLowerCase()) {\r\n\t\t\t\tcase 'hex': return this.toHEXString(); break;\r\n\t\t\t\tcase 'hexa': return this.toHEXAString(); break;\r\n\t\t\t\tcase 'rgb': return this.toRGBString(); break;\r\n\t\t\t\tcase 'rgba': return this.toRGBAString(); break;\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t};\r\n\r\n\r\n\t\tthis.toHEXString = function () {\r\n\t\t\treturn jsc.hexColor(\r\n\t\t\t\tthis.channels.r,\r\n\t\t\t\tthis.channels.g,\r\n\t\t\t\tthis.channels.b\r\n\t\t\t);\r\n\t\t};\r\n\r\n\r\n\t\tthis.toHEXAString = function () {\r\n\t\t\treturn jsc.hexaColor(\r\n\t\t\t\tthis.channels.r,\r\n\t\t\t\tthis.channels.g,\r\n\t\t\t\tthis.channels.b,\r\n\t\t\t\tthis.channels.a\r\n\t\t\t);\r\n\t\t};\r\n\r\n\r\n\t\tthis.toRGBString = function () {\r\n\t\t\treturn jsc.rgbColor(\r\n\t\t\t\tthis.channels.r,\r\n\t\t\t\tthis.channels.g,\r\n\t\t\t\tthis.channels.b\r\n\t\t\t);\r\n\t\t};\r\n\r\n\r\n\t\tthis.toRGBAString = function () {\r\n\t\t\treturn jsc.rgbaColor(\r\n\t\t\t\tthis.channels.r,\r\n\t\t\t\tthis.channels.g,\r\n\t\t\t\tthis.channels.b,\r\n\t\t\t\tthis.channels.a\r\n\t\t\t);\r\n\t\t};\r\n\r\n\r\n\t\tthis.toGrayscale = function () {\r\n\t\t\treturn (\r\n\t\t\t\t0.213 * this.channels.r +\r\n\t\t\t\t0.715 * this.channels.g +\r\n\t\t\t\t0.072 * this.channels.b\r\n\t\t\t);\r\n\t\t};\r\n\r\n\r\n\t\tthis.toCanvas = function () {\r\n\t\t\treturn jsc.genColorPreviewCanvas(this.toRGBAString()).canvas;\r\n\t\t};\r\n\r\n\r\n\t\tthis.toDataURL = function () {\r\n\t\t\treturn this.toCanvas().toDataURL();\r\n\t\t};\r\n\r\n\r\n\t\tthis.toBackground = function () {\r\n\t\t\treturn jsc.pub.background(this.toRGBAString());\r\n\t\t};\r\n\r\n\r\n\t\tthis.isLight = function () {\r\n\t\t\treturn this.toGrayscale() > 255 / 2;\r\n\t\t};\r\n\r\n\r\n\t\tthis.hide = function () {\r\n\t\t\tif (isPickerOwner()) {\r\n\t\t\t\tdetachPicker();\r\n\t\t\t}\r\n\t\t};\r\n\r\n\r\n\t\tthis.show = function () {\r\n\t\t\tdrawPicker();\r\n\t\t};\r\n\r\n\r\n\t\tthis.redraw = function () {\r\n\t\t\tif (isPickerOwner()) {\r\n\t\t\t\tdrawPicker();\r\n\t\t\t}\r\n\t\t};\r\n\r\n\r\n\t\tthis.getFormat = function () {\r\n\t\t\treturn this._currentFormat;\r\n\t\t};\r\n\r\n\r\n\t\tthis._setFormat = function (format) {\r\n\t\t\tthis._currentFormat = format.toLowerCase();\r\n\t\t};\r\n\r\n\r\n\t\tthis.hasAlphaChannel = function () {\r\n\t\t\tif (this.alphaChannel === 'auto') {\r\n\t\t\t\treturn (\r\n\t\t\t\t\tthis.format.toLowerCase() === 'any' || // format can change on the fly (e.g. from hex to rgba), so let's consider the alpha channel enabled\r\n\t\t\t\t\tjsc.isAlphaFormat(this.getFormat()) || // the current format supports alpha channel\r\n\t\t\t\t\tthis.alpha !== undefined || // initial alpha value is set, so we're working with alpha channel\r\n\t\t\t\t\tthis.alphaElement !== undefined // the alpha value is redirected, so we're working with alpha channel\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\treturn this.alphaChannel; // the alpha channel is explicitly set\r\n\t\t};\r\n\r\n\r\n\t\tthis.processValueInput = function (str) {\r\n\t\t\tif (!this.fromString(str)) {\r\n\t\t\t\t// could not parse the color value - let's just expose the current color\r\n\t\t\t\tthis.exposeColor();\r\n\t\t\t}\r\n\t\t};\r\n\r\n\r\n\t\tthis.processAlphaInput = function (str) {\r\n\t\t\tif (!this.fromHSVA(null, null, null, parseFloat(str))) {\r\n\t\t\t\t// could not parse the alpha value - let's just expose the current color\r\n\t\t\t\tthis.exposeColor();\r\n\t\t\t}\r\n\t\t};\r\n\r\n\r\n\t\tthis.exposeColor = function (flags) {\r\n\t\t\tvar colorStr = this.toString();\r\n\t\t\tvar fmt = this.getFormat();\r\n\r\n\t\t\t// reflect current color in data- attribute\r\n\t\t\tjsc.setDataAttr(this.targetElement, 'current-color', colorStr);\r\n\r\n\t\t\tif (!(flags & jsc.flags.leaveValue) && this.valueElement) {\r\n\t\t\t\tif (fmt === 'hex' || fmt === 'hexa') {\r\n\t\t\t\t\tif (!this.uppercase) { colorStr = colorStr.toLowerCase(); }\r\n\t\t\t\t\tif (!this.hash) { colorStr = colorStr.replace(/^#/, ''); }\r\n\t\t\t\t}\r\n\t\t\t\tthis.setValueElementValue(colorStr);\r\n\t\t\t}\r\n\r\n\t\t\tif (!(flags & jsc.flags.leaveAlpha) && this.alphaElement) {\r\n\t\t\t\tvar alphaVal = Math.round(this.channels.a * 100) / 100;\r\n\t\t\t\tthis.setAlphaElementValue(alphaVal);\r\n\t\t\t}\r\n\r\n\t\t\tif (!(flags & jsc.flags.leavePreview) && this.previewElement) {\r\n\t\t\t\tvar previewPos = null; // 'left' | 'right' (null -> fill the entire element)\r\n\r\n\t\t\t\tif (\r\n\t\t\t\t\tjsc.isTextInput(this.previewElement) || // text input\r\n\t\t\t\t\t(jsc.isButton(this.previewElement) && !jsc.isButtonEmpty(this.previewElement)) // button with text\r\n\t\t\t\t) {\r\n\t\t\t\t\tpreviewPos = this.previewPosition;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.setPreviewElementBg(this.toRGBAString());\r\n\t\t\t}\r\n\r\n\t\t\tif (isPickerOwner()) {\r\n\t\t\t\tredrawPad();\r\n\t\t\t\tredrawSld();\r\n\t\t\t\tredrawASld();\r\n\t\t\t}\r\n\t\t};\r\n\r\n\r\n\t\tthis.setPreviewElementBg = function (color) {\r\n\t\t\tif (!this.previewElement) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tvar position = null; // color preview position: null | 'left' | 'right'\r\n\t\t\tvar width = null; // color preview width: px | null = fill the entire element\r\n\t\t\tif (\r\n\t\t\t\tjsc.isTextInput(this.previewElement) || // text input\r\n\t\t\t\t(jsc.isButton(this.previewElement) && !jsc.isButtonEmpty(this.previewElement)) // button with text\r\n\t\t\t) {\r\n\t\t\t\tposition = this.previewPosition;\r\n\t\t\t\twidth = this.previewSize;\r\n\t\t\t}\r\n\r\n\t\t\tvar backgrounds = [];\r\n\r\n\t\t\tif (!color) {\r\n\t\t\t\t// there is no color preview to display -> let's remove any previous background image\r\n\t\t\t\tbackgrounds.push({\r\n\t\t\t\t\timage: 'none',\r\n\t\t\t\t\tposition: 'left top',\r\n\t\t\t\t\tsize: 'auto',\r\n\t\t\t\t\trepeat: 'no-repeat',\r\n\t\t\t\t\torigin: 'padding-box',\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\t// CSS gradient for background color preview\r\n\t\t\t\tbackgrounds.push({\r\n\t\t\t\t\timage: jsc.genColorPreviewGradient(\r\n\t\t\t\t\t\tcolor,\r\n\t\t\t\t\t\tposition,\r\n\t\t\t\t\t\twidth ? width - jsc.pub.previewSeparator.length : null\r\n\t\t\t\t\t),\r\n\t\t\t\t\tposition: 'left top',\r\n\t\t\t\t\tsize: 'auto',\r\n\t\t\t\t\trepeat: position ? 'repeat-y' : 'repeat',\r\n\t\t\t\t\torigin: 'padding-box',\r\n\t\t\t\t});\r\n\r\n\t\t\t\t// data URL of generated PNG image with a gray transparency chessboard\r\n\t\t\t\tvar preview = jsc.genColorPreviewCanvas(\r\n\t\t\t\t\t'rgba(0,0,0,0)',\r\n\t\t\t\t\tposition ? {'left':'right', 'right':'left'}[position] : null,\r\n\t\t\t\t\twidth,\r\n\t\t\t\t\ttrue\r\n\t\t\t\t);\r\n\t\t\t\tbackgrounds.push({\r\n\t\t\t\t\timage: 'url(\\'' + preview.canvas.toDataURL() + '\\')',\r\n\t\t\t\t\tposition: (position || 'left') + ' top',\r\n\t\t\t\t\tsize: preview.width + 'px ' + preview.height + 'px',\r\n\t\t\t\t\trepeat: position ? 'repeat-y' : 'repeat',\r\n\t\t\t\t\torigin: 'padding-box',\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tvar bg = {\r\n\t\t\t\timage: [],\r\n\t\t\t\tposition: [],\r\n\t\t\t\tsize: [],\r\n\t\t\t\trepeat: [],\r\n\t\t\t\torigin: [],\r\n\t\t\t};\r\n\t\t\tfor (var i = 0; i < backgrounds.length; i += 1) {\r\n\t\t\t\tbg.image.push(backgrounds[i].image);\r\n\t\t\t\tbg.position.push(backgrounds[i].position);\r\n\t\t\t\tbg.size.push(backgrounds[i].size);\r\n\t\t\t\tbg.repeat.push(backgrounds[i].repeat);\r\n\t\t\t\tbg.origin.push(backgrounds[i].origin);\r\n\t\t\t}\r\n\r\n\t\t\t// set previewElement's background-images\r\n\t\t\tvar sty = {\r\n\t\t\t\t'background-image': bg.image.join(', '),\r\n\t\t\t\t'background-position': bg.position.join(', '),\r\n\t\t\t\t'background-size': bg.size.join(', '),\r\n\t\t\t\t'background-repeat': bg.repeat.join(', '),\r\n\t\t\t\t'background-origin': bg.origin.join(', '),\r\n\t\t\t};\r\n\t\t\tjsc.setStyle(this.previewElement, sty, this.forceStyle);\r\n\r\n\r\n\t\t\t// set/restore previewElement's padding\r\n\t\t\tvar padding = {\r\n\t\t\t\tleft: null,\r\n\t\t\t\tright: null,\r\n\t\t\t};\r\n\t\t\tif (position) {\r\n\t\t\t\tpadding[position] = (this.previewSize + this.previewPadding) + 'px';\r\n\t\t\t}\r\n\r\n\t\t\tvar sty = {\r\n\t\t\t\t'padding-left': padding.left,\r\n\t\t\t\t'padding-right': padding.right,\r\n\t\t\t};\r\n\t\t\tjsc.setStyle(this.previewElement, sty, this.forceStyle, true);\r\n\t\t};\r\n\r\n\r\n\t\tthis.setValueElementValue = function (str) {\r\n\t\t\tif (this.valueElement) {\r\n\t\t\t\tif (jsc.nodeName(this.valueElement) === 'input') {\r\n\t\t\t\t\tthis.valueElement.value = str;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.valueElement.innerHTML = str;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\r\n\t\tthis.setAlphaElementValue = function (str) {\r\n\t\t\tif (this.alphaElement) {\r\n\t\t\t\tif (jsc.nodeName(this.alphaElement) === 'input') {\r\n\t\t\t\t\tthis.alphaElement.value = str;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.alphaElement.innerHTML = str;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\r\n\t\tthis._processParentElementsInDOM = function () {\r\n\t\t\tif (this._parentElementsProcessed) { return; }\r\n\t\t\tthis._parentElementsProcessed = true;\r\n\r\n\t\t\tvar elm = this.targetElement;\r\n\t\t\tdo {\r\n\t\t\t\t// If the target element or one of its parent nodes has fixed position,\r\n\t\t\t\t// then use fixed positioning instead\r\n\t\t\t\tvar compStyle = jsc.getCompStyle(elm);\r\n\t\t\t\tif (compStyle.position && compStyle.position.toLowerCase() === 'fixed') {\r\n\t\t\t\t\tthis.fixed = true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (elm !== this.targetElement) {\r\n\t\t\t\t\t// Ensure to attach onParentScroll only once to each parent element\r\n\t\t\t\t\t// (multiple targetElements can share the same parent nodes)\r\n\t\t\t\t\t//\r\n\t\t\t\t\t// Note: It's not just offsetParents that can be scrollable,\r\n\t\t\t\t\t// that's why we loop through all parent nodes\r\n\t\t\t\t\tif (!jsc.getData(elm, 'hasScrollListener')) {\r\n\t\t\t\t\t\telm.addEventListener('scroll', jsc.onParentScroll, false);\r\n\t\t\t\t\t\tjsc.setData(elm, 'hasScrollListener', true);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} while ((elm = elm.parentNode) && jsc.nodeName(elm) !== 'body');\r\n\t\t};\r\n\r\n\r\n\t\tthis.tryHide = function () {\r\n\t\t\tif (this.hideOnLeave) {\r\n\t\t\t\tthis.hide();\r\n\t\t\t}\r\n\t\t};\r\n\r\n\r\n\t\tthis.set__palette = function (val) {\r\n\t\t\tthis.palette = val;\r\n\t\t\tthis._palette = jsc.parsePaletteValue(val);\r\n\t\t\tthis._paletteHasTransparency = jsc.containsTranparentColor(this._palette);\r\n\t\t};\r\n\r\n\r\n\t\tfunction setOption (option, value) {\r\n\t\t\tif (typeof option !== 'string') {\r\n\t\t\t\tthrow new Error('Invalid value for option name: ' + option);\r\n\t\t\t}\r\n\r\n\t\t\t// enum option\r\n\t\t\tif (jsc.enumOpts.hasOwnProperty(option)) {\r\n\t\t\t\tif (typeof value === 'string') { // enum string values are case insensitive\r\n\t\t\t\t\tvalue = value.toLowerCase();\r\n\t\t\t\t}\r\n\t\t\t\tif (jsc.enumOpts[option].indexOf(value) === -1) {\r\n\t\t\t\t\tthrow new Error('Option \\'' + option + '\\' has invalid value: ' + value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// deprecated option\r\n\t\t\tif (jsc.deprecatedOpts.hasOwnProperty(option)) {\r\n\t\t\t\tvar oldOpt = option;\r\n\t\t\t\tvar newOpt = jsc.deprecatedOpts[option];\r\n\t\t\t\tif (newOpt) {\r\n\t\t\t\t\t// if we have a new name for this option, let's log a warning and use the new name\r\n\t\t\t\t\tconsole.warn('Option \\'%s\\' is DEPRECATED, using \\'%s\\' instead.' + jsc.docsRef, oldOpt, newOpt);\r\n\t\t\t\t\toption = newOpt;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// new name not available for the option\r\n\t\t\t\t\tthrow new Error('Option \\'' + option + '\\' is DEPRECATED');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar setter = 'set__' + option;\r\n\r\n\t\t\tif (typeof THIS[setter] === 'function') { // a setter exists for this option\r\n\t\t\t\tTHIS[setter](value);\r\n\t\t\t\treturn true;\r\n\r\n\t\t\t} else if (option in THIS) { // option exists as a property\r\n\t\t\t\tTHIS[option] = value;\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\tthrow new Error('Unrecognized configuration option: ' + option);\r\n\t\t}\r\n\r\n\r\n\t\tfunction getOption (option) {\r\n\t\t\tif (typeof option !== 'string') {\r\n\t\t\t\tthrow new Error('Invalid value for option name: ' + option);\r\n\t\t\t}\r\n\r\n\t\t\t// deprecated option\r\n\t\t\tif (jsc.deprecatedOpts.hasOwnProperty(option)) {\r\n\t\t\t\tvar oldOpt = option;\r\n\t\t\t\tvar newOpt = jsc.deprecatedOpts[option];\r\n\t\t\t\tif (newOpt) {\r\n\t\t\t\t\t// if we have a new name for this option, let's log a warning and use the new name\r\n\t\t\t\t\tconsole.warn('Option \\'%s\\' is DEPRECATED, using \\'%s\\' instead.' + jsc.docsRef, oldOpt, newOpt);\r\n\t\t\t\t\toption = newOpt;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// new name not available for the option\r\n\t\t\t\t\tthrow new Error('Option \\'' + option + '\\' is DEPRECATED');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar getter = 'get__' + option;\r\n\r\n\t\t\tif (typeof THIS[getter] === 'function') { // a getter exists for this option\r\n\t\t\t\treturn THIS[getter](value);\r\n\r\n\t\t\t} else if (option in THIS) { // option exists as a property\r\n\t\t\t\treturn THIS[option];\r\n\t\t\t}\r\n\r\n\t\t\tthrow new Error('Unrecognized configuration option: ' + option);\r\n\t\t}\r\n\r\n\r\n\t\tfunction detachPicker () {\r\n\t\t\tjsc.removeClass(THIS.targetElement, jsc.pub.activeClassName);\r\n\t\t\tjsc.picker.wrap.parentNode.removeChild(jsc.picker.wrap);\r\n\t\t\tdelete jsc.picker.owner;\r\n\t\t}\r\n\r\n\r\n\t\tfunction drawPicker () {\r\n\r\n\t\t\t// At this point, when drawing the picker, we know what the parent elements are\r\n\t\t\t// and we can do all related DOM operations, such as registering events on them\r\n\t\t\t// or checking their positioning\r\n\t\t\tTHIS._processParentElementsInDOM();\r\n\r\n\t\t\tif (!jsc.picker) {\r\n\t\t\t\tjsc.picker = {\r\n\t\t\t\t\towner: null, // owner picker instance\r\n\t\t\t\t\twrap : jsc.createEl('div'),\r\n\t\t\t\t\tbox : jsc.createEl('div'),\r\n\t\t\t\t\tboxS : jsc.createEl('div'), // shadow area\r\n\t\t\t\t\tboxB : jsc.createEl('div'), // border\r\n\t\t\t\t\tpad : jsc.createEl('div'),\r\n\t\t\t\t\tpadB : jsc.createEl('div'), // border\r\n\t\t\t\t\tpadM : jsc.createEl('div'), // mouse/touch area\r\n\t\t\t\t\tpadCanvas : jsc.createPadCanvas(),\r\n\t\t\t\t\tcross : jsc.createEl('div'),\r\n\t\t\t\t\tcrossBY : jsc.createEl('div'), // border Y\r\n\t\t\t\t\tcrossBX : jsc.createEl('div'), // border X\r\n\t\t\t\t\tcrossLY : jsc.createEl('div'), // line Y\r\n\t\t\t\t\tcrossLX : jsc.createEl('div'), // line X\r\n\t\t\t\t\tsld : jsc.createEl('div'), // slider\r\n\t\t\t\t\tsldB : jsc.createEl('div'), // border\r\n\t\t\t\t\tsldM : jsc.createEl('div'), // mouse/touch area\r\n\t\t\t\t\tsldGrad : jsc.createSliderGradient(),\r\n\t\t\t\t\tsldPtrS : jsc.createEl('div'), // slider pointer spacer\r\n\t\t\t\t\tsldPtrIB : jsc.createEl('div'), // slider pointer inner border\r\n\t\t\t\t\tsldPtrMB : jsc.createEl('div'), // slider pointer middle border\r\n\t\t\t\t\tsldPtrOB : jsc.createEl('div'), // slider pointer outer border\r\n\t\t\t\t\tasld : jsc.createEl('div'), // alpha slider\r\n\t\t\t\t\tasldB : jsc.createEl('div'), // border\r\n\t\t\t\t\tasldM : jsc.createEl('div'), // mouse/touch area\r\n\t\t\t\t\tasldGrad : jsc.createASliderGradient(),\r\n\t\t\t\t\tasldPtrS : jsc.createEl('div'), // slider pointer spacer\r\n\t\t\t\t\tasldPtrIB : jsc.createEl('div'), // slider pointer inner border\r\n\t\t\t\t\tasldPtrMB : jsc.createEl('div'), // slider pointer middle border\r\n\t\t\t\t\tasldPtrOB : jsc.createEl('div'), // slider pointer outer border\r\n\t\t\t\t\tpal : jsc.createEl('div'), // palette\r\n\t\t\t\t\tbtn : jsc.createEl('div'),\r\n\t\t\t\t\tbtnT : jsc.createEl('span'), // text\r\n\t\t\t\t};\r\n\r\n\t\t\t\tjsc.picker.pad.appendChild(jsc.picker.padCanvas.elm);\r\n\t\t\t\tjsc.picker.padB.appendChild(jsc.picker.pad);\r\n\t\t\t\tjsc.picker.cross.appendChild(jsc.picker.crossBY);\r\n\t\t\t\tjsc.picker.cross.appendChild(jsc.picker.crossBX);\r\n\t\t\t\tjsc.picker.cross.appendChild(jsc.picker.crossLY);\r\n\t\t\t\tjsc.picker.cross.appendChild(jsc.picker.crossLX);\r\n\t\t\t\tjsc.picker.padB.appendChild(jsc.picker.cross);\r\n\t\t\t\tjsc.picker.box.appendChild(jsc.picker.padB);\r\n\t\t\t\tjsc.picker.box.appendChild(jsc.picker.padM);\r\n\r\n\t\t\t\tjsc.picker.sld.appendChild(jsc.picker.sldGrad.elm);\r\n\t\t\t\tjsc.picker.sldB.appendChild(jsc.picker.sld);\r\n\t\t\t\tjsc.picker.sldB.appendChild(jsc.picker.sldPtrOB);\r\n\t\t\t\tjsc.picker.sldPtrOB.appendChild(jsc.picker.sldPtrMB);\r\n\t\t\t\tjsc.picker.sldPtrMB.appendChild(jsc.picker.sldPtrIB);\r\n\t\t\t\tjsc.picker.sldPtrIB.appendChild(jsc.picker.sldPtrS);\r\n\t\t\t\tjsc.picker.box.appendChild(jsc.picker.sldB);\r\n\t\t\t\tjsc.picker.box.appendChild(jsc.picker.sldM);\r\n\r\n\t\t\t\tjsc.picker.asld.appendChild(jsc.picker.asldGrad.elm);\r\n\t\t\t\tjsc.picker.asldB.appendChild(jsc.picker.asld);\r\n\t\t\t\tjsc.picker.asldB.appendChild(jsc.picker.asldPtrOB);\r\n\t\t\t\tjsc.picker.asldPtrOB.appendChild(jsc.picker.asldPtrMB);\r\n\t\t\t\tjsc.picker.asldPtrMB.appendChild(jsc.picker.asldPtrIB);\r\n\t\t\t\tjsc.picker.asldPtrIB.appendChild(jsc.picker.asldPtrS);\r\n\t\t\t\tjsc.picker.box.appendChild(jsc.picker.asldB);\r\n\t\t\t\tjsc.picker.box.appendChild(jsc.picker.asldM);\r\n\r\n\t\t\t\tjsc.picker.box.appendChild(jsc.picker.pal);\r\n\r\n\t\t\t\tjsc.picker.btn.appendChild(jsc.picker.btnT);\r\n\t\t\t\tjsc.picker.box.appendChild(jsc.picker.btn);\r\n\r\n\t\t\t\tjsc.picker.boxB.appendChild(jsc.picker.box);\r\n\t\t\t\tjsc.picker.wrap.appendChild(jsc.picker.boxS);\r\n\t\t\t\tjsc.picker.wrap.appendChild(jsc.picker.boxB);\r\n\r\n\t\t\t\tjsc.picker.wrap.addEventListener('touchstart', jsc.onPickerTouchStart,\r\n\t\t\t\t\tjsc.isPassiveEventSupported ? {passive: false} : false);\r\n\t\t\t}\r\n\r\n\t\t\tvar p = jsc.picker;\r\n\r\n\t\t\tvar displaySlider = !!jsc.getSliderChannel(THIS);\r\n\t\t\tvar displayAlphaSlider = THIS.hasAlphaChannel();\r\n\t\t\tvar pickerDims = jsc.getPickerDims(THIS);\r\n\t\t\tvar crossOuterSize = (2 * THIS.pointerBorderWidth + THIS.pointerThickness + 2 * THIS.crossSize);\r\n\t\t\tvar controlPadding = jsc.getControlPadding(THIS);\r\n\t\t\tvar borderRadius = Math.min(\r\n\t\t\t\tTHIS.borderRadius,\r\n\t\t\t\tMath.round(THIS.padding * Math.PI)); // px\r\n\t\t\tvar padCursor = 'crosshair';\r\n\r\n\t\t\t// wrap\r\n\t\t\tp.wrap.className = 'jscolor-picker-wrap';\r\n\t\t\tp.wrap.style.clear = 'both';\r\n\t\t\tp.wrap.style.width = pickerDims.borderW + 'px';\r\n\t\t\tp.wrap.style.height = pickerDims.borderH + 'px';\r\n\t\t\tp.wrap.style.zIndex = THIS.zIndex;\r\n\r\n\t\t\t// picker\r\n\t\t\tp.box.className = 'jscolor-picker';\r\n\t\t\tp.box.style.width = pickerDims.paddedW + 'px';\r\n\t\t\tp.box.style.height = pickerDims.paddedH + 'px';\r\n\t\t\tp.box.style.position = 'relative';\r\n\r\n\t\t\t// picker shadow\r\n\t\t\tp.boxS.className = 'jscolor-picker-shadow';\r\n\t\t\tp.boxS.style.position = 'absolute';\r\n\t\t\tp.boxS.style.left = '0';\r\n\t\t\tp.boxS.style.top = '0';\r\n\t\t\tp.boxS.style.width = '100%';\r\n\t\t\tp.boxS.style.height = '100%';\r\n\t\t\tjsc.setBorderRadius(p.boxS, borderRadius + 'px');\r\n\r\n\t\t\t// picker border\r\n\t\t\tp.boxB.className = 'jscolor-picker-border';\r\n\t\t\tp.boxB.style.position = 'relative';\r\n\t\t\tp.boxB.style.border = THIS.borderWidth + 'px solid';\r\n\t\t\tp.boxB.style.borderColor = THIS.borderColor;\r\n\t\t\tp.boxB.style.background = THIS.backgroundColor;\r\n\t\t\tjsc.setBorderRadius(p.boxB, borderRadius + 'px');\r\n\r\n\t\t\t// IE hack:\r\n\t\t\t// If the element is transparent, IE will trigger the event on the elements under it,\r\n\t\t\t// e.g. on Canvas or on elements with border\r\n\t\t\tp.padM.style.background = 'rgba(255,0,0,.2)';\r\n\t\t\tp.sldM.style.background = 'rgba(0,255,0,.2)';\r\n\t\t\tp.asldM.style.background = 'rgba(0,0,255,.2)';\r\n\r\n\t\t\tp.padM.style.opacity =\r\n\t\t\tp.sldM.style.opacity =\r\n\t\t\tp.asldM.style.opacity =\r\n\t\t\t\t'0';\r\n\r\n\t\t\t// pad\r\n\t\t\tp.pad.style.position = 'relative';\r\n\t\t\tp.pad.style.width = THIS.width + 'px';\r\n\t\t\tp.pad.style.height = THIS.height + 'px';\r\n\r\n\t\t\t// pad - color spectrum (HSV and HVS)\r\n\t\t\tp.padCanvas.draw(THIS.width, THIS.height, jsc.getPadYChannel(THIS));\r\n\r\n\t\t\t// pad border\r\n\t\t\tp.padB.style.position = 'absolute';\r\n\t\t\tp.padB.style.left = THIS.padding + 'px';\r\n\t\t\tp.padB.style.top = THIS.padding + 'px';\r\n\t\t\tp.padB.style.border = THIS.controlBorderWidth + 'px solid';\r\n\t\t\tp.padB.style.borderColor = THIS.controlBorderColor;\r\n\r\n\t\t\t// pad mouse area\r\n\t\t\tp.padM.style.position = 'absolute';\r\n\t\t\tp.padM.style.left = 0 + 'px';\r\n\t\t\tp.padM.style.top = 0 + 'px';\r\n\t\t\tp.padM.style.width = (THIS.padding + 2 * THIS.controlBorderWidth + THIS.width + controlPadding) + 'px';\r\n\t\t\tp.padM.style.height = (2 * THIS.controlBorderWidth + 2 * THIS.padding + THIS.height) + 'px';\r\n\t\t\tp.padM.style.cursor = padCursor;\r\n\t\t\tjsc.setData(p.padM, {\r\n\t\t\t\tinstance: THIS,\r\n\t\t\t\tcontrol: 'pad',\r\n\t\t\t})\r\n\r\n\t\t\t// pad cross\r\n\t\t\tp.cross.style.position = 'absolute';\r\n\t\t\tp.cross.style.left =\r\n\t\t\tp.cross.style.top =\r\n\t\t\t\t'0';\r\n\t\t\tp.cross.style.width =\r\n\t\t\tp.cross.style.height =\r\n\t\t\t\tcrossOuterSize + 'px';\r\n\r\n\t\t\t// pad cross border Y and X\r\n\t\t\tp.crossBY.style.position =\r\n\t\t\tp.crossBX.style.position =\r\n\t\t\t\t'absolute';\r\n\t\t\tp.crossBY.style.background =\r\n\t\t\tp.crossBX.style.background =\r\n\t\t\t\tTHIS.pointerBorderColor;\r\n\t\t\tp.crossBY.style.width =\r\n\t\t\tp.crossBX.style.height =\r\n\t\t\t\t(2 * THIS.pointerBorderWidth + THIS.pointerThickness) + 'px';\r\n\t\t\tp.crossBY.style.height =\r\n\t\t\tp.crossBX.style.width =\r\n\t\t\t\tcrossOuterSize + 'px';\r\n\t\t\tp.crossBY.style.left =\r\n\t\t\tp.crossBX.style.top =\r\n\t\t\t\t(Math.floor(crossOuterSize / 2) - Math.floor(THIS.pointerThickness / 2) - THIS.pointerBorderWidth) + 'px';\r\n\t\t\tp.crossBY.style.top =\r\n\t\t\tp.crossBX.style.left =\r\n\t\t\t\t'0';\r\n\r\n\t\t\t// pad cross line Y and X\r\n\t\t\tp.crossLY.style.position =\r\n\t\t\tp.crossLX.style.position =\r\n\t\t\t\t'absolute';\r\n\t\t\tp.crossLY.style.background =\r\n\t\t\tp.crossLX.style.background =\r\n\t\t\t\tTHIS.pointerColor;\r\n\t\t\tp.crossLY.style.height =\r\n\t\t\tp.crossLX.style.width =\r\n\t\t\t\t(crossOuterSize - 2 * THIS.pointerBorderWidth) + 'px';\r\n\t\t\tp.crossLY.style.width =\r\n\t\t\tp.crossLX.style.height =\r\n\t\t\t\tTHIS.pointerThickness + 'px';\r\n\t\t\tp.crossLY.style.left =\r\n\t\t\tp.crossLX.style.top =\r\n\t\t\t\t(Math.floor(crossOuterSize / 2) - Math.floor(THIS.pointerThickness / 2)) + 'px';\r\n\t\t\tp.crossLY.style.top =\r\n\t\t\tp.crossLX.style.left =\r\n\t\t\t\tTHIS.pointerBorderWidth + 'px';\r\n\r\n\r\n\t\t\t// slider\r\n\t\t\tp.sld.style.overflow = 'hidden';\r\n\t\t\tp.sld.style.width = THIS.sliderSize + 'px';\r\n\t\t\tp.sld.style.height = THIS.height + 'px';\r\n\r\n\t\t\t// slider gradient\r\n\t\t\tp.sldGrad.draw(THIS.sliderSize, THIS.height, '#000', '#000');\r\n\r\n\t\t\t// slider border\r\n\t\t\tp.sldB.style.display = displaySlider ? 'block' : 'none';\r\n\t\t\tp.sldB.style.position = 'absolute';\r\n\t\t\tp.sldB.style.left = (THIS.padding + THIS.width + 2 * THIS.controlBorderWidth + 2 * controlPadding) + 'px';\r\n\t\t\tp.sldB.style.top = THIS.padding + 'px';\r\n\t\t\tp.sldB.style.border = THIS.controlBorderWidth + 'px solid';\r\n\t\t\tp.sldB.style.borderColor = THIS.controlBorderColor;\r\n\r\n\t\t\t// slider mouse area\r\n\t\t\tp.sldM.style.display = displaySlider ? 'block' : 'none';\r\n\t\t\tp.sldM.style.position = 'absolute';\r\n\t\t\tp.sldM.style.left = (THIS.padding + THIS.width + 2 * THIS.controlBorderWidth + controlPadding) + 'px';\r\n\t\t\tp.sldM.style.top = 0 + 'px';\r\n\t\t\tp.sldM.style.width = (\r\n\t\t\t\t\t(THIS.sliderSize + 2 * controlPadding + 2 * THIS.controlBorderWidth) +\r\n\t\t\t\t\t(displayAlphaSlider ? 0 : Math.max(0, THIS.padding - controlPadding)) // remaining padding to the right edge\r\n\t\t\t\t) + 'px';\r\n\t\t\tp.sldM.style.height = (2 * THIS.controlBorderWidth + 2 * THIS.padding + THIS.height) + 'px';\r\n\t\t\tp.sldM.style.cursor = 'default';\r\n\t\t\tjsc.setData(p.sldM, {\r\n\t\t\t\tinstance: THIS,\r\n\t\t\t\tcontrol: 'sld',\r\n\t\t\t});\r\n\r\n\t\t\t// slider pointer inner and outer border\r\n\t\t\tp.sldPtrIB.style.border =\r\n\t\t\tp.sldPtrOB.style.border =\r\n\t\t\t\tTHIS.pointerBorderWidth + 'px solid ' + THIS.pointerBorderColor;\r\n\r\n\t\t\t// slider pointer outer border\r\n\t\t\tp.sldPtrOB.style.position = 'absolute';\r\n\t\t\tp.sldPtrOB.style.left = -(2 * THIS.pointerBorderWidth + THIS.pointerThickness) + 'px';\r\n\t\t\tp.sldPtrOB.style.top = '0';\r\n\r\n\t\t\t// slider pointer middle border\r\n\t\t\tp.sldPtrMB.style.border = THIS.pointerThickness + 'px solid ' + THIS.pointerColor;\r\n\r\n\t\t\t// slider pointer spacer\r\n\t\t\tp.sldPtrS.style.width = THIS.sliderSize + 'px';\r\n\t\t\tp.sldPtrS.style.height = jsc.pub.sliderInnerSpace + 'px';\r\n\r\n\r\n\t\t\t// alpha slider\r\n\t\t\tp.asld.style.overflow = 'hidden';\r\n\t\t\tp.asld.style.width = THIS.sliderSize + 'px';\r\n\t\t\tp.asld.style.height = THIS.height + 'px';\r\n\r\n\t\t\t// alpha slider gradient\r\n\t\t\tp.asldGrad.draw(THIS.sliderSize, THIS.height, '#000');\r\n\r\n\t\t\t// alpha slider border\r\n\t\t\tp.asldB.style.display = displayAlphaSlider ? 'block' : 'none';\r\n\t\t\tp.asldB.style.position = 'absolute';\r\n\t\t\tp.asldB.style.left = (\r\n\t\t\t\t\t(THIS.padding + THIS.width + 2 * THIS.controlBorderWidth + controlPadding) +\r\n\t\t\t\t\t(displaySlider ? (THIS.sliderSize + 3 * controlPadding + 2 * THIS.controlBorderWidth) : 0)\r\n\t\t\t\t) + 'px';\r\n\t\t\tp.asldB.style.top = THIS.padding + 'px';\r\n\t\t\tp.asldB.style.border = THIS.controlBorderWidth + 'px solid';\r\n\t\t\tp.asldB.style.borderColor = THIS.controlBorderColor;\r\n\r\n\t\t\t// alpha slider mouse area\r\n\t\t\tp.asldM.style.display = displayAlphaSlider ? 'block' : 'none';\r\n\t\t\tp.asldM.style.position = 'absolute';\r\n\t\t\tp.asldM.style.left = (\r\n\t\t\t\t\t(THIS.padding + THIS.width + 2 * THIS.controlBorderWidth + controlPadding) +\r\n\t\t\t\t\t(displaySlider ? (THIS.sliderSize + 2 * controlPadding + 2 * THIS.controlBorderWidth) : 0)\r\n\t\t\t\t) + 'px';\r\n\t\t\tp.asldM.style.top = 0 + 'px';\r\n\t\t\tp.asldM.style.width = (\r\n\t\t\t\t\t(THIS.sliderSize + 2 * controlPadding + 2 * THIS.controlBorderWidth) +\r\n\t\t\t\t\tMath.max(0, THIS.padding - controlPadding) // remaining padding to the right edge\r\n\t\t\t\t) + 'px';\r\n\t\t\tp.asldM.style.height = (2 * THIS.controlBorderWidth + 2 * THIS.padding + THIS.height) + 'px';\r\n\t\t\tp.asldM.style.cursor = 'default';\r\n\t\t\tjsc.setData(p.asldM, {\r\n\t\t\t\tinstance: THIS,\r\n\t\t\t\tcontrol: 'asld',\r\n\t\t\t})\r\n\r\n\t\t\t// alpha slider pointer inner and outer border\r\n\t\t\tp.asldPtrIB.style.border =\r\n\t\t\tp.asldPtrOB.style.border =\r\n\t\t\t\tTHIS.pointerBorderWidth + 'px solid ' + THIS.pointerBorderColor;\r\n\r\n\t\t\t// alpha slider pointer outer border\r\n\t\t\tp.asldPtrOB.style.position = 'absolute';\r\n\t\t\tp.asldPtrOB.style.left = -(2 * THIS.pointerBorderWidth + THIS.pointerThickness) + 'px';\r\n\t\t\tp.asldPtrOB.style.top = '0';\r\n\r\n\t\t\t// alpha slider pointer middle border\r\n\t\t\tp.asldPtrMB.style.border = THIS.pointerThickness + 'px solid ' + THIS.pointerColor;\r\n\r\n\t\t\t// alpha slider pointer spacer\r\n\t\t\tp.asldPtrS.style.width = THIS.sliderSize + 'px';\r\n\t\t\tp.asldPtrS.style.height = jsc.pub.sliderInnerSpace + 'px';\r\n\r\n\r\n\t\t\t// palette\r\n\t\t\tp.pal.className = 'jscolor-palette';\r\n\t\t\tp.pal.style.display = pickerDims.palette.rows ? 'block' : 'none';\r\n\t\t\tp.pal.style.position = 'absolute';\r\n\t\t\tp.pal.style.left = THIS.padding + 'px';\r\n\t\t\tp.pal.style.top = (2 * THIS.controlBorderWidth + 2 * THIS.padding + THIS.height) + 'px';\r\n\r\n\t\t\t// palette's color samples\r\n\r\n\t\t\tp.pal.innerHTML = '';\r\n\r\n\t\t\tvar chessboard = jsc.genColorPreviewCanvas('rgba(0,0,0,0)');\r\n\r\n\t\t\tvar si = 0; // color sample's index\r\n\t\t\tfor (var r = 0; r < pickerDims.palette.rows; r++) {\r\n\t\t\t\tfor (var c = 0; c < pickerDims.palette.cols && si < THIS._palette.length; c++, si++) {\r\n\t\t\t\t\tvar sampleColor = THIS._palette[si];\r\n\t\t\t\t\tvar sampleCssColor = jsc.rgbaColor.apply(null, sampleColor.rgba);\r\n\r\n\t\t\t\t\tvar sc = jsc.createEl('div'); // color sample's color\r\n\t\t\t\t\tsc.style.width = (pickerDims.palette.cellW - 2 * THIS.controlBorderWidth) + 'px';\r\n\t\t\t\t\tsc.style.height = (pickerDims.palette.cellH - 2 * THIS.controlBorderWidth) + 'px';\r\n\t\t\t\t\tsc.style.backgroundColor = sampleCssColor;\r\n\r\n\t\t\t\t\tvar sw = jsc.createEl('div'); // color sample's wrap\r\n\t\t\t\t\tsw.className = 'jscolor-palette-sample';\r\n\t\t\t\t\tsw.style.display = 'block';\r\n\t\t\t\t\tsw.style.position = 'absolute';\r\n\t\t\t\t\tsw.style.left = (\r\n\t\t\t\t\t\t\tpickerDims.palette.cols <= 1 ? 0 :\r\n\t\t\t\t\t\t\tMath.round(10 * (c * ((pickerDims.contentW - pickerDims.palette.cellW) / (pickerDims.palette.cols - 1)))) / 10\r\n\t\t\t\t\t\t) + 'px';\r\n\t\t\t\t\tsw.style.top = (r * (pickerDims.palette.cellH + THIS.paletteSpacing)) + 'px';\r\n\t\t\t\t\tsw.style.border = THIS.controlBorderWidth + 'px solid';\r\n\t\t\t\t\tsw.style.borderColor = THIS.controlBorderColor;\r\n\t\t\t\t\tsw.style.cursor = 'pointer';\r\n\t\t\t\t\tif (sampleColor.rgba[3] !== null && sampleColor.rgba[3] < 1.0) { // only create chessboard background if the sample has transparency\r\n\t\t\t\t\t\tsw.style.backgroundImage = 'url(\\'' + chessboard.canvas.toDataURL() + '\\')';\r\n\t\t\t\t\t\tsw.style.backgroundRepeat = 'repeat';\r\n\t\t\t\t\t\tsw.style.backgroundPosition = 'center center';\r\n\t\t\t\t\t}\r\n\t\t\t\t\tjsc.setData(sw, {\r\n\t\t\t\t\t\tinstance: THIS,\r\n\t\t\t\t\t\tcontrol: 'palette-sample',\r\n\t\t\t\t\t\tcolor: sampleColor,\r\n\t\t\t\t\t})\r\n\t\t\t\t\tsw.addEventListener('click', jsc.onPaletteSampleClick, false);\r\n\t\t\t\t\tsw.appendChild(sc);\r\n\t\t\t\t\tp.pal.appendChild(sw);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\t\t\t// the Close button\r\n\t\t\tfunction setBtnBorder () {\r\n\t\t\t\tvar insetColors = THIS.controlBorderColor.split(/\\s+/);\r\n\t\t\t\tvar outsetColor = insetColors.length < 2 ? insetColors[0] : insetColors[1] + ' ' + insetColors[0] + ' ' + insetColors[0] + ' ' + insetColors[1];\r\n\t\t\t\tp.btn.style.borderColor = outsetColor;\r\n\t\t\t}\r\n\t\t\tvar btnPadding = 15; // px\r\n\t\t\tp.btn.className = 'jscolor-btn-close';\r\n\t\t\tp.btn.style.display = THIS.closeButton ? 'block' : 'none';\r\n\t\t\tp.btn.style.position = 'absolute';\r\n\t\t\tp.btn.style.left = THIS.padding + 'px';\r\n\t\t\tp.btn.style.bottom = THIS.padding + 'px';\r\n\t\t\tp.btn.style.padding = '0 ' + btnPadding + 'px';\r\n\t\t\tp.btn.style.maxWidth = (pickerDims.contentW - 2 * THIS.controlBorderWidth - 2 * btnPadding) + 'px';\r\n\t\t\tp.btn.style.overflow = 'hidden';\r\n\t\t\tp.btn.style.height = THIS.buttonHeight + 'px';\r\n\t\t\tp.btn.style.whiteSpace = 'nowrap';\r\n\t\t\tp.btn.style.border = THIS.controlBorderWidth + 'px solid';\r\n\t\t\tsetBtnBorder();\r\n\t\t\tp.btn.style.color = THIS.buttonColor;\r\n\t\t\tp.btn.style.font = '12px sans-serif';\r\n\t\t\tp.btn.style.textAlign = 'center';\r\n\t\t\tp.btn.style.cursor = 'pointer';\r\n\t\t\tp.btn.onmousedown = function () {\r\n\t\t\t\tTHIS.hide();\r\n\t\t\t};\r\n\t\t\tp.btnT.style.lineHeight = THIS.buttonHeight + 'px';\r\n\t\t\tp.btnT.innerHTML = '';\r\n\t\t\tp.btnT.appendChild(window.document.createTextNode(THIS.closeText));\r\n\r\n\t\t\t// reposition the pointers\r\n\t\t\tredrawPad();\r\n\t\t\tredrawSld();\r\n\t\t\tredrawASld();\r\n\r\n\t\t\t// If we are changing the owner without first closing the picker,\r\n\t\t\t// make sure to first deal with the old owner\r\n\t\t\tif (jsc.picker.owner && jsc.picker.owner !== THIS) {\r\n\t\t\t\tjsc.removeClass(jsc.picker.owner.targetElement, jsc.pub.activeClassName);\r\n\t\t\t}\r\n\r\n\t\t\t// Set a new picker owner\r\n\t\t\tjsc.picker.owner = THIS;\r\n\r\n\t\t\t// The redrawPosition() method needs picker.owner to be set, that's why we call it here,\r\n\t\t\t// after setting the owner\r\n\t\t\tif (THIS.container === window.document.body) {\r\n\t\t\t\tjsc.redrawPosition();\r\n\t\t\t} else {\r\n\t\t\t\tjsc._drawPosition(THIS, 0, 0, 'relative', false);\r\n\t\t\t}\r\n\r\n\t\t\tif (p.wrap.parentNode !== THIS.container) {\r\n\t\t\t\tTHIS.container.appendChild(p.wrap);\r\n\t\t\t}\r\n\r\n\t\t\tjsc.addClass(THIS.targetElement, jsc.pub.activeClassName);\r\n\t\t}\r\n\r\n\r\n\t\tfunction redrawPad () {\r\n\t\t\t// redraw the pad pointer\r\n\t\t\tvar yChannel = jsc.getPadYChannel(THIS);\r\n\t\t\tvar x = Math.round((THIS.channels.h / 360) * (THIS.width - 1));\r\n\t\t\tvar y = Math.round((1 - THIS.channels[yChannel] / 100) * (THIS.height - 1));\r\n\t\t\tvar crossOuterSize = (2 * THIS.pointerBorderWidth + THIS.pointerThickness + 2 * THIS.crossSize);\r\n\t\t\tvar ofs = -Math.floor(crossOuterSize / 2);\r\n\t\t\tjsc.picker.cross.style.left = (x + ofs) + 'px';\r\n\t\t\tjsc.picker.cross.style.top = (y + ofs) + 'px';\r\n\r\n\t\t\t// redraw the slider\r\n\t\t\tswitch (jsc.getSliderChannel(THIS)) {\r\n\t\t\tcase 's':\r\n\t\t\t\tvar rgb1 = jsc.HSV_RGB(THIS.channels.h, 100, THIS.channels.v);\r\n\t\t\t\tvar rgb2 = jsc.HSV_RGB(THIS.channels.h, 0, THIS.channels.v);\r\n\t\t\t\tvar color1 = 'rgb(' +\r\n\t\t\t\t\tMath.round(rgb1[0]) + ',' +\r\n\t\t\t\t\tMath.round(rgb1[1]) + ',' +\r\n\t\t\t\t\tMath.round(rgb1[2]) + ')';\r\n\t\t\t\tvar color2 = 'rgb(' +\r\n\t\t\t\t\tMath.round(rgb2[0]) + ',' +\r\n\t\t\t\t\tMath.round(rgb2[1]) + ',' +\r\n\t\t\t\t\tMath.round(rgb2[2]) + ')';\r\n\t\t\t\tjsc.picker.sldGrad.draw(THIS.sliderSize, THIS.height, color1, color2);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'v':\r\n\t\t\t\tvar rgb = jsc.HSV_RGB(THIS.channels.h, THIS.channels.s, 100);\r\n\t\t\t\tvar color1 = 'rgb(' +\r\n\t\t\t\t\tMath.round(rgb[0]) + ',' +\r\n\t\t\t\t\tMath.round(rgb[1]) + ',' +\r\n\t\t\t\t\tMath.round(rgb[2]) + ')';\r\n\t\t\t\tvar color2 = '#000';\r\n\t\t\t\tjsc.picker.sldGrad.draw(THIS.sliderSize, THIS.height, color1, color2);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\t// redraw the alpha slider\r\n\t\t\tjsc.picker.asldGrad.draw(THIS.sliderSize, THIS.height, THIS.toHEXString());\r\n\t\t}\r\n\r\n\r\n\t\tfunction redrawSld () {\r\n\t\t\tvar sldChannel = jsc.getSliderChannel(THIS);\r\n\t\t\tif (sldChannel) {\r\n\t\t\t\t// redraw the slider pointer\r\n\t\t\t\tvar y = Math.round((1 - THIS.channels[sldChannel] / 100) * (THIS.height - 1));\r\n\t\t\t\tjsc.picker.sldPtrOB.style.top = (y - (2 * THIS.pointerBorderWidth + THIS.pointerThickness) - Math.floor(jsc.pub.sliderInnerSpace / 2)) + 'px';\r\n\t\t\t}\r\n\r\n\t\t\t// redraw the alpha slider\r\n\t\t\tjsc.picker.asldGrad.draw(THIS.sliderSize, THIS.height, THIS.toHEXString());\r\n\t\t}\r\n\r\n\r\n\t\tfunction redrawASld () {\r\n\t\t\tvar y = Math.round((1 - THIS.channels.a) * (THIS.height - 1));\r\n\t\t\tjsc.picker.asldPtrOB.style.top = (y - (2 * THIS.pointerBorderWidth + THIS.pointerThickness) - Math.floor(jsc.pub.sliderInnerSpace / 2)) + 'px';\r\n\t\t}\r\n\r\n\r\n\t\tfunction isPickerOwner () {\r\n\t\t\treturn jsc.picker && jsc.picker.owner === THIS;\r\n\t\t}\r\n\r\n\r\n\t\tfunction onValueKeyDown (ev) {\r\n\t\t\tif (jsc.eventKey(ev) === 'Enter') {\r\n\t\t\t\tif (THIS.valueElement) {\r\n\t\t\t\t\tTHIS.processValueInput(THIS.valueElement.value);\r\n\t\t\t\t}\r\n\t\t\t\tTHIS.tryHide();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tfunction onAlphaKeyDown (ev) {\r\n\t\t\tif (jsc.eventKey(ev) === 'Enter') {\r\n\t\t\t\tif (THIS.alphaElement) {\r\n\t\t\t\t\tTHIS.processAlphaInput(THIS.alphaElement.value);\r\n\t\t\t\t}\r\n\t\t\t\tTHIS.tryHide();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tfunction onValueChange (ev) {\r\n\t\t\tif (jsc.getData(ev, 'internal')) {\r\n\t\t\t\treturn; // skip if the event was internally triggered by jscolor\r\n\t\t\t}\r\n\r\n\t\t\tvar oldVal = THIS.valueElement.value;\r\n\r\n\t\t\tTHIS.processValueInput(THIS.valueElement.value); // this might change the value\r\n\r\n\t\t\tjsc.triggerCallback(THIS, 'onChange');\r\n\r\n\t\t\tif (THIS.valueElement.value !== oldVal) {\r\n\t\t\t\t// value was additionally changed -> let's trigger the change event again, even though it was natively dispatched\r\n\t\t\t\tjsc.triggerInputEvent(THIS.valueElement, 'change', true, true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tfunction onAlphaChange (ev) {\r\n\t\t\tif (jsc.getData(ev, 'internal')) {\r\n\t\t\t\treturn; // skip if the event was internally triggered by jscolor\r\n\t\t\t}\r\n\r\n\t\t\tvar oldVal = THIS.alphaElement.value;\r\n\r\n\t\t\tTHIS.processAlphaInput(THIS.alphaElement.value); // this might change the value\r\n\r\n\t\t\tjsc.triggerCallback(THIS, 'onChange');\r\n\r\n\t\t\t// triggering valueElement's onChange (because changing alpha changes the entire color, e.g. with rgba format)\r\n\t\t\tjsc.triggerInputEvent(THIS.valueElement, 'change', true, true);\r\n\r\n\t\t\tif (THIS.alphaElement.value !== oldVal) {\r\n\t\t\t\t// value was additionally changed -> let's trigger the change event again, even though it was natively dispatched\r\n\t\t\t\tjsc.triggerInputEvent(THIS.alphaElement, 'change', true, true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tfunction onValueInput (ev) {\r\n\t\t\tif (jsc.getData(ev, 'internal')) {\r\n\t\t\t\treturn; // skip if the event was internally triggered by jscolor\r\n\t\t\t}\r\n\r\n\t\t\tif (THIS.valueElement) {\r\n\t\t\t\tTHIS.fromString(THIS.valueElement.value, jsc.flags.leaveValue);\r\n\t\t\t}\r\n\r\n\t\t\tjsc.triggerCallback(THIS, 'onInput');\r\n\r\n\t\t\t// triggering valueElement's onInput\r\n\t\t\t// (not needed, it was dispatched normally by the browser)\r\n\t\t}\r\n\r\n\r\n\t\tfunction onAlphaInput (ev) {\r\n\t\t\tif (jsc.getData(ev, 'internal')) {\r\n\t\t\t\treturn; // skip if the event was internally triggered by jscolor\r\n\t\t\t}\r\n\r\n\t\t\tif (THIS.alphaElement) {\r\n\t\t\t\tTHIS.fromHSVA(null, null, null, parseFloat(THIS.alphaElement.value), jsc.flags.leaveAlpha);\r\n\t\t\t}\r\n\r\n\t\t\tjsc.triggerCallback(THIS, 'onInput');\r\n\r\n\t\t\t// triggering valueElement's onInput (because changing alpha changes the entire color, e.g. with rgba format)\r\n\t\t\tjsc.triggerInputEvent(THIS.valueElement, 'input', true, true);\r\n\t\t}\r\n\r\n\r\n\t\t// let's process the DEPRECATED 'options' property (this will be later removed)\r\n\t\tif (jsc.pub.options) {\r\n\t\t\t// let's set custom default options, if specified\r\n\t\t\tfor (var opt in jsc.pub.options) {\r\n\t\t\t\tif (jsc.pub.options.hasOwnProperty(opt)) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tsetOption(opt, jsc.pub.options[opt]);\r\n\t\t\t\t\t} catch (e) {\r\n\t\t\t\t\t\tconsole.warn(e);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\t// let's apply configuration presets\r\n\t\t//\r\n\t\tvar presetsArr = [];\r\n\r\n\t\tif (opts.preset) {\r\n\t\t\tif (typeof opts.preset === 'string') {\r\n\t\t\t\tpresetsArr = opts.preset.split(/\\s+/);\r\n\t\t\t} else if (Array.isArray(opts.preset)) {\r\n\t\t\t\tpresetsArr = opts.preset.slice(); // slice() to clone\r\n\t\t\t} else {\r\n\t\t\t\tconsole.warn('Unrecognized preset value');\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// always use the 'default' preset. If it's not listed, append it to the end.\r\n\t\tif (presetsArr.indexOf('default') === -1) {\r\n\t\t\tpresetsArr.push('default');\r\n\t\t}\r\n\r\n\t\t// let's apply the presets in reverse order, so that should there be any overlapping options,\r\n\t\t// the formerly listed preset will override the latter\r\n\t\tfor (var i = presetsArr.length - 1; i >= 0; i -= 1) {\r\n\t\t\tvar pres = presetsArr[i];\r\n\t\t\tif (!pres) {\r\n\t\t\t\tcontinue; // preset is empty string\r\n\t\t\t}\r\n\t\t\tif (!jsc.pub.presets.hasOwnProperty(pres)) {\r\n\t\t\t\tconsole.warn('Unknown preset: %s', pres);\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tfor (var opt in jsc.pub.presets[pres]) {\r\n\t\t\t\tif (jsc.pub.presets[pres].hasOwnProperty(opt)) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tsetOption(opt, jsc.pub.presets[pres][opt]);\r\n\t\t\t\t\t} catch (e) {\r\n\t\t\t\t\t\tconsole.warn(e);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\t// let's set specific options for this color picker\r\n\t\tvar nonProperties = [\r\n\t\t\t// these options won't be set as instance properties\r\n\t\t\t'preset',\r\n\t\t];\r\n\t\tfor (var opt in opts) {\r\n\t\t\tif (opts.hasOwnProperty(opt)) {\r\n\t\t\t\tif (nonProperties.indexOf(opt) === -1) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tsetOption(opt, opts[opt]);\r\n\t\t\t\t\t} catch (e) {\r\n\t\t\t\t\t\tconsole.warn(e);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\t//\r\n\t\t// Install the color picker on chosen element(s)\r\n\t\t//\r\n\r\n\r\n\t\t// Determine picker's container element\r\n\t\tif (this.container === undefined) {\r\n\t\t\tthis.container = window.document.body; // default container is BODY element\r\n\r\n\t\t} else { // explicitly set to custom element\r\n\t\t\tthis.container = jsc.node(this.container);\r\n\t\t}\r\n\r\n\t\tif (!this.container) {\r\n\t\t\tthrow new Error('Cannot instantiate color picker without a container element');\r\n\t\t}\r\n\r\n\r\n\t\t// Fetch the target element\r\n\t\tthis.targetElement = jsc.node(targetElement);\r\n\r\n\t\tif (!this.targetElement) {\r\n\t\t\t// temporarily customized error message to help with migrating from versions prior to 2.2\r\n\t\t\tif (typeof targetElement === 'string' && /^[a-zA-Z][\\w:.-]*$/.test(targetElement)) {\r\n\t\t\t\t// targetElement looks like valid ID\r\n\t\t\t\tvar possiblyId = targetElement;\r\n\t\t\t\tthrow new Error('If \\'' + possiblyId + '\\' is supposed to be an ID, please use \\'#' + possiblyId + '\\' or any valid CSS selector.');\r\n\t\t\t}\r\n\r\n\t\t\tthrow new Error('Cannot instantiate color picker without a target element');\r\n\t\t}\r\n\r\n\t\tif (this.targetElement.jscolor && this.targetElement.jscolor instanceof jsc.pub) {\r\n\t\t\tthrow new Error('Color picker already installed on this element');\r\n\t\t}\r\n\r\n\r\n\t\t// link this instance with the target element\r\n\t\tthis.targetElement.jscolor = this;\r\n\t\tjsc.addClass(this.targetElement, jsc.pub.className);\r\n\r\n\t\t// register this instance\r\n\t\tjsc.instances.push(this);\r\n\r\n\r\n\t\t// if target is BUTTON\r\n\t\tif (jsc.isButton(this.targetElement)) {\r\n\r\n\t\t\tif (this.targetElement.type.toLowerCase() !== 'button') {\r\n\t\t\t\t// on buttons, always force type to be 'button', e.g. in situations the target