Counting Goats to Sleep Some people count sheep to get to sleep. Others count goats.
Write a program or function that takes in a positive integer N and outputs N-1 awake goats followed by one sleeping goat, as if someone was counting N goats and at the very last one they fell asleep.
Awake goats look like this:
      \
  ___/o&gt;
-(___)&quot;
 '' ''

Sleeping goats look like this:
      \
  ___/-&gt;
,(___)&quot;
 `` ``

They are chained together with a single space between beard and tail of adjacent goats:
      \       \       \
  ___/o&gt;  ___/o&gt;  ___/-&gt;
-(___)&quot; -(___)&quot; ,(___)&quot;
 '' ''   '' ''   `` ``

The output is allowed to have trailing spaces and a single trailing newline.
The shortest code in bytes wins.
Examples
N = 1:
      \
  ___/-&gt;
,(___)&quot;
 `` ``

N = 2:
      \       \
  ___/o&gt;  ___/-&gt;
-(___)&quot; ,(___)&quot;
 '' ''   `` ``

N = 3:
      \       \       \
  ___/o&gt;  ___/o&gt;  ___/-&gt;
-(___)&quot; -(___)&quot; ,(___)&quot;
 '' ''   '' ''   `` ``

N = 4:
      \       \       \       \
  ___/o&gt;  ___/o&gt;  ___/o&gt;  ___/-&gt;
-(___)&quot; -(___)&quot; -(___)&quot; ,(___)&quot;
 '' ''   '' ''   '' ''   `` ``

Larger N should work just as well.
MATL, 56 53 bytes
:&quot;'!!((!((!!#*```).?p0```!!!]'8eP!P]'p(.' '.a-'XE&amp;hqc

Try it online!
Explanation
Awake goat
The awake goat can be packed into the string
  '' ''  &quot;)___(-&gt;o/___   \

and unpacked as will be explained shortly. However, the single-quote symbols would need to be duplicated in order to escape them, so the string literal would have to be defined as (note the enclosing single-quote symbols and the duplication of the original ones):
'  '''' ''''  &quot;)___(-&gt;o/___   \'

To save bytes, we define the string using characters one code point above that, thus avoiding duplication. The string literal becomes
'!!((!((!!#*```).?p0```!!!]'

At the end of the code we will subtract 1 and convert to char. (We could do it now, right after the string literal; but leaving it for the end will save another single-quote duplication, as we will see).
To explain how the string is unpacked, we will work with the original characters (that are produced at the end of the code by subtacting 1), so the explanation is easier to follow. We first reshape the string
  '' ''  &quot;)___(-&gt;o/___   \

into an 8-row 2D char array, in column-major order (down, then across). This automatically pads the last column with char 0 (at the end of the code, subtracting 1 will transform it into number −1, which converted to char gives again char 0). Char 0 is displayed as a space. So effectively we are padding with spaces. The result of reshaping is
  &gt; 
 &quot;o\
')/ 
'__ 
 __ 
'__ 
'(  
 -  

We now flip vertically:
 -  
'(  
'__ 
 __ 
'__ 
')/ 
 &quot;o\
  &gt; 

and then transpose and flip vertically again to produce the awake goat:
      \ 
  ___/o&gt;
-(___)&quot; 
 '' ''  

The two flip operations are needed because the original packed string is &quot;in reverse&quot;. This is to exploit the fact that the actual 2D char array representing the goat has 6 initial spaces in its first row, which get automatically filled by padding when the string is reshaped into an 8-row 2D array. But the padding is done at the end (not beginning) of the last column (not row), hence the flips and transpose.
Sleeping goat
A sleeping goat is generated from an awake goat by transliterating chars o, ', - into -, `, , respectively. Actually, because of the one-code-point-above transformation, we transliterate chars p, (, ' into ., a, -, which again saves us from having to duplicate the single-quote symbol. This is why the subtract-one operation was left for the end of the program.
Code structure

Generate an awake goat N times, working with code points increased by 1.
Transform the last goat into a sleeping goat.
Concatenate all goats horizontally. Subtract 1 to code points and cast to char.

Commented code
:                              % (Step 1) Implicitly input N. Push range [1 2 ... N]
&quot;                              % For each (i.e. repeat N times)
  '!!((!((!!#*```).?p0```!!!]' %   Push this string. Quotes are escaped by duplicating
  8e                           %   Reshape into an 8-row 2D array of char, in
                               %   column-major order, padding last column with
                               %   char 0
  P                            %   Flip vertically
  !P                           %   Transpose and flip vertically
]                              % End
'p(.'                          % (Step 2) Push this string: source for transliteration
'.a-'                          % Push this string: target for transliteration
XE                             % Transliterate. Transforms last goat into sleeping
&amp;h                             % (Step 3) Horizontally concat all 2D char arrays
qc                             % Subtract 1 and convert to char. 0 becomes −1, which
                               % is converted to char 0, which is displayed as a space
                               % Implicitly display