let numCells,cellSize,totalCells,fillPercent,cursors,selectedColorProfile,fee,blockNumber,inscriptionIncrementRate,applyGlitchEffect,colorInterval,errorTriggered=!1,showErrorAnimation=!1,savedGrid=[],showElements=!1,grid=[],maxSpan=4.5,rareMaxSpan=20,rareBlockProbability=.01,occupiedCount=0,glitchSquares=[],totalTransactions=0,totalGasSpent=0,totalGlitchSquares=0,lastFeeUpdate=0,nInscription=0,currentSeed=hashToSeed(txnhash),colorRange1=["#42c920","#082e00"],colorRange2=["#7fffd4","#0079c4"],colorRange3=["#f0c945","#91281b"],colorRange4=["#FF1300","#FF9200"],colorRange5=["#f4b41a","#16A085"],colorRange6=["#f4b41a","#f93800"],colorRange7=["#ff0173","#76f7b7","#087487"],colorRange8=["#c2403e","#f0c945","#4280be"],colorRange10=["#eb1933","#2151a1","#ffffff"],colorRange9=["#131b25","#2357b4"],colorRange11=["#eb09c1","#8906ba"],colorRange12=["#cdff01","#330066","#ff33cc"],colorRange13=["#690d44","#8c0c5d","#ad2061"],colorRange14=["#d12a2f","#fbf9f5"],group1=[{profile:colorProfile1,probability:.22},{profile:colorProfile2,probability:.12},{profile:colorProfile3,probability:.17},{profile:colorProfile4,probability:.23},{profile:colorProfile9,probability:.19},{profile:colorProfile11,probability:.07}],group2=[{profile:colorProfile5,probability:.44},{profile:colorProfile14,probability:.12},{profile:colorProfile6,probability:.44}],group3=[{profile:colorProfile8,probability:.45},{profile:colorProfile10,probability:.1},{profile:colorProfile13,probability:.45}],group4=[{profile:colorProfile7,probability:.5},{profile:colorProfile12,probability:.5}];function hashToSeed(o){let e=0;for(let r=0;r({x:floor(random(numCells)),y:0,updateInterval:assignSpeedProfile(),startOffset:0}))),glitchSquares=[],selectColorProfile(),selectFillPercent(),selectGlitchProbProfile(),applyFillProfile(),setupElements()}function applyFillProfile(){const o=random();if(o<.06)maxSpan=1,rareMaxSpan=7;else if(o<.26)maxSpan=3,rareMaxSpan=20;else if(o<.76)maxSpan=6,rareMaxSpan=60;else if(o<.93)maxSpan=20,rareMaxSpan=60;else{maxSpan=1,rareMaxSpan=200;const o=Math.random()*(1.2-1.8)+.8;maxSpan*=o,rareMaxSpan*=o}}function assignSpeedProfile(){let o=random();return o<.93?floor(random(10,20)):o<.066?floor(random(5,8)):floor(random(8,10))}function assignSpeedProfile(){let o=random();return o<.03?floor(random(1,2)):o<.8?floor(random(2,10)):floor(random(20,40))}function selectColorProfile(){let o,e=random();o=e<.7?group1:e<.85?group2:e<.96?group3:group4;let r=random(),l=0;for(let e=0;e120&&(errorTriggered=!0,random()<.009&&(showErrorAnimation=!0)),showErrorAnimation?displayErrorAnimation():(cursors.forEach((o=>{frameCount%o.updateInterval==0&&occupiedCount/totalCells{fill(0),rect(o.x*cellSize,o.y*cellSize,o.span*cellSize,o.span*cellSize);for(let e=0;e=numCells&&(o.y=0,o.x++),totalTransactions++;if(o.x=r&&random()=numCells&&(o.y=0,o.x++)}}function getRandomColorFromRange(o){let e=color(o[0]),r=color(o[1]);return lerpColor(e,r,random())}function drawNoiseOverlay(o,e,r){for(let l=0;lgetRandomColorFromProfile(o,e))),n=floor(random(100,19100));glitchSquares.push({x:o,y:e,span:r,colorIndex:0,colors:t,offsetX:0,speed:n}),totalGlitchSquares++}function getRandomColorFromProfile(o,e){return getColorForPosition(o,e)}function getColorRangeForProfile(o){return o===colorProfile1?colorRange1:o===colorProfile2?colorRange2:o===colorProfile3?colorRange3:colorRange4}function swapSquareColors(){if(frameCount%90==0&&random()<.52){let o=findRandomSquare(),e=findRandomSquare(o.span);if(o&&e){let r=o.color;o.color=e.color,e.color=r}}}function findRandomSquare(o=null){let e=grid.flat().filter((e=>e&&(!o||e.span===o)));return e.length>0?random(e):null}function resetValues(){totalTransactions=0,totalGasSpent=0,totalGlitchSquares=0,nInscription=0;for(let o=0;o1e3&&(fee=random(20,251),lastFeeUpdate=o),displayInfo()}}function displayInfo(){text(`Tot Txn: ${totalTransactions}`,10,height-.075*height+12),text(`Average Txn Fees: ${fee.toFixed(2)}`,200,height-.075*height+12),text(`Total Fees: ${totalGasSpent.toFixed(2)} sats`,400,height-.075*height+12),text(` : ${totalGlitchSquares}`,600,height-.075*height+12);let o=(occupiedCount/totalCells*100).toFixed(2)+"%";nInscription=floor(occupiedCount/inscriptionIncrementRate),text(`Block Seize: ${o}`,10,height-.025*height+12),text(`Tot Inscriptions: ${nInscription}`,200,height-.025*height+12),text(`Block Number: ${blockNumber}`,400,height-.025*height+12)}