(function() {
  const coin = chrome.extension.getURL('sounds/mario-coin.mp3')
  const fireball = chrome.extension.getURL('sounds/mario-fireball.wav')
  const gift = chrome.extension.getURL('sounds/mario-gift.mp3')
  const kick = chrome.extension.getURL('sounds/mario-kick.wav')
  const oneUp = chrome.extension.getURL('sounds/mario-one-up.mp3')
  const stamp = chrome.extension.getURL('sounds/mario-stamp.mp3')
  const pause = chrome.extension.getURL('sounds/mario-pause.wav')

  const soundSources = {
    heart: oneUp,
    '+1': coin,
    '-1': fireball,
    laugh: stamp,
    hooray: gift,
    confused: pause,
  }

  function playSound(src) {
    const sound = new Howl({ src, volume: 0.5 })
    sound.play()
  }

  function getReactionType(button) {
    const type = button.getAttribute('data-reaction-label') || button.value
    return type.split(' ')[0].toLowerCase()
  }

  function addReaction(event) {
    const button = event.currentTarget
    const type = getReactionType(button)
    const source = soundSources[type]
    if (source) {
      playSound(source)
    }
  }

  function removeReaction(event) {
    playSound(kick)
  }

  // Add reaction
  $('body').on('click', '.js-reaction-option-item', addReaction)
  $('body').on('click',
               'button.reaction-summary-item:not(.user-has-reacted):not(.add-reaction-btn)',
               addReaction)

  // Remove reaction
  $('body').on('click', 'button.user-has-reacted', removeReaction)
})()

@@ -479,27 +479,26 @@
   const 
-soundSource
+marioSound
 s = %7B%0A  
@@ -606,16 +606,166 @@
  pause,%0A
+    unreact: kick,%0A  %7D%0A%0A  function getSource(type, soundPack) %7B%0A    if (soundPack === 'mario') %7B%0A      return marioSounds%5Btype%5D%0A    %7D%0A    return null%0A
   %7D%0A%0A  f
@@ -785,16 +785,24 @@
 ound(src
+, volume
 ) %7B%0A    
@@ -841,13 +841,8 @@
 lume
-: 0.5
  %7D)%0A
@@ -1045,32 +1045,51 @@
 ddReaction(event
+, volume, soundPack
 ) %7B%0A    const bu
@@ -1179,26 +1179,34 @@
 e = 
-sound
+get
 Source
-s%5B
+(
 type
-%5D
+, soundPack)
 %0A   
@@ -1242,16 +1242,24 @@
 d(source
+, volume
 )%0A    %7D%0A
@@ -1293,17 +1293,100 @@
 ion(
-event
+volume, soundPack) %7B%0A    const source = getSource('unreact', soundPack)%0A    if (source
 ) %7B%0A
+  
     
@@ -1399,19 +1399,181 @@
 und(
-kick)%0A  %7D%0A%0A
+source, volume)%0A    %7D%0A  %7D%0A%0A  SoundsOfGitHubStorage.load().then(options =%3E %7B%0A    const volume = options.volume %7C%7C '0.5'%0A    const soundPack = options.soundPack %7C%7C 'mario'%0A%0A  
   //
@@ -1580,32 +1580,34 @@
  Add reaction%0A  
+ 
+ 
 $('body').on('cl
@@ -1639,16 +1639,21 @@
 n-item',
+ e =%3E
  addReac
@@ -1656,18 +1656,42 @@
 Reaction
-)%0A
+(e, volume, soundPack))%0A  
   $('bod
@@ -1706,16 +1706,18 @@
 click',%0A
+  
         
@@ -1815,16 +1815,23 @@
         
+   e =%3E
  addReac
@@ -1834,19 +1834,43 @@
 Reaction
+(e, volume, soundPack)
 )%0A%0A
+  
   // Rem
@@ -1882,16 +1882,18 @@
 eaction%0A
+  
   $('bod
@@ -1934,16 +1934,22 @@
 eacted',
+ () =%3E
  removeR
@@ -1955,15 +1955,39 @@
 Reaction
+(volume, soundPack))%0A  %7D
 )%0A%7D)()%0A

Use saved options when playing sounds