pacman-contribution-graph 3.2.5 → 3.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -17,6 +17,7 @@ Transform your GitHub or GitLab contribution graph into arcade games! This JavaS
17
17
  | 🧱 **Breakout** | A ball bounces around breaking your contribution bricks |
18
18
  | 🚀 **Galaga** | A fighter ship shoots lasers at your contribution grid |
19
19
  | 🫧 **Puzzle Bobble** | A cannon fires colored bubbles to pop matching contribution clusters |
20
+ | 💣 **Bomberman** | Two bombers blast contribution cells across the graph |
20
21
 
21
22
  More games coming soon!
22
23
 
@@ -52,12 +53,20 @@ More games coming soon!
52
53
  <img alt="puzzle bobble contribution graph" src="https://raw.githubusercontent.com/abozanona/abozanona/output/puzzle-bobble-contribution-graph.svg">
53
54
  </picture>
54
55
 
56
+ ### Bomberman preview
57
+
58
+ <picture>
59
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/abozanona/abozanona/output/bomberman-contribution-graph-dark.svg">
60
+ <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/abozanona/abozanona/output/bomberman-contribution-graph.svg">
61
+ <img alt="bomberman contribution graph" src="https://raw.githubusercontent.com/abozanona/abozanona/output/bomberman-contribution-graph.svg">
62
+ </picture>
63
+
55
64
  ## 🎮 Features
56
65
 
57
66
  Elevate your GitHub profile with the Pac-Man Contribution Graph Game and add a playful touch to your coding journey!
58
67
 
59
68
  - **Contribution Visualization**: Converts your GitHub or GitLab contribution data into a colorful grid.
60
- - **Multiple Games**: Classic Pac-Man and Breakout, with more planned
69
+ - **Multiple Games**: Classic Pac-Man, Breakout, Galaga, Puzzle Bobble, and Bomberman, with more planned
61
70
  - **Multiple Themes**: Choose between different themes, such as GitHub Dark and GitLab Dark.
62
71
  - **Customizable Settings**: Adjust game settings.
63
72
  - **GitHub Integration**: Automatically fetches your contribution data via GraphQL API
@@ -179,6 +188,28 @@ Here's how to set up and run the games:
179
188
  renderer.start();
180
189
  ```
181
190
 
191
+ **Bomberman:**
192
+
193
+ ```javascript
194
+ import { BombermanRenderer } from 'pacman-contribution-graph';
195
+
196
+ const renderer = new BombermanRenderer({
197
+ username: 'your_username',
198
+ platform: 'github', // or 'gitlab'
199
+ gameTheme: 'github-dark', // 'github', 'github-dark', 'gitlab', or 'gitlab-dark'
200
+ svgCallback: (svg) => {
201
+ document.getElementById('output').innerHTML = svg;
202
+ },
203
+ gameOverCallback: () => {
204
+ console.log('Game over!');
205
+ },
206
+ pointsIncreasedCallback: (points) => {
207
+ console.log('Score:', points);
208
+ }
209
+ });
210
+ renderer.start();
211
+ ```
212
+
182
213
  3. **Customize Settings**: Adjust the parameters as needed:
183
214
  - `username`: Your GitHub or GitLab username.
184
215
  - `platform`: Specify `'github'` or `'gitlab'`.
@@ -228,9 +259,9 @@ To showcase the Pac-Man game on your GitHub profile, follow these steps:
228
259
  with:
229
260
  github_user_name: ${{ github.repository_owner }}
230
261
  # Comma-separated list of games to generate.
231
- # Valid values: pacman, breakout, galaga, puzzle-bobble
262
+ # Valid values: pacman, breakout, galaga, puzzle-bobble, bomberman
232
263
  # Default: pacman
233
- games: 'pacman,breakout,galaga,puzzle-bobble'
264
+ games: 'pacman,breakout,galaga,puzzle-bobble,bomberman'
234
265
 
235
266
  # Push the generated SVGs to the output branch
236
267
  - name: push SVGs to the output branch
@@ -276,6 +307,13 @@ To showcase the Pac-Man game on your GitHub profile, follow these steps:
276
307
  <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/[USERNAME]/[USERNAME]/output/puzzle-bobble-contribution-graph.svg">
277
308
  <img alt="puzzle bobble contribution graph" src="https://raw.githubusercontent.com/[USERNAME]/[USERNAME]/output/puzzle-bobble-contribution-graph.svg">
278
309
  </picture>
310
+
311
+ <!-- Bomberman -->
312
+ <picture>
313
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/[USERNAME]/[USERNAME]/output/bomberman-contribution-graph-dark.svg">
314
+ <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/[USERNAME]/[USERNAME]/output/bomberman-contribution-graph.svg">
315
+ <img alt="bomberman contribution graph" src="https://raw.githubusercontent.com/[USERNAME]/[USERNAME]/output/bomberman-contribution-graph.svg">
316
+ </picture>
279
317
  ```
280
318
 
281
319
  4. **Commit and Push**:
@@ -329,6 +367,9 @@ To showcase the Pac-Man game on your GitLab profile, follow these steps:
329
367
  # Puzzle Bobble
330
368
  - pacman-contribution-graph --platform gitlab --username "$CI_PROJECT_NAMESPACE" --game puzzle-bobble --gameTheme gitlab --output dist/puzzle-bobble-contribution-graph.svg
331
369
  - pacman-contribution-graph --platform gitlab --username "$CI_PROJECT_NAMESPACE" --game puzzle-bobble --gameTheme gitlab-dark --output dist/puzzle-bobble-contribution-graph-dark.svg
370
+ # Bomberman
371
+ - pacman-contribution-graph --platform gitlab --username "$CI_PROJECT_NAMESPACE" --game bomberman --gameTheme gitlab --output dist/bomberman-contribution-graph.svg
372
+ - pacman-contribution-graph --platform gitlab --username "$CI_PROJECT_NAMESPACE" --game bomberman --gameTheme gitlab-dark --output dist/bomberman-contribution-graph-dark.svg
332
373
  artifacts:
333
374
  paths:
334
375
  - dist/pacman-contribution-graph.svg
@@ -339,6 +380,8 @@ To showcase the Pac-Man game on your GitLab profile, follow these steps:
339
380
  - dist/galaga-contribution-graph-dark.svg
340
381
  - dist/puzzle-bobble-contribution-graph.svg
341
382
  - dist/puzzle-bobble-contribution-graph-dark.svg
383
+ - dist/bomberman-contribution-graph.svg
384
+ - dist/bomberman-contribution-graph-dark.svg
342
385
  expire_in: 1 hour
343
386
  rules:
344
387
  - if: '$CI_PIPELINE_SOURCE == "schedule"'
@@ -396,6 +439,13 @@ To showcase the Pac-Man game on your GitLab profile, follow these steps:
396
439
  <source media="(prefers-color-scheme: light)" srcset="https://gitlab.com/[USERNAME]/[USERNAME]/-/raw/main/output/puzzle-bobble-contribution-graph.svg">
397
440
  <img alt="puzzle bobble contribution graph" src="https://gitlab.com/[USERNAME]/[USERNAME]/-/raw/main/output/puzzle-bobble-contribution-graph.svg">
398
441
  </picture>
442
+
443
+ <!-- Bomberman -->
444
+ <picture>
445
+ <source media="(prefers-color-scheme: dark)" srcset="https://gitlab.com/[USERNAME]/[USERNAME]/-/raw/main/output/bomberman-contribution-graph-dark.svg">
446
+ <source media="(prefers-color-scheme: light)" srcset="https://gitlab.com/[USERNAME]/[USERNAME]/-/raw/main/output/bomberman-contribution-graph.svg">
447
+ <img alt="bomberman contribution graph" src="https://gitlab.com/[USERNAME]/[USERNAME]/-/raw/main/output/bomberman-contribution-graph.svg">
448
+ </picture>
399
449
  ```
400
450
 
401
451
  5. **Commit and Push**:
package/action.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  name: 'generate-pacman-game-from-github-contribution-grid'
2
- description: 'Generates arcade games (Pac-Man, Breakout) from a GitHub user contributions grid and outputs animated SVGs'
2
+ description: 'Generates arcade games from a GitHub user contributions grid and outputs animated SVGs'
3
3
  author: 'abozanona'
4
4
 
5
5
  runs:
@@ -15,7 +15,7 @@ inputs:
15
15
  required: false
16
16
  default: ${{ github.token }}
17
17
  games:
18
- description: 'Comma-separated list of games to generate. Valid values: pacman, breakout, galaga. Example: "pacman,breakout,galaga"'
18
+ description: 'Comma-separated list of games to generate. Valid values: pacman, breakout, galaga, puzzle-bobble, bomberman. Example: "pacman,breakout,galaga,puzzle-bobble,bomberman"'
19
19
  required: false
20
20
  default: 'pacman'
21
21
  player_style:
package/cli/cli.js CHANGED
@@ -4,13 +4,13 @@
4
4
  import fs from 'fs';
5
5
  import { hideBin } from 'yargs/helpers';
6
6
  import yargs from 'yargs/yargs';
7
- import { BreakoutRenderer, GalagaRenderer, PacmanRenderer, PuzzleBobbleRenderer } from '../dist/pacman-contribution-graph.min.js';
7
+ import { PacmanRenderer, BreakoutRenderer, GalagaRenderer, PuzzleBobbleRenderer, BombermanRenderer } from '../dist/pacman-contribution-graph.min.js';
8
8
 
9
9
  const argv = yargs(hideBin(process.argv))
10
10
  .option('game', {
11
11
  alias: 'g',
12
- describe: 'Game to generate: pacman, breakout, galaga, puzzle-bobble',
13
- choices: ['pacman', 'breakout', 'galaga', 'puzzle-bobble'],
12
+ describe: 'Game to generate: pacman, breakout, galaga, puzzle-bobble, bomberman',
13
+ choices: ['pacman', 'breakout', 'galaga', 'puzzle-bobble', 'bomberman'],
14
14
  default: 'pacman',
15
15
  type: 'string'
16
16
  })
@@ -63,6 +63,9 @@ switch (argv.game) {
63
63
  case 'puzzle-bobble':
64
64
  renderer = new PuzzleBobbleRenderer(config);
65
65
  break;
66
+ case 'bomberman':
67
+ renderer = new BombermanRenderer(config);
68
+ break;
66
69
  default:
67
70
  renderer = new PacmanRenderer(config);
68
71
  }
@@ -1 +1 @@
1
- var t={d:(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{Lc:()=>O,b9:()=>K,Cf:()=>Ot,rn:()=>ft,OJ:()=>te});const n=53,o=200,i={github:{textColor:"#57606a",gridBackground:"#ffffff",wallColor:"#000000",intensityColors:["#ebedf0","#9be9a8","#40c463","#30a14e","#216e39"]},"github-dark":{textColor:"#8b949e",gridBackground:"#0d1117",wallColor:"#ffffff",intensityColors:["#161b22","#0e4429","#006d32","#26a641","#39d353"]},gitlab:{textColor:"#626167",gridBackground:"#ffffff",wallColor:"#000000",intensityColors:["#ececef","#d2dcff","#7992f5","#4e65cd","#303470"]},"gitlab-dark":{textColor:"#999999",gridBackground:"#1f1f1f",wallColor:"#ffffff",intensityColors:["#2a2a3d","#4a5bdc","#2e3dbf","#1b2e8a","#0f1a4e"]}},a=(t,e)=>Math.floor((e.getTime()-t.getTime())/6048e5),r=t=>new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())),s=t=>{var e;return null!==(e=i[t.config.gameTheme])&&void 0!==e?e:i.github},l=t=>{switch(t){case"NONE":default:return 0;case"FIRST_QUARTILE":return 1;case"SECOND_QUARTILE":return 2;case"THIRD_QUARTILE":return 3;case"FOURTH_QUARTILE":return 4}},c=(t,e)=>{const n=e/4;return 0===t?"NONE":t<n?"FIRST_QUARTILE":t<2*n?"SECOND_QUARTILE":t<3*n?"THIRD_QUARTILE":"FOURTH_QUARTILE"},u=t=>{const e=r(new Date),n=new Date(e);n.setUTCDate(e.getUTCDate()-365),n.setUTCDate(n.getUTCDate()-n.getUTCDay());const o=Array.from({length:53},(()=>Array.from({length:7},(()=>({commitsCount:0,color:s(t).intensityColors[0],level:"NONE"})))));t.contributions.forEach((i=>{const c=r(new Date(i.date));if(c<n||c>e)return;const u=c.getUTCDay(),d=a(n,c);if(d>=0&&d<53){const e=s(t);o[d][u]={commitsCount:i.count,color:e.intensityColors[l(i.level)],level:i.level}}})),t.grid=o},d=s,A=u,h=t=>{const e=r(new Date),o=new Date(e);o.setUTCDate(e.getUTCDate()-365),o.setUTCDate(o.getUTCDate()-o.getUTCDay());const i=a(o,e)+1,s=Array(i).fill("");let l="";for(let t=0;t<i;t++){const e=new Date(o);e.setUTCDate(e.getUTCDate()+7*t);const n=e.toLocaleString("default",{month:"short"});n!==l&&(s[t]=n,l=n)}t.monthLabels=i>n?s.slice(i-n):s},m=t=>(u(t),t.grid);var g=function(t,e,n,o){return new(n||(n=Promise))((function(i,a){function r(t){try{l(o.next(t))}catch(t){a(t)}}function s(t){try{l(o.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}l((o=o.apply(t,e||[])).next())}))};const f=t=>g(void 0,void 0,void 0,(function*(){var e;return(null===(e=t.config.githubSettings)||void 0===e?void 0:e.accessToken)?yield(t=>g(void 0,void 0,void 0,(function*(){var e;const n=yield fetch("https://api.github.com/graphql",{method:"POST",headers:{Authorization:`Bearer ${null===(e=t.config.githubSettings)||void 0===e?void 0:e.accessToken}`,"Content-Type":"application/json"},body:JSON.stringify({query:"\n\t\tquery ($login: String!) {\n\t\t\tuser(login: $login) {\n\t\t\t\tcontributionsCollection {\n\t\t\t\t\tcontributionCalendar {\n\t\t\t\t\t\tweeks {\n\t\t\t\t\t\t\tcontributionDays {\n\t\t\t\t\t\t\t\tdate\n\t\t\t\t\t\t\t\tcontributionCount\n\t\t\t\t\t\t\t\tcolor\n\t\t\t\t\t\t\t\tcontributionLevel\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t",variables:{login:t.config.username}})});if(!n.ok)throw new Error(`GitHub GraphQL request failed: ${n.status} ${n.statusText}`);return(yield n.json()).data.user.contributionsCollection.contributionCalendar.weeks.map((t=>t.contributionDays)).reduce(((t,e)=>t.concat(e)),[]).map((e=>{const n=e.contributionLevel,o=s(t);return{date:new Date(e.date),count:e.contributionCount,color:o.intensityColors[l(n)],level:n}}))})))(t):yield(t=>g(void 0,void 0,void 0,(function*(){var e,n;const o=[];let i=!1,a=1;do{try{const r={};(null===(e=t.config.githubSettings)||void 0===e?void 0:e.accessToken)&&(r.Authorization="Bearer "+t.config.githubSettings.accessToken);const s=yield fetch(`https://api.github.com/search/commits?q=author:${t.config.username}&sort=author-date&order=desc&page=${a}&per_page=100`,{headers:r}),l=yield s.json();i=!l.items||0===l.items.length,o.push(...null!==(n=l.items)&&void 0!==n?n:[]),a++}catch(t){i=!0}}while(!i);const r=Array.from(o.reduce(((t,e)=>{var n,o,i,a;const r=null===(o=null===(n=e.commit.author)||void 0===n?void 0:n.date)||void 0===o?void 0:o.split("T")[0],s=(null===(a=null===(i=e.commit.committer)||void 0===i?void 0:i.date)||void 0===a?void 0:a.split("T")[0])||r,l=(t.get(s)||{count:0}).count+1;return t.set(s,{date:new Date(s),count:l,color:"",level:"NONE"})}),new Map).values()),u=Math.max(...r.map((t=>t.count)).filter((t=>t>0)));return r.map((e=>{const n=c(e.count,u),o=s(t);return{date:new Date(e.date),count:e.count,color:o.intensityColors[l(n)],level:n}}))})))(t)})),y=t=>{return e=void 0,n=void 0,i=function*(){const e=yield fetch(`https://v0-new-project-q1hhrdodoye-abozanona-gmailcoms-projects.vercel.app/api/contributions?username=${t.config.username}`),n=yield e.json(),o=Object.entries(n).map((([t,e])=>({date:new Date(t),count:Number(e),color:"",level:"NONE"}))),i=Math.max(...o.map((t=>t.count)).filter((t=>t>0)));return o.map((e=>{const n=c(e.count,i),o=s(t);return{date:new Date(e.date),count:e.count,color:o.intensityColors[l(n)],level:n}}))},new((o=void 0)||(o=Promise))((function(t,a){function r(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o((function(t){t(n)}))).then(r,s)}l((i=i.apply(e,n||[])).next())}));var e,n,o,i},x=.21,v=7.4,p=t=>22*t,b=t=>22*t+15,C=(t,e,n)=>{var o,i;const a=t.gameHistory.length,r=null!==(i=null===(o=t.initialColors[e])||void 0===o?void 0:o[n])&&void 0!==i?i:"#ebedf0",s=t.brickEvents.filter((t=>t.x===e&&t.y===n));if(0===s.length)return{keyTimes:"0;1",values:`${r};${r}`};const l=[0],c=[r];for(const t of s){const e=Number((t.frameIndex/Math.max(a-1,1)).toFixed(4));e!==l[l.length-1]?(l.push(e),c.push(t.color)):c[c.length-1]=t.color}return 1!==l[l.length-1]&&(l.push(1),c.push(c[c.length-1])),{keyTimes:l.join(";"),values:c.join(";")}},w=(t,e)=>{var n,o,i,a;const r=t.gameHistory.length;if(0===r){const t=null!==(n=e[0])&&void 0!==n?n:"0,0";return{keyTimes:"0;1",values:`${t};${t}`}}const s=[],l=[];let c=null,u=null;return e.forEach(((t,e)=>{t!==c&&(null!==c&&null!==u&&e-1!==u&&(s.push(Number(((e-1)/(r-1)).toFixed(4))),l.push(c)),s.push(Number((e/(r-1)).toFixed(4))),l.push(t),c=t,u=e)})),0!==s.length&&1===s[s.length-1]||(0===s.length?(s.push(0,1),l.push(null!==(o=e[0])&&void 0!==o?o:"0,0",null!==(i=e[e.length-1])&&void 0!==i?i:"0,0")):(s.push(1),l.push(null!==(a=null!=c?c:e[e.length-1])&&void 0!==a?a:"0,0"))),{keyTimes:s.join(";"),values:l.join(";")}},B=t=>{const e=t.gameHistory.length*o/2,i=d(t);let a='<svg width="1166" height="209" xmlns="http://www.w3.org/2000/svg">';a+=`<desc>Generated with breakout-contribution-graph on ${new Date}</desc>`,a+=`<metadata>\n\t\t<info>\n\t\t\t<frames>${t.gameHistory.length}</frames>\n\t\t\t<frameRate>5</frameRate>\n\t\t\t<durationMs>${e}</durationMs>\n\t\t\t<generatedOn>${(new Date).toISOString()}</generatedOn>\n\t\t</info>\n\t</metadata>`,a+=`<rect width="100%" height="100%" fill="${i.gridBackground}"/>`;let r="";for(let e=0;e<n;e++)t.monthLabels[e]!==r&&(a+=`<text x="${22*e+10}" y="10" text-anchor="middle" font-size="10" fill="${i.textColor}">${t.monthLabels[e]}</text>`,r=t.monthLabels[e]);for(let o=0;o<n;o++)for(let n=0;n<7;n++){const r=p(o),s=b(n),l=C(t,o,n);a+=`<rect id="c-${o}-${n}" x="${r}" y="${s}" width="20" height="20" rx="3" fill="${i.intensityColors[0]}">\n\t\t\t\t<animate attributeName="fill" calcMode="discrete" dur="${e}ms" repeatCount="indefinite"\n\t\t\t\t\tvalues="${l.values}" keyTimes="${l.keyTimes}"/>\n\t\t\t</rect>`}const s=Math.round(4.62),l=w(t,(t=>t.gameHistory.map((t=>`${p(t.ball.x)},${b(t.ball.y)}`)))(t));a+=`<circle id="ball" cx="0" cy="0" r="${s}" fill="${i.wallColor}" stroke="#aaaaaa" stroke-width="1">\n\t\t<animateTransform attributeName="transform" type="translate"\n\t\t\tcalcMode="linear"\n\t\t\tdur="${e}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${l.keyTimes}"\n\t\t\tvalues="${l.values}"/>\n\t</circle>`;const c=b(v),u=Math.round(152),A=Math.round(11),h=w(t,(t=>t.gameHistory.map((t=>`${p(t.paddle.x)},0`)))(t));return a+=`<rect id="paddle" x="0" y="${c}" width="${u}" height="${A}" rx="3" fill="${i.wallColor}">\n\t\t<animateTransform attributeName="transform" type="translate"\n\t\t\tcalcMode="linear"\n\t\t\tdur="${e}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${h.keyTimes}"\n\t\t\tvalues="${h.values}"/>\n\t</rect>`,a+="</svg>",a};const M=20/22,E=["NONE","FIRST_QUARTILE","SECOND_QUARTILE","THIRD_QUARTILE","FOURTH_QUARTILE"],k=t=>{const e=E.indexOf(t);return E[Math.max(0,e-1)]},T=t=>{var e,o;t.frameCount++;const{ball:i,paddle:a,grid:r}=t,s=Math.hypot(i.dx,i.dy),l=Math.ceil(s/x),c=1/l;for(let s=0;s<l;s++){i.x+=i.dx*c,i.y+=i.dy*c,i.x-x<=0&&(i.x=x,i.dx=Math.abs(i.dx)),i.x+x>=n&&(i.x=52.79,i.dx=-Math.abs(i.dx)),i.y-x<=0&&(i.y=x,i.dy=Math.abs(i.dy));const s=a.x,l=a.x+7;if(i.dy>0&&i.y+x>=v&&i.y-x<7.9&&i.x>=s-x&&i.x<=l+x){i.y=7.19;const e=s+3.5,n=Math.max(-1,Math.min(1,(i.x-e)/3.5)),o=Math.hypot(i.dx,i.dy),a=65*n*(Math.PI/180);i.dx=o*Math.sin(a),i.dy=-o*Math.cos(a),t.bouncesSinceTargetSet++,t.bouncesSinceTargetSet>=5&&(t.targetBrick=S(t),t.bouncesSinceTargetSet=0)}i.y>8.4&&(i.x=26.5,i.y=5.9,i.dy=-Math.abs(i.dy));const u=Math.max(0,Math.floor(i.x-x)),A=Math.min(52,Math.floor(i.x+x)),h=Math.max(0,Math.floor(i.y-x)),m=Math.min(6,Math.floor(i.y+x));let g=!1,f=!1;const y=d(t);for(let n=u;n<=A;n++)for(let a=h;a<=m;a++){if(0===r[n][a].commitsCount)continue;const s=Math.max(n,Math.min(n+M,i.x)),l=Math.max(a,Math.min(a+M,i.y));if(Math.pow(i.x-s,2)+Math.pow(i.y-l,2)>=.04409999999999999)continue;const c=r[n][a].level,u=k(c);if(r[n][a].level=u,"NONE"===u)r[n][a].commitsCount=0,r[n][a].color=y.intensityColors[0],(null===(e=t.targetBrick)||void 0===e?void 0:e.cx)===n&&(null===(o=t.targetBrick)||void 0===o?void 0:o.cy)===a&&(t.targetBrick=S(t),t.bouncesSinceTargetSet=0);else{const t=E.indexOf(u);r[n][a].color=y.intensityColors[t]}t.brickEvents.push({frameIndex:t.gameHistory.length,x:n,y:a,color:r[n][a].color});const d=x-Math.abs(i.x-s),A=x-Math.abs(i.y-l);d<=A?(i.x+=i.dx<0?d:-d,g=!0):(i.y+=i.dy<0?A:-A,f=!0),t.framesSinceLastBrickHit=0,t.config.pointsIncreasedCallback(I(t))}g&&(i.dx=-i.dx),f&&(i.dy=-i.dy)}if(i.dy>0&&t.targetBrick){const e=t.targetBrick,o=(v-i.y)/i.dy;let r=i.x+i.dx*o;r=Math.abs((r%106+106)%106),r>n&&(r=106-r);const s=e.cx+.5,l=e.cy+.5,c=v-l,u=s-r,d=Math.atan2(u,Math.max(c,.5))*(180/Math.PI),A=r-Math.max(-65,Math.min(65,d))/65*3.5,h=Math.max(0,Math.min(46,A-3.5));a.x<h-2?a.x+=2:a.x>h+2?a.x-=2:a.x=h}else if(i.dy>0){const t=a.x+3.5;t<i.x-.5?a.x=Math.min(a.x+2,46):t>i.x+.5&&(a.x=Math.max(a.x-2,0))}R(t)},R=t=>{t.gameHistory.push({ball:Object.assign({},t.ball),paddle:Object.assign({},t.paddle)})},I=t=>{let e=0;return t.grid.forEach((t=>t.forEach((t=>{0===t.commitsCount&&e++})))),e},S=t=>{var e,o;const i=[];for(let a=0;a<n;a++)for(let n=0;n<7;n++)(null===(o=null===(e=t.grid[a])||void 0===e?void 0:e[n])||void 0===o?void 0:o.commitsCount)>0&&i.push({cx:a,cy:n});return 0===i.length?null:i[Math.floor(Math.random()*i.length)]},D=t=>{return e=void 0,n=void 0,i=function*(){if(t.frameCount=0,t.framesSinceLastBrickHit=0,t.gameHistory=[],t.brickEvents=[],t.grid=m(t),t.initialColors=t.grid.map((t=>t.map((t=>t.color)))),0===t.grid.reduce(((t,e)=>t+e.filter((t=>t.commitsCount>0)).length),0)){const e=B(t);return t.config.svgCallback(e),void t.config.gameOverCallback()}for((t=>{t.ball={x:26.5,y:5.9,dx:.75,dy:-.95}})(t),(t=>{t.paddle={x:23,width:7}})(t),t.targetBrick=S(t),t.bouncesSinceTargetSet=0;t.grid.some((t=>t.some((t=>t.commitsCount>0))))&&t.frameCount<3e3;)T(t),t.frameCount%200==0&&t.grid.reduce(((t,e)=>t+e.filter((t=>t.commitsCount>0)).length),0);const e=B(t);t.config.svgCallback(e),t.config.gameStatsCallback&&t.config.gameStatsCallback({totalScore:I(t),steps:t.frameCount,ghostsEaten:0}),t.config.gameOverCallback()},new((o=void 0)||(o=Promise))((function(t,a){function r(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o((function(t){t(n)}))).then(r,s)}l((i=i.apply(e,n||[])).next())}));var e,n,o,i},N={frameCount:0,contributions:[],ball:{x:0,y:0,dx:0,dy:0},paddle:{x:0,width:7},grid:[],monthLabels:[],framesSinceLastBrickHit:0,targetBrick:null,bouncesSinceTargetSet:0,gameHistory:[],initialColors:[],brickEvents:[],config:void 0};class O{constructor(t){this.conf=Object.assign({},t)}start(){return t=this,e=void 0,o=function*(){switch(this.store=JSON.parse(JSON.stringify(N)),this.store.config=Object.assign(Object.assign({},{platform:"github",username:"",svgCallback:t=>{},gameOverCallback:()=>{},gameTheme:"github",pointsIncreasedCallback:t=>{},githubSettings:{accessToken:""}}),this.conf),this.store.config.platform){case"gitlab":this.store.contributions=yield y(this.store);break;case"github":this.store.contributions=yield f(this.store);break;default:throw new Error(`Unsupported platform: ${this.store.config.platform}`)}return A(this.store),h(this.store),yield D(this.store),this.store},new((n=void 0)||(n=Promise))((function(i,a){function r(t){try{l(o.next(t))}catch(t){a(t)}}function s(t){try{l(o.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}l((o=o.apply(t,e||[])).next())}));var t,e,n,o}stop(){this.store}}const U=t=>22*t,H=t=>22*t+15,F=(t,e,n)=>{var o,i;const a=t.gameHistory.length,r=null!==(i=null===(o=t.initialColors[e])||void 0===o?void 0:o[n])&&void 0!==i?i:"#ebedf0",s=t.cellEvents.filter((t=>t.x===e&&t.y===n));if(0===s.length)return{keyTimes:"0;1",values:`${r};${r}`};const l=[0],c=[r];for(const t of s){const e=Number((t.frameIndex/Math.max(a-1,1)).toFixed(4));e!==l[l.length-1]?(l.push(e),c.push(t.color)):c[c.length-1]=t.color}return 1!==l[l.length-1]&&(l.push(1),c.push(c[c.length-1])),{keyTimes:l.join(";"),values:c.join(";")}},z=t=>{const e=t.gameHistory.length,i=Math.max(e*o/2,1e3),a=d(t),r=H(10.5);let s='<svg width="1166" height="259" xmlns="http://www.w3.org/2000/svg">';s+=`<desc>Generated with galaga-contribution-graph on ${new Date}</desc>`,s+='<rect width="100%" height="100%" fill="#000000"/>';{let t=12345;const e=()=>(t=1664525*t+1013904223>>>0,t/4294967295);for(let t=0;t<120;t++){const t=(1166*e()).toFixed(1),n=(.4+1.6*e()).toFixed(1),o=(.3+.7*e()).toFixed(2),i=Math.floor(2500+5500*e());s+=`<circle cx="${t}" cy="0" r="${n}" fill="white" opacity="${o}"><animate attributeName="cy" from="-2" to="261" dur="${i}ms" begin="-${Math.floor(e()*i)}ms" repeatCount="indefinite"/></circle>`}}let l="";for(let e=0;e<n;e++)t.monthLabels[e]!==l&&(s+=`<text x="${22*e+10}" y="10" text-anchor="middle" font-size="10" fill="#aaaaaa">${t.monthLabels[e]}</text>`,l=t.monthLabels[e]);const c=a.intensityColors[0];for(let e=0;e<n;e++)for(let n=0;n<7;n++){const o=U(e),a=H(n),r=F(t,e,n);s+=`<rect x="${o}" y="${a}" width="20" height="20" rx="3" fill="transparent">\n\t\t\t\t<animate attributeName="fill" calcMode="discrete" dur="${i}ms" repeatCount="indefinite"\n\t\t\t\t\tvalues="${r.values.split(";").map((t=>t===c?"transparent":t)).join(";")}" keyTimes="${r.keyTimes}"/>\n\t\t\t</rect>`}if(e>=2){const n=(t=>{const e=[],n=new Map;for(let o=0;o<t.gameHistory.length;o++){const i=t.gameHistory[o].bullets.filter((t=>t.active)),a=new Set(i.map((t=>t.id)));for(const[t,i]of n)a.has(t)||(e.push({id:t,x:i.x,startFrame:i.startFrame,endFrame:o-1,yPositions:i.yPositions}),n.delete(t));for(const t of i)n.has(t.id)?n.get(t.id).yPositions.push(t.y):n.set(t.id,{x:t.x,startFrame:o,yPositions:[t.y]})}for(const[o,i]of n)e.push({id:o,x:i.x,startFrame:i.startFrame,endFrame:t.gameHistory.length-1,yPositions:i.yPositions});return e})(t);for(const t of n){const n=U(t.x),o=Number((t.startFrame/(e-1)).toFixed(4)),a=Number((Math.min(t.endFrame+1,e-1)/(e-1)).toFixed(4));let r,l;o<=0&&a>=1?(r="0;1",l="1;1"):o<=0?(r=`0;${a};${a};1`,l="1;1;0;0"):a>=1?(r=`0;${o};${o};1`,l="0;0;1;1"):(r=`0;${o};${o};${a};${a};1`,l="0;0;1;1;0;0");const c=[],u=[],d=H(t.yPositions[0]).toFixed(1),A=H(t.yPositions[t.yPositions.length-1]).toFixed(1);t.startFrame>0&&(c.push(0),u.push(`${n.toFixed(1)},${d}`));for(let o=0;o<t.yPositions.length;o++){const i=t.startFrame+o,a=Number((i/(e-1)).toFixed(4)),r=H(t.yPositions[o]).toFixed(1);0!==c.length&&a===c[c.length-1]||(c.push(a),u.push(`${n.toFixed(1)},${r}`))}1!==c[c.length-1]&&(c.push(1),u.push(`${n.toFixed(1)},${A}`)),s+=`<image x="-5" y="-13" width="10" height="13" href="data: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YC8fVxY/qxhPc3rOH4T8Bvq5CUC/vgh26zEBYxQBugOrWVCNYOEVwKAE1nAB2YYxBBh/HQ8uCvUJFi7+VARIVwfmAqcBhmQWWoB1XdhFGNGFcb0cZBjjrszRLLWgkgbovJB2JJfKXIljUjlSEev0RJuArIF0vC84/AYNLX/sQtRIxoRxj4qpXkfiaeIm/J+HcbEDDSiRMRoQNV3AA8yDcgJM/G+EPdE3VUpFd5INV9+JXFMykLmAfjIjmyK0wLUj5NYkJKBx0sKrWIMEchGxsgVNsQVNCYEfLGEySrd5xSK6LArjdUwtDIrCL/JGvSI+ReIgAAAAAElFTkSuQmCC" opacity="0" preserveAspectRatio="xMidYMid meet">\n\t\t\t\t<animate attributeName="opacity" calcMode="discrete" dur="${i}ms" repeatCount="indefinite"\n\t\t\t\t\tkeyTimes="${r}" values="${l}"/>\n\t\t\t\t<animateTransform attributeName="transform" type="translate" calcMode="linear"\n\t\t\t\t\tdur="${i}ms" repeatCount="indefinite"\n\t\t\t\t\tkeyTimes="${c.join(";")}" values="${u.join(";")}"/>\n\t\t\t</image>`}}if(e>=2)for(const n of t.explosionEvents){const t=(U(n.x)+10).toFixed(1),o=(H(n.y)+10).toFixed(1),a=Number((n.frameIndex/(e-1)).toFixed(4)),r=Number((Math.min(n.frameIndex+7,e-1)/(e-1)).toFixed(4));if(r<=a)continue;const l=`0;${a};${a};${r};1`,c="0;0;1;0;0",u=`${i}ms`;s+=`<circle cx="${t}" cy="${o}" r="2" fill="none" stroke="${n.color}" stroke-width="3" opacity="0">\n\t\t\t\t<animate attributeName="r" calcMode="linear" dur="${u}" repeatCount="indefinite" keyTimes="${l}" values="2;2;2;20;20"/>\n\t\t\t\t<animate attributeName="stroke-width" calcMode="linear" dur="${u}" repeatCount="indefinite" keyTimes="${l}" values="3;3;3;0;0"/>\n\t\t\t\t<animate attributeName="opacity" calcMode="linear" dur="${u}" repeatCount="indefinite" keyTimes="${l}" values="${c}"/>\n\t\t\t</circle>`;const d=[{dx:0,dy:-11},{dx:0,dy:11},{dx:-11,dy:0},{dx:11,dy:0}];for(const{dx:e,dy:i}of d){const a=(Number(t)+e).toFixed(1),r=(Number(o)+i).toFixed(1);s+=`<circle cx="${t}" cy="${o}" r="2.5" fill="${n.color}" opacity="0">\n\t\t\t\t\t<animate attributeName="cx" calcMode="linear" dur="${u}" repeatCount="indefinite" keyTimes="${l}" values="${t};${t};${t};${a};${a}"/>\n\t\t\t\t\t<animate attributeName="cy" calcMode="linear" dur="${u}" repeatCount="indefinite" keyTimes="${l}" values="${o};${o};${o};${r};${r}"/>\n\t\t\t\t\t<animate attributeName="r" calcMode="linear" dur="${u}" repeatCount="indefinite" keyTimes="${l}" values="2.5;2.5;2.5;0;0"/>\n\t\t\t\t\t<animate attributeName="opacity" calcMode="linear" dur="${u}" repeatCount="indefinite" keyTimes="${l}" values="${c}"/>\n\t\t\t\t</circle>`}}const u=t.gameHistory.map((t=>`${U(t.ship.x).toFixed(1)},${r.toFixed(1)}`)),A=((t,e)=>{var n,o,i,a;const r=t.gameHistory.length;if(0===r){const t=null!==(n=e[0])&&void 0!==n?n:"0,0";return{keyTimes:"0;1",values:`${t};${t}`}}const s=[],l=[];let c=null,u=null;return e.forEach(((t,e)=>{t!==c&&(null!==c&&null!==u&&e-1!==u&&(s.push(Number(((e-1)/(r-1)).toFixed(4))),l.push(c)),s.push(Number((e/(r-1)).toFixed(4))),l.push(t),c=t,u=e)})),0!==s.length&&1===s[s.length-1]||(0===s.length?(s.push(0,1),l.push(null!==(o=e[0])&&void 0!==o?o:"0,0",null!==(i=e[e.length-1])&&void 0!==i?i:"0,0")):(s.push(1),l.push(null!==(a=null!=c?c:e[e.length-1])&&void 0!==a?a:"0,0"))),{keyTimes:s.join(";"),values:l.join(";")}})(t,u);return s+=`<image x="-16" y="-35" width="32" height="35" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABGCAYAAAB8MJLDAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mA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WlDjHZYW/z8EqWhvJfzAzwz3Hgec4+PmBA4Xn3Drgvl+FzQHwqakpHkURgiBAs9mU0/KjsirGyMVMLJBfmd3LvWt2BtlqBDLqtaI8g9YPZlmUnVK6LIFWqyX3C4itLln2fR9hGHZJQFgDKV7s0yL/HeNPkc0h7Hvfc1ie0Gm329A0DeVyWUqgXC5Lt+9lsV+gXC5DdRwHuq7LlRO6rstNy70sNjAbhtGVZs4iwPVY/fL4XnsTbOh9OeewbRuMMTiOA9u2kSQJHMdBuVwu5Gq1ijiO4TgO1KK1M2JTQT8WLlcul8ee/dUyG6hUVe00SGOY2EaTjVAABnJ2zdN7tn3e0HUkYvu8piFcWnl+wbfPN5tN6LoOTdPgeV6OxV6ALIula0VMKZUbGAWL2dgiBiB3m3DOC1nsEslyqVQCY6yQxaapLNu2jTiOc6wOW0rWTwJZFucP2p8jXLSXh7lrv2RMbMgqOmeY22eZ2rbdtYZWLCPv5TRN0W63c8wYQxAEksXeniwX1bxt23LrmuA4jnMchiEYYzkOgkByu91GmqY5FuP/vSz+kxXbtvEfwITwAX3FN6kAAAAASUVORK5CYII=" preserveAspectRatio="xMidYMid meet">\n\t\t<animateTransform attributeName="transform" type="translate" calcMode="linear"\n\t\t\tdur="${i}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${A.keyTimes}"\n\t\t\tvalues="${A.values}"/>\n\t</image>`,s+="</svg>",s};const V=["NONE","FIRST_QUARTILE","SECOND_QUARTILE","THIRD_QUARTILE","FOURTH_QUARTILE"],L=t=>{const e=V.indexOf(t);return V[Math.max(0,e-1)]},Q=()=>Math.floor(5*Math.random())+4,j=t=>t.grid.some((t=>t.some((t=>t.commitsCount>0)))),Y=(t,e=-1)=>{const o=Math.round(t.ship.x-.5),i=e=>t.grid[e].reduce(((t,e)=>{var n;return t+(null!==(n={NONE:0,FIRST_QUARTILE:1,SECOND_QUARTILE:2,THIRD_QUARTILE:3,FOURTH_QUARTILE:4}[e.level])&&void 0!==n?n:0)}),0);for(let t=3;t<=n;t++){let a=-1,r=0;for(let s=-t;s<=t;s++){const t=o+s;if(t<0||t>=n)continue;if(t===e)continue;const l=i(t);l>r&&(r=l,a=t)}if(-1!==a)return a}for(let o=0;o<n;o++)if(o!==e&&t.grid[o].some((t=>t.commitsCount>0)))return o;return Math.floor(26.5)},P=t=>{var e;t.frameCount++;const{grid:o,ship:i}=t,a=d(t);for(const e of t.bullets){if(!e.active)continue;if(e.y-=.6,e.y<-1){e.active=!1;continue}const i=Math.round(e.x-.5),r=Math.floor(e.y);if(i>=0&&i<n&&r>=0&&r<7&&o[i][r].commitsCount>0){const n=o[i][r].color,s=L(o[i][r].level);o[i][r].level=s,o[i][r].color=a.intensityColors[V.indexOf(s)],"NONE"===s&&(o[i][r].commitsCount=0,t.explosionEvents.push({frameIndex:t.gameHistory.length,x:i,y:r,color:n})),t.cellEvents.push({frameIndex:t.gameHistory.length,x:i,y:r,color:o[i][r].color}),t.config.pointsIncreasedCallback(t.cellEvents.length),e.active=!1}}t.bullets=t.bullets.filter((t=>t.active)),(null===(e=o[t.currentTargetCol])||void 0===e?void 0:e.some((t=>t.commitsCount>0)))||(t.currentTargetCol=Y(t),t.framesShootingAtTarget=0);const r=t.currentTargetCol,s=r+.5,l=s-i.x;Math.abs(l)>.4?i.x+=.4*Math.sign(l):i.x=s,i.x=Math.max(.8,Math.min(52.2,i.x));const c=Math.abs(i.x-s)<.5,u=o[r].some((t=>t.commitsCount>0));c&&u&&(t.framesShootingAtTarget>=t.framesAllowedForTarget?(t.currentTargetCol=Y(t,r),t.framesShootingAtTarget=0,t.framesAllowedForTarget=Q()):(t.frameCount%2==0&&t.bullets.length<10&&t.bullets.push({id:t.nextBulletId++,x:s,y:9.5,active:!0}),t.framesShootingAtTarget++)),(t=>{t.gameHistory.push({ship:{x:t.ship.x},bullets:t.bullets.map((t=>Object.assign({},t)))})})(t)},G=t=>{return e=void 0,n=void 0,i=function*(){if(t.frameCount=0,t.nextBulletId=0,t.gameHistory=[],t.cellEvents=[],t.explosionEvents=[],t.bullets=[],t.grid=m(t),t.initialColors=t.grid.map((t=>t.map((t=>t.color)))),!j(t)){const e=z(t);return t.config.svgCallback(e),void t.config.gameOverCallback()}for(t.ship={x:26.5},t.currentTargetCol=Y(t),t.framesShootingAtTarget=0,t.framesAllowedForTarget=Q();j(t)&&t.frameCount<3e3;)P(t);const e=z(t);t.config.svgCallback(e),t.config.gameStatsCallback&&t.config.gameStatsCallback({totalScore:t.cellEvents.length,steps:t.frameCount,ghostsEaten:0}),t.config.gameOverCallback()},new((o=void 0)||(o=Promise))((function(t,a){function r(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o((function(t){t(n)}))).then(r,s)}l((i=i.apply(e,n||[])).next())}));var e,n,o,i},J={frameCount:0,nextBulletId:0,contributions:[],ship:{x:0},bullets:[],grid:[],monthLabels:[],gameHistory:[],initialColors:[],cellEvents:[],explosionEvents:[],currentTargetCol:-1,framesShootingAtTarget:0,framesAllowedForTarget:4,config:void 0};class K{constructor(t){this.conf=Object.assign({},t)}start(){return t=this,e=void 0,o=function*(){switch(this.store=JSON.parse(JSON.stringify(J)),this.store.config=Object.assign(Object.assign({},{platform:"github",username:"",svgCallback:t=>{},gameOverCallback:()=>{},gameTheme:"github",pointsIncreasedCallback:t=>{},githubSettings:{accessToken:""}}),this.conf),this.store.config.platform){case"gitlab":this.store.contributions=yield y(this.store);break;case"github":this.store.contributions=yield f(this.store);break;default:throw new Error(`Unsupported platform: ${this.store.config.platform}`)}return A(this.store),h(this.store),yield G(this.store),this.store},new((n=void 0)||(n=Promise))((function(i,a){function r(t){try{l(o.next(t))}catch(t){a(t)}}function s(t){try{l(o.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}l((o=o.apply(t,e||[])).next())}));var t,e,n,o}stop(){this.store}}const W="yellow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ZjGEMDSzOPS+sjh2IXKuOOmOnb0GFm6DW4J3JfttIEkt1moWW2b5ugFAekDybSblTTM25qS/YsZucY4xMDIDd+Yp/6Jmkc8yfY5xBICq52uJM4UqECcvRHRCMIuoelT9jKjMyRvpILdlRuPJKd8Lmz0zlm61uHOvRVb0OmbsPD6drAW/YGH5Fe1PPbYaBykkrNWbvO8MWK8fOBABpb53yIfLPndXnzpIePDomDdf+qSLR4hzCtJU8OSBKOizP66vR/y+Ux33EnBN71P5DQllVXyQma9lAAAAAElFTkSuQmCC",left:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAB4ElEQVR4nH2SvWtUURDFf3Pf24+siYkYFLRRizSaSiVi7V9g7b9hpSgogmIhipVbC0IwQrTQRgQ/CiMxCbsgxi9iIMHGENndrG/vPRZv3+atbDIwMHM4Z+65946xc1SByW791cwuSNIufIiiCOASFB8z/71FU2JTor7miSpPgKtdzgAxgCtdZ2lVSGmG4AnB9/r6uijsuRlh/WLnHLjyFea+CO8TOp12T5Rlp9PG+4TlX6JYuuGcS8VmBnCRd3VNe5/U8id284Okl5kj7xNq6wIu501Mz/xck/c+kaRaTvxc2/FUSh2G4IFnABQKDtzehzYksc8nG5spuefgqDRyJMUa2YBEwsrTUeqeO7z/1uBk8CBtbXSJWQ5LVNIBH/OPu7jSAB4AvOZ3Cs5sSZv/P56kuSDV81gInqYEzMdAky0Po47zpcFffNoGgH8BaDnAMLfDau0S6m5ArwSQQj9JYSCWC9ebJgUsZyXrzVyfqL/vOGCUYQPnYianPrP8J2M6Dh5eYv+BBXx38GoTTkx9wrmYIQDGAG7zttbgzLlXDsqMjV9j4UebieOzBpGBcWziEYsrLcYP3SpCiVNnX/BmqQHcJ45jKJTvAiMAzswwqwLF7XtaDK5q2ZWhgovvRVHMP7z+WsD4PpRYAAAAAElFTkSuQmCC",right:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAB1kl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g+JU35h8fmA4XQbM2fLD65sLWC634BQQFYQ7O/PDWzmJnXZZA4+4GKzfent9qwWeoKlD7CDSvRCkCp5Rq0crtQSK1jzWOvKsaFT0ZY5S/AWqkD0QparkoAAAAAElFTkSuQmCC"},eyes:{up:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAj0lEQVR4nO2RsQ7CMAxE79K6aQCJbuztb8Af8P8rX8HaYzCChgbanZ5kyYqezjkb2MR3K02eOUdzJiBwhBCsgPWE7RcmD9YfBsCgp9zdS5Kul/Mpn50z95tzdSkAAKSYZp/7ZDzKF6XYxIUUvw12bbvKAF1VMQCvXUhSydXIjDk2kcDkjL4kF1k+4xrmH/UA3stP0Iur7f8AAAAASUVORK5CYII=",down:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAm0lEQVR4nO2Ryw3CQAxE35jdEBFRAycEpUAJ9A81EBIlcMjPgazEHUbyxX47I3vhLwBiDDydUpxnQt8zgG2+kQeD1A2cTJo3JIqVzV29jod9NrCX82m3xLRt27wHTYlmY+SjquslRpJ9ZVAmDKC/wf0K0lQAuFtWddn0a88ZgAwoKKx7MdRnShxdF5hAHIc5t+Q3rp2BoRT2c3oBFX9xUA7hwq8AAAAASUVORK5CYII=",left:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAuUlEQVR4nO2PvRIBQRCEu+fOIaD8RkoRKCGZwNt4fwKFcutnW2LP1tWdF6CjmdmveruBvxgGSSqOJKvgmEnM6CWYxS7hkYSVbuWdABIC9pTkI2cAeHiv3WazDPsiazWeFczDS0buQQLl0CfnrmHOb10LDHkoJxtV1cXZubyohCyyH36tVuji8vvHwJI6DltMhzNM2jqpUJqmaEdMD8YV5h3l0vHNrAf9zrjV/ARQpLrPYmYBZrWpfkwv2KllZq2VZYMAAAAASUVORK5CYII=",right:"data:image/png;base64,iVBORw0KGgoAAA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mOnp778olH3nw7t1/ZQs3f5q3bNuynIE4tIbc8MU/iqnFW8GOAztKmU3jht869XdOIYRMZyuFzy/H+jO/Ctl1wN+MdRZTiRU7cPbLth4UNDnF1T1dpczZ75vbM4lgZPaxYGSkN30VI6TgUH4FK9xNevpd2iL307J/jIzRmHySyldvo4HmZ08iWu8lIiTFxBS57ArRg6/ip6/C4VKapy9/Rug+m8gzXYzOX2DcGIYSU1uvPHTta8aN4dDcd3Q81U5wl8PI718wkl2A4eRFQg+4W+LosRhH1xZ5dPo9hAJhw8DMh4ytLdI5Ft3ShfuCDC/N/AMdtzXsl7IlxgAAAABJRU5ErkJggg=="}},X={horizontal:Array(54).fill(null).map((()=>Array(8).fill({active:!1,id:""}))),vertical:Array(54).fill(null).map((()=>Array(8).fill({active:!1,id:""})))},q=(t,e,n,o,i)=>{"horizontal"===n?t>=0&&t<X.horizontal.length&&e>=0&&e<X.horizontal[0].length&&(X.horizontal[t][e]={active:!0,id:o,color:i}):t>=0&&t<X.vertical.length&&e>=0&&e<X.vertical[0].length&&(X.vertical[t][e]={active:!0,id:o,color:i})},Z=(t,e)=>[[-1,0],[1,0],[0,-1],[0,1]].filter((([o,i])=>{const a=t+o,r=e+i;return!(a<0||a>=n||r<0||r>=7||(-1===o?X.vertical[t][e].active:1===o?X.vertical[t+1][e].active:-1===i?X.horizontal[t][e].active:1===i&&X.horizontal[t][e+1].active))})),_={getValidMoves:Z,calculateDistance:(t,e,n,o)=>Math.sqrt(Math.pow(n-t,2)+Math.pow(o-e,2)),findNextStepDijkstra(t,e){if(t.x===e.x&&t.y===e.y)return null;const n=[Object.assign(Object.assign({},t),{cost:0,path:[]})],o=new Set([`${t.x},${t.y}`]);for(;n.length;){n.sort(((t,e)=>t.cost-e.cost));const{x:t,y:i,cost:a,path:r}=n.shift();for(const[s,l]of Z(t,i)){const c=t+s,u=i+l,d=`${c},${u}`;if(o.has(d))continue;o.add(d);const A=[...r,{x:c,y:u}];if(c===e.x&&u===e.y)return A.length>0?A[0]:null;n.push({x:c,y:u,cost:a+1,path:A})}}return null}},tt={blinky:{x:50,y:0},pinky:{x:0,y:0},inky:{x:50,y:6},clyde:{x:0,y:6}};let et="scatter",nt=0,ot=0;const it=t=>{switch(t.direction){case"up":t.direction="down";break;case"down":t.direction="up";break;case"left":t.direction="right";break;case"right":t.direction="left"}},at=(t,e)=>{if(!t.justReleasedFromHouse)return t.respawnCounter&&t.respawnCounter>0?(t.respawnCounter--,void(0===t.respawnCounter&&t.originalName&&(t.name=t.originalName,t.inHouse=!1,t.scared=e.pacman.powerupRemainingDuration>0))):("up"===t.direction&&t.y<=3?(t.direction="down",t.y=3):"down"===t.direction&&t.y>=3&&(t.direction="up",t.y=3),"up"===t.direction?t.y-=1:t.y+=1,void((t.y<3||t.y>=4)&&(t.y=(t.direction,3),t.direction="up"===t.direction?"down":"up")));26===t.x?(t.y=2,t.direction="up",t.inHouse=!1,t.justReleasedFromHouse=!1):t.x<26?(t.x+=1,t.direction="right"):t.x>26&&(t.x-=1,t.direction="left")},rt=(t,e)=>{const n=tt[t.name]||tt.blinky;if(t.target=n,t.x===n.x&&t.y===n.y){const e=_.getValidMoves(t.x,t.y);if(e.length>0){const[n,o]=e[0];t.x+=n,t.y+=o,n>0?t.direction="right":n<0?t.direction="left":o>0?t.direction="down":o<0&&(t.direction="up")}return}const o=dt(t.x,t.y,n.x,n.y,t.direction);o&&(t.x=o.x,t.y=o.y,o.direction&&(t.direction=o.direction))},st=(t,e)=>{var n,o,i,a,r,s,l,c;const u=.5,d=null!==(n=t.subX)&&void 0!==n?n:0,A=null!==(o=t.subY)&&void 0!==o?o:0;if(0!==d||0!==A){const n=d>0?1:d<0?-1:0,o=A>0?1:A<0?-1:0;return t.subX=d+n*u,t.subY=A+o*u,(null!==(i=t.subX)&&void 0!==i?i:0)>=1?(t.x+=1,t.subX=0):(null!==(a=t.subX)&&void 0!==a?a:0)<=-1&&(t.x-=1,t.subX=0),(null!==(r=t.subY)&&void 0!==r?r:0)>=1?(t.y+=1,t.subY=0):(null!==(s=t.subY)&&void 0!==s?s:0)<=-1&&(t.y-=1,t.subY=0),void(0===(null!==(l=t.subX)&&void 0!==l?l:0)&&0===(null!==(c=t.subY)&&void 0!==c?c:0)&&0===e.pacman.powerupRemainingDuration&&(t.scared=!1))}if(0===e.pacman.powerupRemainingDuration)return void(t.scared=!1);(!t.target||t.x===t.target.x&&t.y===t.target.y)&&(t.target=mt(t.x,t.y));const h=lt(t);if(0===h.length)return;const m=t.target.x-t.x,g=t.target.y-t.y;let f=h;if(Math.random()<.5);else{const t=h.filter((t=>{const e=t[0],n=t[1];return m>0&&e>0||m<0&&e<0||g>0&&n>0||g<0&&n<0}));t.length>0&&(f=t)}const[y,x]=f[Math.floor(Math.random()*f.length)];y>0?t.direction="right":y<0?t.direction="left":x>0?t.direction="down":x<0&&(t.direction="up"),t.subX=y*u,t.subY=x*u},lt=t=>_.getValidMoves(t.x,t.y).filter((e=>{const[n,o]=e;return!("right"===t.direction&&n<0||"left"===t.direction&&n>0||"up"===t.direction&&o>0||"down"===t.direction&&o<0)})),ct=(t,e)=>{const n={x:26,y:3};if(Math.abs(t.x-n.x)<=1&&Math.abs(t.y-n.y)<=1)return t.x=n.x,t.y=n.y,t.inHouse=!0,void(t.respawnCounter=1);const o=_.findNextStepDijkstra({x:t.x,y:t.y},n);if(o){const e=o.x-t.x,n=o.y-t.y;e>0?t.direction="right":e<0?t.direction="left":n>0?t.direction="down":n<0&&(t.direction="up"),t.x=o.x,t.y=o.y}else{const e=dt(t.x,t.y,n.x,n.y,t.direction);e&&(t.x=e.x,t.y=e.y,e.direction&&(t.direction=e.direction))}},ut=(t,e)=>{if("eyes"===t.name)return void ct(t);const n=At(t,e);t.target=n;const o=dt(t.x,t.y,n.x,n.y,t.direction);o&&(t.x=o.x,t.y=o.y,o.direction&&(t.direction=o.direction))},dt=(t,e,n,o,i)=>{if(t===n&&e===o)return null;const a=[{x:t,y:e,path:[],direction:i||"right"}],r=new Set;for(r.add(`${t},${e}`);a.length>0;){const t=a.shift(),{x:e,y:i,path:s,direction:l}=t,c=_.getValidMoves(e,i),u=c.filter((t=>{const[e,n]=t;return!l||!("right"===l&&e<0||"left"===l&&e>0||"up"===l&&n>0||"down"===l&&n<0)||1===c.length}));for(const[t,c]of u){const u=e+t,d=i+c,A=`${u},${d}`;if(r.has(A))continue;let h;r.add(A),h=t>0?"right":t<0?"left":c>0?"down":c<0?"up":l;const m=[...s,{x:u,y:d,pathDirection:h}];if(u===n&&d===o)return m.length>0?{x:m[0].x,y:m[0].y,direction:m[0].pathDirection}:null;a.push({x:u,y:d,path:m,direction:h})}}const s=_.getValidMoves(t,e);if(s.length>0){const[n,o]=s[Math.floor(Math.random()*s.length)];let a=i;return n>0?a="right":n<0?a="left":o>0?a="down":o<0&&(a="up"),{x:t+n,y:e+o,direction:a}}return null},At=(t,e)=>{const{pacman:n}=e;let o=ht(e),i=1;if("blinky"===t.name){const t=371,e=(t-ot)/t;if(e>.7&&(i=1.2),e>.9&&(i=1.4),Math.random()<.8*i)return{x:n.x,y:n.y}}switch(t.name){case"blinky":default:return{x:n.x,y:n.y};case"pinky":const i=4;let a=n.x,r=n.y;return"up"===n.direction?(a=n.x-4,r=n.y-4):(a=n.x+o[0]*i,r=n.y+o[1]*i),a=Math.min(Math.max(a,0),52),r=Math.min(Math.max(r,0),6),{x:a,y:r};case"inky":const s=e.ghosts.find((t=>"blinky"===t.name));let l={x:n.x+2*o[0],y:n.y+2*o[1]};if("up"===n.direction&&(l.x=n.x-2,l.y=n.y-2),s){const t=l.x-s.x,e=l.y-s.y;l={x:l.x+t,y:l.y+e}}return l.x=Math.min(Math.max(l.x,0),52),l.y=Math.min(Math.max(l.y,0),6),l;case"clyde":return _.calculateDistance(t.x,t.y,n.x,n.y)<8?tt.clyde:{x:n.x,y:n.y}}},ht=t=>{switch(t.pacman.direction){case"right":return[1,0];case"left":return[-1,0];case"up":return[0,-1];case"down":return[0,1];default:return[0,0]}},mt=(t,e)=>{const n=t+Math.floor(17*Math.random())-8,o=e+Math.floor(17*Math.random())-8;return{x:Math.max(0,Math.min(n,52)),y:Math.max(0,Math.min(o,6))}},gt=t=>{ot=(t=>{let e=0;for(let o=0;o<n;o++)for(let n=0;n<7;n++)"NONE"!==t.grid[o][n].level&&e++;return e})(t),(t=>{t.pacman.powerupRemainingDuration>0||(nt++,nt>=5*("scatter"===et?7:20)&&(et="scatter"===et?"chase":"scatter",nt=0,t.ghosts.forEach((t=>{t.inHouse||"eyes"===t.name||t.scared||it(t)}))))})(t);for(const e of t.ghosts)e.inHouse?at(e,t):("eyes"===e.name&&(e.scared=!1),e.scared?st(e,t):"eyes"===e.name?ct(e):"scatter"===et?rt(e):ut(e,t))};var ft;!function(t){t.CONSERVATIVE="conservative",t.AGGRESSIVE="aggressive",t.OPPORTUNISTIC="opportunistic"}(ft||(ft={}));const yt=t=>{const e=[];for(let o=0;o<n;o++)for(let n=0;n<7;n++){const i=t.grid[o][n];if("NONE"!==i.level){const a=_.calculateDistance(o,n,t.pacman.x,t.pacman.y),r=i.commitsCount/(a+1);e.push({x:o,y:n,value:r})}}return e.sort(((t,e)=>e.value-t.value)),0===e.length?{x:t.pacman.x,y:t.pacman.y,value:0}:e[0]},xt=t=>{const e=new Map,o=!!t.pacman.powerupRemainingDuration;if(t.ghosts.forEach((t=>{if(!t.scared)for(let o=-5;o<=5;o++)for(let i=-5;i<=5;i++){const a=t.x+o,r=t.y+i;if(a>=0&&a<n&&r>=0&&r<7){const t=`${a},${r}`,n=15-(Math.abs(o)+Math.abs(i));if(n>0){const o=e.get(t)||0;e.set(t,Math.max(o,n))}}}})),o)for(const[t,n]of e.entries())e.set(t,n/5);return e},vt=(t,e)=>{var n;(n=t.pacman).recentPositions||(n.recentPositions=[]),t.pacman.recentPositions.push(`${e.x},${e.y}`),t.pacman.recentPositions.length>5&&t.pacman.recentPositions.shift();const o=e.x-t.pacman.x,i=e.y-t.pacman.y;t.pacman.direction=o>0?"right":o<0?"left":i>0?"down":i<0?"up":t.pacman.direction,t.pacman.x=e.x,t.pacman.y=e.y},pt=t=>{t.pacman.powerupRemainingDuration=15,t.ghosts.forEach((t=>{"eyes"!==t.name&&(t.scared=!0)}))},bt=t=>{if(t.pacman.deadRemainingDuration)return;const e=!!t.pacman.powerupRemainingDuration,n=t.ghosts.filter((t=>t.scared));let o;try{if(e&&n.length>0){const e=(t=>{const e=t.ghosts.filter((t=>t.scared));return 0===e.length?null:e.reduce(((e,n)=>{const o=_.calculateDistance(n.x,n.y,t.pacman.x,t.pacman.y);return o<e.distance?{x:n.x,y:n.y,distance:o}:e}),{x:t.pacman.x,y:t.pacman.y,distance:1/0})})(t);o=null!=e?e:yt(t)}else t.pacman.target?t.pacman.x===t.pacman.target.x&&t.pacman.y===t.pacman.target.y?(o=yt(t),t.pacman.target=o):o=t.pacman.target:(o=yt(t),t.pacman.target=o);o||(o={x:t.pacman.x,y:t.pacman.y});const i=((t,e)=>{var n;const o=[{x:t.pacman.x,y:t.pacman.y,path:[],score:0}],i=new Set([`${t.pacman.x},${t.pacman.y}`]),a=xt(t);let r=.5,s=.5;switch(t.config.playerStyle){case ft.CONSERVATIVE:r=3,s=.1;break;case ft.AGGRESSIVE:r=.3,s=2;break;case ft.OPPORTUNISTIC:default:r=.8,s=.8}let l=1/0;t.ghosts.forEach((e=>{if(!e.scared){const n=_.calculateDistance(t.pacman.x,t.pacman.y,e.x,e.y);l=Math.min(l,n)}}));const c=t.config.playerStyle===ft.CONSERVATIVE?5:7,u=l<c;for(t.config.playerStyle===ft.CONSERVATIVE&&u&&(r*=5);o.length>0;){o.sort(((t,e)=>e.score-t.score));const l=o.shift(),{x:c,y:u,path:d}=l;if(c===e.x&&u===e.y){if(d.length>0){let e=0,n=0;return d.forEach((o=>{const i=`${o.x},${o.y}`,l=a.get(i)||0,c=t.grid[o.x][o.y].commitsCount;e-=l*r,n+=c*s})),d[0]}return null}for(const[l,A]of _.getValidMoves(c,u)){const h=c+l,m=u+A,g=`${h},${m}`;if(!i.has(g)){const l=[...d,{x:h,y:m}],c=a.get(g)||0,u=t.grid[h][m].commitsCount,A=_.calculateDistance(h,m,e.x,e.y),f=(null===(n=t.pacman.recentPositions)||void 0===n?void 0:n.includes(g))?100:0;let y,x,v;t.config.playerStyle===ft.CONSERVATIVE?(y=(15-c)*r,c>=5?y-=100:y+=50,x=u*s,v=5*y+x+-A/10-f):(y=(15-c)*r,x=u*s,v=y+x+-A/10-f),o.push({x:h,y:m,path:l,score:v}),i.add(g)}}}return null})(t,o);i?vt(t,i):(t=>{const e=_.getValidMoves(t.pacman.x,t.pacman.y);if(0===e.length)return;const n=e.reduce(((e,[n,o])=>{const i=t.pacman.x+n,a=t.pacman.y+o;let r=1/0;return t.ghosts.forEach((t=>{if(!t.scared){const e=_.calculateDistance(t.x,t.y,i,a);r=Math.min(r,e)}})),r>e.distance?{dx:n,dy:o,distance:r}:e}),{dx:0,dy:0,distance:-1/0});vt(t,{x:t.pacman.x+n.dx,y:t.pacman.y+n.dy})})(t),(t=>{const e=t.grid[t.pacman.x][t.pacman.y];if("NONE"!==e.level){t.pacman.totalPoints+=e.commitsCount,t.pacman.points++,t.config.pointsIncreasedCallback(t.pacman.totalPoints);const n=d(t);"FOURTH_QUARTILE"===e.level&&pt(t),e.level="NONE",e.color=n.intensityColors[0],e.commitsCount=0}})(t)}catch(t){console.error("Error in movePacman:",t)}},Ct=t=>{const e=10,n=t,o=2*Math.PI-t;return`M 10,10\n L ${e+e*Math.cos(n)},${e+e*Math.sin(n)}\n A 10,10 0 1,1 ${e+e*Math.cos(o)},${e+e*Math.sin(o)}\n Z`},wt=(t,e,n)=>t.gameHistory.map((t=>t.grid[e][n].color)),Bt=(t,e)=>{if(t.gameHistory.length!==e.length)throw new Error(`The amount of values (${e.length}) does not match the size of the game history (${t.gameHistory.length})`);const n=t.gameHistory.length;if(0===n)return{keyTimes:"0;1",values:e[0]||"#000;#000"};let o=[],i=[],a=null,r=null;return e.forEach(((t,e)=>{t!==a&&(null!==a&&null!==r&&e-1!==r&&(o.push(Number(((e-1/40)/(n-1)).toFixed(4))),i.push(a)),o.push(Number((e/(n-1)).toFixed(4))),i.push(t),a=t,r=e)})),0!==o.length&&1===o[o.length-1]||(0===o.length?(o.push(0,1),i.push(e[0]||"#000",e[e.length-1]||"#000")):(o.push(1),i.push(a||e[e.length-1]||"#000"))),{keyTimes:o.join(";"),values:i.join(";")}},Mt=t=>{const e=t.gameHistory.length*o;let i='<svg width="1166" height="184" xmlns="http://www.w3.org/2000/svg">';i+=`<desc>Generated with pacman-contribution-graph on ${new Date}</desc>`,i+=`<metadata>\n\t\t<info>\n\t\t\t<frames>${t.gameHistory.length}</frames>\n\t\t\t<frameRate>5</frameRate>\n\t\t\t<durationMs>${e}</durationMs>\n\t\t\t<generatedOn>${(new Date).toISOString()}</generatedOn>\n\t\t</info>\n\t</metadata>`,i+=`<rect width="100%" height="100%" fill="${d(t).gridBackground}"/>`,i+=(()=>{let t="<defs>";return["blinky","inky","pinky","clyde"].forEach((e=>{["up","down","left","right"].forEach((n=>{const o=$[e];n in o&&(t+=`\n <symbol id="ghost-${e}-${n}" viewBox="0 0 20 20">\n <image href="${o[n]}" width="20" height="20"/>\n </symbol>\n `)}))})),t+=`\n <symbol id="ghost-scared" viewBox="0 0 20 20">\n <image href="${$.scared.imgDate}" width="20" height="20"/>\n </symbol>`,["up","down","left","right"].forEach((e=>{$.eyes&&e in $.eyes?t+=`\n <symbol id="ghost-eyes-${e}" viewBox="0 0 20 20">\n <image href="${$.eyes[e]}" width="20" height="20"/>\n </symbol>\n `:(console.warn(`Imagem para eyes-${e} não encontrada, usando placeholder`),t+=`\n <symbol id="ghost-eyes-${e}" viewBox="0 0 20 20">\n <circle cx="10" cy="10" r="${20/3}" fill="white"/>\n </symbol>\n `)})),t+="</defs>",t})();let a="";for(let e=0;e<n;e++)t.monthLabels[e]!==a&&(i+=`<text x="${22*e+10}" y="10" text-anchor="middle" font-size="10" fill="${d(t).textColor}">${t.monthLabels[e]}</text>`,a=t.monthLabels[e]);for(let o=0;o<n;o++)for(let n=0;n<7;n++){const a=22*o,r=22*n+15,s=Bt(t,wt(t,o,n));i+=`<rect id="c-${o}-${n}" x="${a}" y="${r}" width="20" height="20" rx="5" fill="${d(t).intensityColors[0]}">\n\t\t\t\t<animate attributeName="fill" dur="${e}ms" repeatCount="indefinite" \n\t\t\t\t\tvalues="${s.values}" \n\t\t\t\t\tkeyTimes="${s.keyTimes}"/>\n\t\t\t</rect>`}for(let e=0;e<7;e++){let o=null;for(let a=0;a<=n;a++){let r=a<n&&X.horizontal[a][e].active;r&&null===o&&(o=a),r&&a!==n||null===o||(i+=`<rect id="wh-${o}-${e}" x="${22*o-2}" y="${22*e-2+15}" width="${22*(a-o)}" height="2" fill="${d(t).wallColor}"></rect>`,o=null)}}for(let e=0;e<n;e++){let n=null;for(let o=0;o<=7;o++){let a=o<7&&X.vertical[e][o].active;a&&null===n&&(n=o),a&&7!==o||null===n||(i+=`<rect id="wv-${e}-${n}" x="${22*e-2}" y="${22*n-2+15}" width="2" height="${22*(o-n)}" fill="${d(t).wallColor}"></rect>`,n=null)}}const r=Bt(t,t.gameHistory.map((t=>{return(e=t.pacman).deadRemainingDuration?"#80808064":e.powerupRemainingDuration?"red":W;var e}))),s=Bt(t,(t=>t.gameHistory.map((t=>`${22*t.pacman.x},${22*t.pacman.y+15}`)))(t)),l=Bt(t,(t=>t.gameHistory.map(((e,n)=>{const o=Math.min(n+1,t.gameHistory.length-1);return(t=>{switch(t){case"right":default:return"0 10 10";case"left":return"180 10 10";case"up":return"270 10 10";case"down":return"90 10 10"}})(t.gameHistory[o].pacman.direction)})))(t));return i+=`<path id="pacman" d="${Ct(.55)}" fill="${W}">\n\t\t<animate attributeName="fill" dur="${e}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${r.keyTimes}"\n\t\t\tvalues="${r.values}"/>\n\t\t<animateTransform attributeName="transform" type="translate" dur="${e}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${s.keyTimes}"\n\t\t\tvalues="${s.values}"\n\t\t\tadditive="sum"/>\n\t\t<animateTransform attributeName="transform" type="rotate" dur="${e}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${l.keyTimes}"\n\t\t\tvalues="${l.values}"\n\t\t\tcalcMode="discrete"\n\t\t\tadditive="sum"/>\n\t\t<animate attributeName="d" dur="0.5s" repeatCount="indefinite"\n\t\t\tvalues="${Ct(.55)};${Ct(.05)};${Ct(.55)}"/>\n\t</path>`,t.ghosts.forEach(((n,o)=>{const a=Bt(t,((t,e)=>t.gameHistory.map((t=>{var n,o;if(e>=t.ghosts.length)return"0,0";const i=t.ghosts[e];return`${22*(i.x+(null!==(n=i.subX)&&void 0!==n?n:0))},${22*(i.y+(null!==(o=i.subY)&&void 0!==o?o:0))+15}`})))(t,o));i+=`<g id="ghost${o}" transform="translate(0,0)">\n\t\t\t<animateTransform attributeName="transform" type="translate" \n\t\t\t\tdur="${e}ms" repeatCount="indefinite"\n\t\t\t\tkeyTimes="${a.keyTimes}"\n\t\t\t\tvalues="${a.values}"\n\t\t\t\tadditive="replace"/>`;const r=function(t,e){const n={};["blinky-up","blinky-down","blinky-left","blinky-right","inky-up","inky-down","inky-left","inky-right","pinky-up","pinky-down","pinky-left","pinky-right","clyde-up","clyde-down","clyde-left","clyde-right","eyes-up","eyes-down","eyes-left","eyes-right","scared"].forEach((t=>{n[t]=[{time:0,visible:!1}]}));const o=t.ghosts[e];if(!o)return n;const i=o.scared?"scared":"eyes"===o.name?`eyes-${o.direction||"right"}`:`${o.name}-${o.direction||"right"}`;n[i]=[{time:0,visible:!0}];let a=i;return t.gameHistory.forEach(((o,i)=>{if(e>=o.ghosts.length)return;const r=o.ghosts[e],s=i/(t.gameHistory.length-1),l=r.scared?"scared":"eyes"===r.name?`eyes-${r.direction||"right"}`:`${r.name}-${r.direction||"right"}`;l!==a&&(n[a].push({time:s,visible:!1}),n[l]||(n[l]=[{time:0,visible:!1}]),n[l].push({time:s,visible:!0}),a=l)})),n[a].push({time:1,visible:!0}),Object.keys(n).forEach((t=>{t!==a&&n[t].length>0&&n[t][n[t].length-1].time<1&&n[t].push({time:1,visible:!1})})),n}(t,o);for(const[t,n]of Object.entries(r)){if(0===n.length)continue;const o=`#ghost-${t}`,a=n.map((t=>t.time.toFixed(4))).join(";"),r=n.map((t=>t.visible?"visible":"hidden")).join(";"),s=n[0].visible?"visible":"hidden";i+=`<use href="${o}" width="20" height="20" visibility="${s}">\n\t\t\t\t<animate attributeName="visibility" \n\t\t\t\t\tdur="${e}ms" repeatCount="indefinite"\n\t\t\t\t\tkeyTimes="${a}"\n\t\t\t\t\tvalues="${r}" />\n\t\t\t</use>`}i+="</g>"})),i+="</svg>",i};var Et=function(t,e,n,o){return new(n||(n=Promise))((function(i,a){function r(t){try{l(o.next(t))}catch(t){a(t)}}function s(t){try{l(o.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}l((o=o.apply(t,e||[])).next())}))};const kt=t=>{t.ghosts=[{x:26,y:2,name:"blinky",direction:"left",scared:!1,target:void 0,inHouse:!1,respawnCounter:0,freezeCounter:0,justReleasedFromHouse:!1},{x:25,y:3,name:"inky",direction:"up",scared:!1,target:void 0,inHouse:!0,respawnCounter:0,freezeCounter:10,justReleasedFromHouse:!1},{x:26,y:3,name:"pinky",direction:"down",scared:!1,target:void 0,inHouse:!0,respawnCounter:0,freezeCounter:20,justReleasedFromHouse:!1},{x:27,y:3,name:"clyde",direction:"up",scared:!1,target:void 0,inHouse:!0,respawnCounter:0,freezeCounter:30,justReleasedFromHouse:!1}],t.ghosts.forEach((t=>{t.justReleasedFromHouse=!1,t.respawnCounter=0,t.inHouse&&("inky"===t.name?t.direction="up":"pinky"===t.name?t.direction="down":"clyde"===t.name&&(t.direction="up"))}))},Tt=t=>Et(void 0,void 0,void 0,(function*(){var e,n;if(t.frameCount++,t.pacman.deadRemainingDuration>0&&(t.pacman.deadRemainingDuration--,0===t.pacman.deadRemainingDuration&&((t=>{t.pacman.x=27,t.pacman.y=7,t.pacman.direction="right",t.pacman.recentPositions=[]})(t),kt(t))),t.pacman.powerupRemainingDuration>0&&(t.pacman.powerupRemainingDuration--,0===t.pacman.powerupRemainingDuration&&(t.ghosts.forEach((t=>{var e,n;"eyes"!==t.name&&0===(null!==(e=t.subX)&&void 0!==e?e:0)&&0===(null!==(n=t.subY)&&void 0!==n?n:0)&&(t.scared=!1)})),t.pacman.points=0)),t.ghosts.forEach((e=>{e.inHouse&&e.respawnCounter&&e.respawnCounter>0&&(e.respawnCounter--,0===e.respawnCounter&&(e.name=e.originalName||(t=>{const e=["blinky","inky","pinky","clyde"];return e[t%e.length]})(t.ghosts.indexOf(e)),e.inHouse=!1,e.scared=t.pacman.powerupRemainingDuration>0,e.justReleasedFromHouse=!0)),e.freezeCounter&&(e.freezeCounter--,0===e.freezeCounter&&St(t,e.name))})),!t.grid.some((t=>t.some((t=>t.commitsCount>0))))){const n=Mt(t);return t.config.svgCallback(n),t.config.gameStatsCallback&&t.config.gameStatsCallback({totalScore:t.pacman.totalPoints,steps:t.aliveSteps,ghostsEaten:null!==(e=t.pacman.ghostsEaten)&&void 0!==e?e:0}),void t.config.gameOverCallback()}bt(t),It(t),0===t.pacman.deadRemainingDuration&&(gt(t),It(t)),t.pacmanMouthOpen=!t.pacmanMouthOpen,0===t.pacman.deadRemainingDuration&&t.aliveSteps++,t.config.gameStatsCallback&&t.config.gameStatsCallback({totalScore:t.pacman.totalPoints,steps:t.aliveSteps,ghostsEaten:null!==(n=t.pacman.ghostsEaten)&&void 0!==n?n:0}),Rt(t)})),Rt=t=>{t.gameHistory.push({pacman:Object.assign({},t.pacman),ghosts:t.ghosts.map((t=>Object.assign({},t))),grid:t.grid.map((t=>t.map((t=>Object.assign({},t)))))})},It=t=>{t.pacman.deadRemainingDuration||t.ghosts.forEach((e=>{var n;"eyes"!==e.name&&e.x===t.pacman.x&&e.y===t.pacman.y&&(t.pacman.powerupRemainingDuration&&e.scared?(e.originalName=e.name,e.name="eyes",e.scared=!1,e.target={x:26,y:3},e.subX=0,e.subY=0,t.pacman.points+=10,t.pacman.ghostsEaten=(null!==(n=t.pacman.ghostsEaten)&&void 0!==n?n:0)+1):(t.pacman.points=0,t.pacman.powerupRemainingDuration=0,0===t.pacman.deadRemainingDuration&&(t.pacman.deadRemainingDuration=10)))}))},St=(t,e)=>{const n=t.ghosts.find((t=>t.name===e&&t.inHouse));n&&(n.justReleasedFromHouse=!0,n.y=2,n.direction="up")},Dt={frameCount:0,aliveSteps:0,contributions:[],pacman:{x:0,y:0,direction:"right",points:0,totalPoints:0,deadRemainingDuration:0,powerupRemainingDuration:0,recentPositions:[],ghostsEaten:0},ghosts:[],grid:[],monthLabels:[],pacmanMouthOpen:!0,gameInterval:0,gameHistory:[],config:void 0,useGithubThemeColor:!0},Nt=(t,e,o,i,a)=>{"horizontal"==o?(q(t,e,"horizontal",a),"x"==i?q(n-t-1,e,"horizontal",a):"y"==i?q(t,7-e,"horizontal",a):"xy"==i&&(q(n-t-1,e,"horizontal",a),q(t,7-e,"horizontal",a),q(n-t-1,7-e,"horizontal",a))):(q(t,e,"vertical",a),"x"==i?q(n-t,e,"vertical",a):"y"==i?q(t,7-e-1,"vertical",a):"xy"==i&&(q(n-t,e,"vertical",a),q(t,7-e-1,"vertical",a),q(n-t,7-e-1,"vertical",a)))};class Ot{constructor(t){this.conf=Object.assign({},t)}start(){return t=this,e=void 0,o=function*(){const t={platform:"github",username:"",svgCallback:t=>{},gameOverCallback:()=>{},gameTheme:"github",pointsIncreasedCallback:t=>{},githubSettings:{accessToken:""},playerStyle:ft.OPPORTUNISTIC};switch(this.store=JSON.parse(JSON.stringify(Dt)),this.store.config=Object.assign(Object.assign({},t),this.conf),this.store.config.platform){case"gitlab":this.store.contributions=yield y(this.store);break;case"github":this.store.contributions=yield f(this.store);break;default:throw new Error(`Unsupported platform: ${this.store.config.platform}`)}return Nt(0,2,"horizontal","xy","L1"),Nt(1,2,"horizontal","xy","L1"),Nt(4,1,"vertical","x","L2"),Nt(4,2,"vertical","x","L2"),Nt(4,3,"vertical","x","L2"),Nt(4,4,"vertical","x","L2"),Nt(3,3,"horizontal","x","L3"),Nt(2,3,"horizontal","x","L3"),Nt(4,5,"horizontal","x","L4"),Nt(6,4,"vertical","x","L5"),Nt(6,3,"vertical","x","L5"),Nt(6,2,"vertical","x","L5"),Nt(6,2,"horizontal","x","L6"),Nt(7,2,"horizontal","x","L6"),Nt(8,2,"horizontal","x","L6"),Nt(9,2,"horizontal","x","L6"),Nt(13,2,"horizontal","xy","L7"),Nt(14,2,"horizontal","xy","L7"),Nt(15,2,"horizontal","xy","L7"),Nt(16,2,"horizontal","xy","L7"),Nt(17,2,"horizontal","xy","L7"),Nt(18,2,"horizontal","xy","L7"),Nt(16,2,"vertical","xy","L8"),Nt(8,1,"horizontal","x","L9"),Nt(9,1,"horizontal","x","L9"),Nt(10,1,"horizontal","x","L9"),Nt(11,1,"horizontal","x","L9"),Nt(12,1,"vertical","x","L10"),Nt(12,3,"vertical","x","L10"),Nt(11,4,"horizontal","x","L11"),Nt(10,4,"horizontal","x","L11"),Nt(9,4,"horizontal","x","L11"),Nt(8,4,"horizontal","x","L11"),Nt(8,4,"vertical","x","L12"),Nt(8,5,"vertical","x","L12"),Nt(23,1,"horizontal","x","L18"),Nt(22,1,"horizontal","x","L18"),Nt(21,1,"horizontal","x","L18"),Nt(21,1,"vertical","x","L18"),Nt(21,2,"vertical","x","L18"),Nt(21,3,"vertical","x","L18"),Nt(20,4,"horizontal","x","L18"),Nt(19,4,"horizontal","x","L18"),Nt(19,3,"vertical","x","L18"),Nt(18,3,"horizontal","x","L18"),Nt(22,5,"vertical","x","L19"),Nt(21,5,"horizontal","x","L19"),Nt(20,5,"horizontal","x","L19"),Nt(20,5,"vertical","x","L19"),Nt(1,6,"horizontal","x","L20"),Nt(2,6,"horizontal","x","L20"),Nt(3,4,"vertical","x","L20"),Nt(5,6,"horizontal","x","L21"),Nt(6,6,"horizontal","x","L21"),q(25,2,"horizontal","GH_TOP"),q(27,2,"horizontal","GH_TOP"),q(25,4,"horizontal","GH_BOTTOM"),q(26,4,"horizontal","GH_BOTTOM"),q(27,4,"horizontal","GH_BOTTOM"),q(25,3,"vertical","GH_LEFT"),q(28,3,"vertical","GH_RIGHT"),q(25,2,"vertical","GH_LEFT"),q(28,2,"vertical","GH_RIGHT"),A(this.store),h(this.store),yield(e=this.store,Et(void 0,void 0,void 0,(function*(){e.frameCount=0,e.aliveSteps=0,e.gameHistory=[],e.ghosts.forEach((t=>t.scared=!1)),e.grid=m(e);const t=()=>e.grid.some((t=>t.some((t=>t.commitsCount>0))));for(t()&&((t=>{t.pacman={x:0,y:0,direction:"right",points:0,totalPoints:0,deadRemainingDuration:0,powerupRemainingDuration:0,recentPositions:[],ghostsEaten:0}})(e),kt(e));t();)yield Tt(e);yield Tt(e)}))),this.store;var e},new((n=void 0)||(n=Promise))((function(i,a){function r(t){try{l(o.next(t))}catch(t){a(t)}}function s(t){try{l(o.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}l((o=o.apply(t,e||[])).next())}));var t,e,n,o}stop(){var t;t=this.store,Et(void 0,void 0,void 0,(function*(){clearInterval(t.gameInterval)}))}}const Ut=["#e74c3c","#f1c40f","#2ecc71","#3498db","#9b59b6","#e67e22"],Ht=t=>22*t+10,Ft=t=>22*t+15+10,zt=(t,e,n)=>{0===t.keyTimes.length||e!==t.keyTimes[t.keyTimes.length-1]?(t.keyTimes.push(e),t.values.push(n)):t.values[t.values.length-1]=n},Vt=t=>(1!==t.keyTimes[t.keyTimes.length-1]&&(t.keyTimes.push(1),t.values.push(t.values[t.values.length-1])),{keyTimes:t.keyTimes.join(";"),values:t.values.join(";")}),Lt=(t,e)=>Number((t/Math.max(e-1,1)).toFixed(4)),Qt=(t,e,n,o)=>{var i,a;const r=t.gameHistory.length,s=null!==(a=null===(i=t.initialColors[e])||void 0===i?void 0:i[n])&&void 0!==a?a:o,l=t.cellEvents.filter((t=>t.x===e&&t.y===n));if(0===l.length)return{keyTimes:"0;1",values:`${s};${s}`};const c={keyTimes:[0],values:[s]};for(const t of l){const e=Lt(t.frameIndex,r);zt(c,e,t.color)}return Vt(c)},jt=t=>{var e,i,a,r,s,l,c,u,A;const h=t.gameHistory.length,m=`${Math.max(h*o/6,1e3)}ms`,g=d(t),f=g.intensityColors[0];let y='<svg width="1166" height="249" xmlns="http://www.w3.org/2000/svg">';y+=`<desc>Generated with puzzle-bobble-contribution-graph on ${new Date}</desc>`,y+=`<rect width="100%" height="100%" fill="${g.gridBackground}"/>`;let x="";for(let e=0;e<n;e++)t.monthLabels[e]!==x&&(y+=`<text x="${22*e+10}" y="10" text-anchor="middle" font-size="10" fill="${g.textColor}">${t.monthLabels[e]}</text>`,x=t.monthLabels[e]);for(let e=0;e<n;e++)for(let n=0;n<7;n++){const o=Ht(e),i=Ft(n),a=Qt(t,e,n,f);y+=`<circle cx="${o}" cy="${i}" r="9" fill="${f}">\n\t\t\t\t<animate attributeName="fill" calcMode="discrete" dur="${m}" repeatCount="indefinite"\n\t\t\t\t\tvalues="${a.values}" keyTimes="${a.keyTimes}"/>\n\t\t\t</circle>`}if(h>=2){const n=(t=>{const e=[],n=new Map;for(let o=0;o<t.gameHistory.length;o++){const i=t.gameHistory[o].activeBubble;for(const[t,a]of n)i&&i.id===t||(e.push({id:t,colorIndex:a.colorIndex,startFrame:a.startFrame,endFrame:o-1,xPositions:a.xs,yPositions:a.ys}),n.delete(t));if(i&&i.active)if(n.has(i.id)){const t=n.get(i.id);t.xs.push(i.x),t.ys.push(i.y)}else n.set(i.id,{colorIndex:i.colorIndex,startFrame:o,xs:[i.x],ys:[i.y]})}for(const[o,i]of n)e.push({id:o,colorIndex:i.colorIndex,startFrame:i.startFrame,endFrame:t.gameHistory.length-1,xPositions:i.xs,yPositions:i.ys});return e})(t);for(const t of n){const n=Number((t.startFrame/(h-1)).toFixed(4)),o=Number((Math.min(t.endFrame+1,h-1)/(h-1)).toFixed(4)),i=null!==(e=Ut[t.colorIndex])&&void 0!==e?e:Ut[0];let a,r;n<=0&&o>=1?(a="0;1",r="1;1"):n<=0?(a=`0;${o};${o};1`,r="1;1;0;0"):o>=1?(a=`0;${n};${n};1`,r="0;0;1;1"):(a=`0;${n};${n};${o};${o};1`,r="0;0;1;1;0;0");const s=[],l=[],c=t.xPositions[0].toFixed(1),u=t.yPositions[0].toFixed(1);t.startFrame>0&&(s.push(0),l.push(`${c},${u}`));for(let e=0;e<t.xPositions.length;e++){const n=t.startFrame+e,o=Number((n/(h-1)).toFixed(4)),i=t.xPositions[e].toFixed(1),a=t.yPositions[e].toFixed(1);0!==s.length&&o===s[s.length-1]||(s.push(o),l.push(`${i},${a}`))}if(1!==s[s.length-1]){const e=t.xPositions[t.xPositions.length-1].toFixed(1),n=t.yPositions[t.yPositions.length-1].toFixed(1);s.push(1),l.push(`${e},${n}`)}y+=`<circle cx="0" cy="0" r="9" fill="${i}" opacity="0" stroke="white" stroke-width="1" stroke-opacity="0.4">\n\t\t\t\t<animate attributeName="opacity" calcMode="discrete" dur="${m}" repeatCount="indefinite"\n\t\t\t\t\tkeyTimes="${a}" values="${r}"/>\n\t\t\t\t<animateTransform attributeName="transform" type="translate" calcMode="linear"\n\t\t\t\t\tdur="${m}" repeatCount="indefinite"\n\t\t\t\t\tkeyTimes="${s.join(";")}" values="${l.join(";")}"/>\n\t\t\t</circle>`}}if(h>=2)for(const e of t.popEvents){const t=Number((e.frameIndex/(h-1)).toFixed(4)),n=Number((Math.min(e.frameIndex+8,h-1)/(h-1)).toFixed(4));if(n<=t)continue;const o=`0;${t};${t};${n};1`,i="0;0;1;0;0";for(const{x:t,y:n}of e.cells)y+=`<circle cx="${Ht(t).toFixed(1)}" cy="${Ft(n).toFixed(1)}" r="4" fill="none" stroke="${e.color}" stroke-width="2" opacity="0">\n\t\t\t\t\t<animate attributeName="r" calcMode="linear" dur="${m}" repeatCount="indefinite" keyTimes="${o}" values="4;4;4;20;20"/>\n\t\t\t\t\t<animate attributeName="stroke-width" calcMode="linear" dur="${m}" repeatCount="indefinite" keyTimes="${o}" values="2;2;2;0;0"/>\n\t\t\t\t\t<animate attributeName="opacity" calcMode="linear" dur="${m}" repeatCount="indefinite" keyTimes="${o}" values="${i}"/>\n\t\t\t\t</circle>`}if(h>=2){const e=169,n=583..toFixed(1),o=(e+30).toFixed(1),d={keyTimes:[],values:[]};for(let e=0;e<t.gameHistory.length;e++){const i=Lt(e,h),a=(90-t.gameHistory[e].cannon.angleDeg).toFixed(1);zt(d,i,`${a} ${n} ${o}`)}const f=Vt(d),x=22,v=Number(n),p=Number(o),b=p-x,C={keyTimes:[],values:[]};for(let e=0;e<t.gameHistory.length;e++){const n=Lt(e,h),o=t.gameHistory[e].currentBubbleColorIndex;zt(C,n,null!==(i=Ut[o])&&void 0!==i?i:Ut[0])}const w=Vt(C);y+=`<circle cx="${n}" cy="${o}" r="10" fill="${null!==(s=Ut[null!==(r=null===(a=t.gameHistory[0])||void 0===a?void 0:a.currentBubbleColorIndex)&&void 0!==r?r:0])&&void 0!==s?s:Ut[0]}" stroke="white" stroke-width="2">\n\t\t\t<animate attributeName="fill" calcMode="discrete" dur="${m}" repeatCount="indefinite"\n\t\t\t\tvalues="${w.values}" keyTimes="${w.keyTimes}"/>\n\t\t\t<animateTransform attributeName="transform" type="rotate" calcMode="linear"\n\t\t\t\tdur="${m}" repeatCount="indefinite"\n\t\t\t\tkeyTimes="${f.keyTimes}" values="${f.values}"/>\n\t\t</circle>`,y+=`<line x1="${v}" y1="${p}" x2="${v}" y2="${b}" stroke="#cccccc" stroke-width="6" stroke-linecap="round">\n\t\t\t<animateTransform attributeName="transform" type="rotate" calcMode="linear"\n\t\t\t\tdur="${m}" repeatCount="indefinite"\n\t\t\t\tkeyTimes="${f.keyTimes}" values="${f.values}"/>\n\t\t</line>`;const B={keyTimes:[],values:[]};for(let e=0;e<t.gameHistory.length;e++){const n=Lt(e,h),o=t.gameHistory[e].nextBubbleColorIndex;zt(B,n,null!==(l=Ut[o])&&void 0!==l?l:Ut[0])}const M=Vt(B),E=(Number(n)+28).toFixed(1),k=o,T=null!==(A=Ut[null!==(u=null===(c=t.gameHistory[0])||void 0===c?void 0:c.nextBubbleColorIndex)&&void 0!==u?u:0])&&void 0!==A?A:Ut[0];y+=`<text x="${E}" y="${(Number(o)-16).toFixed(1)}" text-anchor="middle" font-size="8" fill="${g.textColor}" opacity="0.8">NEXT</text>`,y+=`<circle cx="${E}" cy="${k}" r="9" fill="${T}" stroke="white" stroke-width="1" stroke-opacity="0.5">\n\t\t\t<animate attributeName="fill" calcMode="discrete" dur="${m}" repeatCount="indefinite"\n\t\t\t\tvalues="${M.values}" keyTimes="${M.keyTimes}"/>\n\t\t</circle>`}return y+="</svg>",y};const Yt=t=>22*t+10,Pt=t=>22*t+15+10,Gt=t=>Math.round((t-10)/22),Jt=t=>Math.round((t-15-10)/22),Kt=t=>t.grid.some((t=>t.some((t=>t.commitsCount>0)))),Wt=(t,e,o,i)=>{var a,r,s;const l=new Set,c=[],u=[{x:e,y:o}];for(;u.length;){const{x:e,y:o}=u.pop(),d=`${e},${o}`;if(l.has(d))continue;if(e<0||e>=n||o<0||o>=7)continue;const A=null===(a=t.grid[e])||void 0===a?void 0:a[o];A&&0!==A.commitsCount&&(null!==(s=null===(r=t.cellBubbleColors[e])||void 0===r?void 0:r[o])&&void 0!==s?s:-1)===i&&(l.add(d),c.push({x:e,y:o}),u.push({x:e-1,y:o},{x:e+1,y:o},{x:e,y:o-1},{x:e,y:o+1}))}return c},$t=(t,e,o,i)=>{var a,r,s,l;const c=o*Math.PI/180;let u=10*Math.cos(c),d=-10*Math.sin(c),A=t,h=e;for(let t=0;t<2e3;t++){if(A+=u,h+=d,A<9&&(A=9,u=Math.abs(u)),A>1157&&(A=1157,u=-Math.abs(u)),h<0)return null;const t=Gt(A),e=Jt(h);if(!(e<0||e>=7||t<0||t>=n)){for(const[o,s]of[[0,0],[1,0],[-1,0],[0,1],[0,-1]]){const l=t+o,c=e+s;if(!(l<0||l>=n||c<0||c>=7)&&(null===(r=null===(a=i.grid[l])||void 0===a?void 0:a[c])||void 0===r?void 0:r.commitsCount)>0){const t=Yt(l),e=Pt(c);if(Math.hypot(A-t,h-e)<20)return{col:Math.max(0,Math.min(52,Gt(A))),row:Math.max(0,Math.min(6,Jt(h)))}}}if(0===e&&0===(null===(l=null===(s=i.grid[t])||void 0===s?void 0:s[0])||void 0===l?void 0:l.commitsCount))return{col:Math.max(0,Math.min(52,t)),row:0}}}return null},Xt=t=>{t.gameHistory.push({cannon:Object.assign({},t.cannon),activeBubble:t.activeBubble?Object.assign({},t.activeBubble):null,nextBubbleColorIndex:t.nextBubbleColorIndex,currentBubbleColorIndex:t.currentBubbleColorIndex})},qt=t=>{var e,o,i,a,r,s,l;if(t.frameCount++,!t.activeBubble){-1===t.cannonTargetAngle&&(t.cannonTargetAngle=((t,e,o,i)=>{var a,r,s,l,c,u,d,A,h,m,g,f,y,x;const v=1664525*t.nextBubbleId+1013904223>>>0,p=[],b=[],C=[],w=[[-1,0],[1,0],[0,-1],[0,1],[-1,1],[0,1],[1,1],[-1,2],[0,2],[1,2]];for(let e=12;e<=168;e+=2){const o=$t(583,199,e,t);if(!o)continue;if((null!==(s=null===(r=null===(a=t.grid[o.col])||void 0===a?void 0:a[o.row])||void 0===r?void 0:r.commitsCount)&&void 0!==s?s:0)>0)continue;let h=!1,m=!1,g=0;for(const[e,a]of w){const r=o.col+e,s=o.row+a;if(!(r<0||r>=n||s<0||s>=7)&&0!==(null!==(u=null===(c=null===(l=t.grid[r])||void 0===l?void 0:l[s])||void 0===c?void 0:c.commitsCount)&&void 0!==u?u:0)&&(m=!0,(null!==(A=null===(d=t.cellBubbleColors[r])||void 0===d?void 0:d[s])&&void 0!==A?A:-1)===i)){h=!0;const e=Wt(t,r,s,i).length+1;e>g&&(g=e)}}g>=3?p.push({angleDeg:e,score:g}):h?b.push(e):m&&C.push(e)}if(p.length>0){const t=Math.max(...p.map((t=>t.score))),e=p.filter((e=>e.score===t));return e[v%e.length].angleDeg}if(b.length>0)return b[v%b.length];if(C.length>0)return C[v%C.length];let B=90,M=1/0;for(let e=12;e<=168;e+=2){const o=$t(583,199,e,t);if(!o)continue;if((null!==(g=null===(m=null===(h=t.grid[o.col])||void 0===h?void 0:h[o.row])||void 0===m?void 0:m.commitsCount)&&void 0!==g?g:0)>0)continue;const i=Yt(o.col),a=Pt(o.row);let r=1/0;for(let e=0;e<n;e++)for(let n=0;n<7;n++)if((null!==(x=null===(y=null===(f=t.grid[e])||void 0===f?void 0:f[n])||void 0===y?void 0:y.commitsCount)&&void 0!==x?x:0)>0){const t=Math.hypot(i-Yt(e),a-Pt(n));t<r&&(r=t)}r<M&&(M=r,B=e)}return B})(t,0,0,t.nextBubbleColorIndex));const i=t.cannonTargetAngle;t.currentBubbleColorIndex=t.nextBubbleColorIndex;const a=i-t.cannon.angleDeg;if(!(Math.abs(a)<=6))return t.cannon.angleDeg+=6*Math.sign(a),t.cannon.angleDeg=Math.max(10,Math.min(170,t.cannon.angleDeg)),void Xt(t);t.cannon.angleDeg=i;const r=t.nextBubbleColorIndex;t.currentBubbleColorIndex=r,t.cannonTargetAngle=-1;const s=new Set;for(let i=0;i<n;i++)for(let n=0;n<7;n++)t.grid[i][n].commitsCount>0&&s.add(null!==(o=null===(e=t.cellBubbleColors[i])||void 0===e?void 0:e[n])&&void 0!==o?o:0);const l=[...s];if(l.length>0){const e=1664525*t.frameCount+1013904223>>>0;t.nextBubbleColorIndex=l[e%l.length]}const c=t.cannon.angleDeg*Math.PI/180;return t.activeBubble={id:t.nextBubbleId++,x:583,y:199,vx:10*Math.cos(c),vy:-10*Math.sin(c),colorIndex:r,active:!0},void Xt(t)}const c=t.activeBubble;if(c.x+=c.vx,c.y+=c.vy,c.x<9&&(c.x=9,c.vx=Math.abs(c.vx)),c.x>1157&&(c.x=1157,c.vx=-Math.abs(c.vx)),c.y<0||c.y>209)return t.activeBubble=null,t.cannonTargetAngle=-1,void Xt(t);let u=!1,A=-1,h=-1;const m=Gt(c.x),g=Jt(c.y);t:for(let e=-1;e<=1;e++)for(let o=-1;o<=1;o++){const l=m+e,d=g+o;if(l<0||l>=n||d<0||d>=7)continue;const f=Yt(l),y=Pt(d);if(Math.hypot(c.x-f,c.y-y)<18){if((null===(a=null===(i=t.grid[l])||void 0===i?void 0:i[d])||void 0===a?void 0:a.commitsCount)>0){if(0===(null===(s=null===(r=t.grid[m])||void 0===r?void 0:r[g])||void 0===s?void 0:s.commitsCount)&&m>=0&&m<n&&g>=0&&g<7)A=m,h=g;else for(const[e,o]of[[0,1],[-1,0],[1,0],[0,-1]]){const i=l+e,a=d+o;if(i>=0&&i<n&&a>=0&&a<7&&0===t.grid[i][a].commitsCount){A=i,h=a;break}}u=!0;break t}if(0===d){A=l,h=0,u=!0;break t}}}if(!u&&g<=0&&m>=0&&m<n&&(A=m,h=0,u=!0),u&&A>=0&&h>=0){A=Math.max(0,Math.min(52,A)),h=Math.max(0,Math.min(6,h));const e=d(t).intensityColors[0],n=null!==(l=Ut[c.colorIndex])&&void 0!==l?l:Ut[0];t.grid[A][h]={commitsCount:1,color:n,level:"FIRST_QUARTILE"},t.cellBubbleColors[A][h]=c.colorIndex,t.cellEvents.push({frameIndex:t.gameHistory.length,x:A,y:h,color:n});const o=Wt(t,A,h,c.colorIndex);if(o.length>=3){const i=n;for(const{x:n,y:i}of o)t.grid[n][i]={commitsCount:0,color:e,level:"NONE"},t.cellBubbleColors[n][i]=-1,t.cellEvents.push({frameIndex:t.gameHistory.length,x:n,y:i,color:e});t.popEvents.push({frameIndex:t.gameHistory.length,cells:o,color:i}),t.config.pointsIncreasedCallback(t.cellEvents.length)}t.activeBubble=null,t.cannonTargetAngle=-1}Xt(t)},Zt=t=>{return e=void 0,o=void 0,a=function*(){var e,o,i;t.frameCount=0,t.nextBubbleId=0,t.gameHistory=[],t.cellEvents=[],t.popEvents=[],t.activeBubble=null,t.grid=m(t);const a=d(t).intensityColors[0],r=[];for(let e=0;e<n;e++)for(let n=0;n<7;n++)t.grid[e][n].commitsCount>0&&r.push({x:e,y:n});const s=r.length<=50?2:r.length<=150?3:r.length<=250?4:r.length<=350?5:6;let l=2654435761*r.length>>>0;const c=()=>(l=Math.imul(l,1664525)+1013904223>>>0,l/4294967296);t.cellBubbleColors=Array.from({length:n},(()=>new Array(7).fill(-1)));for(const{x:e,y:n}of r)t.cellBubbleColors[e][n]=Math.floor(c()*s);for(let n=0;n<3;n++){const n=t.cellBubbleColors.map((t=>[...t]));for(const{x:i,y:a}of r){const r=new Array(s).fill(0);let l=0;for(const[t,s]of[[-1,0],[1,0],[0,-1],[0,1],[-1,-1],[1,-1],[-1,1],[1,1]]){const c=null!==(o=null===(e=n[i+t])||void 0===e?void 0:e[a+s])&&void 0!==o?o:-1;c>=0&&(r[c]++,l++)}if(l>0){const e=Math.max(...r);e>=.5*l&&(t.cellBubbleColors[i][a]=r.indexOf(e))}}}for(const{x:e,y:n}of r){const o=t.cellBubbleColors[e][n];t.grid[e][n]=Object.assign(Object.assign({},t.grid[e][n]),{color:Ut[o]})}t.initialColors=t.grid.map((t=>t.map((t=>t.commitsCount>0?t.color:a))));const u=[...new Set(r.map((({x:e,y:n})=>t.cellBubbleColors[e][n])))];if(t.nextBubbleColorIndex=null!==(i=u[Math.floor(c()*u.length)])&&void 0!==i?i:0,!Kt(t)){const e=jt(t);return t.config.svgCallback(e),void t.config.gameOverCallback()}for(t.cannon={angleDeg:90},t.cannonTargetAngle=-1,t.currentBubbleColorIndex=t.nextBubbleColorIndex;Kt(t)&&t.frameCount<5e3;)qt(t);const A=jt(t);t.config.svgCallback(A),t.config.gameStatsCallback&&t.config.gameStatsCallback({totalScore:t.cellEvents.length,steps:t.frameCount,ghostsEaten:0}),t.config.gameOverCallback()},new((i=void 0)||(i=Promise))((function(t,n){function r(t){try{l(a.next(t))}catch(t){n(t)}}function s(t){try{l(a.throw(t))}catch(t){n(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof i?n:new i((function(t){t(n)}))).then(r,s)}l((a=a.apply(e,o||[])).next())}));var e,o,i,a},_t={frameCount:0,nextBubbleId:0,nextBubbleColorIndex:0,currentBubbleColorIndex:0,cannonTargetAngle:-1,contributions:[],cannon:{angleDeg:90},activeBubble:null,grid:[],monthLabels:[],gameHistory:[],initialColors:[],cellBubbleColors:[],cellEvents:[],popEvents:[],config:void 0};class te{constructor(t){this.conf=Object.assign({},t)}start(){return t=this,e=void 0,o=function*(){switch(this.store=JSON.parse(JSON.stringify(_t)),this.store.config=Object.assign(Object.assign({},{platform:"github",username:"",svgCallback:t=>{},gameOverCallback:()=>{},gameTheme:"github",pointsIncreasedCallback:t=>{},githubSettings:{accessToken:""}}),this.conf),this.store.config.platform){case"gitlab":this.store.contributions=yield y(this.store);break;case"github":this.store.contributions=yield f(this.store);break;default:throw new Error(`Unsupported platform: ${this.store.config.platform}`)}return A(this.store),h(this.store),yield Zt(this.store),this.store},new((n=void 0)||(n=Promise))((function(i,a){function r(t){try{l(o.next(t))}catch(t){a(t)}}function s(t){try{l(o.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}l((o=o.apply(t,e||[])).next())}));var t,e,n,o}stop(){this.store}}var ee=e.Lc,ne=e.b9,oe=e.Cf,ie=e.rn,ae=e.OJ;export{ee as BreakoutRenderer,ne as GalagaRenderer,oe as PacmanRenderer,ie as PlayerStyle,ae as PuzzleBobbleRenderer};
1
+ var t={d:(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{Hr:()=>gn,Lc:()=>vt,b9:()=>Tt,Cf:()=>at,rn:()=>K,OJ:()=>te});const n=53,i=200,a={github:{textColor:"#57606a",gridBackground:"#ffffff",wallColor:"#000000",intensityColors:["#ebedf0","#9be9a8","#40c463","#30a14e","#216e39"]},"github-dark":{textColor:"#8b949e",gridBackground:"#0d1117",wallColor:"#ffffff",intensityColors:["#161b22","#0e4429","#006d32","#26a641","#39d353"]},gitlab:{textColor:"#626167",gridBackground:"#ffffff",wallColor:"#000000",intensityColors:["#ececef","#d2dcff","#7992f5","#4e65cd","#303470"]},"gitlab-dark":{textColor:"#999999",gridBackground:"#1f1f1f",wallColor:"#ffffff",intensityColors:["#2a2a3d","#4a5bdc","#2e3dbf","#1b2e8a","#0f1a4e"]}},o=(t,e)=>Math.floor((e.getTime()-t.getTime())/6048e5),r=t=>new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())),s=t=>{var e;return null!==(e=a[t.config.gameTheme])&&void 0!==e?e:a.github},A=t=>{switch(t){case"NONE":default:return 0;case"FIRST_QUARTILE":return 1;case"SECOND_QUARTILE":return 2;case"THIRD_QUARTILE":return 3;case"FOURTH_QUARTILE":return 4}},l=(t,e)=>{const n=e/4;return 0===t?"NONE":t<n?"FIRST_QUARTILE":t<2*n?"SECOND_QUARTILE":t<3*n?"THIRD_QUARTILE":"FOURTH_QUARTILE"},c=t=>{const e=r(new Date),n=new Date(e);n.setUTCDate(e.getUTCDate()-365),n.setUTCDate(n.getUTCDate()-n.getUTCDay());const i=Array.from({length:53},(()=>Array.from({length:7},(()=>({commitsCount:0,color:s(t).intensityColors[0],level:"NONE"})))));t.contributions.forEach((a=>{const l=r(new Date(a.date));if(l<n||l>e)return;const c=l.getUTCDay(),d=o(n,l);if(d>=0&&d<53){const e=s(t);i[d][c]={commitsCount:a.count,color:e.intensityColors[A(a.level)],level:a.level}}})),t.grid=i},d=s,g=c,u=t=>{const e=r(new Date),i=new Date(e);i.setUTCDate(e.getUTCDate()-365),i.setUTCDate(i.getUTCDate()-i.getUTCDay());const a=o(i,e)+1,s=Array(a).fill("");let A="";for(let t=0;t<a;t++){const e=new Date(i);e.setUTCDate(e.getUTCDate()+7*t);const n=e.toLocaleString("default",{month:"short"});n!==A&&(s[t]=n,A=n)}t.monthLabels=a>n?s.slice(a-n):s},h=t=>(c(t),t.grid);var m=function(t,e,n,i){return new(n||(n=Promise))((function(a,o){function r(t){try{A(i.next(t))}catch(t){o(t)}}function s(t){try{A(i.throw(t))}catch(t){o(t)}}function A(t){var e;t.done?a(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}A((i=i.apply(t,e||[])).next())}))};const f=t=>m(void 0,void 0,void 0,(function*(){var e;return(null===(e=t.config.githubSettings)||void 0===e?void 0:e.accessToken)?yield(t=>m(void 0,void 0,void 0,(function*(){var e;const n=yield fetch("https://api.github.com/graphql",{method:"POST",headers:{Authorization:`Bearer ${null===(e=t.config.githubSettings)||void 0===e?void 0:e.accessToken}`,"Content-Type":"application/json"},body:JSON.stringify({query:"\n\t\tquery ($login: String!) {\n\t\t\tuser(login: $login) {\n\t\t\t\tcontributionsCollection {\n\t\t\t\t\tcontributionCalendar {\n\t\t\t\t\t\tweeks {\n\t\t\t\t\t\t\tcontributionDays {\n\t\t\t\t\t\t\t\tdate\n\t\t\t\t\t\t\t\tcontributionCount\n\t\t\t\t\t\t\t\tcolor\n\t\t\t\t\t\t\t\tcontributionLevel\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t",variables:{login:t.config.username}})});if(!n.ok)throw new Error(`GitHub GraphQL request failed: ${n.status} ${n.statusText}`);return(yield n.json()).data.user.contributionsCollection.contributionCalendar.weeks.map((t=>t.contributionDays)).reduce(((t,e)=>t.concat(e)),[]).map((e=>{const n=e.contributionLevel,i=s(t);return{date:new Date(e.date),count:e.contributionCount,color:i.intensityColors[A(n)],level:n}}))})))(t):yield(t=>m(void 0,void 0,void 0,(function*(){var e,n;const i=[];let a=!1,o=1;do{try{const r={};(null===(e=t.config.githubSettings)||void 0===e?void 0:e.accessToken)&&(r.Authorization="Bearer "+t.config.githubSettings.accessToken);const s=yield fetch(`https://api.github.com/search/commits?q=author:${t.config.username}&sort=author-date&order=desc&page=${o}&per_page=100`,{headers:r}),A=yield s.json();a=!A.items||0===A.items.length,i.push(...null!==(n=A.items)&&void 0!==n?n:[]),o++}catch(t){a=!0}}while(!a);const r=Array.from(i.reduce(((t,e)=>{var n,i,a,o;const r=null===(i=null===(n=e.commit.author)||void 0===n?void 0:n.date)||void 0===i?void 0:i.split("T")[0],s=(null===(o=null===(a=e.commit.committer)||void 0===a?void 0:a.date)||void 0===o?void 0:o.split("T")[0])||r,A=(t.get(s)||{count:0}).count+1;return t.set(s,{date:new Date(s),count:A,color:"",level:"NONE"})}),new Map).values()),c=Math.max(...r.map((t=>t.count)).filter((t=>t>0)));return r.map((e=>{const n=l(e.count,c),i=s(t);return{date:new Date(e.date),count:e.count,color:i.intensityColors[A(n)],level:n}}))})))(t)})),y=t=>{return e=void 0,n=void 0,a=function*(){const e=yield fetch(`https://v0-new-project-q1hhrdodoye-abozanona-gmailcoms-projects.vercel.app/api/contributions?username=${t.config.username}`),n=yield e.json(),i=Object.entries(n).map((([t,e])=>({date:new Date(t),count:Number(e),color:"",level:"NONE"}))),a=Math.max(...i.map((t=>t.count)).filter((t=>t>0)));return i.map((e=>{const n=l(e.count,a),i=s(t);return{date:new Date(e.date),count:e.count,color:i.intensityColors[A(n)],level:n}}))},new((i=void 0)||(i=Promise))((function(t,o){function r(t){try{A(a.next(t))}catch(t){o(t)}}function s(t){try{A(a.throw(t))}catch(t){o(t)}}function A(e){var n;e.done?t(e.value):(n=e.value,n instanceof i?n:new i((function(t){t(n)}))).then(r,s)}A((a=a.apply(e,n||[])).next())}));var e,n,i,a},p="yellow",x={blinky:{up:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABiklEQVR4nIXSO2sVURQF4G8mMwa8QU2KxFcjCoIgacR/oCBYCP4fsTEIBkWwEK21UAQLIdjYaKEiJIXBXhN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lm61uHOvRVb0OmbsPD6drAW/YGH5Fe1PPbYaBykkrNWbvO8MWK8fOBABpb53yIfLPndXnzpIePDomDdf+qSLR4hzCtJU8OSBKOizP66vR/y+Ux33EnBN71P5DQllVXyQma9lAAAAAElFTkSuQmCC",left:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAB4ElEQVR4nH2SvWtUURDFf3Pf24+siYkYFLRRizSaSiVi7V9g7b9hpSgogmIhipVbC0IwQrTQRgQ/CiMxCbsgxi9iIMHGENndrG/vPRZv3+atbDIwMHM4Z+65946xc1SByW791cwuSNIufIiiCOASFB8z/71FU2JTor7miSpPgKtdzgAxgCtdZ2lVSGmG4AnB9/r6uijsuRlh/WLnHLjyFea+CO8TOp12T5Rlp9PG+4TlX6JYuuGcS8VmBnCRd3VNe5/U8id284Okl5kj7xNq6wIu501Mz/xck/c+kaRaTvxc2/FUSh2G4IFnABQKDtzehzYksc8nG5spuefgqDRyJMUa2YBEwsrTUeqeO7z/1uBk8CBtbXSJWQ5LVNIBH/OPu7jSAB4AvOZ3Cs5sSZv/P56kuSDV81gInqYEzMdAky0Po47zpcFffNoGgH8BaDnAMLfDau0S6m5ArwSQQj9JYSCWC9ebJgUsZyXrzVyfqL/vOGCUYQPnYianPrP8J2M6Dh5eYv+BBXx38GoTTkx9wrmYIQDGAG7zttbgzLlXDsqMjV9j4UebieOzBpGBcWziEYsrLcYP3SpCiVNnX/BmqQHcJ45jKJTvAiMAzswwqwLF7XtaDK5q2ZWhgovvRVHMP7z+WsD4PpRYAAAAAElFTkSuQmCC",right:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAB1klEQVR4nI2Tu4tTURDGf2fOvUlMcAXjigpZFfGBlaAI+h/4T9nYCClslFiJLlhZbJXCJmyxrs91bdyXYLFE8UGURaImN3PG4t6blxH8YIr5+OabOXPOcUzBpeECPAAuZnRb4FqAMK2fgPce4Aa+2GTjY5d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64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAj0lEQVR4nO2RsQ7CMAxE79K6aQCJbuztb8Af8P8rX8HaYzCChgbanZ5kyYqezjkb2MR3K02eOUdzJiBwhBCsgPWE7RcmD9YfBsCgp9zdS5Kul/Mpn50z95tzdSkAAKSYZp/7ZDzKF6XYxIUUvw12bbvKAF1VMQCvXUhSydXIjDk2kcDkjL4kF1k+4xrmH/UA3stP0Iur7f8AAAAASUVORK5CYII=",down:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAm0lEQVR4nO2Ryw3CQAxE35jdEBFRAycEpUAJ9A81EBIlcMjPgazEHUbyxX47I3vhLwBiDDydUpxnQt8zgG2+kQeD1A2cTJo3JIqVzV29jod9NrCX82m3xLRt27wHTYlmY+SjquslRpJ9ZVAmDKC/wf0K0lQAuFtWddn0a88ZgAwoKKx7MdRnShxdF5hAHIc5t+Q3rp2BoRT2c3oBFX9xUA7hwq8AAAAASUVORK5CYII=",left:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAuUlEQVR4nO2PvRIBQRCEu+fOIaD8RkoRKCGZwNt4fwKFcutnW2LP1tWdF6CjmdmveruBvxgGSSqOJKvgmEnM6CWYxS7hkYSVbuWdABIC9pTkI2cAeHiv3WazDPsiazWeFczDS0buQQLl0CfnrmHOb10LDHkoJxtV1cXZubyohCyyH36tVuji8vvHwJI6DltMhzNM2jqpUJqmaEdMD8YV5h3l0vHNrAf9zrjV/ARQpLrPYmYBZrWpfkwv2KllZq2VZYMAAAAASUVORK5CYII=",right:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAArklEQVR4nO2RsQrCMBCGv0vaUq2gIlJxEBEX6eLi5jv4/g8h0qViIpxT27S0i3M/COTCx5/cBSYAiIxBA8a8IcfEIhiRjmh7tQHi3pkAVnqpIfs4sbX8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2iL307J/jIzRmHySyldvo4HmZ08iWu8lIiTFxBS57ArRg6/ip6/C4VKapy9/Rug+m8gzXYzOX2DcGIYSU1uvPHTta8aN4dDcd3Q81U5wl8PI718wkl2A4eRFQg+4W+LosRhH1xZ5dPo9hAJhw8DMh4ytLdI5Ft3ShfuCDC/N/AMdtzXsl7IlxgAAAABJRU5ErkJggg=="}},b={horizontal:Array(54).fill(null).map((()=>Array(8).fill({active:!1,id:""}))),vertical:Array(54).fill(null).map((()=>Array(8).fill({active:!1,id:""})))},v=(t,e,n,i,a)=>{"horizontal"===n?t>=0&&t<b.horizontal.length&&e>=0&&e<b.horizontal[0].length&&(b.horizontal[t][e]={active:!0,id:i,color:a}):t>=0&&t<b.vertical.length&&e>=0&&e<b.vertical[0].length&&(b.vertical[t][e]={active:!0,id:i,color:a})},C=(t,e)=>[[-1,0],[1,0],[0,-1],[0,1]].filter((([i,a])=>{const o=t+i,r=e+a;return!(o<0||o>=n||r<0||r>=7||(-1===i?b.vertical[t][e].active:1===i?b.vertical[t+1][e].active:-1===a?b.horizontal[t][e].active:1===a&&b.horizontal[t][e+1].active))})),w={getValidMoves:C,calculateDistance:(t,e,n,i)=>Math.sqrt(Math.pow(n-t,2)+Math.pow(i-e,2)),findNextStepDijkstra(t,e){if(t.x===e.x&&t.y===e.y)return null;const n=[Object.assign(Object.assign({},t),{cost:0,path:[]})],i=new Set([`${t.x},${t.y}`]);for(;n.length;){n.sort(((t,e)=>t.cost-e.cost));const{x:t,y:a,cost:o,path:r}=n.shift();for(const[s,A]of C(t,a)){const l=t+s,c=a+A,d=`${l},${c}`;if(i.has(d))continue;i.add(d);const g=[...r,{x:l,y:c}];if(l===e.x&&c===e.y)return g.length>0?g[0]:null;n.push({x:l,y:c,cost:o+1,path:g})}}return null}},B={blinky:{x:50,y:0},pinky:{x:0,y:0},inky:{x:50,y:6},clyde:{x:0,y:6}};let E="scatter",k=0,U=0;const S=t=>{switch(t.direction){case"up":t.direction="down";break;case"down":t.direction="up";break;case"left":t.direction="right";break;case"right":t.direction="left"}},R=(t,e)=>{if(!t.justReleasedFromHouse)return t.respawnCounter&&t.respawnCounter>0?(t.respawnCounter--,void(0===t.respawnCounter&&t.originalName&&(t.name=t.originalName,t.inHouse=!1,t.scared=e.pacman.powerupRemainingDuration>0))):("up"===t.direction&&t.y<=3?(t.direction="down",t.y=3):"down"===t.direction&&t.y>=3&&(t.direction="up",t.y=3),"up"===t.direction?t.y-=1:t.y+=1,void((t.y<3||t.y>=4)&&(t.y=(t.direction,3),t.direction="up"===t.direction?"down":"up")));26===t.x?(t.y=2,t.direction="up",t.inHouse=!1,t.justReleasedFromHouse=!1):t.x<26?(t.x+=1,t.direction="right"):t.x>26&&(t.x-=1,t.direction="left")},M=(t,e)=>{const n=B[t.name]||B.blinky;if(t.target=n,t.x===n.x&&t.y===n.y){const e=w.getValidMoves(t.x,t.y);if(e.length>0){const[n,i]=e[0];t.x+=n,t.y+=i,n>0?t.direction="right":n<0?t.direction="left":i>0?t.direction="down":i<0&&(t.direction="up")}return}const i=V(t.x,t.y,n.x,n.y,t.direction);i&&(t.x=i.x,t.y=i.y,i.direction&&(t.direction=i.direction))},I=(t,e)=>{var n,i,a,o,r,s,A,l;const c=.5,d=null!==(n=t.subX)&&void 0!==n?n:0,g=null!==(i=t.subY)&&void 0!==i?i:0;if(0!==d||0!==g){const n=d>0?1:d<0?-1:0,i=g>0?1:g<0?-1:0;return t.subX=d+n*c,t.subY=g+i*c,(null!==(a=t.subX)&&void 0!==a?a:0)>=1?(t.x+=1,t.subX=0):(null!==(o=t.subX)&&void 0!==o?o:0)<=-1&&(t.x-=1,t.subX=0),(null!==(r=t.subY)&&void 0!==r?r:0)>=1?(t.y+=1,t.subY=0):(null!==(s=t.subY)&&void 0!==s?s:0)<=-1&&(t.y-=1,t.subY=0),void(0===(null!==(A=t.subX)&&void 0!==A?A:0)&&0===(null!==(l=t.subY)&&void 0!==l?l:0)&&0===e.pacman.powerupRemainingDuration&&(t.scared=!1))}if(0===e.pacman.powerupRemainingDuration)return void(t.scared=!1);(!t.target||t.x===t.target.x&&t.y===t.target.y)&&(t.target=H(t.x,t.y));const u=O(t);if(0===u.length)return;const h=t.target.x-t.x,m=t.target.y-t.y;let f=u;if(Math.random()<.5);else{const t=u.filter((t=>{const e=t[0],n=t[1];return h>0&&e>0||h<0&&e<0||m>0&&n>0||m<0&&n<0}));t.length>0&&(f=t)}const[y,p]=f[Math.floor(Math.random()*f.length)];y>0?t.direction="right":y<0?t.direction="left":p>0?t.direction="down":p<0&&(t.direction="up"),t.subX=y*c,t.subY=p*c},O=t=>w.getValidMoves(t.x,t.y).filter((e=>{const[n,i]=e;return!("right"===t.direction&&n<0||"left"===t.direction&&n>0||"up"===t.direction&&i>0||"down"===t.direction&&i<0)})),D=(t,e)=>{const n={x:26,y:3};if(Math.abs(t.x-n.x)<=1&&Math.abs(t.y-n.y)<=1)return t.x=n.x,t.y=n.y,t.inHouse=!0,void(t.respawnCounter=1);const i=w.findNextStepDijkstra({x:t.x,y:t.y},n);if(i){const e=i.x-t.x,n=i.y-t.y;e>0?t.direction="right":e<0?t.direction="left":n>0?t.direction="down":n<0&&(t.direction="up"),t.x=i.x,t.y=i.y}else{const e=V(t.x,t.y,n.x,n.y,t.direction);e&&(t.x=e.x,t.y=e.y,e.direction&&(t.direction=e.direction))}},T=(t,e)=>{if("eyes"===t.name)return void D(t);const n=N(t,e);t.target=n;const i=V(t.x,t.y,n.x,n.y,t.direction);i&&(t.x=i.x,t.y=i.y,i.direction&&(t.direction=i.direction))},V=(t,e,n,i,a)=>{if(t===n&&e===i)return null;const o=[{x:t,y:e,path:[],direction:a||"right"}],r=new Set;for(r.add(`${t},${e}`);o.length>0;){const t=o.shift(),{x:e,y:a,path:s,direction:A}=t,l=w.getValidMoves(e,a),c=l.filter((t=>{const[e,n]=t;return!A||!("right"===A&&e<0||"left"===A&&e>0||"up"===A&&n>0||"down"===A&&n<0)||1===l.length}));for(const[t,l]of c){const c=e+t,d=a+l,g=`${c},${d}`;if(r.has(g))continue;let u;r.add(g),u=t>0?"right":t<0?"left":l>0?"down":l<0?"up":A;const h=[...s,{x:c,y:d,pathDirection:u}];if(c===n&&d===i)return h.length>0?{x:h[0].x,y:h[0].y,direction:h[0].pathDirection}:null;o.push({x:c,y:d,path:h,direction:u})}}const s=w.getValidMoves(t,e);if(s.length>0){const[n,i]=s[Math.floor(Math.random()*s.length)];let o=a;return n>0?o="right":n<0?o="left":i>0?o="down":i<0&&(o="up"),{x:t+n,y:e+i,direction:o}}return null},N=(t,e)=>{const{pacman:n}=e;let i=Q(e),a=1;if("blinky"===t.name){const t=371,e=(t-U)/t;if(e>.7&&(a=1.2),e>.9&&(a=1.4),Math.random()<.8*a)return{x:n.x,y:n.y}}switch(t.name){case"blinky":default:return{x:n.x,y:n.y};case"pinky":const a=4;let o=n.x,r=n.y;return"up"===n.direction?(o=n.x-4,r=n.y-4):(o=n.x+i[0]*a,r=n.y+i[1]*a),o=Math.min(Math.max(o,0),52),r=Math.min(Math.max(r,0),6),{x:o,y:r};case"inky":const s=e.ghosts.find((t=>"blinky"===t.name));let A={x:n.x+2*i[0],y:n.y+2*i[1]};if("up"===n.direction&&(A.x=n.x-2,A.y=n.y-2),s){const t=A.x-s.x,e=A.y-s.y;A={x:A.x+t,y:A.y+e}}return A.x=Math.min(Math.max(A.x,0),52),A.y=Math.min(Math.max(A.y,0),6),A;case"clyde":return w.calculateDistance(t.x,t.y,n.x,n.y)<8?B.clyde:{x:n.x,y:n.y}}},Q=t=>{switch(t.pacman.direction){case"right":return[1,0];case"left":return[-1,0];case"up":return[0,-1];case"down":return[0,1];default:return[0,0]}},H=(t,e)=>{const n=t+Math.floor(17*Math.random())-8,i=e+Math.floor(17*Math.random())-8;return{x:Math.max(0,Math.min(n,52)),y:Math.max(0,Math.min(i,6))}},F=t=>{U=(t=>{let e=0;for(let i=0;i<n;i++)for(let n=0;n<7;n++)"NONE"!==t.grid[i][n].level&&e++;return e})(t),(t=>{t.pacman.powerupRemainingDuration>0||(k++,k>=5*("scatter"===E?7:20)&&(E="scatter"===E?"chase":"scatter",k=0,t.ghosts.forEach((t=>{t.inHouse||"eyes"===t.name||t.scared||S(t)}))))})(t);for(const e of t.ghosts)e.inHouse?R(e,t):("eyes"===e.name&&(e.scared=!1),e.scared?I(e,t):"eyes"===e.name?D(e):"scatter"===E?M(e):T(e,t))};var K;!function(t){t.CONSERVATIVE="conservative",t.AGGRESSIVE="aggressive",t.OPPORTUNISTIC="opportunistic"}(K||(K={}));const Y=t=>{const e=[];for(let i=0;i<n;i++)for(let n=0;n<7;n++){const a=t.grid[i][n];if("NONE"!==a.level){const o=w.calculateDistance(i,n,t.pacman.x,t.pacman.y),r=a.commitsCount/(o+1);e.push({x:i,y:n,value:r})}}return e.sort(((t,e)=>e.value-t.value)),0===e.length?{x:t.pacman.x,y:t.pacman.y,value:0}:e[0]},J=t=>{const e=new Map,i=!!t.pacman.powerupRemainingDuration;if(t.ghosts.forEach((t=>{if(!t.scared)for(let i=-5;i<=5;i++)for(let a=-5;a<=5;a++){const o=t.x+i,r=t.y+a;if(o>=0&&o<n&&r>=0&&r<7){const t=`${o},${r}`,n=15-(Math.abs(i)+Math.abs(a));if(n>0){const i=e.get(t)||0;e.set(t,Math.max(i,n))}}}})),i)for(const[t,n]of e.entries())e.set(t,n/5);return e},L=(t,e)=>{var n;(n=t.pacman).recentPositions||(n.recentPositions=[]),t.pacman.recentPositions.push(`${e.x},${e.y}`),t.pacman.recentPositions.length>5&&t.pacman.recentPositions.shift();const i=e.x-t.pacman.x,a=e.y-t.pacman.y;t.pacman.direction=i>0?"right":i<0?"left":a>0?"down":a<0?"up":t.pacman.direction,t.pacman.x=e.x,t.pacman.y=e.y},G=t=>{t.pacman.powerupRemainingDuration=15,t.ghosts.forEach((t=>{"eyes"!==t.name&&(t.scared=!0)}))},j=t=>{if(t.pacman.deadRemainingDuration)return;const e=!!t.pacman.powerupRemainingDuration,n=t.ghosts.filter((t=>t.scared));let i;try{if(e&&n.length>0){const e=(t=>{const e=t.ghosts.filter((t=>t.scared));return 0===e.length?null:e.reduce(((e,n)=>{const i=w.calculateDistance(n.x,n.y,t.pacman.x,t.pacman.y);return i<e.distance?{x:n.x,y:n.y,distance:i}:e}),{x:t.pacman.x,y:t.pacman.y,distance:1/0})})(t);i=null!=e?e:Y(t)}else t.pacman.target?t.pacman.x===t.pacman.target.x&&t.pacman.y===t.pacman.target.y?(i=Y(t),t.pacman.target=i):i=t.pacman.target:(i=Y(t),t.pacman.target=i);i||(i={x:t.pacman.x,y:t.pacman.y});const a=((t,e)=>{var n;const i=[{x:t.pacman.x,y:t.pacman.y,path:[],score:0}],a=new Set([`${t.pacman.x},${t.pacman.y}`]),o=J(t);let r=.5,s=.5;switch(t.config.playerStyle){case K.CONSERVATIVE:r=3,s=.1;break;case K.AGGRESSIVE:r=.3,s=2;break;case K.OPPORTUNISTIC:default:r=.8,s=.8}let A=1/0;t.ghosts.forEach((e=>{if(!e.scared){const n=w.calculateDistance(t.pacman.x,t.pacman.y,e.x,e.y);A=Math.min(A,n)}}));const l=t.config.playerStyle===K.CONSERVATIVE?5:7,c=A<l;for(t.config.playerStyle===K.CONSERVATIVE&&c&&(r*=5);i.length>0;){i.sort(((t,e)=>e.score-t.score));const A=i.shift(),{x:l,y:c,path:d}=A;if(l===e.x&&c===e.y){if(d.length>0){let e=0,n=0;return d.forEach((i=>{const a=`${i.x},${i.y}`,A=o.get(a)||0,l=t.grid[i.x][i.y].commitsCount;e-=A*r,n+=l*s})),d[0]}return null}for(const[A,g]of w.getValidMoves(l,c)){const u=l+A,h=c+g,m=`${u},${h}`;if(!a.has(m)){const A=[...d,{x:u,y:h}],l=o.get(m)||0,c=t.grid[u][h].commitsCount,g=w.calculateDistance(u,h,e.x,e.y),f=(null===(n=t.pacman.recentPositions)||void 0===n?void 0:n.includes(m))?100:0;let y,p,x;t.config.playerStyle===K.CONSERVATIVE?(y=(15-l)*r,l>=5?y-=100:y+=50,p=c*s,x=5*y+p+-g/10-f):(y=(15-l)*r,p=c*s,x=y+p+-g/10-f),i.push({x:u,y:h,path:A,score:x}),a.add(m)}}}return null})(t,i);a?L(t,a):(t=>{const e=w.getValidMoves(t.pacman.x,t.pacman.y);if(0===e.length)return;const n=e.reduce(((e,[n,i])=>{const a=t.pacman.x+n,o=t.pacman.y+i;let r=1/0;return t.ghosts.forEach((t=>{if(!t.scared){const e=w.calculateDistance(t.x,t.y,a,o);r=Math.min(r,e)}})),r>e.distance?{dx:n,dy:i,distance:r}:e}),{dx:0,dy:0,distance:-1/0});L(t,{x:t.pacman.x+n.dx,y:t.pacman.y+n.dy})})(t),(t=>{const e=t.grid[t.pacman.x][t.pacman.y];if("NONE"!==e.level){t.pacman.totalPoints+=e.commitsCount,t.pacman.points++,t.config.pointsIncreasedCallback(t.pacman.totalPoints);const n=d(t);"FOURTH_QUARTILE"===e.level&&G(t),e.level="NONE",e.color=n.intensityColors[0],e.commitsCount=0}})(t)}catch(t){console.error("Error in movePacman:",t)}},z=t=>{const e=10,n=t,i=2*Math.PI-t;return`M 10,10\n L ${e+e*Math.cos(n)},${e+e*Math.sin(n)}\n A 10,10 0 1,1 ${e+e*Math.cos(i)},${e+e*Math.sin(i)}\n Z`},P=(t,e,n)=>t.gameHistory.map((t=>t.grid[e][n].color)),X=(t,e)=>{if(t.gameHistory.length!==e.length)throw new Error(`The amount of values (${e.length}) does not match the size of the game history (${t.gameHistory.length})`);const n=t.gameHistory.length;if(0===n)return{keyTimes:"0;1",values:e[0]||"#000;#000"};let i=[],a=[],o=null,r=null;return e.forEach(((t,e)=>{t!==o&&(null!==o&&null!==r&&e-1!==r&&(i.push(Number(((e-1/40)/(n-1)).toFixed(4))),a.push(o)),i.push(Number((e/(n-1)).toFixed(4))),a.push(t),o=t,r=e)})),0!==i.length&&1===i[i.length-1]||(0===i.length?(i.push(0,1),a.push(e[0]||"#000",e[e.length-1]||"#000")):(i.push(1),a.push(o||e[e.length-1]||"#000"))),{keyTimes:i.join(";"),values:a.join(";")}},W=t=>{const e=t.gameHistory.length*i;let a='<svg width="1166" height="184" xmlns="http://www.w3.org/2000/svg">';a+=`<desc>Generated with pacman-contribution-graph on ${new Date}</desc>`,a+=`<metadata>\n\t\t<info>\n\t\t\t<frames>${t.gameHistory.length}</frames>\n\t\t\t<frameRate>5</frameRate>\n\t\t\t<durationMs>${e}</durationMs>\n\t\t\t<generatedOn>${(new Date).toISOString()}</generatedOn>\n\t\t</info>\n\t</metadata>`,a+=`<rect width="100%" height="100%" fill="${d(t).gridBackground}"/>`,a+=(()=>{let t="<defs>";return["blinky","inky","pinky","clyde"].forEach((e=>{["up","down","left","right"].forEach((n=>{const i=x[e];n in i&&(t+=`\n <symbol id="ghost-${e}-${n}" viewBox="0 0 20 20">\n <image href="${i[n]}" width="20" height="20"/>\n </symbol>\n `)}))})),t+=`\n <symbol id="ghost-scared" viewBox="0 0 20 20">\n <image href="${x.scared.imgDate}" width="20" height="20"/>\n </symbol>`,["up","down","left","right"].forEach((e=>{x.eyes&&e in x.eyes?t+=`\n <symbol id="ghost-eyes-${e}" viewBox="0 0 20 20">\n <image href="${x.eyes[e]}" width="20" height="20"/>\n </symbol>\n `:(console.warn(`Imagem para eyes-${e} não encontrada, usando placeholder`),t+=`\n <symbol id="ghost-eyes-${e}" viewBox="0 0 20 20">\n <circle cx="10" cy="10" r="${20/3}" fill="white"/>\n </symbol>\n `)})),t+="</defs>",t})();let o="";for(let e=0;e<n;e++)t.monthLabels[e]!==o&&(a+=`<text x="${22*e+10}" y="10" text-anchor="middle" font-size="10" fill="${d(t).textColor}">${t.monthLabels[e]}</text>`,o=t.monthLabels[e]);for(let i=0;i<n;i++)for(let n=0;n<7;n++){const o=22*i,r=22*n+15,s=X(t,P(t,i,n));a+=`<rect id="c-${i}-${n}" x="${o}" y="${r}" width="20" height="20" rx="5" fill="${d(t).intensityColors[0]}">\n\t\t\t\t<animate attributeName="fill" dur="${e}ms" repeatCount="indefinite" \n\t\t\t\t\tvalues="${s.values}" \n\t\t\t\t\tkeyTimes="${s.keyTimes}"/>\n\t\t\t</rect>`}for(let e=0;e<7;e++){let i=null;for(let o=0;o<=n;o++){let r=o<n&&b.horizontal[o][e].active;r&&null===i&&(i=o),r&&o!==n||null===i||(a+=`<rect id="wh-${i}-${e}" x="${22*i-2}" y="${22*e-2+15}" width="${22*(o-i)}" height="2" fill="${d(t).wallColor}"></rect>`,i=null)}}for(let e=0;e<n;e++){let n=null;for(let i=0;i<=7;i++){let o=i<7&&b.vertical[e][i].active;o&&null===n&&(n=i),o&&7!==i||null===n||(a+=`<rect id="wv-${e}-${n}" x="${22*e-2}" y="${22*n-2+15}" width="2" height="${22*(i-n)}" fill="${d(t).wallColor}"></rect>`,n=null)}}const r=X(t,t.gameHistory.map((t=>{return(e=t.pacman).deadRemainingDuration?"#80808064":e.powerupRemainingDuration?"red":p;var e}))),s=X(t,(t=>t.gameHistory.map((t=>`${22*t.pacman.x},${22*t.pacman.y+15}`)))(t)),A=X(t,(t=>t.gameHistory.map(((e,n)=>{const i=Math.min(n+1,t.gameHistory.length-1);return(t=>{switch(t){case"right":default:return"0 10 10";case"left":return"180 10 10";case"up":return"270 10 10";case"down":return"90 10 10"}})(t.gameHistory[i].pacman.direction)})))(t));return a+=`<path id="pacman" d="${z(.55)}" fill="${p}">\n\t\t<animate attributeName="fill" dur="${e}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${r.keyTimes}"\n\t\t\tvalues="${r.values}"/>\n\t\t<animateTransform attributeName="transform" type="translate" dur="${e}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${s.keyTimes}"\n\t\t\tvalues="${s.values}"\n\t\t\tadditive="sum"/>\n\t\t<animateTransform attributeName="transform" type="rotate" dur="${e}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${A.keyTimes}"\n\t\t\tvalues="${A.values}"\n\t\t\tcalcMode="discrete"\n\t\t\tadditive="sum"/>\n\t\t<animate attributeName="d" dur="0.5s" repeatCount="indefinite"\n\t\t\tvalues="${z(.55)};${z(.05)};${z(.55)}"/>\n\t</path>`,t.ghosts.forEach(((n,i)=>{const o=X(t,((t,e)=>t.gameHistory.map((t=>{var n,i;if(e>=t.ghosts.length)return"0,0";const a=t.ghosts[e];return`${22*(a.x+(null!==(n=a.subX)&&void 0!==n?n:0))},${22*(a.y+(null!==(i=a.subY)&&void 0!==i?i:0))+15}`})))(t,i));a+=`<g id="ghost${i}" transform="translate(0,0)">\n\t\t\t<animateTransform attributeName="transform" type="translate" \n\t\t\t\tdur="${e}ms" repeatCount="indefinite"\n\t\t\t\tkeyTimes="${o.keyTimes}"\n\t\t\t\tvalues="${o.values}"\n\t\t\t\tadditive="replace"/>`;const r=function(t,e){const n={};["blinky-up","blinky-down","blinky-left","blinky-right","inky-up","inky-down","inky-left","inky-right","pinky-up","pinky-down","pinky-left","pinky-right","clyde-up","clyde-down","clyde-left","clyde-right","eyes-up","eyes-down","eyes-left","eyes-right","scared"].forEach((t=>{n[t]=[{time:0,visible:!1}]}));const i=t.ghosts[e];if(!i)return n;const a=i.scared?"scared":"eyes"===i.name?`eyes-${i.direction||"right"}`:`${i.name}-${i.direction||"right"}`;n[a]=[{time:0,visible:!0}];let o=a;return t.gameHistory.forEach(((i,a)=>{if(e>=i.ghosts.length)return;const r=i.ghosts[e],s=a/(t.gameHistory.length-1),A=r.scared?"scared":"eyes"===r.name?`eyes-${r.direction||"right"}`:`${r.name}-${r.direction||"right"}`;A!==o&&(n[o].push({time:s,visible:!1}),n[A]||(n[A]=[{time:0,visible:!1}]),n[A].push({time:s,visible:!0}),o=A)})),n[o].push({time:1,visible:!0}),Object.keys(n).forEach((t=>{t!==o&&n[t].length>0&&n[t][n[t].length-1].time<1&&n[t].push({time:1,visible:!1})})),n}(t,i);for(const[t,n]of Object.entries(r)){if(0===n.length)continue;const i=`#ghost-${t}`,o=n.map((t=>t.time.toFixed(4))).join(";"),r=n.map((t=>t.visible?"visible":"hidden")).join(";"),s=n[0].visible?"visible":"hidden";a+=`<use href="${i}" width="20" height="20" visibility="${s}">\n\t\t\t\t<animate attributeName="visibility" \n\t\t\t\t\tdur="${e}ms" repeatCount="indefinite"\n\t\t\t\t\tkeyTimes="${o}"\n\t\t\t\t\tvalues="${r}" />\n\t\t\t</use>`}a+="</g>"})),a+="</svg>",a};var q=function(t,e,n,i){return new(n||(n=Promise))((function(a,o){function r(t){try{A(i.next(t))}catch(t){o(t)}}function s(t){try{A(i.throw(t))}catch(t){o(t)}}function A(t){var e;t.done?a(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}A((i=i.apply(t,e||[])).next())}))};const Z=t=>{t.ghosts=[{x:26,y:2,name:"blinky",direction:"left",scared:!1,target:void 0,inHouse:!1,respawnCounter:0,freezeCounter:0,justReleasedFromHouse:!1},{x:25,y:3,name:"inky",direction:"up",scared:!1,target:void 0,inHouse:!0,respawnCounter:0,freezeCounter:10,justReleasedFromHouse:!1},{x:26,y:3,name:"pinky",direction:"down",scared:!1,target:void 0,inHouse:!0,respawnCounter:0,freezeCounter:20,justReleasedFromHouse:!1},{x:27,y:3,name:"clyde",direction:"up",scared:!1,target:void 0,inHouse:!0,respawnCounter:0,freezeCounter:30,justReleasedFromHouse:!1}],t.ghosts.forEach((t=>{t.justReleasedFromHouse=!1,t.respawnCounter=0,t.inHouse&&("inky"===t.name?t.direction="up":"pinky"===t.name?t.direction="down":"clyde"===t.name&&(t.direction="up"))}))},$=t=>q(void 0,void 0,void 0,(function*(){var e,n;if(t.frameCount++,t.pacman.deadRemainingDuration>0&&(t.pacman.deadRemainingDuration--,0===t.pacman.deadRemainingDuration&&((t=>{t.pacman.x=27,t.pacman.y=7,t.pacman.direction="right",t.pacman.recentPositions=[]})(t),Z(t))),t.pacman.powerupRemainingDuration>0&&(t.pacman.powerupRemainingDuration--,0===t.pacman.powerupRemainingDuration&&(t.ghosts.forEach((t=>{var e,n;"eyes"!==t.name&&0===(null!==(e=t.subX)&&void 0!==e?e:0)&&0===(null!==(n=t.subY)&&void 0!==n?n:0)&&(t.scared=!1)})),t.pacman.points=0)),t.ghosts.forEach((e=>{e.inHouse&&e.respawnCounter&&e.respawnCounter>0&&(e.respawnCounter--,0===e.respawnCounter&&(e.name=e.originalName||(t=>{const e=["blinky","inky","pinky","clyde"];return e[t%e.length]})(t.ghosts.indexOf(e)),e.inHouse=!1,e.scared=t.pacman.powerupRemainingDuration>0,e.justReleasedFromHouse=!0)),e.freezeCounter&&(e.freezeCounter--,0===e.freezeCounter&&et(t,e.name))})),!t.grid.some((t=>t.some((t=>t.commitsCount>0))))){const n=W(t);return t.config.svgCallback(n),t.config.gameStatsCallback&&t.config.gameStatsCallback({totalScore:t.pacman.totalPoints,steps:t.aliveSteps,ghostsEaten:null!==(e=t.pacman.ghostsEaten)&&void 0!==e?e:0}),void t.config.gameOverCallback()}j(t),tt(t),0===t.pacman.deadRemainingDuration&&(F(t),tt(t)),t.pacmanMouthOpen=!t.pacmanMouthOpen,0===t.pacman.deadRemainingDuration&&t.aliveSteps++,t.config.gameStatsCallback&&t.config.gameStatsCallback({totalScore:t.pacman.totalPoints,steps:t.aliveSteps,ghostsEaten:null!==(n=t.pacman.ghostsEaten)&&void 0!==n?n:0}),_(t)})),_=t=>{t.gameHistory.push({pacman:Object.assign({},t.pacman),ghosts:t.ghosts.map((t=>Object.assign({},t))),grid:t.grid.map((t=>t.map((t=>Object.assign({},t)))))})},tt=t=>{t.pacman.deadRemainingDuration||t.ghosts.forEach((e=>{var n;"eyes"!==e.name&&e.x===t.pacman.x&&e.y===t.pacman.y&&(t.pacman.powerupRemainingDuration&&e.scared?(e.originalName=e.name,e.name="eyes",e.scared=!1,e.target={x:26,y:3},e.subX=0,e.subY=0,t.pacman.points+=10,t.pacman.ghostsEaten=(null!==(n=t.pacman.ghostsEaten)&&void 0!==n?n:0)+1):(t.pacman.points=0,t.pacman.powerupRemainingDuration=0,0===t.pacman.deadRemainingDuration&&(t.pacman.deadRemainingDuration=10)))}))},et=(t,e)=>{const n=t.ghosts.find((t=>t.name===e&&t.inHouse));n&&(n.justReleasedFromHouse=!0,n.y=2,n.direction="up")},nt={frameCount:0,aliveSteps:0,contributions:[],pacman:{x:0,y:0,direction:"right",points:0,totalPoints:0,deadRemainingDuration:0,powerupRemainingDuration:0,recentPositions:[],ghostsEaten:0},ghosts:[],grid:[],monthLabels:[],pacmanMouthOpen:!0,gameInterval:0,gameHistory:[],config:void 0,useGithubThemeColor:!0},it=(t,e,i,a,o)=>{"horizontal"==i?(v(t,e,"horizontal",o),"x"==a?v(n-t-1,e,"horizontal",o):"y"==a?v(t,7-e,"horizontal",o):"xy"==a&&(v(n-t-1,e,"horizontal",o),v(t,7-e,"horizontal",o),v(n-t-1,7-e,"horizontal",o))):(v(t,e,"vertical",o),"x"==a?v(n-t,e,"vertical",o):"y"==a?v(t,7-e-1,"vertical",o):"xy"==a&&(v(n-t,e,"vertical",o),v(t,7-e-1,"vertical",o),v(n-t,7-e-1,"vertical",o)))};class at{constructor(t){this.conf=Object.assign({},t)}start(){return t=this,e=void 0,i=function*(){const t={platform:"github",username:"",svgCallback:t=>{},gameOverCallback:()=>{},gameTheme:"github",pointsIncreasedCallback:t=>{},githubSettings:{accessToken:""},playerStyle:K.OPPORTUNISTIC};switch(this.store=JSON.parse(JSON.stringify(nt)),this.store.config=Object.assign(Object.assign({},t),this.conf),this.store.config.platform){case"gitlab":this.store.contributions=yield y(this.store);break;case"github":this.store.contributions=yield f(this.store);break;default:throw new Error(`Unsupported platform: ${this.store.config.platform}`)}return it(0,2,"horizontal","xy","L1"),it(1,2,"horizontal","xy","L1"),it(4,1,"vertical","x","L2"),it(4,2,"vertical","x","L2"),it(4,3,"vertical","x","L2"),it(4,4,"vertical","x","L2"),it(3,3,"horizontal","x","L3"),it(2,3,"horizontal","x","L3"),it(4,5,"horizontal","x","L4"),it(6,4,"vertical","x","L5"),it(6,3,"vertical","x","L5"),it(6,2,"vertical","x","L5"),it(6,2,"horizontal","x","L6"),it(7,2,"horizontal","x","L6"),it(8,2,"horizontal","x","L6"),it(9,2,"horizontal","x","L6"),it(13,2,"horizontal","xy","L7"),it(14,2,"horizontal","xy","L7"),it(15,2,"horizontal","xy","L7"),it(16,2,"horizontal","xy","L7"),it(17,2,"horizontal","xy","L7"),it(18,2,"horizontal","xy","L7"),it(16,2,"vertical","xy","L8"),it(8,1,"horizontal","x","L9"),it(9,1,"horizontal","x","L9"),it(10,1,"horizontal","x","L9"),it(11,1,"horizontal","x","L9"),it(12,1,"vertical","x","L10"),it(12,3,"vertical","x","L10"),it(11,4,"horizontal","x","L11"),it(10,4,"horizontal","x","L11"),it(9,4,"horizontal","x","L11"),it(8,4,"horizontal","x","L11"),it(8,4,"vertical","x","L12"),it(8,5,"vertical","x","L12"),it(23,1,"horizontal","x","L18"),it(22,1,"horizontal","x","L18"),it(21,1,"horizontal","x","L18"),it(21,1,"vertical","x","L18"),it(21,2,"vertical","x","L18"),it(21,3,"vertical","x","L18"),it(20,4,"horizontal","x","L18"),it(19,4,"horizontal","x","L18"),it(19,3,"vertical","x","L18"),it(18,3,"horizontal","x","L18"),it(22,5,"vertical","x","L19"),it(21,5,"horizontal","x","L19"),it(20,5,"horizontal","x","L19"),it(20,5,"vertical","x","L19"),it(1,6,"horizontal","x","L20"),it(2,6,"horizontal","x","L20"),it(3,4,"vertical","x","L20"),it(5,6,"horizontal","x","L21"),it(6,6,"horizontal","x","L21"),v(25,2,"horizontal","GH_TOP"),v(27,2,"horizontal","GH_TOP"),v(25,4,"horizontal","GH_BOTTOM"),v(26,4,"horizontal","GH_BOTTOM"),v(27,4,"horizontal","GH_BOTTOM"),v(25,3,"vertical","GH_LEFT"),v(28,3,"vertical","GH_RIGHT"),v(25,2,"vertical","GH_LEFT"),v(28,2,"vertical","GH_RIGHT"),g(this.store),u(this.store),yield(e=this.store,q(void 0,void 0,void 0,(function*(){e.frameCount=0,e.aliveSteps=0,e.gameHistory=[],e.ghosts.forEach((t=>t.scared=!1)),e.grid=h(e);const t=()=>e.grid.some((t=>t.some((t=>t.commitsCount>0))));for(t()&&((t=>{t.pacman={x:0,y:0,direction:"right",points:0,totalPoints:0,deadRemainingDuration:0,powerupRemainingDuration:0,recentPositions:[],ghostsEaten:0}})(e),Z(e));t();)yield $(e);yield $(e)}))),this.store;var e},new((n=void 0)||(n=Promise))((function(a,o){function r(t){try{A(i.next(t))}catch(t){o(t)}}function s(t){try{A(i.throw(t))}catch(t){o(t)}}function A(t){var e;t.done?a(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}A((i=i.apply(t,e||[])).next())}));var t,e,n,i}stop(){var t;t=this.store,q(void 0,void 0,void 0,(function*(){clearInterval(t.gameInterval)}))}}const ot=.21,rt=7.4,st=t=>22*t,At=t=>22*t+15,lt=(t,e,n)=>{var i,a;const o=t.gameHistory.length,r=null!==(a=null===(i=t.initialColors[e])||void 0===i?void 0:i[n])&&void 0!==a?a:"#ebedf0",s=t.brickEvents.filter((t=>t.x===e&&t.y===n));if(0===s.length)return{keyTimes:"0;1",values:`${r};${r}`};const A=[0],l=[r];for(const t of s){const e=Number((t.frameIndex/Math.max(o-1,1)).toFixed(4));e!==A[A.length-1]?(A.push(e),l.push(t.color)):l[l.length-1]=t.color}return 1!==A[A.length-1]&&(A.push(1),l.push(l[l.length-1])),{keyTimes:A.join(";"),values:l.join(";")}},ct=(t,e)=>{var n,i,a,o;const r=t.gameHistory.length;if(0===r){const t=null!==(n=e[0])&&void 0!==n?n:"0,0";return{keyTimes:"0;1",values:`${t};${t}`}}const s=[],A=[];let l=null,c=null;return e.forEach(((t,e)=>{t!==l&&(null!==l&&null!==c&&e-1!==c&&(s.push(Number(((e-1)/(r-1)).toFixed(4))),A.push(l)),s.push(Number((e/(r-1)).toFixed(4))),A.push(t),l=t,c=e)})),0!==s.length&&1===s[s.length-1]||(0===s.length?(s.push(0,1),A.push(null!==(i=e[0])&&void 0!==i?i:"0,0",null!==(a=e[e.length-1])&&void 0!==a?a:"0,0")):(s.push(1),A.push(null!==(o=null!=l?l:e[e.length-1])&&void 0!==o?o:"0,0"))),{keyTimes:s.join(";"),values:A.join(";")}},dt=t=>{const e=t.gameHistory.length*i/2,a=d(t);let o='<svg width="1166" height="209" xmlns="http://www.w3.org/2000/svg">';o+=`<desc>Generated with breakout-contribution-graph on ${new Date}</desc>`,o+=`<metadata>\n\t\t<info>\n\t\t\t<frames>${t.gameHistory.length}</frames>\n\t\t\t<frameRate>5</frameRate>\n\t\t\t<durationMs>${e}</durationMs>\n\t\t\t<generatedOn>${(new Date).toISOString()}</generatedOn>\n\t\t</info>\n\t</metadata>`,o+=`<rect width="100%" height="100%" fill="${a.gridBackground}"/>`;let r="";for(let e=0;e<n;e++)t.monthLabels[e]!==r&&(o+=`<text x="${22*e+10}" y="10" text-anchor="middle" font-size="10" fill="${a.textColor}">${t.monthLabels[e]}</text>`,r=t.monthLabels[e]);for(let i=0;i<n;i++)for(let n=0;n<7;n++){const r=st(i),s=At(n),A=lt(t,i,n);o+=`<rect id="c-${i}-${n}" x="${r}" y="${s}" width="20" height="20" rx="3" fill="${a.intensityColors[0]}">\n\t\t\t\t<animate attributeName="fill" calcMode="discrete" dur="${e}ms" repeatCount="indefinite"\n\t\t\t\t\tvalues="${A.values}" keyTimes="${A.keyTimes}"/>\n\t\t\t</rect>`}const s=Math.round(4.62),A=ct(t,(t=>t.gameHistory.map((t=>`${st(t.ball.x)},${At(t.ball.y)}`)))(t));o+=`<circle id="ball" cx="0" cy="0" r="${s}" fill="${a.wallColor}" stroke="#aaaaaa" stroke-width="1">\n\t\t<animateTransform attributeName="transform" type="translate"\n\t\t\tcalcMode="linear"\n\t\t\tdur="${e}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${A.keyTimes}"\n\t\t\tvalues="${A.values}"/>\n\t</circle>`;const l=At(rt),c=Math.round(152),g=Math.round(11),u=ct(t,(t=>t.gameHistory.map((t=>`${st(t.paddle.x)},0`)))(t));return o+=`<rect id="paddle" x="0" y="${l}" width="${c}" height="${g}" rx="3" fill="${a.wallColor}">\n\t\t<animateTransform attributeName="transform" type="translate"\n\t\t\tcalcMode="linear"\n\t\t\tdur="${e}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${u.keyTimes}"\n\t\t\tvalues="${u.values}"/>\n\t</rect>`,o+="</svg>",o};const gt=20/22,ut=["NONE","FIRST_QUARTILE","SECOND_QUARTILE","THIRD_QUARTILE","FOURTH_QUARTILE"],ht=t=>{const e=ut.indexOf(t);return ut[Math.max(0,e-1)]},mt=t=>{var e,i;t.frameCount++;const{ball:a,paddle:o,grid:r}=t,s=Math.hypot(a.dx,a.dy),A=Math.ceil(s/ot),l=1/A;for(let s=0;s<A;s++){a.x+=a.dx*l,a.y+=a.dy*l,a.x-ot<=0&&(a.x=ot,a.dx=Math.abs(a.dx)),a.x+ot>=n&&(a.x=52.79,a.dx=-Math.abs(a.dx)),a.y-ot<=0&&(a.y=ot,a.dy=Math.abs(a.dy));const s=o.x,A=o.x+7;if(a.dy>0&&a.y+ot>=rt&&a.y-ot<7.9&&a.x>=s-ot&&a.x<=A+ot){a.y=7.19;const e=s+3.5,n=Math.max(-1,Math.min(1,(a.x-e)/3.5)),i=Math.hypot(a.dx,a.dy),o=65*n*(Math.PI/180);a.dx=i*Math.sin(o),a.dy=-i*Math.cos(o),t.bouncesSinceTargetSet++,t.bouncesSinceTargetSet>=5&&(t.targetBrick=pt(t),t.bouncesSinceTargetSet=0)}a.y>8.4&&(a.x=26.5,a.y=5.9,a.dy=-Math.abs(a.dy));const c=Math.max(0,Math.floor(a.x-ot)),g=Math.min(52,Math.floor(a.x+ot)),u=Math.max(0,Math.floor(a.y-ot)),h=Math.min(6,Math.floor(a.y+ot));let m=!1,f=!1;const y=d(t);for(let n=c;n<=g;n++)for(let o=u;o<=h;o++){if(0===r[n][o].commitsCount)continue;const s=Math.max(n,Math.min(n+gt,a.x)),A=Math.max(o,Math.min(o+gt,a.y));if(Math.pow(a.x-s,2)+Math.pow(a.y-A,2)>=.04409999999999999)continue;const l=r[n][o].level,c=ht(l);if(r[n][o].level=c,"NONE"===c)r[n][o].commitsCount=0,r[n][o].color=y.intensityColors[0],(null===(e=t.targetBrick)||void 0===e?void 0:e.cx)===n&&(null===(i=t.targetBrick)||void 0===i?void 0:i.cy)===o&&(t.targetBrick=pt(t),t.bouncesSinceTargetSet=0);else{const t=ut.indexOf(c);r[n][o].color=y.intensityColors[t]}t.brickEvents.push({frameIndex:t.gameHistory.length,x:n,y:o,color:r[n][o].color});const d=ot-Math.abs(a.x-s),g=ot-Math.abs(a.y-A);d<=g?(a.x+=a.dx<0?d:-d,m=!0):(a.y+=a.dy<0?g:-g,f=!0),t.framesSinceLastBrickHit=0,t.config.pointsIncreasedCallback(yt(t))}m&&(a.dx=-a.dx),f&&(a.dy=-a.dy)}if(a.dy>0&&t.targetBrick){const e=t.targetBrick,i=(rt-a.y)/a.dy;let r=a.x+a.dx*i;r=Math.abs((r%106+106)%106),r>n&&(r=106-r);const s=e.cx+.5,A=e.cy+.5,l=rt-A,c=s-r,d=Math.atan2(c,Math.max(l,.5))*(180/Math.PI),g=r-Math.max(-65,Math.min(65,d))/65*3.5,u=Math.max(0,Math.min(46,g-3.5));o.x<u-2?o.x+=2:o.x>u+2?o.x-=2:o.x=u}else if(a.dy>0){const t=o.x+3.5;t<a.x-.5?o.x=Math.min(o.x+2,46):t>a.x+.5&&(o.x=Math.max(o.x-2,0))}ft(t)},ft=t=>{t.gameHistory.push({ball:Object.assign({},t.ball),paddle:Object.assign({},t.paddle)})},yt=t=>{let e=0;return t.grid.forEach((t=>t.forEach((t=>{0===t.commitsCount&&e++})))),e},pt=t=>{var e,i;const a=[];for(let o=0;o<n;o++)for(let n=0;n<7;n++)(null===(i=null===(e=t.grid[o])||void 0===e?void 0:e[n])||void 0===i?void 0:i.commitsCount)>0&&a.push({cx:o,cy:n});return 0===a.length?null:a[Math.floor(Math.random()*a.length)]},xt=t=>{return e=void 0,n=void 0,a=function*(){if(t.frameCount=0,t.framesSinceLastBrickHit=0,t.gameHistory=[],t.brickEvents=[],t.grid=h(t),t.initialColors=t.grid.map((t=>t.map((t=>t.color)))),0===t.grid.reduce(((t,e)=>t+e.filter((t=>t.commitsCount>0)).length),0)){const e=dt(t);return t.config.svgCallback(e),void t.config.gameOverCallback()}for((t=>{t.ball={x:26.5,y:5.9,dx:.75,dy:-.95}})(t),(t=>{t.paddle={x:23,width:7}})(t),t.targetBrick=pt(t),t.bouncesSinceTargetSet=0;t.grid.some((t=>t.some((t=>t.commitsCount>0))))&&t.frameCount<3e3;)mt(t),t.frameCount%200==0&&t.grid.reduce(((t,e)=>t+e.filter((t=>t.commitsCount>0)).length),0);const e=dt(t);t.config.svgCallback(e),t.config.gameStatsCallback&&t.config.gameStatsCallback({totalScore:yt(t),steps:t.frameCount,ghostsEaten:0}),t.config.gameOverCallback()},new((i=void 0)||(i=Promise))((function(t,o){function r(t){try{A(a.next(t))}catch(t){o(t)}}function s(t){try{A(a.throw(t))}catch(t){o(t)}}function A(e){var n;e.done?t(e.value):(n=e.value,n instanceof i?n:new i((function(t){t(n)}))).then(r,s)}A((a=a.apply(e,n||[])).next())}));var e,n,i,a},bt={frameCount:0,contributions:[],ball:{x:0,y:0,dx:0,dy:0},paddle:{x:0,width:7},grid:[],monthLabels:[],framesSinceLastBrickHit:0,targetBrick:null,bouncesSinceTargetSet:0,gameHistory:[],initialColors:[],brickEvents:[],config:void 0};class vt{constructor(t){this.conf=Object.assign({},t)}start(){return t=this,e=void 0,i=function*(){switch(this.store=JSON.parse(JSON.stringify(bt)),this.store.config=Object.assign(Object.assign({},{platform:"github",username:"",svgCallback:t=>{},gameOverCallback:()=>{},gameTheme:"github",pointsIncreasedCallback:t=>{},githubSettings:{accessToken:""}}),this.conf),this.store.config.platform){case"gitlab":this.store.contributions=yield y(this.store);break;case"github":this.store.contributions=yield f(this.store);break;default:throw new Error(`Unsupported platform: ${this.store.config.platform}`)}return g(this.store),u(this.store),yield xt(this.store),this.store},new((n=void 0)||(n=Promise))((function(a,o){function r(t){try{A(i.next(t))}catch(t){o(t)}}function s(t){try{A(i.throw(t))}catch(t){o(t)}}function A(t){var e;t.done?a(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}A((i=i.apply(t,e||[])).next())}));var t,e,n,i}stop(){this.store}}const Ct=t=>22*t,wt=t=>22*t+15,Bt=(t,e,n)=>{var i,a;const o=t.gameHistory.length,r=null!==(a=null===(i=t.initialColors[e])||void 0===i?void 0:i[n])&&void 0!==a?a:"#ebedf0",s=t.cellEvents.filter((t=>t.x===e&&t.y===n));if(0===s.length)return{keyTimes:"0;1",values:`${r};${r}`};const A=[0],l=[r];for(const t of s){const e=Number((t.frameIndex/Math.max(o-1,1)).toFixed(4));e!==A[A.length-1]?(A.push(e),l.push(t.color)):l[l.length-1]=t.color}return 1!==A[A.length-1]&&(A.push(1),l.push(l[l.length-1])),{keyTimes:A.join(";"),values:l.join(";")}},Et=t=>{const e=t.gameHistory.length,a=Math.max(e*i/2,1e3),o=d(t),r=wt(10.5);let s='<svg width="1166" height="259" xmlns="http://www.w3.org/2000/svg">';s+=`<desc>Generated with galaga-contribution-graph on ${new Date}</desc>`,s+='<rect width="100%" height="100%" fill="#000000"/>';{let t=12345;const e=()=>(t=1664525*t+1013904223>>>0,t/4294967295);for(let t=0;t<120;t++){const t=(1166*e()).toFixed(1),n=(.4+1.6*e()).toFixed(1),i=(.3+.7*e()).toFixed(2),a=Math.floor(2500+5500*e());s+=`<circle cx="${t}" cy="0" r="${n}" fill="white" opacity="${i}"><animate attributeName="cy" from="-2" to="261" dur="${a}ms" begin="-${Math.floor(e()*a)}ms" repeatCount="indefinite"/></circle>`}}let A="";for(let e=0;e<n;e++)t.monthLabels[e]!==A&&(s+=`<text x="${22*e+10}" y="10" text-anchor="middle" font-size="10" fill="#aaaaaa">${t.monthLabels[e]}</text>`,A=t.monthLabels[e]);const l=o.intensityColors[0];for(let e=0;e<n;e++)for(let n=0;n<7;n++){const i=Ct(e),o=wt(n),r=Bt(t,e,n);s+=`<rect x="${i}" y="${o}" width="20" height="20" rx="3" fill="transparent">\n\t\t\t\t<animate attributeName="fill" calcMode="discrete" dur="${a}ms" repeatCount="indefinite"\n\t\t\t\t\tvalues="${r.values.split(";").map((t=>t===l?"transparent":t)).join(";")}" keyTimes="${r.keyTimes}"/>\n\t\t\t</rect>`}if(e>=2){const n=(t=>{const e=[],n=new Map;for(let i=0;i<t.gameHistory.length;i++){const a=t.gameHistory[i].bullets.filter((t=>t.active)),o=new Set(a.map((t=>t.id)));for(const[t,a]of n)o.has(t)||(e.push({id:t,x:a.x,startFrame:a.startFrame,endFrame:i-1,yPositions:a.yPositions}),n.delete(t));for(const t of a)n.has(t.id)?n.get(t.id).yPositions.push(t.y):n.set(t.id,{x:t.x,startFrame:i,yPositions:[t.y]})}for(const[i,a]of n)e.push({id:i,x:a.x,startFrame:a.startFrame,endFrame:t.gameHistory.length-1,yPositions:a.yPositions});return e})(t);for(const t of n){const n=Ct(t.x),i=Number((t.startFrame/(e-1)).toFixed(4)),o=Number((Math.min(t.endFrame+1,e-1)/(e-1)).toFixed(4));let r,A;i<=0&&o>=1?(r="0;1",A="1;1"):i<=0?(r=`0;${o};${o};1`,A="1;1;0;0"):o>=1?(r=`0;${i};${i};1`,A="0;0;1;1"):(r=`0;${i};${i};${o};${o};1`,A="0;0;1;1;0;0");const l=[],c=[],d=wt(t.yPositions[0]).toFixed(1),g=wt(t.yPositions[t.yPositions.length-1]).toFixed(1);t.startFrame>0&&(l.push(0),c.push(`${n.toFixed(1)},${d}`));for(let i=0;i<t.yPositions.length;i++){const a=t.startFrame+i,o=Number((a/(e-1)).toFixed(4)),r=wt(t.yPositions[i]).toFixed(1);0!==l.length&&o===l[l.length-1]||(l.push(o),c.push(`${n.toFixed(1)},${r}`))}1!==l[l.length-1]&&(l.push(1),c.push(`${n.toFixed(1)},${g}`)),s+=`<image x="-5" y="-13" width="10" height="13" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAACACAMAAACMX59YAAAAIGNIUk0AAHom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YYxBBh/HQ8uCvUJFi7+VARIVwfmAqcBhmQWWoB1XdhFGNGFcb0cZBjjrszRLLWgkgbovJB2JJfKXIljUjlSEev0RJuArIF0vC84/AYNLX/sQtRIxoRxj4qpXkfiaeIm/J+HcbEDDSiRMRoQNV3AA8yDcgJM/G+EPdE3VUpFd5INV9+JXFMykLmAfjIjmyK0wLUj5NYkJKBx0sKrWIMEchGxsgVNsQVNCYEfLGEySrd5xSK6LArjdUwtDIrCL/JGvSI+ReIgAAAAAElFTkSuQmCC" opacity="0" preserveAspectRatio="xMidYMid meet">\n\t\t\t\t<animate attributeName="opacity" calcMode="discrete" dur="${a}ms" repeatCount="indefinite"\n\t\t\t\t\tkeyTimes="${r}" values="${A}"/>\n\t\t\t\t<animateTransform attributeName="transform" type="translate" calcMode="linear"\n\t\t\t\t\tdur="${a}ms" repeatCount="indefinite"\n\t\t\t\t\tkeyTimes="${l.join(";")}" values="${c.join(";")}"/>\n\t\t\t</image>`}}if(e>=2)for(const n of t.explosionEvents){const t=(Ct(n.x)+10).toFixed(1),i=(wt(n.y)+10).toFixed(1),o=Number((n.frameIndex/(e-1)).toFixed(4)),r=Number((Math.min(n.frameIndex+7,e-1)/(e-1)).toFixed(4));if(r<=o)continue;const A=`0;${o};${o};${r};1`,l="0;0;1;0;0",c=`${a}ms`;s+=`<circle cx="${t}" cy="${i}" r="2" fill="none" stroke="${n.color}" stroke-width="3" opacity="0">\n\t\t\t\t<animate attributeName="r" calcMode="linear" dur="${c}" repeatCount="indefinite" keyTimes="${A}" values="2;2;2;20;20"/>\n\t\t\t\t<animate attributeName="stroke-width" calcMode="linear" dur="${c}" repeatCount="indefinite" keyTimes="${A}" values="3;3;3;0;0"/>\n\t\t\t\t<animate attributeName="opacity" calcMode="linear" dur="${c}" repeatCount="indefinite" keyTimes="${A}" values="${l}"/>\n\t\t\t</circle>`;const d=[{dx:0,dy:-11},{dx:0,dy:11},{dx:-11,dy:0},{dx:11,dy:0}];for(const{dx:e,dy:a}of d){const o=(Number(t)+e).toFixed(1),r=(Number(i)+a).toFixed(1);s+=`<circle cx="${t}" cy="${i}" r="2.5" fill="${n.color}" opacity="0">\n\t\t\t\t\t<animate attributeName="cx" calcMode="linear" dur="${c}" repeatCount="indefinite" keyTimes="${A}" values="${t};${t};${t};${o};${o}"/>\n\t\t\t\t\t<animate attributeName="cy" calcMode="linear" dur="${c}" repeatCount="indefinite" keyTimes="${A}" values="${i};${i};${i};${r};${r}"/>\n\t\t\t\t\t<animate attributeName="r" calcMode="linear" dur="${c}" repeatCount="indefinite" keyTimes="${A}" values="2.5;2.5;2.5;0;0"/>\n\t\t\t\t\t<animate attributeName="opacity" calcMode="linear" dur="${c}" repeatCount="indefinite" keyTimes="${A}" values="${l}"/>\n\t\t\t\t</circle>`}}const c=t.gameHistory.map((t=>`${Ct(t.ship.x).toFixed(1)},${r.toFixed(1)}`)),g=((t,e)=>{var n,i,a,o;const r=t.gameHistory.length;if(0===r){const t=null!==(n=e[0])&&void 0!==n?n:"0,0";return{keyTimes:"0;1",values:`${t};${t}`}}const s=[],A=[];let l=null,c=null;return e.forEach(((t,e)=>{t!==l&&(null!==l&&null!==c&&e-1!==c&&(s.push(Number(((e-1)/(r-1)).toFixed(4))),A.push(l)),s.push(Number((e/(r-1)).toFixed(4))),A.push(t),l=t,c=e)})),0!==s.length&&1===s[s.length-1]||(0===s.length?(s.push(0,1),A.push(null!==(i=e[0])&&void 0!==i?i:"0,0",null!==(a=e[e.length-1])&&void 0!==a?a:"0,0")):(s.push(1),A.push(null!==(o=null!=l?l:e[e.length-1])&&void 0!==o?o:"0,0"))),{keyTimes:s.join(";"),values:A.join(";")}})(t,c);return s+=`<image x="-16" y="-35" width="32" height="35" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABGCAYAAAB8MJLDAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAADsMAA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URgiBAs9mU0/KjsirGyMVMLJBfmd3LvWt2BtlqBDLqtaI8g9YPZlmUnVK6LIFWqyX3C4itLln2fR9hGHZJQFgDKV7s0yL/HeNPkc0h7Hvfc1ie0Gm329A0DeVyWUqgXC5Lt+9lsV+gXC5DdRwHuq7LlRO6rstNy70sNjAbhtGVZs4iwPVY/fL4XnsTbOh9OeewbRuMMTiOA9u2kSQJHMdBuVwu5Gq1ijiO4TgO1KK1M2JTQT8WLlcul8ee/dUyG6hUVe00SGOY2EaTjVAABnJ2zdN7tn3e0HUkYvu8piFcWnl+wbfPN5tN6LoOTdPgeV6OxV6ALIula0VMKZUbGAWL2dgiBiB3m3DOC1nsEslyqVQCY6yQxaapLNu2jTiOc6wOW0rWTwJZFucP2p8jXLSXh7lrv2RMbMgqOmeY22eZ2rbdtYZWLCPv5TRN0W63c8wYQxAEksXeniwX1bxt23LrmuA4jnMchiEYYzkOgkByu91GmqY5FuP/vSz+kxXbtvEfwITwAX3FN6kAAAAASUVORK5CYII=" preserveAspectRatio="xMidYMid meet">\n\t\t<animateTransform attributeName="transform" type="translate" calcMode="linear"\n\t\t\tdur="${a}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${g.keyTimes}"\n\t\t\tvalues="${g.values}"/>\n\t</image>`,s+="</svg>",s};const kt=["NONE","FIRST_QUARTILE","SECOND_QUARTILE","THIRD_QUARTILE","FOURTH_QUARTILE"],Ut=t=>{const e=kt.indexOf(t);return kt[Math.max(0,e-1)]},St=()=>Math.floor(5*Math.random())+4,Rt=t=>t.grid.some((t=>t.some((t=>t.commitsCount>0)))),Mt=(t,e=-1)=>{const i=Math.round(t.ship.x-.5),a=e=>t.grid[e].reduce(((t,e)=>{var n;return t+(null!==(n={NONE:0,FIRST_QUARTILE:1,SECOND_QUARTILE:2,THIRD_QUARTILE:3,FOURTH_QUARTILE:4}[e.level])&&void 0!==n?n:0)}),0);for(let t=3;t<=n;t++){let o=-1,r=0;for(let s=-t;s<=t;s++){const t=i+s;if(t<0||t>=n)continue;if(t===e)continue;const A=a(t);A>r&&(r=A,o=t)}if(-1!==o)return o}for(let i=0;i<n;i++)if(i!==e&&t.grid[i].some((t=>t.commitsCount>0)))return i;return Math.floor(26.5)},It=t=>{var e;t.frameCount++;const{grid:i,ship:a}=t,o=d(t);for(const e of t.bullets){if(!e.active)continue;if(e.y-=.6,e.y<-1){e.active=!1;continue}const a=Math.round(e.x-.5),r=Math.floor(e.y);if(a>=0&&a<n&&r>=0&&r<7&&i[a][r].commitsCount>0){const n=i[a][r].color,s=Ut(i[a][r].level);i[a][r].level=s,i[a][r].color=o.intensityColors[kt.indexOf(s)],"NONE"===s&&(i[a][r].commitsCount=0,t.explosionEvents.push({frameIndex:t.gameHistory.length,x:a,y:r,color:n})),t.cellEvents.push({frameIndex:t.gameHistory.length,x:a,y:r,color:i[a][r].color}),t.config.pointsIncreasedCallback(t.cellEvents.length),e.active=!1}}t.bullets=t.bullets.filter((t=>t.active)),(null===(e=i[t.currentTargetCol])||void 0===e?void 0:e.some((t=>t.commitsCount>0)))||(t.currentTargetCol=Mt(t),t.framesShootingAtTarget=0);const r=t.currentTargetCol,s=r+.5,A=s-a.x;Math.abs(A)>.4?a.x+=.4*Math.sign(A):a.x=s,a.x=Math.max(.8,Math.min(52.2,a.x));const l=Math.abs(a.x-s)<.5,c=i[r].some((t=>t.commitsCount>0));l&&c&&(t.framesShootingAtTarget>=t.framesAllowedForTarget?(t.currentTargetCol=Mt(t,r),t.framesShootingAtTarget=0,t.framesAllowedForTarget=St()):(t.frameCount%2==0&&t.bullets.length<10&&t.bullets.push({id:t.nextBulletId++,x:s,y:9.5,active:!0}),t.framesShootingAtTarget++)),(t=>{t.gameHistory.push({ship:{x:t.ship.x},bullets:t.bullets.map((t=>Object.assign({},t)))})})(t)},Ot=t=>{return e=void 0,n=void 0,a=function*(){if(t.frameCount=0,t.nextBulletId=0,t.gameHistory=[],t.cellEvents=[],t.explosionEvents=[],t.bullets=[],t.grid=h(t),t.initialColors=t.grid.map((t=>t.map((t=>t.color)))),!Rt(t)){const e=Et(t);return t.config.svgCallback(e),void t.config.gameOverCallback()}for(t.ship={x:26.5},t.currentTargetCol=Mt(t),t.framesShootingAtTarget=0,t.framesAllowedForTarget=St();Rt(t)&&t.frameCount<3e3;)It(t);const e=Et(t);t.config.svgCallback(e),t.config.gameStatsCallback&&t.config.gameStatsCallback({totalScore:t.cellEvents.length,steps:t.frameCount,ghostsEaten:0}),t.config.gameOverCallback()},new((i=void 0)||(i=Promise))((function(t,o){function r(t){try{A(a.next(t))}catch(t){o(t)}}function s(t){try{A(a.throw(t))}catch(t){o(t)}}function A(e){var n;e.done?t(e.value):(n=e.value,n instanceof i?n:new i((function(t){t(n)}))).then(r,s)}A((a=a.apply(e,n||[])).next())}));var e,n,i,a},Dt={frameCount:0,nextBulletId:0,contributions:[],ship:{x:0},bullets:[],grid:[],monthLabels:[],gameHistory:[],initialColors:[],cellEvents:[],explosionEvents:[],currentTargetCol:-1,framesShootingAtTarget:0,framesAllowedForTarget:4,config:void 0};class Tt{constructor(t){this.conf=Object.assign({},t)}start(){return t=this,e=void 0,i=function*(){switch(this.store=JSON.parse(JSON.stringify(Dt)),this.store.config=Object.assign(Object.assign({},{platform:"github",username:"",svgCallback:t=>{},gameOverCallback:()=>{},gameTheme:"github",pointsIncreasedCallback:t=>{},githubSettings:{accessToken:""}}),this.conf),this.store.config.platform){case"gitlab":this.store.contributions=yield y(this.store);break;case"github":this.store.contributions=yield f(this.store);break;default:throw new Error(`Unsupported platform: ${this.store.config.platform}`)}return g(this.store),u(this.store),yield Ot(this.store),this.store},new((n=void 0)||(n=Promise))((function(a,o){function r(t){try{A(i.next(t))}catch(t){o(t)}}function s(t){try{A(i.throw(t))}catch(t){o(t)}}function A(t){var e;t.done?a(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}A((i=i.apply(t,e||[])).next())}));var t,e,n,i}stop(){this.store}}const Vt=["#e74c3c","#f1c40f","#2ecc71","#3498db","#9b59b6","#e67e22"],Nt=t=>22*t+10,Qt=t=>22*t+15+10,Ht=(t,e,n)=>{0===t.keyTimes.length||e!==t.keyTimes[t.keyTimes.length-1]?(t.keyTimes.push(e),t.values.push(n)):t.values[t.values.length-1]=n},Ft=t=>(1!==t.keyTimes[t.keyTimes.length-1]&&(t.keyTimes.push(1),t.values.push(t.values[t.values.length-1])),{keyTimes:t.keyTimes.join(";"),values:t.values.join(";")}),Kt=(t,e)=>Number((t/Math.max(e-1,1)).toFixed(4)),Yt=(t,e,n,i)=>{var a,o;const r=t.gameHistory.length,s=null!==(o=null===(a=t.initialColors[e])||void 0===a?void 0:a[n])&&void 0!==o?o:i,A=t.cellEvents.filter((t=>t.x===e&&t.y===n));if(0===A.length)return{keyTimes:"0;1",values:`${s};${s}`};const l={keyTimes:[0],values:[s]};for(const t of A){const e=Kt(t.frameIndex,r);Ht(l,e,t.color)}return Ft(l)},Jt=t=>{var e,a,o,r,s,A,l,c,g;const u=t.gameHistory.length,h=`${Math.max(u*i/6,1e3)}ms`,m=d(t),f=m.intensityColors[0];let y='<svg width="1166" height="249" xmlns="http://www.w3.org/2000/svg">';y+=`<desc>Generated with puzzle-bobble-contribution-graph on ${new Date}</desc>`,y+=`<rect width="100%" height="100%" fill="${m.gridBackground}"/>`;let p="";for(let e=0;e<n;e++)t.monthLabels[e]!==p&&(y+=`<text x="${22*e+10}" y="10" text-anchor="middle" font-size="10" fill="${m.textColor}">${t.monthLabels[e]}</text>`,p=t.monthLabels[e]);for(let e=0;e<n;e++)for(let n=0;n<7;n++){const i=Nt(e),a=Qt(n),o=Yt(t,e,n,f);y+=`<circle cx="${i}" cy="${a}" r="9" fill="${f}">\n\t\t\t\t<animate attributeName="fill" calcMode="discrete" dur="${h}" repeatCount="indefinite"\n\t\t\t\t\tvalues="${o.values}" keyTimes="${o.keyTimes}"/>\n\t\t\t</circle>`}if(u>=2){const n=(t=>{const e=[],n=new Map;for(let i=0;i<t.gameHistory.length;i++){const a=t.gameHistory[i].activeBubble;for(const[t,o]of n)a&&a.id===t||(e.push({id:t,colorIndex:o.colorIndex,startFrame:o.startFrame,endFrame:i-1,xPositions:o.xs,yPositions:o.ys}),n.delete(t));if(a&&a.active)if(n.has(a.id)){const t=n.get(a.id);t.xs.push(a.x),t.ys.push(a.y)}else n.set(a.id,{colorIndex:a.colorIndex,startFrame:i,xs:[a.x],ys:[a.y]})}for(const[i,a]of n)e.push({id:i,colorIndex:a.colorIndex,startFrame:a.startFrame,endFrame:t.gameHistory.length-1,xPositions:a.xs,yPositions:a.ys});return e})(t);for(const t of n){const n=Number((t.startFrame/(u-1)).toFixed(4)),i=Number((Math.min(t.endFrame+1,u-1)/(u-1)).toFixed(4)),a=null!==(e=Vt[t.colorIndex])&&void 0!==e?e:Vt[0];let o,r;n<=0&&i>=1?(o="0;1",r="1;1"):n<=0?(o=`0;${i};${i};1`,r="1;1;0;0"):i>=1?(o=`0;${n};${n};1`,r="0;0;1;1"):(o=`0;${n};${n};${i};${i};1`,r="0;0;1;1;0;0");const s=[],A=[],l=t.xPositions[0].toFixed(1),c=t.yPositions[0].toFixed(1);t.startFrame>0&&(s.push(0),A.push(`${l},${c}`));for(let e=0;e<t.xPositions.length;e++){const n=t.startFrame+e,i=Number((n/(u-1)).toFixed(4)),a=t.xPositions[e].toFixed(1),o=t.yPositions[e].toFixed(1);0!==s.length&&i===s[s.length-1]||(s.push(i),A.push(`${a},${o}`))}if(1!==s[s.length-1]){const e=t.xPositions[t.xPositions.length-1].toFixed(1),n=t.yPositions[t.yPositions.length-1].toFixed(1);s.push(1),A.push(`${e},${n}`)}y+=`<circle cx="0" cy="0" r="9" fill="${a}" opacity="0" stroke="white" stroke-width="1" stroke-opacity="0.4">\n\t\t\t\t<animate attributeName="opacity" calcMode="discrete" dur="${h}" repeatCount="indefinite"\n\t\t\t\t\tkeyTimes="${o}" values="${r}"/>\n\t\t\t\t<animateTransform attributeName="transform" type="translate" calcMode="linear"\n\t\t\t\t\tdur="${h}" repeatCount="indefinite"\n\t\t\t\t\tkeyTimes="${s.join(";")}" values="${A.join(";")}"/>\n\t\t\t</circle>`}}if(u>=2)for(const e of t.popEvents){const t=Number((e.frameIndex/(u-1)).toFixed(4)),n=Number((Math.min(e.frameIndex+8,u-1)/(u-1)).toFixed(4));if(n<=t)continue;const i=`0;${t};${t};${n};1`,a="0;0;1;0;0";for(const{x:t,y:n}of e.cells)y+=`<circle cx="${Nt(t).toFixed(1)}" cy="${Qt(n).toFixed(1)}" r="4" fill="none" stroke="${e.color}" stroke-width="2" opacity="0">\n\t\t\t\t\t<animate attributeName="r" calcMode="linear" dur="${h}" repeatCount="indefinite" keyTimes="${i}" values="4;4;4;20;20"/>\n\t\t\t\t\t<animate attributeName="stroke-width" calcMode="linear" dur="${h}" repeatCount="indefinite" keyTimes="${i}" values="2;2;2;0;0"/>\n\t\t\t\t\t<animate attributeName="opacity" calcMode="linear" dur="${h}" repeatCount="indefinite" keyTimes="${i}" values="${a}"/>\n\t\t\t\t</circle>`}if(u>=2){const e=169,n=583..toFixed(1),i=(e+30).toFixed(1),d={keyTimes:[],values:[]};for(let e=0;e<t.gameHistory.length;e++){const a=Kt(e,u),o=(90-t.gameHistory[e].cannon.angleDeg).toFixed(1);Ht(d,a,`${o} ${n} ${i}`)}const f=Ft(d),p=22,x=Number(n),b=Number(i),v=b-p,C={keyTimes:[],values:[]};for(let e=0;e<t.gameHistory.length;e++){const n=Kt(e,u),i=t.gameHistory[e].currentBubbleColorIndex;Ht(C,n,null!==(a=Vt[i])&&void 0!==a?a:Vt[0])}const w=Ft(C);y+=`<circle cx="${n}" cy="${i}" r="10" fill="${null!==(s=Vt[null!==(r=null===(o=t.gameHistory[0])||void 0===o?void 0:o.currentBubbleColorIndex)&&void 0!==r?r:0])&&void 0!==s?s:Vt[0]}" stroke="white" stroke-width="2">\n\t\t\t<animate attributeName="fill" calcMode="discrete" dur="${h}" repeatCount="indefinite"\n\t\t\t\tvalues="${w.values}" keyTimes="${w.keyTimes}"/>\n\t\t\t<animateTransform attributeName="transform" type="rotate" calcMode="linear"\n\t\t\t\tdur="${h}" repeatCount="indefinite"\n\t\t\t\tkeyTimes="${f.keyTimes}" values="${f.values}"/>\n\t\t</circle>`,y+=`<line x1="${x}" y1="${b}" x2="${x}" y2="${v}" stroke="#cccccc" stroke-width="6" stroke-linecap="round">\n\t\t\t<animateTransform attributeName="transform" type="rotate" calcMode="linear"\n\t\t\t\tdur="${h}" repeatCount="indefinite"\n\t\t\t\tkeyTimes="${f.keyTimes}" values="${f.values}"/>\n\t\t</line>`;const B={keyTimes:[],values:[]};for(let e=0;e<t.gameHistory.length;e++){const n=Kt(e,u),i=t.gameHistory[e].nextBubbleColorIndex;Ht(B,n,null!==(A=Vt[i])&&void 0!==A?A:Vt[0])}const E=Ft(B),k=(Number(n)+28).toFixed(1),U=i,S=null!==(g=Vt[null!==(c=null===(l=t.gameHistory[0])||void 0===l?void 0:l.nextBubbleColorIndex)&&void 0!==c?c:0])&&void 0!==g?g:Vt[0];y+=`<text x="${k}" y="${(Number(i)-16).toFixed(1)}" text-anchor="middle" font-size="8" fill="${m.textColor}" opacity="0.8">NEXT</text>`,y+=`<circle cx="${k}" cy="${U}" r="9" fill="${S}" stroke="white" stroke-width="1" stroke-opacity="0.5">\n\t\t\t<animate attributeName="fill" calcMode="discrete" dur="${h}" repeatCount="indefinite"\n\t\t\t\tvalues="${E.values}" keyTimes="${E.keyTimes}"/>\n\t\t</circle>`}return y+="</svg>",y};const Lt=t=>22*t+10,Gt=t=>22*t+15+10,jt=t=>Math.round((t-10)/22),zt=t=>Math.round((t-15-10)/22),Pt=t=>t.grid.some((t=>t.some((t=>t.commitsCount>0)))),Xt=(t,e,i,a)=>{var o,r,s;const A=new Set,l=[],c=[{x:e,y:i}];for(;c.length;){const{x:e,y:i}=c.pop(),d=`${e},${i}`;if(A.has(d))continue;if(e<0||e>=n||i<0||i>=7)continue;const g=null===(o=t.grid[e])||void 0===o?void 0:o[i];g&&0!==g.commitsCount&&(null!==(s=null===(r=t.cellBubbleColors[e])||void 0===r?void 0:r[i])&&void 0!==s?s:-1)===a&&(A.add(d),l.push({x:e,y:i}),c.push({x:e-1,y:i},{x:e+1,y:i},{x:e,y:i-1},{x:e,y:i+1}))}return l},Wt=(t,e,i,a)=>{var o,r,s,A;const l=i*Math.PI/180;let c=10*Math.cos(l),d=-10*Math.sin(l),g=t,u=e;for(let t=0;t<2e3;t++){if(g+=c,u+=d,g<9&&(g=9,c=Math.abs(c)),g>1157&&(g=1157,c=-Math.abs(c)),u<0)return null;const t=jt(g),e=zt(u);if(!(e<0||e>=7||t<0||t>=n)){for(const[i,s]of[[0,0],[1,0],[-1,0],[0,1],[0,-1]]){const A=t+i,l=e+s;if(!(A<0||A>=n||l<0||l>=7)&&(null===(r=null===(o=a.grid[A])||void 0===o?void 0:o[l])||void 0===r?void 0:r.commitsCount)>0){const t=Lt(A),e=Gt(l);if(Math.hypot(g-t,u-e)<20)return{col:Math.max(0,Math.min(52,jt(g))),row:Math.max(0,Math.min(6,zt(u)))}}}if(0===e&&0===(null===(A=null===(s=a.grid[t])||void 0===s?void 0:s[0])||void 0===A?void 0:A.commitsCount))return{col:Math.max(0,Math.min(52,t)),row:0}}}return null},qt=t=>{t.gameHistory.push({cannon:Object.assign({},t.cannon),activeBubble:t.activeBubble?Object.assign({},t.activeBubble):null,nextBubbleColorIndex:t.nextBubbleColorIndex,currentBubbleColorIndex:t.currentBubbleColorIndex})},Zt=t=>{var e,i,a,o,r,s,A;if(t.frameCount++,!t.activeBubble){-1===t.cannonTargetAngle&&(t.cannonTargetAngle=((t,e,i,a)=>{var o,r,s,A,l,c,d,g,u,h,m,f,y,p;const x=1664525*t.nextBubbleId+1013904223>>>0,b=[],v=[],C=[],w=[[-1,0],[1,0],[0,-1],[0,1],[-1,1],[0,1],[1,1],[-1,2],[0,2],[1,2]];for(let e=12;e<=168;e+=2){const i=Wt(583,199,e,t);if(!i)continue;if((null!==(s=null===(r=null===(o=t.grid[i.col])||void 0===o?void 0:o[i.row])||void 0===r?void 0:r.commitsCount)&&void 0!==s?s:0)>0)continue;let u=!1,h=!1,m=0;for(const[e,o]of w){const r=i.col+e,s=i.row+o;if(!(r<0||r>=n||s<0||s>=7)&&0!==(null!==(c=null===(l=null===(A=t.grid[r])||void 0===A?void 0:A[s])||void 0===l?void 0:l.commitsCount)&&void 0!==c?c:0)&&(h=!0,(null!==(g=null===(d=t.cellBubbleColors[r])||void 0===d?void 0:d[s])&&void 0!==g?g:-1)===a)){u=!0;const e=Xt(t,r,s,a).length+1;e>m&&(m=e)}}m>=3?b.push({angleDeg:e,score:m}):u?v.push(e):h&&C.push(e)}if(b.length>0){const t=Math.max(...b.map((t=>t.score))),e=b.filter((e=>e.score===t));return e[x%e.length].angleDeg}if(v.length>0)return v[x%v.length];if(C.length>0)return C[x%C.length];let B=90,E=1/0;for(let e=12;e<=168;e+=2){const i=Wt(583,199,e,t);if(!i)continue;if((null!==(m=null===(h=null===(u=t.grid[i.col])||void 0===u?void 0:u[i.row])||void 0===h?void 0:h.commitsCount)&&void 0!==m?m:0)>0)continue;const a=Lt(i.col),o=Gt(i.row);let r=1/0;for(let e=0;e<n;e++)for(let n=0;n<7;n++)if((null!==(p=null===(y=null===(f=t.grid[e])||void 0===f?void 0:f[n])||void 0===y?void 0:y.commitsCount)&&void 0!==p?p:0)>0){const t=Math.hypot(a-Lt(e),o-Gt(n));t<r&&(r=t)}r<E&&(E=r,B=e)}return B})(t,0,0,t.nextBubbleColorIndex));const a=t.cannonTargetAngle;t.currentBubbleColorIndex=t.nextBubbleColorIndex;const o=a-t.cannon.angleDeg;if(!(Math.abs(o)<=6))return t.cannon.angleDeg+=6*Math.sign(o),t.cannon.angleDeg=Math.max(10,Math.min(170,t.cannon.angleDeg)),void qt(t);t.cannon.angleDeg=a;const r=t.nextBubbleColorIndex;t.currentBubbleColorIndex=r,t.cannonTargetAngle=-1;const s=new Set;for(let a=0;a<n;a++)for(let n=0;n<7;n++)t.grid[a][n].commitsCount>0&&s.add(null!==(i=null===(e=t.cellBubbleColors[a])||void 0===e?void 0:e[n])&&void 0!==i?i:0);const A=[...s];if(A.length>0){const e=1664525*t.frameCount+1013904223>>>0;t.nextBubbleColorIndex=A[e%A.length]}const l=t.cannon.angleDeg*Math.PI/180;return t.activeBubble={id:t.nextBubbleId++,x:583,y:199,vx:10*Math.cos(l),vy:-10*Math.sin(l),colorIndex:r,active:!0},void qt(t)}const l=t.activeBubble;if(l.x+=l.vx,l.y+=l.vy,l.x<9&&(l.x=9,l.vx=Math.abs(l.vx)),l.x>1157&&(l.x=1157,l.vx=-Math.abs(l.vx)),l.y<0||l.y>209)return t.activeBubble=null,t.cannonTargetAngle=-1,void qt(t);let c=!1,g=-1,u=-1;const h=jt(l.x),m=zt(l.y);t:for(let e=-1;e<=1;e++)for(let i=-1;i<=1;i++){const A=h+e,d=m+i;if(A<0||A>=n||d<0||d>=7)continue;const f=Lt(A),y=Gt(d);if(Math.hypot(l.x-f,l.y-y)<18){if((null===(o=null===(a=t.grid[A])||void 0===a?void 0:a[d])||void 0===o?void 0:o.commitsCount)>0){if(0===(null===(s=null===(r=t.grid[h])||void 0===r?void 0:r[m])||void 0===s?void 0:s.commitsCount)&&h>=0&&h<n&&m>=0&&m<7)g=h,u=m;else for(const[e,i]of[[0,1],[-1,0],[1,0],[0,-1]]){const a=A+e,o=d+i;if(a>=0&&a<n&&o>=0&&o<7&&0===t.grid[a][o].commitsCount){g=a,u=o;break}}c=!0;break t}if(0===d){g=A,u=0,c=!0;break t}}}if(!c&&m<=0&&h>=0&&h<n&&(g=h,u=0,c=!0),c&&g>=0&&u>=0){g=Math.max(0,Math.min(52,g)),u=Math.max(0,Math.min(6,u));const e=d(t).intensityColors[0],n=null!==(A=Vt[l.colorIndex])&&void 0!==A?A:Vt[0];t.grid[g][u]={commitsCount:1,color:n,level:"FIRST_QUARTILE"},t.cellBubbleColors[g][u]=l.colorIndex,t.cellEvents.push({frameIndex:t.gameHistory.length,x:g,y:u,color:n});const i=Xt(t,g,u,l.colorIndex);if(i.length>=3){const a=n;for(const{x:n,y:a}of i)t.grid[n][a]={commitsCount:0,color:e,level:"NONE"},t.cellBubbleColors[n][a]=-1,t.cellEvents.push({frameIndex:t.gameHistory.length,x:n,y:a,color:e});t.popEvents.push({frameIndex:t.gameHistory.length,cells:i,color:a}),t.config.pointsIncreasedCallback(t.cellEvents.length)}t.activeBubble=null,t.cannonTargetAngle=-1}qt(t)},$t=t=>{return e=void 0,i=void 0,o=function*(){var e,i,a;t.frameCount=0,t.nextBubbleId=0,t.gameHistory=[],t.cellEvents=[],t.popEvents=[],t.activeBubble=null,t.grid=h(t);const o=d(t).intensityColors[0],r=[];for(let e=0;e<n;e++)for(let n=0;n<7;n++)t.grid[e][n].commitsCount>0&&r.push({x:e,y:n});const s=r.length<=50?2:r.length<=150?3:r.length<=250?4:r.length<=350?5:6;let A=2654435761*r.length>>>0;const l=()=>(A=Math.imul(A,1664525)+1013904223>>>0,A/4294967296);t.cellBubbleColors=Array.from({length:n},(()=>new Array(7).fill(-1)));for(const{x:e,y:n}of r)t.cellBubbleColors[e][n]=Math.floor(l()*s);for(let n=0;n<3;n++){const n=t.cellBubbleColors.map((t=>[...t]));for(const{x:a,y:o}of r){const r=new Array(s).fill(0);let A=0;for(const[t,s]of[[-1,0],[1,0],[0,-1],[0,1],[-1,-1],[1,-1],[-1,1],[1,1]]){const l=null!==(i=null===(e=n[a+t])||void 0===e?void 0:e[o+s])&&void 0!==i?i:-1;l>=0&&(r[l]++,A++)}if(A>0){const e=Math.max(...r);e>=.5*A&&(t.cellBubbleColors[a][o]=r.indexOf(e))}}}for(const{x:e,y:n}of r){const i=t.cellBubbleColors[e][n];t.grid[e][n]=Object.assign(Object.assign({},t.grid[e][n]),{color:Vt[i]})}t.initialColors=t.grid.map((t=>t.map((t=>t.commitsCount>0?t.color:o))));const c=[...new Set(r.map((({x:e,y:n})=>t.cellBubbleColors[e][n])))];if(t.nextBubbleColorIndex=null!==(a=c[Math.floor(l()*c.length)])&&void 0!==a?a:0,!Pt(t)){const e=Jt(t);return t.config.svgCallback(e),void t.config.gameOverCallback()}for(t.cannon={angleDeg:90},t.cannonTargetAngle=-1,t.currentBubbleColorIndex=t.nextBubbleColorIndex;Pt(t)&&t.frameCount<5e3;)Zt(t);const g=Jt(t);t.config.svgCallback(g),t.config.gameStatsCallback&&t.config.gameStatsCallback({totalScore:t.cellEvents.length,steps:t.frameCount,ghostsEaten:0}),t.config.gameOverCallback()},new((a=void 0)||(a=Promise))((function(t,n){function r(t){try{A(o.next(t))}catch(t){n(t)}}function s(t){try{A(o.throw(t))}catch(t){n(t)}}function A(e){var n;e.done?t(e.value):(n=e.value,n instanceof a?n:new a((function(t){t(n)}))).then(r,s)}A((o=o.apply(e,i||[])).next())}));var e,i,a,o},_t={frameCount:0,nextBubbleId:0,nextBubbleColorIndex:0,currentBubbleColorIndex:0,cannonTargetAngle:-1,contributions:[],cannon:{angleDeg:90},activeBubble:null,grid:[],monthLabels:[],gameHistory:[],initialColors:[],cellBubbleColors:[],cellEvents:[],popEvents:[],config:void 0};class te{constructor(t){this.conf=Object.assign({},t)}start(){return t=this,e=void 0,i=function*(){switch(this.store=JSON.parse(JSON.stringify(_t)),this.store.config=Object.assign(Object.assign({},{platform:"github",username:"",svgCallback:t=>{},gameOverCallback:()=>{},gameTheme:"github",pointsIncreasedCallback:t=>{},githubSettings:{accessToken:""}}),this.conf),this.store.config.platform){case"gitlab":this.store.contributions=yield y(this.store);break;case"github":this.store.contributions=yield f(this.store);break;default:throw new Error(`Unsupported platform: ${this.store.config.platform}`)}return g(this.store),u(this.store),yield $t(this.store),this.store},new((n=void 0)||(n=Promise))((function(a,o){function r(t){try{A(i.next(t))}catch(t){o(t)}}function s(t){try{A(i.throw(t))}catch(t){o(t)}}function A(t){var e;t.done?a(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}A((i=i.apply(t,e||[])).next())}));var t,e,n,i}stop(){this.store}}const ee={player:{idleDown:{x:305,y:5,width:16,height:21,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAVCAYAAABPPm7SAAABgklEQVR42o1UIW/CQBh91yAmJ7v+g5OcY8kMsssExUFCliCxzTKBRCykFjWGIEECgjCBaEKWtO6Q9w/YSZKZuU5AL71y7folJ+679959330vR2CIuk0TU/4gBUFZ1G2a1G2aTHfLJPn51tZ0t0zS80Jyh22viPnVYVtNxErJ1Amw2DP8F4s9A3UC1aaVHjTfflE1stha/lA+eKVk+2ul7Wt5sv1+B/YkwDdUA6Y5+eABYx/aGwDApDes3EIWqwSoE1QWyGJJdoyD+QiPL+VC27GPSW+oTEXyXqBOoF6537gHAHzEEQAgfL2BOPqaI0kVC5dZ2sqS+YZiMB+pPrvtCN12pHoezEfgGwqjE3nLA2YU/TUvvLm/5sCMgrc8JaJ8IOMQdqMJGYcAAHH0sXg+e4EthRGjteDKE2QcwpWnwgpMGKLKB8DWK23O7DIFfpmCOJ4dmMVb2Rs+7VsdGEdX5BSjVZBPFrVhwtUOUhAX1yL57yvvEVeecJCCEBOg6O8zYf4AxGvpYTg/OGAAAAAASUVORK5CYII="},walkDown0:{x:9,y:8,width:14,height:24,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAYCAYAAADKx8xXAAABiUlEQVR42p1Uv2vCQBT+LmTo2PGa/+CNuS2CFBxbHIybAZeOrqFTR4ci6dipKkVwtIvYwaFQCrol4/0HNpuFLm7XQS8mMU2tDw7C996X9+N7dww5szkpFFgUS1aEw+akbE6qP58o9f2ZOf35RGn/AaklZgeE/GmJWUJmNidFVoDxu8Ax5l2GkCsfBgDU7jc41nSsmQbjqltK4h8vybeZJvGnC4i6RDilDEFjcdUFej4AbEs9xU4mMi1HZ9TF9W1QGjzr+Xhs3yGKJWNpLTujbilRk5KMZav22+pletTTJCuA11zAay5AVpDxZeSwOalwShisPZB1BuFU9lI4FWAZYLDeIJyOIepQUSyZme8BAORkn0HU5RZrAzeprIbNSYUNFxjS3w0OCWHDhc1JmXkfWQGEU8HD826pm0C4XECu/GIdi8hAMSmjY3pIuq/0tEVdZl4BI6/jYO0dtKaxdGVJqa/8HNypbW/K8g1X8RcAoAiPYskM/RftLL2Puxibk2L/WbfS4RyzpwDwA3eo2etvVgkzAAAAAElFTkSuQmCC"},walkDown1:{x:75,y:8,width:14,height:24,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAYCAYAAADKx8xXAAABkElEQVR42p2UsUvDQBTGf1c6OHY88x/cmGwVRHBUOthuDbg4ugZxcHSQEsdOtiKCY3Uo7eAgiNBuccx/ULNVcHE7h/bSXBrb6oOD8N378t5977sT5MKVSlMQ70ksinBcqbQrle4897T++rBW57mnzf4SqekNlgj51fQGKVm4UmnlhDy8emwS/l5EPAkoAexffbNpmNxyFkx26ytJ8u0x/S5nSfJmG68WE/WVRTBYsluHVgAwa/U/UQJ4Od/amGByhRnH6f0lh2fhStKgFdA+vuA9iYXIzlI5YaraSXUHgO54lFaKJ0HqILHOar9ZzxLHqKmcEL8xwm+MUE5o7VniuFLpqK/oTn2UE+LN2wTwqjszbD4S05llgPbxBQBxb1HBq8XF43Cl0kNZgVu1/oC3iuiojiuVLuf3TKvXd3NTNyAaj4gngZUnihQ1gpjIk6w5ZkXKn8tg2VeglJ9jd+ovHa0IS1sdygqyuj+7KeMXDpJPALK49/S4aNVUio7su2iShrJi4eaH4i92WynOJj4F+AFlodcPvNujWwAAAABJRU5ErkJggg=="},walkDown2:{x:108,y:8,width:14,height:24,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAYCAYAAADKx8xXAAABf0lEQVR42qVUMU8CMRT+ShgcGev9g47X7UiICSPEgWPjEjf/wcU4ODoYU0Ymwbg4IgOBgYHE5diOsf8Au0Hi4mQdzh70OOHUlzRpXt/X9/q9rw/IMZcy7VKmccBIHigvcKkkwaEs/dlQ6/c3a/VnQ51bhUuZ7vDJHiC7OnySgolLmWaOwPMrRxELzmLIVYgSANTvPlDUTGwJf7Ry1qFq/mHEfbgPVDUf9OEU/FwiHjMr3vialwI9U+r8+uTXpZaWShK5CjFYRIUADbXBUklCdnvJHIHu5+1RkCW5Y9rMSs9qhyGEOQJBO0LQjsAcYZ2lbzTZ4jHDYB2AOQLcq27Z9KqJ75tVU1najsE6QO/iBgAgh9sM/FwmGVs+8AgA0lZO80r8Tznmjd2npNygDcSLCHwUWuRYrMatRG589JKSAgByFe6xWjagKa2kh1NaQWMnOG75UIs5GmpjswoA1Ksjb28upF4dU1qB9ZFNgAFkb/9xWO2CjbSOqYcUmXB5k+4LCXHPPa24MKoAAAAASUVORK5CYII="},walkDown3:{x:141,y:8,width:14,height:24,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAYCAYAAADKx8xXAAABeklEQVR42p1UIU/DQBh910wgK4/9g5Ot2xKyZHJkYpujCYagsBUIfgCiyCk2gpksCELFRJOZ1bXy/kF3jiUY3E2UK72228q+5NLm+r1+73vfuwNKYVEmLcokjoRRBgXUREBNHAOTMnBfYiI4qf2gKM6WvpTfG23Nlr6sbcGiTF7ZnxVAeXl3XzmYWJRJ1vawWNloEk4vBk/dTJz+4w+ahso1cGKcDGzVbYqL8V7AJYCpAob3Z7hZ/YHo8znsIUf8wTSQPeQIqJlRTQQnPHUxj9aNKA7EFongxFCumF4/wOnFWdXbjZ79wvI95aDGlitbzyiCVE+s7cGZrOFMMvoBNRGPxpr5jXLzAGB3uloV2ulrz8o44lE2Btvv5ooufEBEIWinDxGFugHUOVQRUDOvrpS0398wENuqc4o01PvT6xzOZA3W9iritA4pGP/OlqcuAmpqFQ8Ceerm1IvqJ4ITouQNqJlTFFGo/b32dCjOxcRjoERw8i/nFC+sHSx90I3EuUDEAAAAAElFTkSuQmCC"},walkRight0:{x:8,y:41,width:16,height:24,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAYCAYAAADzoH0MAAABZ0lEQVR42p2UPU8CMRyHnxIHRsdy36Cb53YkLIw4CZskxoTBOOtAoh/A4VYmwM2RyejAwAgbN943gG6SuLjVRbB3XMvhL2ly7eX//rSCAoVSmaLzRKcifyZsg0SnIpTKqCCm+fwNQC+qAzBezBlcP+07CqUy5u7RrM8iE0plrs7fzWg6MeZrXbhG04mxM6wA6MWMlt5gR3apF9VRQbzLupLoVLT0BmAvbZfsICd27T4j3Wjvvi+AgV3CIelGGzms0dIb5LCGHNbA52C8mFNWGQezfpVjJfIAFTGQ7wFAS29IdCqEi0LXSGf9KunqYQeTcKXmm4pNoncKKogBWL4pALqdub+JZdTtzNlD2aV09ZDZv07q3N/0/pHBi2J52T7MgasHmRJue24ODk1CBXFmhKVK2E5g25P8q1RxRd5GH392vVkJ388PeYqMmn84/z48NlAVH3m2cdE+lMqIsvi6kBbH3oP8XfgBu12xmgbSwmIAAAAASUVORK5CYII="},walkRight1:{x:74,y:41,width:16,height:24,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAYCAYAAADzoH0MAAABdklEQVR42p1UIW/CQBh9RyaQyGv/wbm1riQYZJcJihvJsqRqegiS7QdM1KKAuUk2QYZAIIuj8v4BnGwyM3cTW7truWvLXtKkvfS+733vvTsCDRzKpG49EZyU14i6IRGcOJRJZkfoP38BAEKvCwBY7GJMb59OCzmUSXn/KI+XnnQokzfuh5xvllJ+HrXPfLOUKsMWAIjdFr5IoXY2IfS6YHaUs24lghNfpABwQtsEtcmFOnvVJtEL8vcrAFN1hDqIXgA6s+CLFHRmgc4soKrAYhejKQoFtpM2zgUpB0iXgbIGAOCLFInghJhSaLJ0O2mDH8Z5mIiJWpUrahIrXWB2BADYrxgAYDSMq0VsgtEwxkmUTeCHceH7ddnFw134DwYvDPtBUJ8DnQbMjuC+v/1oMQjgXnNzDuqcYHZUsLDRCJkDOk2MDLLO+xUrUF7TTiGF2iirP1Ov/xfl30tnTTvI7o9ClMvz6lTPxKw8TOeESnuYmhRSXfgGrX26OKISwJ0AAAAASUVORK5CYII="},walkRight2:{x:108,y:42,width:15,height:23,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAXCAYAAADUUxW8AAABgElEQVR42qVULW/DMBB9jgoGC93+A7MlLJVKClsFNHBgpOovWDQN9AcMlA5MbcYG24JqBQWFDUug/0FiGGlkzAOZXTcfSqU9yVLs0927e/cUAgA2ZRIAEsGJ+i4jEZyU34hNmYynPkR0wljkYP0lRq8/AICZOwAAhNEZb4+LahGbMpndu9KmTD44X3J93Ej5ndWe9XEjzc6sRHBSZmzCzB2A9Zd6TEsFyq02wSSwcCPC6Awx9DF5Xuq3TluSGPoAgAkAuuoVj17eziyGPuiqh7HIL4kGdPLp5U63dysstTueBrpAYyfzDGKeXUxiBtUKzLWZAj1ZC/A00EapWK7JnnU2tZqCrF8wxnsG814rWBOz43HEe4bP97ASr8x8oF2MRV7bcjwtdu7stkgEJzc7rA6NgqkZnT+vx9EZPA2utOnUJRYihXA8DkRFEZ4GONAuAOixOuV5lQ0dj+skADrRxBUzdUfAhxKH6b+LCfNOyvIrRfWqdtt2wdqcVWemf9nzF67Fws06Dc9qAAAAAElFTkSuQmCC"},walkRight3:{x:142,y:42,width:15,height:23,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAXCAYAAADUUxW8AAABf0lEQVR42pWUr27CUBjFf20qkJMX3uDK1kEyg2RBgBzJDCE8wCoQyAlEJ6dgjwATyyYQldSBvG8AV5LMTO1OsHb9u3QnadJ70/Pdc77v9ALgCmlcIQ3/hOUKafaDIToK6elz5YcHraz8ngMkRNkK6C4+ARi3OwA8RzsAnu7mpqwArpDm1nszq+3amI9T6bPargvWbFdIkz6xCuN2B9kKSBewgYLUKjx+PWTWdt3O6uthoaFOHRKAWDahX5OcIVXABghnjQJRLJsFme/iKks+aGWpo084ayQzLVUyOdHT50xYnN/0+IZZAIsdNzkSwL09B/xsPPNhAZCtIBlLWWTj0608MY39q0zevb5iP7g00XvZcNDKcmJi3Iw44+ro4/XVn2MsHZU6+pSp8PqbIvmgldWj3v+cKEQap8qvbAV4P1nfRztGUwrddmK/ot1FR2GSqNH0QkpbyYck41m0u+hJfKP4ldLjsNjxQkdhUiB/QpqUnrtV5fkvFEJSp0j+DvsGRtzJVsVjbugAAAAASUVORK5CYII="},walkRight4:{x:207,y:42,width:15,height:23,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAXCAYAAADUUxW8AAABgklEQVR42qVUIW/CQBh9RyqQkwf/4BytK8myZLJLBSBJZpapySEQk4gJJhELdGLJJJsgmUBUtq6V9w/gZJOZqd1E28u1HAS2lzS5fs37vnfveykBAJsyCQCp4KQ815EKTuo1YlMmk14fIg7hiQysPcXl4zcA4MbtAgCCOMLs+mG3iU2Z3HZcue240qZMLtZLKb+2xmexXkpdGdFl371OKhNNGF4k4JsRUsFJoyyy9vQgUZz3EcSRuhIAWOVBL5qIdN7C1W0+YFbUGzgBnshA5y31vkMO4ujoZoocjps4FURfmWnH+r11+angpJKacmV6Ex3huKnWVJlcb7APesIahz4mK4ZkxfJwDKL9htVRkhyfqwANBxFsylREjbKTXm6O8/G+09DxuVLYwB9wlGGsPYXjdpEUweGbUYVsmTp/0jMAwD2AJI7w9hzA8bmqe2AyFZxYh+Q9/UzgiQyOXxj4kpuIwgvLJNcTmZqilBREEYcw/gz2rq1wv/xVGbN9quP/iucv403HnBp4/m8AAAAASUVORK5CYII="},walkRight5:{x:241,y:42,width:15,height:23,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAXCAYAAADUUxW8AAABeUlEQVR42qWUr2/CQBTHPyUIJPLGf3CyOEhmkKBgcglmQc02C2JyghDsxDIwS5AFsWwCUbOEuk72P4BKkhncTZTrrqX8yl5ySXPX9973vt/vPQBsIZUtpOLCsGwhVdDuEPkezWhz8MfvKLSye0WAyPeSDVkZ0RhsuavVAZj4S7x+CXBUXoEE9njhqvHCVepnvbfGC3fvagX9cf/2BJB0zAtZGWEWKNpCKlkZAduDSdF1hxbA0CHsZjo3BtuTzIrXK1oPI3JhnxNZNQr8IwoAz93HZGPiL/chf82Ieuv9ZK1drOVfgWyRj6HDpyinHWZqbZokG16/RLhyUo6zsmY5dU/dvRlt8gkL3mWyAG5vlvkPw+watDsAVOezlKuqO9dN3XoKdvEUzHDlELoxmqmbfmGpZLPjsbCFVCnCbCGVSYYJN9jJFq6cFGFHYeuk6cskfiC9MqLWiA/ns5gwUyKzclYinainjnXu7NJK6MTkzpcOP832RQ7LzrBfnle9zbyp77EAAAAASUVORK5CYII="},walkUp0:{x:9,y:74,width:14,height:24,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAYCAYAAADKx8xXAAABj0lEQVR42sWUoU/DQBTGf7dMTCIv/Q9Otm7ISZKJDceSmSmCRSwBiUDU4iiCBDm1gEBUtq6TJ/CsbiQzcw8BV67dYKD41PW9e+++970vVTQQaiPswKK0yv9u+QWhNnJ2fwVAMRhSDIYAnN1fVfmtV26fZyLrpch6KaE2IqcXIqcXH+fP+O3z7Ks41EZOoscq6V9oNpT1Uk6iRwm1kTZA73pTYzDpHjJ5SXeNSu96gx17M/4V/1SYTjskebb3cpJnpNMOAMop6/bnxGkWONyML1mUVil/lyaItxR2SKcd7Ot55SC1z2rfWa8mTjE3AJggZnScMTrOMEFcyzm03WvF3JCsRpigQ+TNGHUPIY9JVhuK+QNRH1mUVrX9LjfjSwDsbJuiHcPEe7UVaiPFYAh3Zv+Ad4ZiMKTyqg8TxDWqAEWeYV/PazG1S1EnSEWzUVTboy9S1Lc01Y76tvYXaDX3mKxG21b7jPnMKqpP+gDd7QFQ5ilH5RsAu+KL0qqW6+KSvzmH2oj6i91+FOc3PgV4B9TS3qWPX7w1AAAAAElFTkSuQmCC"},walkUp1:{x:75,y:74,width:14,height:24,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAYCAYAAADKx8xXAAABgklEQVR42qWUr2/CQBzFP0cQSOSF/+Bk60AilyAARxMMEotATCIQ2DlA4NkEAY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8MAAAAASUVORK5CYII="},walkUp3:{x:141,y:74,width:14,height:24,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAYCAYAAADKx8xXAAABTklEQVR42r2Ur27DMBDGP0cDgYFW3sAwZR2ZVFhpoB0snIZKA/IAAwV5hIxMGgyqFBAQaSRlDvQbpGarVDLmgcyRnT9NNLBPOsWK75c7350DdBRQpgLKFCbkdCG+2YJvtpiC725tmnAlBRl1Mi3JU6WuZ6WuZ5XkqRo8gumY5KkFmRbvv1qYBJQp5sf4+FxgjnYPHKIOm+KsDt+YK+3r4I/6H/DtVNp9LCIXOJR4Xt5PAkXkAgCIbsf+/XUyYhG5EHWISgpCzF4yPx6ssAbMCSJjIzYmDTrWgB8ZAID5MXZPZWsAoPcGq7p4FM1zpEj8yNqsrNvBN9sGTPugfDn3IwaUqYx67UtzrbWWF6zlpZ8qXa7QXeszMj/uFefmRea/jRd1iIx6VsSboO6dmXpAmaqkIERXKaNem6I8FdbXB4dc52w6TkHWyM2ZHPOH9QOrJroE5w6VZAAAAABJRU5ErkJggg=="},death0:{x:206,y:202,width:16,height:21,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAVCAYAAABPPm7SAAABgElEQVR42pWUoW/CQBTGvyMVk8gb/8HJ1ixgliBLEBuSZG4KS8jEJGJZaqfGDAkSEGQIRJOZNjOtvP+AnSSZmTsEveNKr4W9pObye6/93vf1gIpyKZMuZbKKIWWNALCmdQCAL3YAgFTwAu/YGgfTMQCANlsAgEEcAQDeHp5l2SC4lMnJZi7l70/lM9nMc7KIamaNALMvD5dU/zYB3w6RCk5q6rD98odLy2RzO/iII3RGQWXz5+uwfImdUQD6fg2vy5GsWA5UZ53HIDdESwifri6WYLLO0ZahROb7uVILLATJpUyuzwzxxS6XA8cG/Kdq5tuTFdMpZI0A/V6Efi8CaxycGUzHSFYM1iAld/fHoHy34GUxVpXEEWY30dGV5QKp4ERLEHEI2mxDxCG4WIDPoa30ujxj6prJSUgFJ77YQcRh5Q5MRrtgfr63XGj9ALSMJPsb+fYQIJOvmW9QFmowjgrNpzYTm/dlMmyckwpOfBSHnF4ap1eb2gOxAdYbp4TZA9mI4jenPoeaAAAAAElFTkSuQmCC"},death1:{x:8,y:206,width:16,height:24,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAYCAYAAADzoH0MAAABVElEQVR42qVUMW7CMBR9RhyA8ZcbeEy2VOrCGIkBDtALsGbsyJi1U5nYgQGJgYGlEtnC6BukHiP1AO5kk3w7Lmq/FMX5/u/5++XZAoFISJpQ/qaVQCwSkiYhaTbnnTHfX71nc94ZOz8IDgGHiP4EDpGM8M8Y84R+WUYB9LnvfY84ONct6OPJvbvjXLfeAt4W6qNEOleojzKaGySwhelcRXM2BDfOiSZRDXLd9owlEpLmRBNQNoOuLsh1i9V2HQS/v76B14qEpKkXd2HSwz7aAa8dA4CuLo4VAOS0RJo994HVFaopvFpPAzktoZrCqW9F5HNOg9gJ5AShk+kRhNrn2+gSeD5QTYG6ukbBQR9wdbudWDCvuWkl3GGyqlI2c52gKu9jVjdoZRur7RqqKaCaYtBYnojWxpTNPEPVi6VbPddtX8TBe+6X+zP4Gx8NzwePEvGr/QduTytbQVkpAwAAAABJRU5ErkJggg=="},death2:{x:41,y:206,width:16,height:24,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAYCAYAAADzoH0MAAABeUlEQVR42qVUsW7CMBB9sfiAjFf+wBvJlkpdGCN1gJF+BhkZGeELyi8AA8IDA0sH1CWM+QPwGKk77kDt2sEOqD0psuO79+w7P18EjyXElW/9KKsIbZYQVwlxtdgtlfo6O99it1TaHwT7gCGiP4F9JJ3mSeTLsDVN+lg5/6wJzmUNen8yoz3PZX2zAWvuUG440tcK5Ya3rgUJbIC2EBgAoua9C4pba5DL2tFFlBBXgmJQ1oc87J0AnzVjOwBAWR9mXF+rzLszB1idCvhiGQDIw/6a63oF3p1BUIzqVGB+mWJ+maI6FRAUg3dnSH820BhHwqN0q869zIjElm5CXJ17mRqlW7+kNUFQ64EYhn8a81XZdwp9W3cJcll73/1RVpHvim+EVA6GptKaSPttn/azpgLfPp+dVOyj2z5vCuVgaAQzZhMIiiEoxphNjJjKgfsanX4gD3sTkK4L5MbzC3QEZBPksoag+CbAJvc9qOheJw6ZLnD0aEsPtfZvVKwyTDYVt1sAAAAASUVORK5CYII="},death3:{x:74,y:206,width:16,height:24,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAYCAYAAADzoH0MAAABpklEQVR42o1UoW7DMBB9jvYBgV7+wGwJmVqpZDBSQTu2SiODgy0sLEzh0DoyqbAJqBZQUDKp0UgL8wetYaTxZmA6106cbJaiWHfvznfP78xgWT4Xpc1+kDlD2/K5KH0uysVmVZbfJ+NbbFYl+RuDbYFNiSiOUfDz+wxPnS5kb9haJf+M8Zbt8PI4xUHmzNGdsjdEKAvw12v11/ehLGoHONUT9muBoJ9jvxattsYEBAz6eautxgEZUu62chDKwrhW5nNRptwF79xBZluEssDofoflqmsEkq2KZT4X5X5wISZIYgCA8CIjQX6c/PJRwToAILOtMggvUm3MzzPMzzPVmvAidQDFGBwILzJOIrC+1zFK2iTR001HqUwnVrcRhmyqAup5ebtDkMS1wSGuRl9dxUlNiflxYg2mcoMkVuVbhUQE2iaOrrt6OwbgIfhoHtcGTE2JOuPUCvl1H/mdqoSJJGqFSq/6rBzsB0NF0tiZIuUuUu5i7EwVyboSAeDKeA+yrQIEyQSh8lwCSYG1BKEskHK3BtCT2yaS/fUSNy0imP33SW962n8AdCQ0/3wR/FEAAAAASUVORK5CYII="},death4:{x:106,y:206,width:18,height:24,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAYCAYAAAD3Va0xAAABYklEQVR42p1VrW7DMBA++wkCrb6BWRyWV8g0MliwFxhsNBRYNHVwrGi8qEpAX2FSA/0GtWGk8d3QWefKzZ+lKInj73zffd85Ah4MozSm5ntvBcwZRmk0SuPxckL8ddF1vJyQvt/jxH2Qt+89PL0fRjdrP2r4em3S2VEWLi/RKI348xLu/NkojS4vQ3aEl6kdr2cNxbOF61mPzo1SgwWDUxOPguhNuk72VieDCQrSqQwqP0QBPv/2UPkBAAA6lcFONlFAwvTeCqDiGaVxW7To8nKSnstL3BYtcqwgSnpzCGlPmS6FkRzUqWx2ofnaQI0oLVGNaBHF4CMq6pLBMZLL3alslpdIZa6w5HIGKWcYsfJD5Cm5ptApTAi0k81iatygkQJrVCNMZEjeEilj8o0oo2BImrS3OqRKinCgURpJWSoF9VvIiF7WNC3hou7nJps6Rvj63lsh1h5qyfNo7q9o7Jf0D3HLEgh0oL3lAAAAAElFTkSuQmCC"}},plunderBomber:{idleDown:{x:305,y:5,width:16,height:21,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAVCAYAAABPPm7SAAABoElEQVR42qWUoW7DMBCGf3eZFLBJhSkYCBgwdFjLFimgAQPtY3SopQEDHS1aH2AP0MIEVNpYy2YYMBCwSQksNKiUge4SJ3U3sCO2zvf9dz6dzWAw4fDS5JdFyto+ywQO4MJoDsq2kKXDBAohzAKyFiIRS4fPgpSEzmUt0sE/rdED33mq9u60GZgt9JuE1f6kgnHC4U6PgBdweAFHtjgKjhN+UkElsEXWyKZXQIKm2OoKc7sHV3EA6TFTUgNeUGd21Qhze49I5QAAJhxeroYp0jcfABD2u4h3e2PD9DN+94pxwusKIpVjbvcQ7/YI+12jAMGRyrH68bH26M7tXiOjDhKsj/YFDdG98HFZKLwcPuFb140qbm9sfHwpRCqHHnu4sh47+oTRGqm8kTXe1U1rx3YAQMrjkNM6gFuJEEzvpB3Lfnu+f5ksUsaEw8uJGAEAlnKN902KhyA8eVhSSjxvYngBhx7fGOWJGMELOGbDuCqR4NmwCZMx0z+wlGtjyQST+BYZLFmkDA7KAVxIKSuR9vdFfdJhWaSMnfsHzwm0z78BuJnMLUIpRL0AAAAASUVORK5CYII="},walkDown0:{x:9,y:8,width:14,height:24,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAYCAYAAADKx8xXAAABTklEQVR42p2UoZLCMBCGv3QQSGRPIiOD49wxg6ASHgOHrryzuHsMToLAg2NlZGUrkXU90UknKaHD3apk83+b3WwSRc9MqhsiJpVV/nzUB96ZYowJIRFIafwAykEx4GFXES4USGXV6FUIaDUCpDQJ/7SuxkX6xXQ3LC72IGQhCDBbag4ry+akA8D5Divb+RKAC0UgvJ1tdOxrlUl18zl+AyCvy8FUfV2Q6u1Dc7zeo1A2nwRryjXeRcvmkyjoIJdV4op3juP1HkT253lddgcU9NHB/q5u3K8/kcoqd/xbsyavy4cd87pka9YAbE4aqaxSJtXNYWWZ7to+bs0aESEb1y1YjzHG8C0/3M6WYt/Cyt3VWD/75utGscXYs+oHVbHH68MxSCqr1CuvP/YLJEOi/nfxNFV3oWdLHb30zt+1Y6iuZ/4k+Bb+MFavHEqs/l8uArn/P6LtpgAAAABJRU5ErkJggg=="},walkDown1:{x:75,y:8,width:14,height:24,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAYCAYAAADKx8xXAAABSUlEQVR42p2UL3PCQBDFf5eJiEQGiTx5OJCdiSCyfIy6aiS1df0YVIKoT1xXRkaCRMalgl64ux6ZTFddLu/t7ts/pwjM5LonYnJplPudhoQ1C4wxPkkEcnrXgbKkGOFPVBEqWuTSqHQqCbhhBMjpE/5pg8an/I3F6zi4fQeh9IkAy0Jz2DRsT9oj2LvDphnuEoCK1gN+fzXRs4tVJtf9PpsDsOvOo6m6uCHVcjWDelxjuZpxrK93jbvuDPUvecSO9XXIKr2Lx4tondgINoAtlNdH682NbM+hfhXOaUXLPpt7EXfdefhn51WZXPe25MtC82KeERHKrLsRuwxjDB/yOfRxe9K3dqxZEOtnaC4uHYYXqKR9uFahUxVbXpccI8mlUWrK9sdegWQMFD4XD1N1qxYb+mWh/Xa4FQu34JHeZNJzETmrKUWJ6f8B6XaqqsKyGRAAAAAASUVORK5CYII="},walkDown2:{x:108,y:8,width:14,height:24,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAYCAYAAADKx8xXAAABVUlEQVR42p2ULXPCQBBA32UikJWJREYerriKCirhZ+BaWSS6jp8BMojOtA4cKyMjiUTiUkH3uBzXDNOdydzmbt/cftyu4Q6xWdGqLk1lANI+I18OTwXl/sQio5WmMmkIjBlire1AIsLou+rsGYViQCgiwo4aaSqT3gsBFxsBMtqEf0oK8DYpgZLha9yo/risX817FwSYbQvWVMy2RQdaTy5760k3OTeuHj6rqO4nB8DYrGiXg5zF+dgb03KQO31xPl5d9Q9CeXl8AKDcn6511MIvB7kziIlC6lkSO/T/9VNIk5Ro5mIx+h6E5wnQqZ9/q3/TmKErm3vko+fCGWiSQmhH7WAyWmOzop3bKQAr2fSWRMEd9W0/hg/eL7qu0lTGxJpXYYVCjxzY1/1zO0VEXFutZHNNjgJaI/+hKxTqxh8Zvmg8f+2bvgEVy+bdMXba6nc0AvwAu7+3SNwDlHEAAAAASUVORK5CYII="},walkDown3:{x:140,y:9,width:15,height:23,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAXCAYAAADUUxW8AAABSElEQVR42qWUIXPCQBCFv2MikMggIyOvDv4BSPgZOCqLRNflZwQJojOtA9eTkZFEVuJSkdlwt0k6MH0quby3uX377uBJ2DitbZzWANEQYUi8H09Zzia8fFFHfaI5CdbaQOSc40zJ7naFS7NmfGGfSEOKuKow0TNCoOE4IKYe8Q+0Pb8ujiTbY4dQvofvn9VbV7w+peQUrE9pQM4X97V8UQTfgm0n25Dw/VEMGta6beO03o+nzRj+mK+P3e0ahkQTfCxnEwCOl5/2J8YPh4iFqOELB+OpBRpiotE57vu7FNCejCTLG7tiTtIhyFZ3tytzEoTfiiWWOp66RxmRwPi59meosbErADJ3aOZdFcb0nV//kGTu0AoFmTvcT5WriqDImbI5OSpZurWo7/ZoRtEV6ufOtsVJv3dZ08aZR+6tvqKtYY9efr4/AL+K1aQg8bD1tAAAAABJRU5ErkJggg=="},walkRight0:{x:8,y:41,width:16,height:24,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAYCAYAAADzoH0MAAABgElEQVR42qVUr3PCMBh94SImkZ1ERga3ObirADn+jDl05GZx/BkgQXC3Oer4ZGRlK5F1nei+kKQp425Ptbm8l/f9FEhAZ6pNnVNtRXwmfQLVVuhMta+Y3MS07shEQIY2FhI6U+1lpnAorjBNBSYzseeCCGeUTkQC6JHvQWsNEIAMLdVWSKqtML/WYtuPQPqxn1F2AugLzLNPAMBk3f1PcxUm8XKyAIByA6yOe7zrt4C8OipcTtYRGSN2MM0Vyk33wm5hsaU9iKjLvgd+yFWBHXw8PQMA1OwLk/XNIp8DgGmqXl9Itl9uLOz3PLjgk5cvYywxdv+H4gqToZUc9184FNdALKjCENgyO/GJQRK5NDG4sUxTwTRV4MIJcAXi+FNifhJNU4FqK1wZTVO5CnBOuLH879jFQCOFzcJNtaV956JItPI0v+0Af6x9F7F910iDk5dYLPFSGd0TiC+nNpJ4dJ0NicgUcbewbh78qUyttVHqVb+UQ4uGOeJR60Oh/DsHPyw/15lZ2SzeAAAAAElFTkSuQmCC"},walkRight1:{x:74,y:41,width:15,height:24,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAYCAYAAAAlBadpAAABoklEQVR42o2UL3PjMBDFf8oYHCz0QUPBDWuYMxPgzhy5fILiY8WGVxp2H8MHE5CZwphZ4IBYDWMYGKYDrhQ7Vpq+GY+lHb23f6RdRQSSahezm86q4T4ZHjadVZJqtyC7CIn0RGMgxQ1FlKTaNblmW58oz0c80ZMm3o3hQIvprEqACfEziAgYIMUlprOq/AjnOtR7ULEi/ZKfo0PL9DWss5f+P1/pniypds3eAtBuYL3TQWCZvrLeaarCst7pkejML7Y/lrSbXrkqLH/M377CA49VYadhS6rd72/fAdD5G9lLHxaAtwOU5+PYsw9Z52+TggyJT48PNLmmyXWwz/gitvWJbX2K5xxDeT6OQn16fGDyPO8hCNRjgcR0Vs1Xl4LdwoKM8txCfSNsX+l20++rwtLsLVVhOdB+CBynV3X9SLw3EQnNsCDjQBvaM/GL+eryPP0h/8ZFhINpJ32tPhsG156vB4K62XqRaXI9SaIk/70/49w/3PszwXa3JYd534LprFIxYrO3zFc65BxmGIwEZ7Fc/D0PJ4qIjPbB81fGbqxo/wGMrdCob5yBZgAAAABJRU5ErkJggg=="},walkRight4:{x:173,y:41,width:15,height:24,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAYCAYAAAAlBadpAAABnElEQVR42p2UK5PjMBCEP6UMDi7UQUPBCdswpyrAW3Xk8jOOLTbcpWH7M3wwAalaGDMLChrGMDDMBxwpcuzs44boUeqeVmtGiokQbbqpfds6Fa+T+LBtnRJtugXplUikB1oLmi4mUaJNV2eGbXWiOB/xQA8aZbeWAw22dSoBRsCPQkTAApousa1TxUXOrdTPQk2Z9Ed+Dw4t9WuYp8/9OF+ZHizadPXeAdBsYL0zgWCpX1nvDGXuWO/MgHTmJ9tfS5pNz1zmjjf7t3c4yljmbixbtOlefvwEwGTvpM+9LAC/D1Ccj8PMXrLJ3keGxMCnxwfqzFBnJuzP+GJsqxPb6jR956kozseB1KfHB0bl+VkEgmpIkNjWqfnqati9WJBSnBuo7sj2Tjebfl3mjnrvKHPHgeZCcBw/1W2R+GwiEpphQcqBJrRn4ifz1bU8/SFf4yLCwTajvk4mG933rbUhMxCyjhrjf36T2RRItOlis77VkveeKpZuW6dUDKz3jvnKBJfD33UBxW4H2f4e/n3jn0REwjoGhsxflX5r2D+I3dBkXCAzPQAAAABJRU5ErkJggg=="},walkRight2:{x:107,y:42,width:16,height:23,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAXCAYAAAAC9s/ZAAABj0lEQVR42o1UoXKDQBB9xyAqI6lEnlxccGSmgsjkM+KiK1sb18+gshHMBJe6O7kSWWRlHRXMXg64hq67W97bt++WVQgEJboP3duO1fQu9gG2Y0W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ElFTkSuQmCC"},walkRight5:{x:239,y:43,width:16,height:22,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAWCAYAAADJqhx8AAABh0lEQVR42pWUoZLCMBCGv3QQyJOprIwM7nAwg4CZM8djnOMsEuTxJmepYAYcOCIjK0EicT1RElKawtzOdJrsZnf/3X8TQUS0VGVMb85WPOo6Mac+2T2Y1pWzMSApHwOJNmfn2EBhDHsKH6QTGsPMbaK1BgNISnO2IonV1pY9JjUEe4oGiqFc+nU2u+t7I3UPoKUqjxt7MwCmQjGUS6a54ndsmeYK8iYCX0JvpChWcNzYqknG1DL/jm17CVqqctFNsbuUbLYFYNK9Ms0Vi27K+iO9HT/FEQCowbZhXHRTv568v3EcKI4DVdMnYf0Axar6z68n5td7xvXhwvpwec5CTMIgAPNdfZ+4Bj4T18A+GV/6s0a174HdDWmbSse/G7Bw0DyN8+up0UiXzSF01IYU1y6TG5g+WS2Lu0Cxqy0cC8WKatr+KYmjzjk/Nsx9fTJvCxuZAPzkE6+c5qoxzsYYvsdrX14oQktVhjXH6o0x4850zNkKJCWm/mC0BQmdzdkK8eohffW4/gGdV7r5dAGLnwAAAABJRU5ErkJggg=="},walkUp0:{x:9,y:74,width:14,height:24,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAYCAYAAADKx8xXAAABkklEQVR42pWUoVLDQBCGv8v0AZCRnDx5dY1rZxBlBtM+QTUuogaegTfgEYqDutYFx4mKcz1JZCXuEOmll0sYYFXy3327m83uChLTufIMmKmtiN9HKVAgqXB8TBUA472lQEKOjx1kASqQ3OtF6/Ht/dSJeK8XFMg2gAiQ1vqSljFUOEIG4cwYA0CFu6Ta+U6t0ehBPcA9MI4WLM2oA8bAZm6RZaO7J1huoTKuKVIKVrgeACBL+Cht6yDAoxRyT2D3M24nV011706o6Q5ZwgbLchtFHILC77idXPG2nwExrPrFCZCa7pqIZ0cuuZelYAwBqOmu1wwAmamtWG5V70CWtIWKbblVmNqKNuL4RvGbde7oXPnjCu8PeJ0rr3PlX69n/rjCH1f41+tZq/tDo+lc+RHArn6ANcALBZLHLwdt+p/txDyvH87ay3Cvxh3yk4mh4U3BtHdNbYX4y/QPbYHsJ8jUVqTrIr7T2QCh/cKkB30zt5fxOsNZeAjzNvTTgxbu6Fz5XnE286aJY0u1XnH+sx6/Ad95zsZS3ogEAAAAAElFTkSuQmCC"},walkUp1:{x:75,y:74,width:14,height:24,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAYCAYAAADKx8xXAAABeElEQVR42qWUsW7CMBCGP0d5AMaMzejRbLAlUocidSFPwMzGg7DxGLABQyXY0g0PDN7wmpE3cIfUqUmsFqk3Oef77s5/zhb0TGXSETHdGBF+p31gSk6N5VJIAMZnw5QcMlyYIPXQlBylFFprAA6f94eKSzVv9zKcbowQIdS1pTU1Ft9BbC+NnUcphULxmw3AsJq3ftUBuNE7ALZvhnzV+uwaqiPU2rJU8y62O2ONHQBAL4HsVE+BB8iuwZxLZpNRq+77HVmcyFewxVAdg1ZjkP8ds8mIw7kEQlgOxfGQLE5txe9EtheX9MEQApDFaTAMAIlujKiOcrCRr36ECa06SnRjRFdx/Cr5yx5iVCbdbYFzV5zKpFOZdPuX0t0WuNsCt38pO7+7tj6VSSdUJp0f4HogAdEJ2ujdUNXYeMWSitjlDeEYpBsjxDO3P/YKJM9C/ZgkfAH8+Pm1b/vyYbpXwMNJmCUEYqKFlRPfd43tRAjFCH3+vv5LnC/VmdRLkE3HiAAAAABJRU5ErkJggg=="},walkUp2:{x:108,y:75,width:14,height:23,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAXCAYAAAA7kX6CAAABcUlEQVR42o2UrZLCMBDH/+n0AU7WRkYGd3XtDAJmzpTHwJVnuHOH4zFAUsEMOHCsjKytRJ7ric6mm7Zwt6bTzf72O1EYiE1Miwmhxin5H08B98wAAGYXhxS6UyZopYOYoRQa1lrs6IDj7dFnYG33hQURAQlaapxSEmLZ0QEAsLZFmC4RAOCKuk9VyhCQ0RkegUSEK2r/zzXKjAKQgf3CYSMMVhUbYBpkSJehwb10XYfnfXQAUDwGCR0/cm9gsrPXz+YGKTSuqBFJqN4C+Aobo38K7+h+cr7+aGR0e8BkZ5js3EW/PbB8f+ucCglAhmSarB9KNDUvXWLUpOHeRtQ4taoMXgk3aDbv7SKbmHZtC690lxz1tmuUu+QBNBoHrxjv6CvhccRyeflguPD7hcOwnJgap/iu8QaBwt3UJYCqP6fGKfXX7V/bAnnyie9q6e+rBxlIobFZHIO0ZENkxEhCz4yn3iX16oEaOuI9/VeNz166XyietEPwUZThAAAAAElFTkSuQmCC"},walkUp3:{x:140,y:76,width:15,height:22,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAWCAYAAAAfD8YZAAABcElEQVR42pWULXfCMBSGn3AqJpGdjKwMjrpyDqLI8jOYqp6cntp+BkgQOwdccURG1lbyD5iApJeWj+11afJ+9N6bKDowcXLiDmzjlFxHt4iHLAFgtHMApOjzgZiTFIkkMUVTUbPeH4PgwhStOAZrLcScbONUJInGGAyGd7vqESVSNMScolub90gAxlzcu/8MYK2lou47XYh3C/ZtVyxzx1fZfqs/Yb7xytdGSlZ5mTt0eSZ46FKKJCFFRd2SJdHtJgAk2bYnMpqeBSpqBjKGJM7GQ9xuEtY+zeHHhZoMuspJtiXJtqz3R2bjYRCRAh6BPJomQUSXBIFHGPgBSdHMN0nvwCOBSPavsnWI5qNK6LJNCKDkaMoB+Xh5DTXoJvLVVs+uoccyd0HkqlW2cUre1RTNwhRhxhemCN1YmIKKGts4NbjlUlGH4fd4m87aey3H81n0LunKWRJTNMvc9Qi3nqs/OUt33w3bOKX+8wB2H8FfO7ur+BAfa5QAAAAASUVORK5CYII="},death0:{x:239,y:175,width:16,height:22,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAWCAYAAADJqhx8AAABfUlEQVR42oWULXfCMBiFn3AqJic7GRkZ3OrgHMQ4ZwZ+BlPVyGnU/gYWxM4B1zkiIyOpROI6AQkpTeGq5uPe9+b9qADQuWq4wtRWxOsY92emtiLTuWoKJAAVDr+ucBxGCoDh3lIgIacB8PfJaQZercJRIFnoWYi4+Tux+TuF9ULP8OIewVKBRGt9s2tMuPjoLKMHWms0mmfIUkmLI3jcuwhJ7COuPyyyvOy7Fcy3UBl3S6B3EC8qXIcIIEs4lDYIxSJZiuxWYPdjpu+vl2p8nlCjHbKENZb5NuEgRfYlnL6/stmPgVhE9VfBk9Vod3FwFXSJu4OUQEwGUKNdq6E6Aqa2wluKIUtCQmPMtwpTW9FyYGorhhP1tHGGkxsZQLS6L2qo75e38Ay7H7M8H0Og3j6Iu255dhCedewMUSeJOleNn8Sf302YygLZIt+3fZaK/jWR+LavksXrKaMxJvndmdTIxSBlK+Vq/WFbM+A54n4j/r09gq+GeGTvEdHjH7yMv10HhrOYAAAAAElFTkSuQmCC"},death1:{x:470,y:175,width:16,height:22,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAWCAYAAADJqhx8AAABjUlEQVR42p2ULW/DMBCGn0QBhYUda6ChxxbWSAPLNNKgweEOFe837J8UtgGTWpayGgyY1WMrHCzzQObWSVxt2klRTme/9/X6LiIgciRsyK4OOurakhAwI6XGsJsIAK43mowURtiuo8QHZ6RIKVFKAbDafrWizeS0ORthnZN2BlKe/wpejgaXkX9WK9MuwUXvOpPIUCtO5aiDjpJgs5SixvRALouLTfSBiztNOm/s5hXKCmpl6GYaASzHuV0dB9SYHhDoOBJkpBSDI/cf63MJPti8gt7kFDfDho2HL8RkTTqHBZqygoKrNv/7J6x9x+6fsMtxbu3j1C7HeUv377g3k5wZ0CeHxc2Q1baJCrD6ycYEmIhDLPhgADFZ9x6Vk9hxXlaid5jOzw30pazEidJWBte3gt+keycKTd/iTqM3+amMshLs3nQPrA46ip3iPgeAhsqyEszktDVQ/kQmoZmXI2Ffjp8t+/NtQXapib8tEzfeXb23D/iHxP8FO0x8adf54o+20x0m+utCvbRYvwEe6M6uyA/L8wAAAABJRU5ErkJggg=="},death2:{x:536,y:176,width:16,height:21,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAVCAYAAABPPm7SAAABb0lEQVR42o2UIZPCMBCFv3QQSCTIyMjgwJUZBMxg2p9R17Mn0bj7GZxhhjpwPUdkZeQhkec4UVLSEo57qrOb97LdvF1BAHqorqG4OVeiG4u6RD1U1ykSgHV/xClWAEyRTT4o4IiZTlo37L8uzXemk0bIxYRP1lrfyzWGEnu/PZAz50r0eAKtNRrNKwQF/NsdulUEBXzidlEh8zpuN5AWUBqLa3BQoMQ+EAFkDqe8aoR8kV6IbDdQHWcsJ4P6JVYXVHxA5rClIi0CFYTI7gmXkwH74wzwRdTzJjqyig91BTdBGzgbhWzrkwFUfGgZyjdf5BzmSvIhc5qG+kgL1Tg28m06nquXxhnPVcvu4tn0rfsjlrtbD1Yz3n++g9Mpuv/k1D/MZ+uwH/fHWnSnscQGbetc6s44kQcnArwt9qRF+9G2i4qyUA8zEvk9yHRCphNk3rbrFInM73mfE3VXlTGmmQEfdlPnuutN/GcX/rUbfwEjELpZrMKARgAAAABJRU5ErkJggg=="},death3:{x:105,y:206,width:20,height:23,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAXCAYAAAALHW+jAAABpElEQVR42q2Vr1rDMBTFf9lXUYkscnLy4tgjTO4VkPUYJsEgcJO8wiQWV+QViMrKVSLrgtgSbrJu419M2iT3fPeee07iODKkmnlODO1bN7ZeHAOaM0VEuHl8SPafb+9QVajwp4ATwLpaeP+Ol2oWZ/vt3/F1tfBjVRQ52Jwpi3KIa90To9+LcoBhChXeZulywPvyktWwBeC+vNwFX1/w8vYBEPfC/mrYJmVP8pRtwMtQJv+rYcuc6ejZg5Klmvlalqx1E4NEBEG4et0AUMty3+Ld1NCxj4llTyx3AUxEaOgAWOsG7VunfevWuolAIkISs2+Qy6USgLRvnVQzn8sirB2LiRyGzGJZRzRm12pZxkwPmiIiSYmcGZaCEAtQBP7+OubsNJnI5rvZjWUZhZ3b5yeAY5dIYRuyz9J/FzRoF0BVaeiYaN+60PbYuTNXVw4WtJnIRlV/3eUQm1ivoQMlWukUn6GCWpax1APAqHj98mwObIEsb9YtRSJs/crUuiYAJy4yYCJCo116HwaS7cHcBZYvC2Z5d+ceptxFlq8x7br/fvU+Af65JJ4LToNfAAAAAElFTkSuQmCC"}},explosions:{bombs:{fuse0:{x:0,y:0,width:16,height:16,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABSUlEQVR42qWTLU/DQBjH/y0VfIEm9wVIOMdhIHWbrEMRJqmYaLIEvWUJScMHIAyHxdWQgCzuMkwrIDkxUdmGIOpGgjjEdtfXEQY/dS/P/3n+9/IY6IARJrvWkzwxqjHhyS6MTiFxQCkFAAghVps5ryWbTV3Q/Qg7NTFx4J4PceoN8flVoHgvYNs2Pt4e4I4C7B31sXiJMJu6yBYFvMu0FLMDX46vHmWWxTLLYhlGSzk4u5GMML3OCJP8dizDC18qt5ZyoCwr4nmkx4fHfXABTO45/IFTizOVdQUXFFxQpK9pK1k8j+COAtCep51b1eorUVSrQHsenq4nAAIdI57vAOIAOS+PoKhW1hBnnaScKyz1VM07UOhnJE7nvtkK7BL/gLWtoOUgyROj+ct+Rc6R5Ilh4p+Yukm2cbGuDmBzM20SNrvS+Gs7K74B0DebyxOmawAAAAAASUVORK5CYII="},fuse1:{x:17,y:0,width:15,height:16,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAQCAYAAADJViUEAAABMElEQVR42qWToVMCQRTGf3vDH6DtjMZrLglpEK9rsDlEHGbMx5gY/gBGbY7NRoSIbSGxwbDBQGQjzfgMcMfCMaPiV3b37X7ve/O9fXAE5rVLAVCHLnWsJTxbb1VIPNGwslA5SIrr26A3pWSnV2uy2iHGdZIkAcA5B96QdnoAjAddnh5Slp8rzqdzqrOpKoj6oi1ZfyTDyZdk/ZHoWEvWH8lyORcdazHPmQzv2xJWUZSdXqfc3Z4BDmgyHkC11sQ46L4Z2jf1kjeRjrUkjdaum7NJaU07PfJ3uXqhvPhY8Pi63SeNFuNBF+gVMff+sjbTGwDUvlEhctMK5F3wBuutqoQPwwTOOUpt20OlpPQHRNZbtVPaT9iUDBDxD0TF3/2NeqBaGoyDf3tD2h+Qo6YqxDeExZNgQsVqAgAAAABJRU5ErkJggg=="},fuse2:{x:33,y:0,width:14,height:16,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAQCAYAAAAmlE46AAABJ0lEQVR42p2SoU/DQBjFf236D+BO4yoQh2J1m5xHMDtFmixBb0Et+wOWAYI0OAxpUJvsXEGtAnGCZJOtxIH7EF27NXQs22fuu8u997539+DAWl43BMA5FHRyCUsaUgvUSkvRJ1li1d1xagHKyw+yuEKSnbXgJeL04c1ytkFus1uSmHlAuzcEYDYecHfbJv38wn/9qSp1ribSH00ljL5FKy390VTSdCFaaYnv+xLe+LKtXhn1/KKF55qyjw0MnmP8jvfHo62VltITMHlKAVi8R+Xa7g0pbBSqFcXwMQDAbXaZjQdA7nH1scLMg/zRsrg6qjEG13U3LMpbgzf7nd9hjKkaUd7OMNhJlliF/N7K4jIQNkeWXcZqn+qWGoD1b+TWgLrMWseG/BdvqH5WjjsArAAAAABJRU5ErkJggg=="},blastCenter:{x:48,y:0,width:16,height:16,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABX0lEQVR42o2TIXODQBCFPzIRF9e4q2skouIsLvwDJhOD6zBV6S/oZKL6CzJFMnWYDFOHJC5TVUQEkkpcLI4KOCBNyPSpY3ff27d3i6GkqmiQFqkBoGNJKDjtYPFZXs0DjADiNCAJBUqqSicjR1CaPtMlBA8CTVRSVUkoiNOgExDZCtstQVqYcw+A6ZIWd6o5SAukhe2WiGwFQGdJWpimyexxBkC8XZ+PIC3OUBxIi9QY629Nfnm6byJv2O666zyAse5+DebcI8uy60xpoaAa92P5Mef9ozv/ByN90J3yY96SB7s3IwOcOcj2wc159eX1a0b9ROSIuuAGWddk+2YP0iI1dGKy8UnCAZHiQBLWNZEj2s1sHUw2PiJbcdoNGzjt6qWbbPw2ZujVzF/B+ylvv3vjLHIE0yXYblkL9N/21o0vnj2+vxLi7bpz0C9sxRohTeyvd/+vvBC4EPqDPlHjF21il6TcejMoAAAAAElFTkSuQmCC"},lit0:{x:0,y:18,width:16,height:18,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAASCAYAAABSO15qAAABPElEQVR42qWTIW/DMBCFv1QDgRsLTKHBgIuqsBSWViOl5v0BU2C0HzAeWjJNZYMr84YaMBDYwfyEsA60tnKJV9Inmdzde+d79sGNiEJBnehTKF639ah+MiTqRJ+WmxKAKo2p0hiA5ab0+aCAS6jcMJsvALjX5wMwmy9QuRndcOICrtP0cQpAsbWsdh2rXUextSJXpbEXiYRikkFrPSFTDQC2UQCU68zXOE8inegTSSadaS3LTelHOXx/8vFaEKoTAkopmn1FlcaY307UupjKDU3TeIG74bOo3GD2FcXWihHMOvMmin/gDDTdDKWUMKs/AsDx5wgwvsH0Bd7fDqy+zmO4QpDEECYAx2d4eEKqX4hDcj8vntEb1zN0CEFuLXVbR97EPjnU6eoIoSW5ikv30TaKH/kPcdjw5nW+GX8GK5onNZQU+wAAAABJRU5ErkJggg=="},lit1:{x:16,y:18,width:16,height:18,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAASCAYAAABSO15qAAABKUlEQVR42sWToXLDMAyGP+cKAgcDU2gw4KJeWApDy0rN8wSBeYLx0NCywZb5ihYwENjBPEJYBrb4bCdbwcD+OwNLv35LsiRYgUrUtGbvhk6EtigMVImairIGoEljmjQGoChr618VmB0y1+z2BwCe1NcB2O0PyFwvMoxmw/zS9nkLQNUajueR43mkao3na9LYighPMclgMDYgkz0AppcA1KfMcuaeCJWoiSTzOzMYirK2pbzdLry+VKzxPAEpJf21oUlj9MfocWebzDV931uBTfgtMtfoa0PVGq8EfcpsE10sMnCb5ZYAcH+/A/yegUuES3Bfwhskq+wIhcEhJ+qGTszfskb4MXgwdEMnNg+JDxDZJXGyeIjv1+0kLrYwHBgnMNxK8dd1/n98As/PkpwJ3lD2AAAAAElFTkSuQmCC"},lit2:{x:32,y:18,width:16,height:18,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAASCAYAAABSO15qAAABRElEQVR42qWTrW7DMBSFv1QDgSsLTKHBgIu6sBSWViWl5n2AKTBPMG5aNpUNtswaasCAYQvzCGEdqGzFrsGkXsnA9+f4nutz4UnLUk5ZyFvK3/XdQ/4kLpSFvK12LQC6zNFlDsBq1/p4EsAFRK2YL5YAvMr7AZgvlohaPXQ4cQ730uxtBkCzN6wPA+vDQLM3QUyXuQfJAsSigt74gkpYAIwVALTbyue4mWSykDeKKpxMb1jtWk/l/HPk+7MhlRcACCGwJ40uc9R1CHKdT9QKa60HeIm/RdQKddI0exNQUNvKDzHQQdzBeFhjCgCX3wsA1lp0fkZdh8cOxolwjO734q/3M9MNsI2E5LmNgOJigOkGLh8jKcc/4agkwXvjB9r1XZakEHcSWFGhriaUctd3mRPHf80tVpbcwlgwI+HEW/n0Oj9tfwQvmoxZnLupAAAAAElFTkSuQmCC"},lit3:{x:48,y:18,width:16,height:18,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAASCAYAAABSO15qAAABSklEQVR42sWTr1PDMBTHP+UQlZO1lRETQXF1q8TOVTLPH8BNTiO4Qw5ZwzEJrrgcahGIyNk6KuuKyCU0WTck7y53yTff9837kQf/bckUKDM5LPs0wF7THt3q5KyAzOQAsOxTxAzKZ4s3t2A6KwIEQhexs1isvOD3i13O3J3jegGZyaGpbcj5PEfsGkwH+t0u04HYNeTz3EZUp14kCRSzAlrFulYAFMIAoIwAYFMVnuNSSWQmB7IirEyruLnbcHVdArD/bHh7XDPFCwSEEJiPLU2dUlZ9wHWYWKwwxni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/aPxALn9y4za7L1CtWXEkHAOVNOG/Zs/85mxFbVYIqS7J2AXZ7GM7RmaTqk7QcUOuTtD5J65O0Pknrk7Q+SeuTtD4JtPQGtD5J65O0Pgm0Pknrk7Q+SeuTdHYjbdu+HVS45zy8phbst/iFCWWSIKa8VzIp7L+4ZSaTAl1J2QsBqklTILSOGxZaJU4Nt4Yb94CLBFztW6w9kSKJFJsBYT+hKFG4fwC/z62Ejpy1NAAAAABJRU5ErkJggg=="},thinRight:{x:83,y:44,width:73,height:72,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEkAAABICAYAAAC6L9h5AAADs0lEQVR42u1crY4bMRAebwMCWqkwUckVFx0L7UvkJY5XqlRYVB7WJ8hLhB47dCoN27AGBIRtwcaXudkZ2+uk57nzrLTK/sQeezI/n8ef4kDJ0S6mHQDA7OtHAADYbfYAADC/P7rSY2u0KAcrCF/j9/j6JQ+nzoqW8/OLdavCohot7oatCG7u+Oc1Kgm7j7cYTlFSm5c6JiWVJLrQdsUqZ35/dCXcTo274TgE67a3JByfas5urEUxyqk6cA9izHIuxqNSManRYEXsxLer3u0UWFSjyor88esHcFmvFJhs1GW3dXuOSSQ2lYpLTkNMegKMOB4hdyuNup2qdRuX8k9LkyqzmweHA1dThraLKonNaoH0zyr1LSsp2SIQBBChwltVUtQiFGEkXRCABm0miFcXk6SKJGxX57ikBCdNNFjRbrOHmb/59lNdYUJXqURJaUSlu6VktyqV5N3tye0EKyqNtnXWk8zdEjETqnFXv1vCxh+8CXBywdLWps/d/CaAuVvg8DiJKKqkNTXXtIQxE2kX046SJHKCfI78WD/0vsnJOP49/qTPYoLFwLxdnc+IcnPl42QhPfP37WLauVDNBnfg34UmisusVBC+HigohLRJCRcCPIKx8lOzr8vxezooag2xCe02++dtvJJowPbWJCDvq8ln+sN9sBYSjRHL+XDgfqLSUkKyFrw7QhWFXc73K8kZI5/KpO3Q/HabPTiOZTboMGfxybXDOyHcwaV+bE1jxpAjX9iEcOy2jjRw3z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IAAAAASUVORK5CYII="},fullRight:{x:80,y:120,width:80,height:80,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAFRklEQVR42u1cP2vbUBA/OR48pKBRpos7li6ph9DVX8JfIEuD90CgQ+fuJkvzBbx3radCIJBkKVm92UOhGkLxEFAH6Umn0917shWaK7kHgUh+eu/p9O7f735SBMra+sMgc/8nk7j222aZAgDA8GobaVlvpEFgw6tt5ASXTGKA6ZDvvFiXQtQiyN5zLwALoSa80Qzg6Cb/G83yc9NhuSu17MK+NrUthRefiP2TSQxrSDMNguxpEGApBE5100uA1bw6Rn007MJIndOYDiuVpW01B1isVTkUNTawZv9W82rXxSeiOmvYgSpsYKNJNrDYfZpaT5UDkQTk7GCxQzfLVI0XVhXG1Gzd3TgXHHUitgM9DXth7EhGs4ZjaYQ+JkBoCo86EKTipsIhG0idCLKBySS2HUgzi1rjPDBK58wGtrGBnEClANviQCK8uzHvTBQ2PQJcrOtIDKfK6WWFygDAGtLsuZ2JCgFulmnTDmKBOSeisEVa4KxSgJwdxGrsBFmAqy8eTGiEI4t1Fc44UJWqMkGmzQtzDoUCCh6A1XLhkPAYPNBqIm13HudQbAcGGhUWPkZORkM6F2mqB3shfRTGbE7v1ajwgaaq3OGbAcDPB4Af3wFe3wPEx8iJHAOk1wAA8PDtl5U1vYACjgWxPRzlOzGZxABXG0vlgoCqJ3RxjAZzIoUtqwXGnA1UCu3r8sI4C8G7j3hlTUWlvsosRIr7RjOAL59UqXBfHZjgS90UBtMRfZL4uM1Tpv13TbOy8yTzVuSkeBABCl3m5wJyev8+mURtInoq4La1Dcrl424wO0+yBpAaEh4qQOE59pm/xktkrqNyoEKNuAGkRYhFILx7nBNw5xi2Qe2mL942hSeFL06F0S7sPL/vXsj1HLkzqqVQ7kaYJ926Gkav5yB7Oq4E4fsarpt0md8H4krjoEigXxuAsgHcAPR3PDDud3RTnJw3xzvja7x7CU9CqbvO7x4KlQNuZ0U2VNRk8h148bZ5I1hdpOReUru7sT+TcL+HvC5VX6nI1GV+7jp3Hs9J/1/NYXN6T8IYigCnl/JCRp6bD6Rh4iJ9zde3y/y+69qsKztPsuz312yvtu91XcbDfZ56/l3mvX2fZedJ1tspSFWKCsO/AHiFPLznrW45fh5Vo9Bkvj7096d+KLvOj887TuIO1/aSSVxxkumNOalzxlpaBHcN54A4Ie7jSJ5yfnoceLibZQoHHx8fPx/+eQR49ypHfbe3+V+5kOv8/GDMB7SDvnyNO++uxTfoxtze5se4n9S4Nbg59p3fnUuv8xjPIeFuvEG/PiaqDj6stlBlIi4jCPFVdqFa0LhRCl53jQXbYoNt56fZCs5iuCAbBdPNfHA6DEfpIca8sDgxhaKFpJAgXcArrWHX+T35b6hvJKEp0gBtKBWhtyzxAyuJRb4XbCi4yrxw02V+DoEJgSdlLiy9OSkNIgk71N8HI7HEIk6tPcLbd/42sJcbj+sbqWRm+fiBythZxg80fqDxA40fCMYPBOMHGj/QBAjGDzR+oPEDjR9o/EDjBxo/EIwfaPxA4wf+J8G0GhUubWAoE0FfcDMBSjmttNNILmw20EeiHOkXnrpUjq2PCOVULemcqh1YE17J9SOqLREfX7INrKEqDkzw2UHDAwNOxHF1JLKPIluo8/uBXGmT1IRNhSUscLGWhQf24R3R/m2WKSQUkeHUF3F3NKRzfQ32LwjNxydVXLiaq/qiuU5AlXt1oQ071nLhohWISy2IJnbQPsAohTGU1Ei/o4q8sFXl2lLdmFeszAtLr8wW38hPWr74+NztL787JmcVH37GAAAAAElFTkSuQmCC"}}}},ne=t=>{const e=t.length;if(e<=1)return null;const n=[],i=[];let a=null;return t.forEach(((t,o)=>{t!==a&&(ae(n,i,re(o,e),t),a=t)})),0===n.length?null:(oe(n,i),i.length<=1||i.every((t=>t===i[0]))?null:{keyTimes:n.join(";"),values:i.join(";")})},ie=t=>{const e=t.length;if(e<=1)return null;const n=[],i=[];let a=null,o=null;return t.forEach(((t,r)=>{t!==a&&(null!==a&&null!==o&&r-1!==o&&ae(n,i,re(r-1,e),a),ae(n,i,re(r,e),t),a=t,o=r)})),oe(n,i),i.length<=1||i.every((t=>t===i[0]))?null:{keyTimes:n.join(";"),values:i.join(";")}},ae=(t,e,n,i)=>{n!==t[t.length-1]?(t.push(n),e.push(i)):e[e.length-1]=i},oe=(t,e)=>{1!==t[t.length-1]&&(t.push(1),e.push(e[e.length-1]))},re=(t,e)=>Number((Math.min(t,Math.max(e-1,1))/Math.max(e-1,1)).toFixed(4)),se={1:{down:[{id:"bm-player-1-down-0",frame:ee.player.walkDown0},{id:"bm-player-1-down-1",frame:ee.player.walkDown1},{id:"bm-player-1-down-2",frame:ee.player.walkDown2},{id:"bm-player-1-down-3",frame:ee.player.walkDown3}],up:[{id:"bm-player-1-up-0",frame:ee.player.walkUp0},{id:"bm-player-1-up-1",frame:ee.player.walkUp1},{id:"bm-player-1-up-2",frame:ee.player.walkUp2},{id:"bm-player-1-up-3",frame:ee.player.walkUp3}],left:[{id:"bm-player-1-left-0",frame:ee.player.walkRight0,flipX:!0},{id:"bm-player-1-left-1",frame:ee.player.walkRight1,flipX:!0},{id:"bm-player-1-left-2",frame:ee.player.walkRight2,flipX:!0},{id:"bm-player-1-left-3",frame:ee.player.walkRight3,flipX:!0},{id:"bm-player-1-left-4",frame:ee.player.walkRight4,flipX:!0},{id:"bm-player-1-left-5",frame:ee.player.walkRight5,flipX:!0}],right:[{id:"bm-player-1-right-0",frame:ee.player.walkRight0},{id:"bm-player-1-right-1",frame:ee.player.walkRight1},{id:"bm-player-1-right-2",frame:ee.player.walkRight2},{id:"bm-player-1-right-3",frame:ee.player.walkRight3},{id:"bm-player-1-right-4",frame:ee.player.walkRight4},{id:"bm-player-1-right-5",frame:ee.player.walkRight5}]},2:{down:[{id:"bm-player-2-down-0",frame:ee.plunderBomber.walkDown0},{id:"bm-player-2-down-1",frame:ee.plunderBomber.walkDown1},{id:"bm-player-2-down-2",frame:ee.plunderBomber.walkDown2},{id:"bm-player-2-down-3",frame:ee.plunderBomber.walkDown3}],up:[{id:"bm-player-2-up-0",frame:ee.plunderBomber.walkUp0},{id:"bm-player-2-up-1",frame:ee.plunderBomber.walkUp1},{id:"bm-player-2-up-2",frame:ee.plunderBomber.walkUp2},{id:"bm-player-2-up-3",frame:ee.plunderBomber.walkUp3}],left:[{id:"bm-player-2-left-0",frame:ee.plunderBomber.walkRight0,flipX:!0},{id:"bm-player-2-left-1",frame:ee.plunderBomber.walkRight1,flipX:!0},{id:"bm-player-2-left-2",frame:ee.plunderBomber.walkRight2,flipX:!0},{id:"bm-player-2-left-3",frame:ee.plunderBomber.walkRight3,flipX:!0},{id:"bm-player-2-left-4",frame:ee.plunderBomber.walkRight4,flipX:!0},{id:"bm-player-2-left-5",frame:ee.plunderBomber.walkRight5,flipX:!0}],right:[{id:"bm-player-2-right-0",frame:ee.plunderBomber.walkRight0},{id:"bm-player-2-right-1",frame:ee.plunderBomber.walkRight1},{id:"bm-player-2-right-2",frame:ee.plunderBomber.walkRight2},{id:"bm-player-2-right-3",frame:ee.plunderBomber.walkRight3},{id:"bm-player-2-right-4",frame:ee.plunderBomber.walkRight4},{id:"bm-player-2-right-5",frame:ee.plunderBomber.walkRight5}]}},Ae={1:[{id:"bm-player-1-death-0",frame:ee.player.death0},{id:"bm-player-1-death-1",frame:ee.player.death1},{id:"bm-player-1-death-2",frame:ee.player.death2},{id:"bm-player-1-death-3",frame:ee.player.death3},{id:"bm-player-1-death-4",frame:ee.player.death4}],2:[{id:"bm-player-2-death-0",frame:ee.plunderBomber.death0},{id:"bm-player-2-death-1",frame:ee.plunderBomber.death1},{id:"bm-player-2-death-2",frame:ee.plunderBomber.death2},{id:"bm-player-2-death-3",frame:ee.plunderBomber.death3}]},le={id:"bm-bomb",frame:ee.explosions.bombs.fuse0},ce=[{id:"bm-explosion-thin-left",frame:ee.explosions.crosses.thinLeft},{id:"bm-explosion-full-left",frame:ee.explosions.crosses.fullLeft},{id:"bm-explosion-full-right",frame:ee.explosions.crosses.fullRight},{id:"bm-explosion-thin-right",frame:ee.explosions.crosses.thinRight}],de=t=>22*t,ge=t=>22*t+15,ue=(t,e,n,i)=>{var a,o;const r=t.gameHistory.length,s=null!==(o=null===(a=t.initialColors[e])||void 0===a?void 0:a[n])&&void 0!==o?o:d(t).intensityColors[0],A=i.get(Ce(e,n));if(!A||0===A.length)return null;const l=[0],c=[s];for(const t of A){const e=re(t.frameIndex,r);e!==l[l.length-1]?(l.push(e),c.push(t.color)):c[c.length-1]=t.color}return 1!==l[l.length-1]&&(l.push(1),c.push(c[c.length-1])),c.length<=1||c.every((t=>t===c[0]))?null:{keyTimes:l.join(";"),values:c.join(";")}},he=(t,e)=>t.gameHistory.map((t=>{const n=t.players.find((t=>t.id===e));return n?pe(n.x,n.y):"0 0"})),me=(t,e)=>t.gameHistory.map(((n,i)=>{const a=n.players.find((t=>t.id===e));if(!a)return Be(e);if(!a.alive){const n=ye(t,e);if(null!==n){const t=Ae[e],a=Math.min(Math.max(i-n,0),t.length-1);return we(t[a])}}const o=i>0?t.gameHistory[i-1].players.find((t=>t.id===e)):void 0,r=Boolean(o&&(o.x!==a.x||o.y!==a.y)),s=se[e][a.direction],A=r?Math.floor(i/2)%s.length:0;return we(s[A])})),fe=(t,e)=>t.gameHistory.map(((n,i)=>{const a=n.players.find((t=>t.id===e));if(!a)return"0";if(a.alive)return"1";const o=ye(t,e);if(null===o)return"0";const r=i-o;return r>=0&&r<Ae[e].length?"1":"0"})),ye=(t,e)=>{for(let n=1;n<t.gameHistory.length;n++){const i=t.gameHistory[n-1].players.find((t=>t.id===e)),a=t.gameHistory[n].players.find((t=>t.id===e));if((null==i?void 0:i.alive)&&a&&!a.alive)return n}return null},pe=(t,e)=>`${de(t)+10} ${ge(e)+10}`,xe=(t,e)=>{const n=t.gameHistory.length,i=[0],a=[Ee()],o=Math.max(e.remainingFrames,1);for(let t=0;t<o;t++){const o=e.frameIndex+t,r=re(o,n),s=Math.min(t,ce.length-1);ae(i,a,r,we(ce[s]))}return oe(i,a),a.length<=1||a.every((t=>t===a[0]))?null:{keyTimes:i.join(";"),values:a.join(";")}},be=(t,e)=>{const n=t.gameHistory.length,i=re(e.frameIndex,n),a=re(e.frameIndex+e.remainingFrames,n);return{keyTimes:`0;${i};${i};${a};${a};1`,values:"0;0;0.9;0.9;0;0"}},ve=(t,e,n)=>{if(t<=1||0===e&&n>=t)return null;const i=re(e,t),a=re(n,t);return{keyTimes:`0;${i};${i};${a};${a};1`,values:"0;0;1;1;0;0"}},Ce=(t,e)=>`${t}:${e}`,we=t=>`#${t.id}`,Be=t=>we(se[t].down[0]),Ee=()=>we(ce[0]),ke=t=>{var e,a,o,r,s;const A=t.gameHistory.length,l=Math.max(A*i/2,1e3),c=d(t),g=(t=>{const e=new Map;for(const n of t){const t=Ce(n.x,n.y),i=e.get(t);i?i.push(n):e.set(t,[n])}return e})(t.cellEvents);let u='<svg width="1166" height="169" xmlns="http://www.w3.org/2000/svg" shape-rendering="crispEdges" color-interpolation="sRGB">';u+="<style>image { image-rendering: pixelated; image-rendering: -moz-crisp-edges; }</style>",u+=(()=>{const t=new Map;for(const e of Object.values(se))for(const n of Object.values(e))for(const e of n)t.set(e.id,e);for(const e of Object.values(Ae))for(const n of e)t.set(n.id,n);t.set(le.id,le);for(const e of ce)t.set(e.id,e);return`<defs>${Array.from(t.entries()).map((([t,e])=>`<symbol id="${t}" viewBox="0 0 ${e.frame.width} ${e.frame.height}" overflow="visible">\n\t\t\t\t<image width="${e.frame.width}" height="${e.frame.height}" href="${e.frame.data}" preserveAspectRatio="xMidYMid meet" style="image-rendering: pixelated;"${e.flipX?` transform="translate(${e.frame.width} 0) scale(-1 1)"`:""}/>\n\t\t\t</symbol>`)).join("")}</defs>`})(),u+=`<rect width="100%" height="100%" fill="${c.gridBackground}"/>`;let h="";for(let e=0;e<n;e++)t.monthLabels[e]!==h&&(u+=`<text x="${22*e+10}" y="10" text-anchor="middle" font-size="10" fill="${c.textColor}">${t.monthLabels[e]}</text>`,h=t.monthLabels[e]);for(let i=0;i<n;i++)for(let n=0;n<7;n++){const o=ue(t,i,n,g);u+=`<rect id="c-${i}-${n}" x="${de(i)}" y="${ge(n)}" width="20" height="20" rx="3" fill="${null!==(a=null===(e=t.initialColors[i])||void 0===e?void 0:e[n])&&void 0!==a?a:c.intensityColors[0]}">`,o&&(u+=`<animate attributeName="fill" calcMode="discrete" dur="${l}ms" repeatCount="indefinite"\n\t\t\t\t\tvalues="${o.values}" keyTimes="${o.keyTimes}"/>`),u+="</rect>"}for(const e of(t=>{const e=new Map;for(let n=0;n<t.gameHistory.length;n++){const i=t.gameHistory[n];for(const t of i.bombs){const i=e.get(t.id);i?i.endFrameExclusive=n+1:e.set(t.id,{bomb:t,startFrame:n,endFrameExclusive:n+1})}}return Array.from(e.values())})(t)){const t=ve(A,e.startFrame,e.endFrameExclusive),n=0===e.startFrame?"1":"0";u+=`<g id="bomb-${e.bomb.id}" opacity="${n}" transform="translate(${pe(e.bomb.x,e.bomb.y)})" style="will-change: opacity;">`,t&&(u+=`<animate attributeName="opacity" calcMode="discrete" dur="${l}ms" repeatCount="indefinite"\n\t\t\t\tkeyTimes="${t.keyTimes}" values="${t.values}"/>`),u+=`<use x="-8" y="-9" width="16" height="18" href="${we(le)}" style="will-change: transform;">\n\t\t\t<animateTransform attributeName="transform" type="scale" calcMode="linear" dur="500ms" repeatCount="indefinite"\n\t\t\t\tkeyTimes="0;0.5;1" values="1;1.1;1"/>\n\t\t</use></g>`}for(const e of t.explosionEvents){const n=be(t,e),i=xe(t,e);u+=`<use x="${de(e.x)+10-32}" y="${ge(e.y)+10-32}" width="64" height="64" href="${Ee()}" opacity="0" style="will-change: opacity;">`,i&&(u+=`<animate attributeName="href" calcMode="discrete" dur="${l}ms" repeatCount="indefinite"\n\t\t\t\tkeyTimes="${i.keyTimes}" values="${i.values}"/>`),n&&(u+=`<animate attributeName="opacity" calcMode="discrete" dur="${l}ms" repeatCount="indefinite"\n\t\t\t\tkeyTimes="${n.keyTimes}" values="${n.values}"/>`),u+="</use>"}for(const e of t.players){const n=he(t,e.id),i=fe(t,e.id),a=me(t,e.id),A=ie(n),c=ne(i),d=ne(a);u+=`<use id="player-${e.id}" x="-11" y="-18" width="22" height="28" href="${null!==(o=a[0])&&void 0!==o?o:Be(e.id)}" opacity="${null!==(r=i[0])&&void 0!==r?r:"0"}" transform="translate(${null!==(s=n[0])&&void 0!==s?s:"0 0"})" style="will-change: transform, opacity;">`,d&&(u+=`<animate attributeName="href" calcMode="discrete" dur="${l}ms" repeatCount="indefinite"\n\t\t\t\tkeyTimes="${d.keyTimes}" values="${d.values}"/>`),c&&(u+=`<animate attributeName="opacity" calcMode="discrete" dur="${l}ms" repeatCount="indefinite"\n\t\t\t\tkeyTimes="${c.keyTimes}" values="${c.values}"/>`),A&&(u+=`<animateTransform attributeName="transform" type="translate" calcMode="linear" dur="${l}ms" repeatCount="indefinite"\n\t\t\t\tkeyTimes="${A.keyTimes}" values="${A.values}"/>`),u+="</use>"}return u+="</svg>",u},Ue=[{x:0,y:-1,direction:"up"},{x:0,y:1,direction:"down"},{x:-1,y:0,direction:"left"},{x:1,y:0,direction:"right"}],Se=({x:t,y:e})=>`${t}:${e}`,Re=(t,e)=>t.x===e.x&&t.y===e.y,Me=(t,e)=>Math.abs(t.x-e.x)+Math.abs(t.y-e.y),Ie=({x:t,y:e})=>t>=0&&t<n&&e>=0&&e<7,Oe=(t,{x:e,y:n})=>Ie({x:e,y:n})&&t.grid[e][n].commitsCount>0,De=(t,{x:e,y:n})=>Ie({x:e,y:n})&&0===t.grid[e][n].commitsCount,Te=(t,{x:e,y:n})=>t.bombs.find((t=>!t.exploded&&t.x===e&&t.y===n)),Ve=(t,e)=>De(t,e)&&!Te(t,e),Ne=t=>[t,...Ue.map((e=>({x:t.x+1*e.x,y:t.y+1*e.y}))).filter(Ie)],Qe=(t,e,n)=>t.activeExplosions.some((t=>(void 0===n||t.ownerId===n)&&t.affectedCells.some((t=>Re(t,e))))),He=(t,e,n)=>t.bombs.filter((t=>!t.exploded&&(void 0===n||t.ownerId===n)&&Ne(t).some((t=>Re(t,e))))),Fe=(t,e,n)=>He(t,n,e.id).length>0,Ke=(t,e,n)=>De(t,n)&&!Te(t,n)&&!Qe(t,n,e.id)&&!Fe(t,e,n),Ye=({x:t,y:e})=>Ue.map((n=>({x:t+n.x,y:e+n.y,direction:n.direction}))).filter(Ie),Je=t=>t.grid.reduce(((t,e)=>t+e.filter((t=>t.commitsCount>0)).length),0),Le=(t,e,i=new Set)=>{let a=null,o=Number.POSITIVE_INFINITY;for(let r=0;r<n;r++)for(let n=0;n<7;n++){const s={x:r,y:n};if(!De(t,s)||i.has(Se(s)))continue;const A=Math.abs(e.x-r)+Math.abs(e.y-n);A<o&&(a=s,o=A)}return null!=a?a:e},Ge=(t,e)=>e.alive&&De(t,e)&&!Te(t,e)&&!t.bombs.some((t=>!t.exploded&&t.ownerId===e.id)),je=(t,e)=>{const n=t.players.find((t=>t.id!==e.id&&t.alive));return Boolean(n&&Ne(e).some((t=>Re(t,n))))},ze=(t,e)=>{Ge(t,e)&&(t.bombs.push({id:t.nextBombId++,ownerId:e.id,x:e.x,y:e.y,timer:8,exploded:!1,sprite:ee.explosions.bombs.fuse0.data}),e.bombsPlaced++)},Pe=(t,e,n)=>{if(!Oe(t,e))return!1;const i=d(t);t.grid[e.x][e.y]={commitsCount:0,level:"NONE",color:i.intensityColors[0]};const a=t.players.find((t=>t.id===n));return a&&a.cellsDestroyed++,t.cellEvents.push({frameIndex:t.gameHistory.length,x:e.x,y:e.y,color:i.intensityColors[0]}),t.config.pointsIncreasedCallback(t.cellEvents.length),!0},Xe=(t,e)=>{if(e.exploded)return;e.exploded=!0;const n=[{x:e.x,y:e.y}],i=[];for(const i of Ue){const a={x:e.x+1*i.x,y:e.y+1*i.y};if(!Ie(a))continue;n.push(a),Pe(t,a,e.ownerId);const o=Te(t,a);o&&Xe(t,o)}for(const e of t.players)e.alive&&n.some((t=>t.x===e.x&&t.y===e.y))&&(e.alive=!1,i.push(e.id));const a={bombId:e.id,ownerId:e.ownerId,x:e.x,y:e.y,remainingFrames:4,affectedCells:n,hitPlayerIds:i,sprite:ee.explosions.bombs.blastCenter.data};t.activeExplosions.push(a),t.explosionEvents.push(Object.assign({frameIndex:t.gameHistory.length},a))},We=t=>{for(const e of t.activeExplosions)e.remainingFrames--;t.activeExplosions=t.activeExplosions.filter((t=>t.remainingFrames>0))},qe=(t,e)=>{const n=t.gameHistory[t.gameHistory.length-2],i=null==n?void 0:n.players.find((t=>t.id===e));return i?{x:i.x,y:i.y}:null},Ze=(t,e,n)=>{const i=qe(t,e.id);return Boolean(i&&Re(i,n))},$e=(t,e)=>t.sort(((t,n)=>{const i=e.avoidFirstStep&&Re(t,e.avoidFirstStep)?1:0,a=e.avoidFirstStep&&Re(n,e.avoidFirstStep)?1:0;return i!==a?i-a:e.target?Me(t,e.target)-Me(n,e.target):0})),_e=(t,e,n,i=new Set)=>{var a;const o=[{position:e,firstStep:null,distance:0,cost:0,blastedCells:0}],r=new Map([[Se(e),0]]);for(;o.length>0;){o.sort(((t,e)=>t.cost-e.cost||Me(t.position,n)-Me(e.position,n)));const e=o.shift();if(!e)break;if(e.firstStep&&Re(e.position,n))return{firstStep:e.firstStep,distance:e.distance,cost:e.cost,blastedCells:e.blastedCells};for(const s of Ye(e.position)){if(Te(t,s)||Qe(t,s))continue;const A=Se(s),l=i.has(A),c=Oe(t,s)&&!l;if(!(De(t,s)||l||c||Re(s,n)))continue;const d=c?10:1,g=e.cost+d,u=r.get(A);void 0!==u&&u<=g||(r.set(A,g),o.push({position:{x:s.x,y:s.y},firstStep:null!==(a=e.firstStep)&&void 0!==a?a:{x:s.x,y:s.y},distance:e.distance+1,cost:g,blastedCells:e.blastedCells+(c?1:0)}))}}return null},tn=(t,e)=>{var n;const i=Math.max(8,4),a=[{position:e,firstStep:null,depth:0}],o=new Set([Se(e)]);for(;a.length>0;){const r=a.shift();if(!r)break;if(r.firstStep&&Ke(t,e,r.position))return r.firstStep;if(r.depth>=i)continue;const s=Ye(r.position).sort(((n,i)=>He(t,n,e.id).length-He(t,i,e.id).length));for(const i of s){const s=Se(i);if(o.has(s)||!De(t,i)||Te(t,i)||Qe(t,i,e.id))continue;const A=r.depth+1;He(t,i,e.id).some((t=>t.timer<=A))||(o.add(s),a.push({position:i,firstStep:null!==(n=r.firstStep)&&void 0!==n?n:{x:i.x,y:i.y},depth:A}))}}return null},en=(t,e,n)=>{if(!De(t,n)||Te(t,n))return!1;const i={id:-1,ownerId:e.id,x:n.x,y:n.y,timer:8,exploded:!1,sprite:""},a=Object.assign(Object.assign({},e),{x:n.x,y:n.y});t.bombs.push(i);try{return Boolean(tn(t,a))}finally{t.bombs.pop()}},nn=(t,e,n)=>{const i=_e(t,e,n),a=[],o=((t,e)=>{var n;const i=new Set([Se(e)]),a=[{position:e,firstStep:null,distance:0}],o=[],r=qe(t,e.id);for(;a.length>0;){const s=a.shift();if(!s)break;o.push(s);const A=$e(Ye(s.position),s.firstStep?{target:e}:{avoidFirstStep:r,target:e});for(const o of A){const r=Se(o);i.has(r)||!Ve(t,o)||Qe(t,o,e.id)||Fe(t,e,o)||(i.add(r),a.push({position:{x:o.x,y:o.y},firstStep:null!==(n=s.firstStep)&&void 0!==n?n:{x:o.x,y:o.y},distance:s.distance+1}))}}return o})(t,e);for(const r of o){if(!en(t,e,r.position))continue;const o=Ne(r.position).filter((e=>Oe(t,e)));if(0===o.length)continue;const s=new Set(o.map(Se)),A=_e(t,r.position,n,s);if(!A)continue;const l=o.sort(((t,e)=>Me(t,n)-Me(e,n)))[0],c=i?i.cost-A.cost:10;if(c<=0)continue;const d=r.firstStep&&Ze(t,e,r.firstStep)?6:0,g=10*A.blastedCells*3+2*r.distance+A.distance+.1*Me(r.position,n)+d-.25*o.length-.5*c;a.push({position:r.position,firstStep:r.firstStep,contribution:l,score:g})}return 0===a.length?null:(a.sort(((t,e)=>t.score-e.score||t.position.x-e.position.x||t.position.y-e.position.y)),a[0])},an=(t,e)=>{if(!((t,e)=>en(t,e,e))(t,e))return!1;if(je(t,e))return!0;const n=t.players.find((t=>t.id!==e.id&&t.alive));if(!n)return!1;const i=nn(t,e,n);return Boolean(i&&Re(i.position,e)&&((t,e)=>((t,e)=>Ne(e).some((e=>Oe(t,e))))(t,e)||je(t,e))(t,e))},on=(t,e)=>{const n=tn(t,e);if(Boolean(Te(t,e))||Qe(t,e,e.id)||Fe(t,e,e))return void(n&&rn(e,n));const i=t.players.find((t=>t.id!==e.id&&t.alive));if(!i)return;const a=qe(t,e.id),o=((t,e,n,i={})=>{var a;const o=new Set([Se(e)]),r=[{position:e,firstStep:null,distance:0}];for(;r.length>0;){const e=r.shift();if(!e)break;if(e.firstStep&&n(e.position))return{firstStep:e.firstStep,distance:e.distance};const s=$e(Ye(e.position),e.firstStep?{target:i.target}:i);for(const n of s){const i=Se(n);!o.has(i)&&Ve(t,n)&&(o.add(i),r.push({position:n,firstStep:null!==(a=e.firstStep)&&void 0!==a?a:{x:n.x,y:n.y},distance:e.distance+1}))}}return null})(t,e,(t=>Re(t,i)),{avoidFirstStep:a,target:i}),r=(null==o?void 0:o.firstStep)&&Ve(t,o.firstStep)&&!Qe(t,o.firstStep,e.id)&&!Fe(t,e,o.firstStep)?o.firstStep:null;if(r)return void rn(e,r);if(t.bombs.some((t=>!t.exploded&&t.ownerId===e.id)))return;const s=nn(t,e,i),A=null==s?void 0:s.firstStep;A&&Ve(t,A)&&!Qe(t,A,e.id)&&!Fe(t,e,A)&&rn(e,A)},rn=(t,e)=>{var n,i;const a=null!==(i=null===(n=Ue.find((n=>t.x+n.x===e.x&&t.y+n.y===e.y)))||void 0===n?void 0:n.direction)&&void 0!==i?i:e.direction;a&&(t.direction=a),t.x=e.x,t.y=e.y};var sn=function(t,e,n,i){return new(n||(n=Promise))((function(a,o){function r(t){try{A(i.next(t))}catch(t){o(t)}}function s(t){try{A(i.throw(t))}catch(t){o(t)}}function A(t){var e;t.done?a(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}A((i=i.apply(t,e||[])).next())}))};const An=(t,e,n,i,a)=>Object.assign(Object.assign({id:t,name:e},n),{alive:!0,direction:i,bombsPlaced:0,cellsDestroyed:0,sprite:a}),ln=t=>{t.gameHistory.push({players:t.players.map((t=>Object.assign({},t))),bombs:t.bombs.map((t=>Object.assign({},t))),explosions:t.activeExplosions.map((t=>Object.assign(Object.assign({},t),{affectedCells:t.affectedCells.map((t=>Object.assign({},t))),hitPlayerIds:[...t.hitPlayerIds]})))})},cn=t=>{t.frameCount++,We(t),(t=>{for(const e of t.bombs)e.exploded||e.timer--;for(const e of[...t.bombs])!e.exploded&&e.timer<=0&&Xe(t,e);t.bombs=t.bombs.filter((t=>!t.exploded))})(t);for(const e of t.players)e.alive&&(Ge(t,e)&&an(t,e)&&ze(t,e),on(t,e));ln(t)},dn={frameCount:0,contributions:[],grid:[],monthLabels:[],gameInterval:0,nextBombId:0,players:[],bombs:[],activeExplosions:[],gameHistory:[],initialColors:[],cellEvents:[],explosionEvents:[],config:void 0};class gn{constructor(t){this.conf=Object.assign({},t)}start(){return t=this,e=void 0,i=function*(){switch(this.store=JSON.parse(JSON.stringify(dn)),this.store.config=Object.assign(Object.assign({},{platform:"github",username:"",svgCallback:t=>{},gameOverCallback:()=>{},gameTheme:"github",pointsIncreasedCallback:t=>{},githubSettings:{accessToken:""}}),this.conf),this.store.config.platform){case"gitlab":this.store.contributions=yield y(this.store);break;case"github":this.store.contributions=yield f(this.store);break;default:throw new Error(`Unsupported platform: ${this.store.config.platform}`)}return g(this.store),u(this.store),yield(t=this.store,sn(void 0,void 0,void 0,(function*(){for((t=>{t.frameCount=0,t.nextBombId=0,t.players=[],t.bombs=[],t.activeExplosions=[],t.gameHistory=[],t.cellEvents=[],t.explosionEvents=[]})(t),t.grid=h(t),t.initialColors=t.grid.map((t=>t.map((t=>t.color)))),(t=>{const e=Le(t,{x:0,y:0}),n=Le(t,{x:52,y:6},new Set([Se(e)]));t.players=[An(1,"Bomberman",e,"right",ee.player.idleDown.data),An(2,"Plunder Bomber",n,"left",ee.plunderBomber.idleDown.data)]})(t),ln(t);Je(t)>0&&t.players.filter((t=>t.alive)).length>1&&t.frameCount<1200;)cn(t);(t=>{if(!t.players.every((t=>t.alive)))for(let e=1;e<8;e++)We(t),ln(t)})(t);const e=ke(t);t.config.svgCallback(e),t.config.gameStatsCallback&&t.config.gameStatsCallback({totalScore:t.cellEvents.length,steps:t.frameCount,ghostsEaten:0}),t.config.gameOverCallback()}))),this.store;var t},new((n=void 0)||(n=Promise))((function(a,o){function r(t){try{A(i.next(t))}catch(t){o(t)}}function s(t){try{A(i.throw(t))}catch(t){o(t)}}function A(t){var e;t.done?a(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}A((i=i.apply(t,e||[])).next())}));var t,e,n,i}stop(){var t;t=this.store,sn(void 0,void 0,void 0,(function*(){clearInterval(t.gameInterval)}))}}var un=e.Hr,hn=e.Lc,mn=e.b9,fn=e.Cf,yn=e.rn,pn=e.OJ;export{un as BombermanRenderer,hn as BreakoutRenderer,mn as GalagaRenderer,fn as PacmanRenderer,yn as PlayerStyle,pn as PuzzleBobbleRenderer};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pacman-contribution-graph",
3
- "version": "3.2.5",
3
+ "version": "3.2.8",
4
4
  "description": "Generates a pacman game from a github or gitlab user contributions grid",
5
5
  "repository": "github:abozanona/pacman-contribution-graph",
6
6
  "homepage": "https://abozanona.github.io/pacman-contribution-graph/",