Towering Cistercian representation SE Sandbox Link, Codidact Sandbox Link
Inspired by this video.
Given a positive integer, draw its Cistercian representation as ascii art.

The Challenge
Cistercian numerals are a decimal-based number representation system which use simple line based drawings to represent 4-digit numerals. Their structure is as follows:
     Tens|Units
         |
Thousands|Hundreds

The digits are represented as follows (in the units place):
1   ⌷ 2   ⌷ 3   ⌷ 4   ⌷ 5   ⌷ 6    ⌷ 7    ⌷ 8    ⌷ 9    ⌷ 0 
___ ⌷     ⌷     ⌷     ⌷ ___ ⌷    . ⌷ ___. ⌷    . ⌷ ___. ⌷
    ⌷     ⌷ \   ⌷   / ⌷   / ⌷    | ⌷    | ⌷    | ⌷    | ⌷
    ⌷     ⌷  \  ⌷  /  ⌷  /  ⌷    | ⌷    | ⌷    | ⌷    | ⌷
    ⌷ ___ ⌷   \ ⌷ /   ⌷ /   ⌷    ' ⌷    ' ⌷ ___' ⌷ ___' ⌷


(all of these are 4 rows in height.)
As you can see, there are some repeating patterns within the symbols:
5 → 4 + 1
7 → 6 + 1
8 → 6 + 2
9 → 6 + 1 + 2

In order to represent a general Cistercian number, you will have to place the digits in the correct place for their value.
They should be mirrored horizontally if they are on the left.
They should be mirrored vertically if they are on the bottom i.e. the lines should be reversed, \ and / should be swapped, and . and ' should be swapped. Here's how they should look.
The fun part is when you stack a Cistercian representation on top of another one to accommodate more digits e.g.:
  T|U  
   |   
 Th|H  
   |   
Hth|Tth
   |   
 TM|M 

like a tower of sorts.
You will need to stack as many 4 part towers as the number requires, and you will need to prepend 0's to the input if it's length is not a multiple of 4.
Hence, given an input number, say, 12345, you should get the following:
00012345 → 5432,1000
which turns into:
4|5
 |
2|3
 |
0|1
 |
0|0

which becomes:
    |___
 \  |  /
  \ | /
   \|/
    |
    |
    |
    |
 ___|  /
    | /
    |/
    |
    |
    |
    |
    |
    |___
    |
    |
    |
    |
    |
    |
    |
    |
    |
    |
    |


Note that this is created by making two towers for the 4 digit numbers 2345 and 0001, stacking them, and adding a link of 4 | characters between them.
Scoring
This is code-golf. Shortest answer in each language wins.
JavaScript (Node.js), 265 bytes
f=n=&gt;n?`01238888765${n&lt;1e4?4:48888}`.replace(e=/\d/g,y=&gt;`4567|3210
`.replace(e,x=&gt;&quot;_ \\/.'|&quot;[q=y/2&amp;2|x&gt;3,y&amp;8?1:(k='40321123'[j=~~('0x'+(1e6+'1023405671567899AB99A899CB99C')[y%4+~-(n/10**q%10)*4])]^x%4?2045&gt;&gt;j&amp;1:'0122233346545'[j])^0xCC6600&gt;&gt;k*4+q&amp;1]))+f(n/1e4|0):''

Try it online!
Encoding
Each digit pattern is a 4x4 matrix consisting of 7 distinct characters. Each character is encoded as a single decimal digit from 0 to 6:
0: &quot;_&quot;
1: &quot; &quot;
2: &quot;\&quot;
3: &quot;/&quot;
4: &quot;.&quot;
5: &quot;'&quot;
6: &quot;|&quot;

All matrices are built with 13 distinct rows, encoded as a single hexadecimal digit from 0 to C:
0: 1111 for &quot;    &quot;
1: 0001 for &quot;___ &quot;
2: 2111 for &quot;\   &quot;
3: 1211 for &quot; \  &quot;
4: 1121 for &quot;  \ &quot;
5: 1131 for &quot;  / &quot;
6: 1311 for &quot; /  &quot;
7: 3111 for &quot;/   &quot;
8: 1114 for &quot;   .&quot;
9: 1116 for &quot;   |&quot;
A: 1115 for &quot;   '&quot;
B: 0004 for &quot;___.&quot;
C: 0005 for &quot;___'&quot;

So, each matrix is fully described by a sequence of 4 hexadecimal digits. For instance, the matrix for 7 is encoded as B99A:
B99A -&gt; 0004 -&gt; &quot;___.&quot;
        1116    &quot;   |&quot;
        1116    &quot;   |&quot;
        1115    &quot;   '&quot;

The leading sequence is 0000 and is omitted. The other sequences are stored as:
1e6 + '1023405671567899AB99A899CB99C'

which expands to:
0      1    2    3    4    5    6    7    8    9
(0000) 1000 0001 0234 0567 1567 899A B99A 899C B99C

Each matrix row is made of a 'background' character appearing 3 times and a 'foreground' character appearing only once (or not at all). So the rows can be encoded as:

the position of the 'foreground' character (0 for rightmost to 3 for leftmost, or 4 if none)
the 'background' character (which is always either 0 for &quot;_&quot; or 1 for &quot; &quot;)
the 'foreground' character

This is summarized in the following table:
 ID | string | digits | FG position | BG char. | FG char.
----+--------+--------+-------------+----------+----------
  0 | &quot;    &quot; |  1111  |      4      |    1     |    0
  1 | &quot;___ &quot; |  0001  |      0      |    0     |    1
  2 | &quot;\   &quot; |  2111  |      3      |    1     |    2
  3 | &quot; \  &quot; |  1211  |      2      |    1     |    2
  4 | &quot;  \ &quot; |  1121  |      1      |    1     |    2
  5 | &quot;  / &quot; |  1131  |      1      |    1     |    3
  6 | &quot; /  &quot; |  1311  |      2      |    1     |    3
  7 | &quot;/   &quot; |  3111  |      3      |    1     |    3
  8 | &quot;   .&quot; |  1114  |      0      |    1     |    4
  9 | &quot;   |&quot; |  1116  |      0      |    1     |    6
  A | &quot;   '&quot; |  1115  |      0      |    1     |    5
  B | &quot;___.&quot; |  0004  |      0      |    0     |    4
  C | &quot;___'&quot; |  0005  |      0      |    0     |    5
----+--------+--------+-------------+----------+----------
                             |           |          |
                             |           |          +--&gt; stored as &quot;0122233346545&quot;
                             |           +-------------&gt; stored as the bit mask 2045
                             +-------------------------&gt; stored as &quot;40321123&quot;