(()=>{"use strict";const e={FormatTime:function(e,t){if(e===1/0)return e;e=Math.ceil(e);const i=Math.floor(e/31557600),o=Math.floor(e%31557600/86400),a=Math.floor(e%86400/3600),n=Math.floor(e%3600/60),s=Math.floor(e%60);let r="";if(CM.Options.TimeFormat){if(e>315576e4)return"XX:XX:XX:XX:XX";r+=(i<10?"0":"")+i+":",r+=(o<10?"0":"")+o+":",r+=(a<10?"0":"")+a+":",r+=(n<10?"0":"")+n+":",r+=(s<10?"0":"")+s}else{if(e>7776e5)return t?"Over 9000 days!":">9000d";r+=i>0?i+(t?1===i?" year":" years":"y")+", ":"",r+=o>0?o+(t?1===o?" day":" days":"d")+", ":"",(r.length>0||a>0)&&(r+=a+(t?1===a?" hour":" hours":"h")+", "),(r.length>0||n>0)&&(r+=n+(t?1===n?" minute":" minutes":"m")+", "),r+=s+(t?1===s?" second":" seconds":"s")}return r}};CM.Disp=e,CM.Disp.GetWrinkConfigBank=function(){return 1===CM.Options.CalcWrink?CM.Cache.WrinklersTotal:2===CM.Options.CalcWrink?CM.Cache.WrinklersFattest[0]:0},CM.Disp.PopAllNormalWrinklers=function(){for(const e of Object.keys(Game.wrinklers))Game.wrinklers[e].sucked>0&&0===Game.wrinklers[e].type&&(Game.wrinklers[e].hp=0)},CM.Disp.GetCPS=function(){return CM.Options.CPSMode?CM.Cache.AvgCPS:0===CM.Options.CalcWrink?Game.cookiesPs*(1-Game.cpsSucked):1===CM.Options.CalcWrink?Game.cookiesPs*(CM.Cache.CurrWrinklerCPSMult+(1-.05*CM.Cache.CurrWrinklerCount)):2===CM.Options.CalcWrink&&1===Game.wrinklers[CM.Cache.WrinklersFattest[1]].type?Game.cookiesPs*(3*CM.Cache.CurrWrinklerCPSMult/CM.Cache.CurrWrinklerCount+(1-.05*CM.Cache.CurrWrinklerCount)):Game.cookiesPs*(CM.Cache.CurrWrinklerCPSMult/CM.Cache.CurrWrinklerCount+(1-.05*CM.Cache.CurrWrinklerCount))},CM.Disp.CalculateGrimoireRefillTime=function(e,t,i){let o=0;for(;e300?CM.Disp.colorRed:e>60?CM.Disp.colorOrange:CM.Disp.colorYellow),{text:i,color:t}},CM.Disp.Beautify=function(e,t,i){const o=CM.Options.ScaleDecimals+1;if(e===1/0)return"Infinity";if(void 0===e)return"0";if(0===CM.Options.Scale)return CM.Backup.Beautify(e,t);if(Number.isFinite(e)){let a="";if(0===e)return e.toString();if(e>.001&&e=.01&&e=.01&&e=.01&&e=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)*e/Game.shimmerTypes.golden.maxTime)}px`,CM.Options.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),i++),"christmas"===Game.season&&0===Game.shimmerTypes.reindeer.spawned?(CM.Disp.TimerBars.CMTimerBarRen.style.display="",l("CMTimerBarRenMinBar").style.width=`${Math.round(Math.max(0,Game.shimmerTypes.reindeer.minTime-Game.shimmerTypes.reindeer.time)*e/Game.shimmerTypes.reindeer.maxTime)}px`,CM.Options.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)*e/Game.shimmerTypes.reindeer.maxTime)}px`,CM.Options.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),i++):CM.Disp.TimerBars.CMTimerBarRen.style.display="none";for(const e of Object.keys(CM.Disp.BuffTimerBars))CM.Disp.BuffTimerBars[e].remove();CM.Disp.BuffTimerBars={};for(const e of Object.keys(Game.buffs))if(Game.buffs[e]){const o=CM.Disp.TimerBarCreateBar(Game.buffs[e].name,Game.buffs[e].name,[{id:`${Game.buffs[e].name}Bar`}]);o.style.display="";let a="";a=void 0!==CM.Disp.buffColors[Game.buffs[e].name]?CM.Disp.buffColors[Game.buffs[e].name]:CM.Disp.colorPurple,o.lastChild.children[1].className=CM.Disp.colorBackPre+a,o.lastChild.children[1].style.color="black",2===CM.Options.TimerBarOverlay?o.lastChild.children[1].textContent=`${Math.round(Game.buffs[e].time/Game.buffs[e].maxTime*100)}%`:o.lastChild.children[1].textContent="",o.lastChild.children[1].style.width=`${Math.round(Game.buffs[e].time*(t-8*Math.ceil(Game.buffs[e].time/Game.fps).toString().length)/Game.buffs[e].maxTime)}px`,o.lastChild.children[2].textContent=Math.ceil(Game.buffs[e].time/Game.fps),i++,CM.Disp.BuffTimerBars[Game.buffs[e].name]=o}for(const e of Object.keys(CM.Disp.BuffTimerBars))CM.Disp.TimerBar.appendChild(CM.Disp.BuffTimerBars[e]);0!==i&&(CM.Disp.TimerBar.style.height=12*i+2+"px"),CM.Disp.LastNumberOfTimers!==i&&(CM.Disp.LastNumberOfTimers=i,CM.Disp.UpdateBotTimerBarPosition())}},CM.Disp.ToggleTimerBar=function(){1===CM.Options.TimerBar?CM.Disp.TimerBar.style.display="":CM.Disp.TimerBar.style.display="none",CM.Disp.UpdateBotTimerBarPosition()},CM.Disp.ToggleTimerBarPos=function(){0===CM.Options.TimerBarPos?(CM.Disp.TimerBar.style.width="30%",CM.Disp.TimerBar.style.bottom="",l("game").insertBefore(CM.Disp.TimerBar,l("sectionLeft"))):(CM.Disp.TimerBar.style.width="100%",CM.Disp.TimerBar.style.bottom="0px",l("wrapper").appendChild(CM.Disp.TimerBar)),CM.Disp.UpdateBotTimerBarPosition()},CM.Disp.UpdateBotTimerBarPosition=function(){1===CM.Options.BotBar&&1===CM.Options.TimerBar&&1===CM.Options.TimerBarPos?(CM.Disp.BotBar.style.bottom=CM.Disp.TimerBar.style.height,l("game").style.bottom=`${Number(CM.Disp.TimerBar.style.height.replace("px",""))+70}px`):1===CM.Options.BotBar?(CM.Disp.BotBar.style.bottom="0px",l("game").style.bottom="70px"):1===CM.Options.TimerBar&&1===CM.Options.TimerBarPos?l("game").style.bottom=CM.Disp.TimerBar.style.height:l("game").style.bottom="0px",1===CM.Options.TimerBar&&0===CM.Options.TimerBarPos?l("sectionLeft").style.top=CM.Disp.TimerBar.style.height:l("sectionLeft").style.top="",CM.Disp.UpdateBackground()},CM.Disp.UpdateBuildings=function(){let e=`Objects${Game.buyBulk}`;if(1===Game.buyMode?CM.Disp.LastTargetBuildings=e:e=CM.Disp.LastTargetBuildings,1===Game.buyMode)if(1===CM.Options.BuildColor)for(const t of Object.keys(CM.Cache[e]))l(`productPrice${Game.Objects[t].id}`).style.color=CM.Options.Colors[CM.Cache[e][t].color];else for(const e of Object.keys(Game.Objects))l(`productPrice${Game.Objects[e].id}`).style.removeProperty("color");else if(-1===Game.buyMode)for(const e of Object.keys(CM.Cache.Objects1)){const t=Game.Objects[e];l(`productPrice${t.id}`).style.color="",l(`productPrice${t.id}`).innerHTML=Beautify(CM.Sim.BuildingSell(t,t.basePrice,t.amount,t.free,Game.buyBulk,1))}if(1===Game.buyMode&&CM.Options.SortBuildings){const t=Object.keys(CM.Cache[e]).map((t=>{const i=CM.Cache[e][t];return i.name=t,i.id=Game.Objects[t].id,i}));t.sort((function(e,t){return CM.Disp.colors.indexOf(e.color)>CM.Disp.colors.indexOf(t.color)?1:CM.Disp.colors.indexOf(e.color){const t=CM.Cache.Objects1[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,i=0,o=0,a=0,n=0,s=0;for(const r of Object.keys(Game.UpgradesInStore)){const p=Game.UpgradesInStore[r];let C=!1;for(let e=0;eCM.Disp.colors.indexOf(t.color)?1:CM.Disp.colors.indexOf(e.color)e.price-t.price));const t=function(e,t){return e.findIndex((e=>e.name===t.name))};for(let i=0;i0?CM.Cache.spawnedGoldenShimmer.wrath?CM.Disp.Favicon.href="https://aktanusa.github.io/CookieMonster/favicon/wrathCookie.ico":CM.Disp.Favicon.href="https://aktanusa.github.io/CookieMonster/favicon/goldenCookie.ico":CM.Disp.Favicon.href="https://orteil.dashnet.org/cookieclicker/favicon.ico"},CM.Disp.UpdateTitle=function(){if(Game.OnAscend||0===CM.Options.Title)document.title=CM.Disp.Title;else if(1===CM.Options.Title){let e,t,i,o=!1,a=!1;e=CM.Cache.spawnedGoldenShimmer?CM.Cache.spawnedGoldenShimmer.wrath?`[W${Math.ceil(CM.Cache.spawnedGoldenShimmer.life/Game.fps)}]`:`[G${Math.ceil(CM.Cache.spawnedGoldenShimmer.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)}]`,CM.Main.lastTickerFortuneState&&(o=!0,t="[F]"),"christmas"===Game.season&&(a=!0,i=CM.Main.lastSeasonPopupState?`[R${Math.ceil(CM.Cache.seasonPopShimmer.life/Game.fps)}]`:`[${Number(l("CMTimerBarRenMinBar").textContent)<0?"!":""}${Math.ceil((Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.time)/Game.fps)}]`);let n=CM.Disp.Title;"["===n.charAt(0)&&(n=n.substring(n.lastIndexOf("]")+1)),document.title=`${e+(o?t:"")+(a?i:"")} ${n}`}else if(2===CM.Options.Title){let e="",t=!1;CM.Cache.spawnedGoldenShimmer&&(t=!0,CM.Cache.spawnedGoldenShimmer.wrath?e+=`[W${Math.ceil(CM.Cache.spawnedGoldenShimmer.life/Game.fps)}]`:e+=`[G${Math.ceil(CM.Cache.spawnedGoldenShimmer.life/Game.fps)}]`),CM.Main.lastTickerFortuneState&&(t=!0,e+="[F]"),"christmas"===Game.season&&CM.Main.lastSeasonPopupState&&(e+=`[R${Math.ceil(CM.Cache.seasonPopShimmer.life/Game.fps)}]`,t=!0),t&&(e+=" - ");let i="Cookie Clicker";"fools"===Game.season&&(i="Cookie Baker"),e+=i,document.title=e}},CM.Disp.CreateGCTimer=function(e){const t=document.createElement("div");t.id=`GCTimer${e.id}`,t.style.width="96px",t.style.height="96px",t.style.position="absolute",t.style.zIndex="10000000001",t.style.textAlign="center",t.style.lineHeight="96px",t.style.fontFamily='"Kavoon", Georgia, serif',t.style.fontSize="35px",t.style.cursor="pointer",t.style.display="block",0===CM.Options.GCTimer&&(t.style.display="none"),t.style.left=e.l.style.left,t.style.top=e.l.style.top,t.onclick=function(){e.pop()},t.onmouseover=function(){e.l.style.filter="brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))",e.l.style.webkitFilter="brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))"},t.onmouseout=function(){e.l.style.filter="",e.l.style.webkitFilter=""},CM.Disp.GCTimers[e.id]=t,l("shimmers").appendChild(t)},CM.Disp.ToggleGCTimer=function(){if(1===CM.Options.GCTimer)for(const e of Object.keys(CM.Disp.GCTimers))CM.Disp.GCTimers[e].style.display="block",CM.Disp.GCTimers[e].style.left=CM.Cache.goldenShimmersByID[e].l.style.left,CM.Disp.GCTimers[e].style.top=CM.Cache.goldenShimmersByID[e].l.style.top;else for(const e of Object.keys(CM.Disp.GCTimers))CM.Disp.GCTimers[e].style.display="none"},CM.Disp.CreateSimpleTooltip=function(e,t,i){CM.Disp[e]=document.createElement("div");const o=document.createElement("div");o.style.minWidth=i,o.style.marginBottom="4px";const a=document.createElement("div");a.style.textAlign="left",a.textContent=t,o.appendChild(a),CM.Disp[e].appendChild(o)},CM.Disp.ReplaceTooltipUpgrade=function(){CM.Disp.TooltipUpgradeBackup=[];for(const e of Object.keys(Game.UpgradesInStore))null!==l(`upgrade${e}`).onmouseover&&(CM.Disp.TooltipUpgradeBackup[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 CM.Disp.Tooltip("u",`${e}`)}),"store"),Game.tooltip.wobble())})},CM.Disp.Tooltip=function(e,t){if("b"===e){if(l("tooltip").innerHTML=Game.Objects[t].tooltip(),1===CM.Options.TooltipAmor){const e=CM.Sim.BuildingGetPrice(Game.Objects[t],Game.Objects[t].basePrice,0,Game.Objects[t].free,Game.Objects[t].amount),i=e-Game.Objects[t].totalCookies;i>0&&(l("tooltip").innerHTML=l("tooltip").innerHTML.split("so far").join(`so far
${Beautify(i)} ${1===Math.floor(i)?"cookie":"cookies"} left to amortize (${CM.Disp.GetTimeColor((e-Game.Objects[t].totalCookies)/(Game.Objects[t].storedTotalCps*Game.globalCpsMult)).text})`))}-1===Game.buyMode&&(l("tooltip").innerHTML=l("tooltip").innerHTML.split(Beautify(Game.Objects[t].bulkPrice)).join(Beautify(CM.Sim.BuildingSell(Game.Objects[t],Game.Objects[t].basePrice,Game.Objects[t].amount,Game.Objects[t].free,Game.buyBulk,1))))}else if("u"===e){if(!Game.UpgradesInStore[t])return"";l("tooltip").innerHTML=Game.crateTooltip(Game.UpgradesInStore[t],"store")}else"s"===e?l("tooltip").innerHTML=Game.lumpTooltip():"g"===e?l("tooltip").innerHTML=Game.Objects["Wizard tower"].minigame.spellTooltip(t)():"p"===e?l("tooltip").innerHTML=Game.ObjectsById[2].minigame.tileTooltip(t[0],t[1])():"ha"===e&&(l("tooltip").innerHTML=Game.ObjectsById[2].minigame.toolTooltip(1)());if("b"===e&&1===Game.buyMode||"u"===e||"s"===e||"g"===e||"p"===e&&!Game.keys[16]||"ha"===e){const e=document.createElement("div");e.id="CMTooltipArea",l("tooltip").appendChild(e)}return CM.Disp.tooltipType=e,CM.Disp.tooltipName=t,CM.Disp.UpdateTooltip(),l("tooltip").innerHTML},CM.Disp.TooltipCreateTooltipBox=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=CM.Disp.colorTextPre+CM.Disp.colorGray,e},CM.Disp.TooltipCreateHeader=function(e){const t=document.createElement("div");return t.style.fontWeight="bold",t.id=`${e}Title`,t.className=CM.Disp.colorTextPre+CM.Disp.colorBlue,t.textContent=e,t},CM.Disp.TooltipCreateCalculationSection=function(e){e.appendChild(CM.Disp.TooltipCreateHeader("Bonus Income"));const t=document.createElement("div");t.style.marginBottom="4px",t.style.color="white",t.id="CMTooltipIncome",e.appendChild(t),e.appendChild(CM.Disp.TooltipCreateHeader("Bonus Cookies per Click")),e.lastChild.style.display="none";const i=document.createElement("div");i.style.marginBottom="4px",i.style.color="white",i.style.display="none",i.id="CMTooltipCookiePerClick",e.appendChild(i),e.appendChild(CM.Disp.TooltipCreateHeader("Payback Period"));const o=document.createElement("div");o.style.marginBottom="4px",o.id="CMTooltipPP",e.appendChild(o),e.appendChild(CM.Disp.TooltipCreateHeader("Time Left"));const a=document.createElement("div");if(a.id="CMTooltipTime",e.appendChild(a),"b"===CM.Disp.tooltipType){e.appendChild(CM.Disp.TooltipCreateHeader("Production left till next achievement")),e.lastChild.id="CMTooltipProductionHeader";const t=document.createElement("div");t.id="CMTooltipProduction",e.appendChild(t)}},CM.Disp.TooltipCreateWarningSection=function(){CM.Disp.TooltipWarn=document.createElement("div"),CM.Disp.TooltipWarn.style.position="absolute",CM.Disp.TooltipWarn.style.display="block",CM.Disp.TooltipWarn.style.left="auto",CM.Disp.TooltipWarn.style.bottom="auto",CM.Disp.TooltipWarn.id="CMDispTooltipWarningParent";const e=function(e,t,i,o,a){const n=document.createElement("div");n.id=e,n.style.display="none",n.style.transition="opacity 0.1s ease-out",n.className=CM.Disp.colorBorderPre+t,n.style.padding="2px",n.style.background="#000 url(img/darkNoise.png)";const s=document.createElement("div");n.appendChild(s);const r=document.createElement("span");r.className=CM.Disp.colorTextPre+t,r.style.fontWeight="bold",r.textContent=i,s.appendChild(r),s.appendChild(document.createTextNode(o));const l=document.createElement("div");n.appendChild(l);const p=document.createElement("span");return p.id=a,l.appendChild(document.createTextNode("Deficit: ")),l.appendChild(p),n};return CM.Disp.TooltipWarn.appendChild(e("CMDispTooltipWarnLucky",CM.Disp.colorRed,"Warning: ",'Purchase of this item will put you under the number of Cookies required for "Lucky!"',"CMDispTooltipWarnLuckyText")),CM.Disp.TooltipWarn.firstChild.style.marginBottom="4px",CM.Disp.TooltipWarn.appendChild(e("CMDispTooltipWarnLuckyFrenzy",CM.Disp.colorYellow,"Warning: ",'Purchase of this item will put you under the number of Cookies required for "Lucky!" (Frenzy)',"CMDispTooltipWarnLuckyFrenzyText")),CM.Disp.TooltipWarn.lastChild.style.marginBottom="4px",CM.Disp.TooltipWarn.appendChild(e("CMDispTooltipWarnConjure",CM.Disp.colorPurple,"Warning: ",'Purchase of this item will put you under the number of Cookies required for "Conjure Baked Goods"',"CMDispTooltipWarnConjureText")),CM.Disp.TooltipWarn.lastChild.style.marginBottom="4px",CM.Disp.TooltipWarn.appendChild(e("CMDispTooltipWarnConjureFrenzy",CM.Disp.colorPurple,"Warning: ",'Purchase of this item will put you under the number of Cookies required for "Conjure Baked Goods" (Frenzy)',"CMDispTooltipWarnConjureFrenzyText")),CM.Disp.TooltipWarn.lastChild.style.marginBottom="4px",CM.Disp.TooltipWarn.appendChild(e("CMDispTooltipWarnEdifice",CM.Disp.colorPurple,"Warning: ",'Purchase of this item will put you under the number of Cookies needed for "Spontaneous Edifice" to possibly give you your most expensive building"',"CMDispTooltipWarnEdificeText")),CM.Disp.TooltipWarn.lastChild.style.marginBottom="4px",CM.Disp.TooltipWarn.appendChild(e("CMDispTooltipWarnUser",CM.Disp.colorRed,"Warning: ",`Purchase of this item will put you under the number of Cookies equal to ${CM.Options.ToolWarnUser} seconds of CPS`,"CMDispTooltipWarnUserText")),CM.Disp.TooltipWarn},CM.Disp.UpdateTooltip=function(){if(CM.Sim.CopyData(),"none"!==l("tooltipAnchor").style.display&&l("CMTooltipArea")){l("CMTooltipArea").innerHTML="";const e=CM.Disp.TooltipCreateTooltipBox();l("CMTooltipArea").appendChild(e),"b"===CM.Disp.tooltipType?CM.Disp.UpdateTooltipBuilding():"u"===CM.Disp.tooltipType?CM.Disp.UpdateTooltipUpgrade():"s"===CM.Disp.tooltipType?CM.Disp.UpdateTooltipSugarLump():"g"===CM.Disp.tooltipType?CM.Disp.UpdateTooltipGrimoire():"p"===CM.Disp.tooltipType?CM.Disp.UpdateTooltipGardenPlots():"ha"===CM.Disp.tooltipType&&CM.Disp.UpdateTooltipHarvestAll(),CM.Disp.UpdateTooltipWarnings()}else null===l("CMTooltipArea")&&null!==l("CMDispTooltipWarningParent")&&l("CMDispTooltipWarningParent").remove()},CM.Disp.UpdateTooltipBuilding=function(){if(1===CM.Options.TooltipBuildUpgrade&&1===Game.buyMode){const e=l("CMTooltipBorder");CM.Disp.TooltipCreateCalculationSection(e);let t=`Objects${Game.buyBulk}`;if(1===Game.buyMode?CM.Disp.LastTargetTooltipBuilding=t:t=CM.Disp.LastTargetTooltipBuilding,CM.Disp.TooltipPrice=Game.Objects[CM.Disp.tooltipName].bulkPrice,CM.Disp.TooltipBonusIncome=CM.Cache[t][CM.Disp.tooltipName].bonus,1===CM.Options.TooltipBuildUpgrade&&1===Game.buyMode){l("CMTooltipIncome").textContent=Beautify(CM.Disp.TooltipBonusIncome,2);const e=Math.round(CM.Disp.TooltipBonusIncome/Game.cookiesPs*1e4);Number.isFinite(e)&&0!==e&&(l("CMTooltipIncome").textContent+=` (${e/100}% of income)`),l("CMTooltipBorder").className=CM.Disp.colorTextPre+CM.Cache[t][CM.Disp.tooltipName].color,l("CMTooltipPP").textContent=Beautify(CM.Cache[t][CM.Disp.tooltipName].pp,2),l("CMTooltipPP").className=CM.Disp.colorTextPre+CM.Cache[t][CM.Disp.tooltipName].color;const i=CM.Disp.GetTimeColor((CM.Disp.TooltipPrice-(Game.cookies+CM.Disp.GetWrinkConfigBank()))/CM.Disp.GetCPS());l("CMTooltipTime").textContent=i.text,"Done!"===i.text&&Game.cookiese.plantsById[e.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][0]-1].matureBase,i=e.plantsById[e.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][0]-1].name;l("CMTooltipBorder").appendChild(CM.Disp.TooltipCreateHeader("Reward (Current / Maximum)"));const o=document.createElement("div");o.id="CMTooltipPlantReward",l("CMTooltipBorder").appendChild(o),"Bakeberry"===i?l("CMTooltipPlantReward").textContent=`${t?CM.Disp.Beautify(Math.min(.03*Game.cookies,60*Game.cookiesPs*30)):"0"} / ${CM.Disp.Beautify(60*Game.cookiesPs*30)}`:"Chocoroot"===i||"White chocoroot"===i?l("CMTooltipPlantReward").textContent=`${t?CM.Disp.Beautify(Math.min(.03*Game.cookies,60*Game.cookiesPs*3)):"0"} / ${CM.Disp.Beautify(60*Game.cookiesPs*3)}`:"Queenbeet"===i?l("CMTooltipPlantReward").textContent=`${t?CM.Disp.Beautify(Math.min(.04*Game.cookies,60*Game.cookiesPs*60)):"0"} / ${CM.Disp.Beautify(60*Game.cookiesPs*60)}`:"Duketater"===i?l("CMTooltipPlantReward").textContent=`${t?CM.Disp.Beautify(Math.min(.08*Game.cookies,60*Game.cookiesPs*120)):"0"} / ${CM.Disp.Beautify(60*Game.cookiesPs*120)}`:l("CMTooltipArea").style.display="none"}else l("CMTooltipArea").style.display="none"},CM.Disp.UpdateTooltipHarvestAll=function(){const e=Game.Objects.Farm.minigame;if(CM.Options.TooltipLump){l("CMTooltipBorder").appendChild(CM.Disp.TooltipCreateHeader("Cookies gained from harvesting:"));let t=0,i=0;Game.keys[16]&&Game.keys[17]&&(i=1);for(let o=0;o<6;o++)for(let a=0;a<6;a++)if(e.plot[o][a][0]>=1){const n=e.plot[o][a],s=e.plantsById[n[0]-1],r=s.name;let l=!0;i&&s.immortal&&(l=!1),n[1]0&&e0&&i.selected){if(e=!0,0!==CM.Disp.TooltipWrinklerBeingShown[t]&&void 0!==CM.Disp.TooltipWrinklerBeingShown[t])break;{const e=document.createElement("div"),i=document.createElement("div");i.style.minWidth="120px",i.style.marginBottom="4px";const o=document.createElement("div");o.style.textAlign="center",o.id="CMTooltipWrinkler",i.appendChild(o),e.appendChild(i),Game.tooltip.draw(this,escape(e.innerHTML)),CM.Disp.TooltipWrinkler=t,CM.Disp.TooltipWrinklerBeingShown[t]=1}}else CM.Disp.TooltipWrinklerBeingShown[t]=0}e||Game.tooltip.hide()}},CM.Disp.UpdateWrinklerTooltip=function(){if(1===CM.Options.TooltipWrink&&null!==l("CMTooltipWrinkler")){let e=Game.wrinklers[CM.Disp.TooltipWrinkler].sucked,t=1.1;if(Game.Has("Sacrilegious corruption")&&(t*=1.05),1===Game.wrinklers[CM.Disp.TooltipWrinkler].type&&(t*=3),e*=t,Game.Has("Wrinklerspawn")&&(e*=1.05),CM.Sim.Objects.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=Beautify(e)}},CM.Disp.AddAuraInfo=function(e){if(1===CM.Options.DragonAuraInfo){const[t,i]=CM.Sim.CalculateChangeAura(e),o=CM.Disp.FormatTime(i/(t+Game.cookiesPs)),a=CM.Disp.Beautify(t/Game.cookiesPs);l("dragonAuraInfo").style.minHeight="60px",l("dragonAuraInfo").style.margin="8px",l("dragonAuraInfo").appendChild(document.createElement("div")).className="line";const n=document.createElement("div");n.style.minWidth="200px",n.style.textAlign="center",n.textContent=`Picking this aura will change CPS by ${CM.Disp.Beautify(t)} (${a}% of current CPS).`,l("dragonAuraInfo").appendChild(n);const s=document.createElement("div");s.style.minWidth="200px",s.style.textAlign="center",s.textContent=`It will take ${o} to recover the cost.`,l("dragonAuraInfo").appendChild(s)}},CM.Disp.AddDragonLevelUpTooltip=function(){if(null!==(l("specialPopup").className.match(/onScreen/)&&l("specialPopup").children[0].style.background.match(/dragon/)))for(let e=0;e${CM.Cache.CostDragonUpgrade}`,"this"),Game.tooltip.wobble()},l("specialPopup").children[e].onmouseout=function(){Game.tooltip.shouldHide=1})},CM.Disp.AddMenu=function(){const e=document.createElement("div");e.className="title","prefs"===Game.onMenu?(e.textContent="Cookie Monster Settings",CM.Disp.AddMenuPref(e)):"stats"===Game.onMenu?CM.Options.Stats&&(e.textContent="Cookie Monster Statistics",CM.Disp.AddMenuStats(e)):"log"===Game.onMenu&&(e.textContent="Cookie Monster ",CM.Disp.AddMenuInfo(e))},CM.Disp.RefreshMenu=function(){CM.Options.UpStats&&"stats"===Game.onMenu&&(Game.drawT-1)%(5*Game.fps)!=0&&(Game.drawT-1)%Game.fps==0&&Game.UpdateMenu()},CM.Disp.AddMenuPref=function(e){const t=document.createDocumentFragment();t.appendChild(e);for(const e of Object.keys(CM.Data.ConfigGroups)){const i=CM.Disp.CreatePrefHeader(e,CM.Data.ConfigGroups[e]);if(t.appendChild(i),CM.Options.Header[e])if("Notification"===e)for(const e of Object.keys(CM.Data.ConfigGroupsNotification)){const i=CM.Disp.CreatePrefHeader(e,CM.Data.ConfigGroupsNotification[e]);if(i.style.fontSize="15px",i.style.opacity="0.5",t.appendChild(i),CM.Options.Header[e])for(const i in CM.Data.Config)CM.Data.Config[i].group===e&&t.appendChild(CM.Disp.CreatePrefOption(i))}else for(const i of Object.keys(CM.Data.Config))CM.Data.Config[i].group===e&&t.appendChild(CM.Disp.CreatePrefOption(i))}const i=document.createElement("div");i.className="listing";const o=document.createElement("a");o.className="option",o.onclick=function(){CM.Config.RestoreDefault()},o.textContent="Restore Default",i.appendChild(o),t.appendChild(i),l("menu").childNodes[2].insertBefore(t,l("menu").childNodes[2].childNodes[l("menu").childNodes[2].childNodes.length-1])},CM.Disp.CreatePrefHeader=function(e,t){const i=document.createElement("div");i.className="title",i.style.opacity="0.7",i.style.fontSize="17px",i.appendChild(document.createTextNode(`${t} `));const o=document.createElement("span");return o.style.cursor="pointer",o.style.display="inline-block",o.style.height="14px",o.style.width="14px",o.style.borderRadius="7px",o.style.textAlign="center",o.style.backgroundColor="#C0C0C0",o.style.color="black",o.style.fontSize="13px",o.style.verticalAlign="middle",o.textContent=CM.Options.Header[e]?"-":"+",o.onclick=function(){CM.Config.ToggleHeader(e),Game.UpdateMenu()},i.appendChild(o),i},CM.Disp.CreatePrefOption=function(e){const t=document.createElement("div");if(t.className="listing","bool"===CM.Data.Config[e].type){const i=document.createElement("a");CM.Data.Config[e].toggle&&0===CM.Options[e]?i.className="option off":i.className="option",i.id=CM.Config.ConfigPrefix+e,i.onclick=function(){CM.Config.ToggleConfig(e)},i.textContent=CM.Data.Config[e].label[CM.Options[e]],t.appendChild(i);const o=document.createElement("label");return o.textContent=CM.Data.Config[e].desc,t.appendChild(o),t}if("vol"===CM.Data.Config[e].type){const i=document.createElement("div");i.className="sliderBox";const o=document.createElement("div");o.style.float="left",o.innerHTML=CM.Data.Config[e].desc,i.appendChild(o);const a=document.createElement("div");a.id=`slider${e}right`,a.style.float="right",a.innerHTML=`${CM.Options[e]}%`,i.appendChild(a);const n=document.createElement("input");return n.className="slider",n.id=`slider${e}`,n.style.clear="both",n.type="range",n.min="0",n.max="100",n.step="1",n.value=CM.Options[e],n.oninput=function(){CM.Config.ToggleConfigVolume(e)},n.onchange=function(){CM.Config.ToggleConfigVolume(e)},i.appendChild(n),t.appendChild(i),t}if("url"===CM.Data.Config[e].type){const i=document.createElement("span");i.className="option",i.textContent=`${CM.Data.Config[e].label} `,t.appendChild(i);const o=document.createElement("input");o.id=CM.Config.ConfigPrefix+e,o.className="option",o.type="text",o.readOnly=!0,o.setAttribute("value",CM.Options[e]),o.style.width="300px",t.appendChild(o),t.appendChild(document.createTextNode(" "));const a=document.createElement("input");a.id=`${CM.Config.ConfigPrefix+e}Prompt`,a.className="option",a.type="text",a.setAttribute("value",CM.Options[e]);const n=document.createElement("a");n.className="option",n.onclick=function(){Game.Prompt(a.outerHTML,[["Save",`CM.Options['${e}'] = l(CM.Config.ConfigPrefix + '${e}' + 'Prompt').value; CM.Config.SaveConfig(); Game.ClosePrompt(); Game.UpdateMenu();`],"Cancel"])},n.textContent="Edit",t.appendChild(n);const s=document.createElement("label");return s.textContent=CM.Data.Config[e].desc,t.appendChild(s),t}if("color"===CM.Data.Config[e].type){t.className="";for(let e=0;ethis.max&&console.log("TEST"),CM.Options[e]=this.value,CM.Config.SaveConfig(),CM.Disp.RefreshScale()},t.appendChild(o),t.appendChild(document.createTextNode(" "));const a=document.createElement("label");return a.textContent=CM.Data.Config[e].desc,t.appendChild(a),t}return t},CM.Disp.ToggleDetailedTime=function(){1===CM.Options.DetailedTime?Game.sayTime=CM.Disp.sayTime:Game.sayTime=CM.Backup.sayTime},CM.Disp.RefreshScale=function(){BeautifyAll(),Game.RefreshStore(),Game.RebuildUpgrades(),CM.Disp.UpdateBotBar(),CM.Disp.UpdateBuildings(),CM.Disp.UpdateUpgrades()},CM.Disp.UpdateColors=function(){let e="";for(let t=0;t0&&(t.appendChild(CM.Disp.CreateStatsHeader("Wrinklers","Wrink")),CM.Options.Header.Wrink)){const e=document.createDocumentFragment();e.appendChild(document.createTextNode(`${Beautify(CM.Cache.WrinklersTotal)} / ${Beautify(CM.Cache.WrinklersNormal)} `));const i=document.createElement("a");i.textContent="Pop All Normal",i.className="option",i.onclick=function(){CM.Disp.PopAllNormalWrinklers()},e.appendChild(i),t.appendChild(CM.Disp.CreateStatsListing("basic","Rewards of Popping (All/Normal)",e));const o=document.createDocumentFragment();o.appendChild(document.createTextNode(`${Beautify(CM.Cache.WrinklersFattest[0])} `));const a=document.createElement("a");a.textContent="Pop Single Fattest",a.className="option",a.onclick=function(){null!==CM.Cache.WrinklersFattest[1]&&(Game.wrinklers[CM.Cache.WrinklersFattest[1]].hp=0)},o.appendChild(a),t.appendChild(CM.Disp.CreateStatsListing("basic",`Rewards of Popping Single Fattest Non-Shiny Wrinkler (id: ${null!==CM.Cache.WrinklersFattest[1]?CM.Cache.WrinklersFattest[1]:"None"})`,o))}let i=!1;const o=[];for(const e of Object.keys(CM.Data.HalloCookies))Game.Has(CM.Data.HalloCookies[e])||(o.push(CM.Data.HalloCookies[e]),i=!0);const a=[];for(const e of Object.keys(CM.Data.ChristCookies))Game.Has(CM.Data.ChristCookies[e])||(a.push(CM.Data.ChristCookies[e]),i=!0);const n=[];for(const e of Object.keys(CM.Data.ValCookies))Game.Has(CM.Data.ValCookies[e])||(n.push(CM.Data.ValCookies[e]),i=!0);const s=[];for(const e of Object.keys(Game.eggDrops))Game.HasUnlocked(Game.eggDrops[e])||(s.push(Game.eggDrops[e]),i=!0);const r=[];for(const e of Object.keys(Game.rareEggDrops))Game.HasUnlocked(Game.rareEggDrops[e])||(r.push(Game.rareEggDrops[e]),i=!0);const p=[];for(const e of Object.keys(CM.Data.PlantDrops))Game.HasUnlocked(CM.Data.PlantDrops[e])||(p.push(CM.Data.PlantDrops[e]),i=!0);const C=Game.HasUnlocked("Chocolate egg")&&!Game.Has("Chocolate egg"),c=Game.Has("Century egg");if(("christmas"===Game.season||i||C||c)&&(t.appendChild(CM.Disp.CreateStatsHeader("Season Specials","Sea")),CM.Options.Header.Sea&&(0!==o.length&&t.appendChild(CM.Disp.CreateStatsListing("basic","Halloween Cookies Left to Buy",CM.Disp.CreateStatsMissDisp(o))),0!==a.length&&t.appendChild(CM.Disp.CreateStatsListing("basic","Christmas Cookies Left to Buy",CM.Disp.CreateStatsMissDisp(a))),0!==n.length&&t.appendChild(CM.Disp.CreateStatsListing("basic","Valentine Cookies Left to Buy",CM.Disp.CreateStatsMissDisp(n))),0!==s.length&&t.appendChild(CM.Disp.CreateStatsListing("basic","Normal Easter Eggs Left to Unlock",CM.Disp.CreateStatsMissDisp(s))),0!==r.length&&t.appendChild(CM.Disp.CreateStatsListing("basic","Rare Easter Eggs Left to Unlock",CM.Disp.CreateStatsMissDisp(r))),0!==p.length&&t.appendChild(CM.Disp.CreateStatsListing("basic","Rare Plant Drops Left to Unlock",CM.Disp.CreateStatsMissDisp(p))),"christmas"===Game.season&&t.appendChild(CM.Disp.CreateStatsListing("basic","Reindeer Reward",document.createTextNode(Beautify(CM.Cache.SeaSpec)))),C&&t.appendChild(CM.Disp.CreateStatsListing("withTooltip","Chocolate Egg Cookies",document.createTextNode(Beautify(CM.Cache.lastChoEgg)),"ChoEggTooltipPlaceholder")),c&&t.appendChild(CM.Disp.CreateStatsListing("basic","Century Egg Multiplier",document.createTextNode(Math.round(1e4*(CM.Cache.CentEgg-1))/100+"%"))))),t.appendChild(CM.Disp.CreateStatsHeader("Miscellaneous","Misc")),CM.Options.Header.Misc){if(t.appendChild(CM.Disp.CreateStatsListing("basic",`Average Cookies Per Second (Past ${CM.Disp.cookieTimes[CM.Options.AvgCPSHist]<60?`${CM.Disp.cookieTimes[CM.Options.AvgCPSHist]} seconds`:CM.Disp.cookieTimes[CM.Options.AvgCPSHist]/60+(3===CM.Options.AvgCPSHist?" minute":" minutes")})`,document.createTextNode(Beautify(CM.Disp.GetCPS(),3)))),t.appendChild(CM.Disp.CreateStatsListing("basic",`Average Cookie Clicks Per Second (Past ${CM.Disp.clickTimes[CM.Options.AvgClicksHist]}${0===CM.Options.AvgClicksHist?" second":" seconds"})`,document.createTextNode(Beautify(CM.Cache.AverageClicks,1)))),Game.Has("Fortune cookies")){const e=[];for(const t of Object.keys(CM.Data.Fortunes))Game.Has(CM.Data.Fortunes[t])||e.push(CM.Data.Fortunes[t]);0!==e.length&&t.appendChild(CM.Disp.CreateStatsListing("basic","Fortune Upgrades Left to Buy",CM.Disp.CreateStatsMissDisp(e)))}if(CM.Options.ShowMissedGC&&t.appendChild(CM.Disp.CreateStatsListing("basic","Missed Golden Cookies",document.createTextNode(Beautify(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),t.appendChild(CM.Disp.CreateStatsListing("basic","Time till autosave",e))}}l("menu").insertBefore(t,l("menu").childNodes[2]),CM.Options.MissingUpgrades&&CM.Disp.AddMissingUpgrades()},CM.Disp.CreateStatsHeader=function(e,t){const i=document.createElement("div");i.className="title",i.style.padding="0px 16px",i.style.opacity="0.7",i.style.fontSize="17px",i.style.fontFamily='"Kavoon", Georgia, serif',i.appendChild(document.createTextNode(`${e} `));const o=document.createElement("span");return o.style.cursor="pointer",o.style.display="inline-block",o.style.height="14px",o.style.width="14px",o.style.borderRadius="7px",o.style.textAlign="center",o.style.backgroundColor="#C0C0C0",o.style.color="black",o.style.fontSize="13px",o.style.verticalAlign="middle",o.textContent=CM.Options.Header[t]?"-":"+",o.onclick=function(){CM.Config.ToggleHeader(t),Game.UpdateMenu()},i.appendChild(o),i},CM.Disp.CreateStatsListing=function(e,t,i,o){const a=document.createElement("div");a.className="listing";const n=document.createElement("b");if(n.textContent=t,a.appendChild(n),"withTooltip"===e){a.className="listing",a.appendChild(document.createTextNode(" "));const e=document.createElement("span");e.onmouseout=function(){Game.tooltip.hide()},e.onmouseover=function(){Game.tooltip.draw(this,escape(CM.Disp[o].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="?",a.appendChild(e)}return a.appendChild(document.createTextNode(": ")),a.appendChild(i),a},CM.Disp.CreateStatsMissDisp=function(e){const t=document.createDocumentFragment();t.appendChild(document.createTextNode(`${e.length} `));const i=document.createElement("span");i.onmouseout=function(){Game.tooltip.hide()};const o=document.createElement("div"),a=document.createElement("div");a.style.minWidth="140px",a.style.marginBottom="4px";const n=document.createElement("div");n.className="name",n.style.marginBottom="4px",n.style.textAlign="center",n.textContent="Missing",a.appendChild(n);for(const t of Object.keys(e)){const i=document.createElement("div");i.style.textAlign="center",i.appendChild(document.createTextNode(e[t])),a.appendChild(i)}return o.appendChild(a),i.onmouseover=function(){Game.tooltip.draw(this,escape(o.innerHTML))},i.style.cursor="default",i.style.display="inline-block",i.style.height="10px",i.style.width="10px",i.style.borderRadius="5px",i.style.textAlign="center",i.style.backgroundColor="#C0C0C0",i.style.color="black",i.style.fontSize="9px",i.style.verticalAlign="bottom",i.textContent="?",t.appendChild(i),t},CM.Disp.CreateStatsLuckySection=function(){const e=Game.auraMult("Dragon's Fortune")?"GoldCookDragonsFortuneTooltipPlaceholder":"GoldCookTooltipPlaceholder",t=document.createElement("div");t.className="CMStatsLuckySection";const i=Game.cookies+CM.Disp.GetWrinkConfigBank()0&&(e.appendChild(CM.Disp.CreateStatsListing("basic","Heavenly Chips To Target Set In Settings (CUR)",document.createTextNode(Beautify(t)))),e.appendChild(CM.Disp.CreateStatsListing("basic","Time To Target (CUR, Current 5 Second Average)",document.createTextNode(CM.Disp.FormatTime(t/CM.Cache.HCPerSecond)))))}const s=CM.Sim.ResetBonus(t),r=document.createDocumentFragment();r.appendChild(document.createTextNode(Beautify(s)));const l=Math.round(s/Game.cookiesPs*1e4);if(isFinite(l)&&0!==l){const e=document.createElement("small");e.textContent=` (${l/100}% of income)`,r.appendChild(e)}e.appendChild(CM.Disp.CreateStatsListing("withTooltip","Reset Bonus Income",r,"ResetTooltipPlaceholder"));const p=Math.floor(Game.HowMuchPrestige(Game.cookiesReset)),C=Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned)),c=C-p;if(!Game.Has("Lucky digit")){let t=7-C%10;t<0&&(t+=10);const i=c+t,o=C+t,a=document.createDocumentFragment();a.appendChild(document.createTextNode(`${o.toLocaleString()} / ${i.toLocaleString()} (+${t})`)),e.appendChild(CM.Disp.CreateStatsListing("basic",'Next "Lucky Digit" (total / reset)',a))}if(!Game.Has("Lucky number")){let t=777-C%1e3;t<0&&(t+=1e3);const i=c+t,o=C+t,a=document.createDocumentFragment();a.appendChild(document.createTextNode(`${o.toLocaleString()} / ${i.toLocaleString()} (+${t})`)),e.appendChild(CM.Disp.CreateStatsListing("basic",'Next "Lucky Number" (total / reset)',a))}if(!Game.Has("Lucky payout")){let t=777777-C%1e6;t<0&&(t+=1e6);const i=c+t,o=C+t,a=document.createDocumentFragment();a.appendChild(document.createTextNode(`${o.toLocaleString()} / ${i.toLocaleString()} (+${t})`)),e.appendChild(CM.Disp.CreateStatsListing("basic",'Next "Lucky Payout" (total / reset)',a))}return e},CM.Disp.AddMissingUpgrades=function(){for(const e of l("menu").children)if(e.children[0])if("Prestige"===e.children[0].innerHTML&&CM.Cache.MissingUpgradesPrestige){const t=CM.Cache.MissingUpgradesPrestige.match(new RegExp("div","g")||0).length/2,i=document.createElement("div");i.id="CMMissingUpgradesPrestigeTitle",i.className="listing";const o=document.createElement("div");o.innerHTML=`Missing Prestige upgrades: ${t}/${Game.PrestigeUpgrades.length} (${Math.floor(t/Game.PrestigeUpgrades.length*100)}%)`,i.appendChild(o),e.appendChild(i);const a=document.createElement("div");a.className="listing crateBox",a.innerHTML=CM.Cache.MissingUpgradesPrestige,e.appendChild(a)}else if("Upgrades"===e.children[0].innerHTML){if(CM.Cache.MissingUpgrades){const t=CM.Cache.MissingUpgrades.match(new RegExp("div","g")||0).length/2,i=document.createElement("div");i.id="CMMissingUpgradesTitle",i.className="listing";const o=document.createElement("div");o.innerHTML=`Missing normal upgrades: ${t}/${Game.UpgradesByPool[""].length+Game.UpgradesByPool.tech.length} (${Math.floor(t/(Game.UpgradesByPool[""].length+Game.UpgradesByPool.tech.length)*100)}%)`,i.appendChild(o),e.insertBefore(i,e.childNodes[3]);const a=document.createElement("div");a.className="listing crateBox",a.innerHTML=CM.Cache.MissingUpgrades,e.insertBefore(a,document.getElementById("CMMissingUpgradesTitle").nextSibling)}if(CM.Cache.MissingUpgradesCookies){const t=CM.Cache.MissingUpgradesCookies.match(new RegExp("div","g")||0).length/2,i=document.createElement("div");i.id="CMMissingUpgradesCookiesTitle",i.className="listing";const o=document.createElement("div");o.innerHTML=`Missing Cookie upgrades: ${t}/${Game.UpgradesByPool.cookie.length} (${Math.floor(t/Game.UpgradesByPool.cookie.length*100)}%)`,i.appendChild(o),e.appendChild(i);const a=document.createElement("div");a.className="listing crateBox",a.innerHTML=CM.Cache.MissingUpgradesCookies,e.appendChild(a)}}},CM.Disp.crateMissing=function(e){let t="crate upgrade missing";"prestige"===e.pool&&(t+=" heavenly");let i=0;Game.prefs.crates||(i=1),i&&(t+=" noFrame");let o=e.icon;e.iconFunction&&(o=e.iconFunction());const a=`function() {return Game.crateTooltip(Game.UpgradesById[${e.id}], 'stats');}`;return`
\n\t
`},CM.Disp.AddMenuInfo=function(e){const t=document.createElement("div");t.className="subsection";const i=document.createElement("span");if(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=CM.Options.Header.InfoTab?"-":"+",i.onclick=function(){CM.Config.ToggleHeader("InfoTab"),Game.UpdateMenu()},e.appendChild(i),t.appendChild(e),CM.Options.Header.InfoTab){const e=document.createElement("div");e.innerHTML=CM.Data.ModDescription,t.appendChild(e);const i=document.createElement("div");i.innerHTML=CM.Data.LatestReleaseNotes,t.appendChild(i)}const o=l("menu").children[1];o.insertBefore(t,o.children[1])},CM.Disp.CreateWrinklerButtons=function(){const e=document.createElement("a");e.id="PopAllNormalWrinklerButton",e.textContent="Pop All Normal",e.className="option",e.onclick=function(){CM.Disp.PopAllNormalWrinklers()},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!==CM.Cache.WrinklersFattest[1]&&(Game.wrinklers[CM.Cache.WrinklersFattest[1]].hp=0)},l("sectionLeftExtra").children[0].append(t)},CM.Disp.UpdateWrinklerButtons=function(){CM.Options.WrinklerButtons?(l("PopAllNormalWrinklerButton").style.display="",l("PopFattestWrinklerButton").style.display=""):(l("PopAllNormalWrinklerButton").style.display="none",l("PopFattestWrinklerButton").style.display="none")},CM.Disp.TooltipText=[["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"]],CM.Disp.colorTextPre="CMText",CM.Disp.colorBackPre="CMBack",CM.Disp.colorBorderPre="CMBorder",CM.Disp.colorBlue="Blue",CM.Disp.colorGreen="Green",CM.Disp.colorYellow="Yellow",CM.Disp.colorOrange="Orange",CM.Disp.colorRed="Red",CM.Disp.colorPurple="Purple",CM.Disp.colorGray="Gray",CM.Disp.colorPink="Pink",CM.Disp.colorBrown="Brown",CM.Disp.colors=[CM.Disp.colorGray,CM.Disp.colorBlue,CM.Disp.colorGreen,CM.Disp.colorYellow,CM.Disp.colorOrange,CM.Disp.colorRed,CM.Disp.colorPurple,CM.Disp.colorPink,CM.Disp.colorBrown],CM.Disp.buffColors={Frenzy:CM.Disp.colorYellow,"Dragon Harvest":CM.Disp.colorBrown,"Elder frenzy":CM.Disp.colorGreen,Clot:CM.Disp.colorRed,"Click frenzy":CM.Disp.colorBlue,Dragonflight:CM.Disp.colorPink},CM.Disp.GCTimers={},CM.Disp.cookieTimes=[10,15,30,60,300,600,900,1800],CM.Disp.clickTimes=[1,5,10,15,30],CM.Disp.TooltipWrinklerBeingShown=[],CM.Disp.TooltipWrinklerArea=0,CM.Disp.TooltipWrinkler=-1,CM.Disp.Title="",CM.Disp.LastTargetBotBar=1,CM.Disp.LastTargetBuildings=1,CM.Disp.LastTargetTooltipBuilding=1})();