use utf8;

sub disptap {
	return map {
		m/\A(-?)(\d)(\d)/;
		sprintf('<small style="line-height:2ex">%s</small>&nbsp;',
			#TODO: prepend $1
			join "<br>\n", '•' x $2, '•' x $3,
		);
	} @_;
}

my %C = qw(red #EC1C24  blue #3953A3  yellow #F9EC31  black #231F20);

(
latnuc   => [qw{ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z }],
latnlc   => [qw{ a b c d e f g h i j k l m n o p q r s t u v w x y z }],
latfsuet => [qw{ a b c d e f g h i j k l m n o p q r ſ s t u v w x y z }],
asl      => [
	map { pack 'W*', map { hex "1D$_" } unpack '(A3)*', $_ } qw{
	8F7a9c    847a9c    86Da9c    801a9c    84Aa9c
	8CEa9c    8F0       815aa2    892a9c    892a9c9A2aac
	840a9c    8DCa9c    88Da9c
	819a9c    876a9c    840a9caA1 8F0a9caA1 81Aa9c
	903a9c    8FBa9c    815a9c    80Ea9c    887a9c
	806a9c    89Aa9c    800a9c945aaa
}],
brai     => [qw{ ⠁ ⠃ ⠉ ⠙ ⠑ ⠋ ⠛ ⠓ ⠊ ⠚ ⠅ ⠇ ⠍ ⠝ ⠕ ⠏ ⠟ ⠗ ⠎ ⠞ ⠥ ⠧ ⠺ ⠭ ⠽ ⠵ }],
morse    => [map {tr/.-/‧‑/r} qw{
            	.- -... -.-. -.. . ..-. --. .... .. .--- -.- .-.. --
            	-. --- .--. --.- .-. ... - ..- ...- .-- -..- -.-- --..
            }],
tap      => [disptap(qw{
            	11 12 13 14 15 21 22 23 24 -24 25 31 32
            	33 34 35 41 42 43 44 45 51 52 53 54 55
            })],
taps     => [disptap(qw{
            	11 12 13 14 21 22 23 24 31 -31 -13 32 33
            	34 41 42 -13 43 44 15 51 52 53 -25 -31 54
            })],
ics => [
	map { '<svg width="20" height="20" viewBox="0 0 30 30">'.$_.'</svg>' }
	split /\n\n/, qq{
		<path fill="$C{blue}" d="M0,0 h30 l-7.5,15 7.5,15 h-30 z"/>
		<path fill="white" d="M0,0 h15 v30 h-15"/>

		<path fill="$C{red}" d="M0,0 h30 l-7.5,15 7.5,15 h-30 z"/>

		<path fill="$C{blue}" d="M0,0 h30v30 h-30z"/>
		<path fill="white" d="M0,6  h30 v18 h-30" />
		<path fill="$C{red}" d="M0,12 h30 v6  h-30" />

		<path fill="$C{yellow}" d="M0,0 h30v30 h-30z"/>
		<path fill="$C{blue}" d="M0,6 h30 v18 h-30"/>

		<path fill="$C{red}" d="M0,0 h30v30 h-30z"/>
		<path fill="$C{blue}" d="M0,0 h30 v15 h-30"/>

		<path fill="white" d="M0,0 h30v30 h-30z"/>
		<path fill="$C{red}" d="M15,0 l15,15 -15,15 -15,-15"/>

		<path fill="$C{blue}" d="M0,0 h30v30 h-30z"/>
		<path fill="$C{yellow}" d="M 0,0 h5 v30 h-5"/>
		<path fill="$C{yellow}" d="M10,0 h5 v30 h-5"/>
		<path fill="$C{yellow}" d="M20,0 h5 v30 h-5"/>

		<path fill="$C{red}" d="M0,0 h30v30 h-30z"/>
		<path fill="white" d="M0,0 h15 v30 h-15"/>

		<path fill="$C{yellow}" d="M0,0 h30v30 h-30z"/>
		<circle fill="black" r="7.5" cx="15" cy="15"/>

		<path fill="$C{blue}" d="M0,0 h30v30 h-30z"/>
		<path fill="white" d="M0,10 h30 v10 h-30"/>

		<path fill="$C{blue}" d="M0,0 h30v30 h-30z"/>
		<path fill="$C{yellow}" d="M0,0 h15 v30 h-15"/>

		<path fill="$C{black}" d="M0,0 h30v30 h-30z"/>
		<path fill="$C{yellow}" d="M0,0 h15 v15 h-15 M15,15 h15 v15 h-15"/>

		<path fill="white" d="M0,0 h30v30 h-30z"/>
		<path fill="$C{blue}" d="M4,0h22l-11,11 M4,30h22l-11,-11 M0,4v22l11,-11 M30,4v22l-11,-11"/>
		<!--path fill="$C{blue}" d="M3,0h24l-12,12 M3,30h24l-12,-12 M0,3v24l12,-12 M30,3v24l-12,-12"/-->

		<path fill="white" d="M0,0 h30v30 h-30z"/>
		<path fill="$C{blue}" d="
			M0,0     h7.5v7.5h-7.5 m0,7.5h7.5v7.5h-7.5
			m7.5,-15 h7.5v7.5h-7.5 m0,7.5h7.5v7.5h-7.5
			m7.5,-30 h7.5v7.5h-7.5 m0,7.5h7.5v7.5h-7.5
			m7.5,-15 h7.5v7.5h-7.5 m0,7.5h7.5v7.5h-7.5
		"/>

		<path fill="$C{yellow}" d="M0,0 h30v30 h-30z"/>
		<path fill="$C{red}" d="M0,0 h30 v30"/>

		<path fill="$C{blue}" d="M0,0 h30v30 h-30z"/>
		<path fill="white" d="M10,10 h10 v10 h-10"/>

		<path fill="$C{yellow}" d="M0,0 h30v30 h-30z"/>

		<path fill="$C{red}" d="M0,0 h30v30 h-30z"/>
		<path fill="$C{yellow}" d="M12.5,0 v30 h5 v-30"/>
		<path fill="$C{yellow}" d="M0,12.5 h30 v5 h-30"/>

		<path fill="white" d="M0,0 h30v30 h-30z"/>
		<path fill="$C{blue}" d="M10,10 h10 v10 h-10"/>

		<path fill="white" d="M0,0 h30v30 h-30z"/>
		<path fill="$C{red}" d="M0,0 h10 v30 h-10"/>
		<path fill="$C{blue}" d="M20,0 h10 v30 h-10"/>

		<path fill="white" d="M0,0 h30v30 h-30z"/>
		<path fill="$C{red}" d="M0,0 h15 v15 h-15 M15,15 h15 v15 h-15"/>

		<path fill="$C{red}" d="M0,0 h30v30 h-30z"/>
		<path fill="white" d="M4,0h22l-11,11 M4,30h22l-11,-11 M0,4v22l11,-11 M30,4v22l-11,-11"/>

		<path fill="$C{blue}" d="M0,0 h30v30 h-30z"/>
		<path fill="white" d="M5,5 h20 v20 h-20"/>
		<path fill="$C{red}" d="M10,10 h10 v10 h-10"/>

		<path fill="white" d="M0,0 h30v30 h-30z"/>
		<path fill="$C{blue}" d="M12.5,0 v30 h5 v-30"/>
		<path fill="$C{blue}" d="M0,12.5 h30 v5 h-30"/>

		<path fill="$C{red}" d="M0,0 h30v30 h-30z"/>
		<path fill="$C{yellow}" d="M0,0h6l-6,6 M12,0h6l-18,18v-6 M24,0h6l-30,30v-6
			M30,6v6l-18,18h-6 M30,18v6l-6,6h-6"/>

		<path fill="$C{black}" d="M0,0 h30v30 h-30z"/>
		<path fill="$C{blue}" d="M30,0 v31 l-15,-15"/>
		<path fill="$C{yellow}" d="M0,0  h31 l-15,15"/>
		<path fill="$C{red}" d="M0,30 h31 l-15,-15"/>
	},
],
sem => [
	map {
		local $_ = $_;
		s/[1-4]\K(?=[4-9])/ /;
		tr/1-9/↙←↖↑↗→↘↓/;
		s{(.)(?=.)}{<span style="position:absolute">$1</span>}
			or s/^/<span>/ and $_ .= '</span>';
		$_
	}
	qw(
		1 2 3 4 5  6 7 21 31 46  14 15 16 17 23
		24 25 26 27 34  35 47 56 57 36  67
	)
],
code39 => [map { tr/012/ ❘❙/r } qw{
	211012 121012 221011 112012 212011 122011 111022 211021 121021 112021
	211102 121102 221101 112102 212101 122101 111202 211201 121201 112201
	201112 102112 202111 101212 201211 102211
}],
rm4scc => [
	map { sprintf
		'<svg width="20" height="20" viewBox="0 0 8 6">'
		. '<path stroke="black" d="M1%s"/></svg>',
		join ' m2',
		map { sprintf ',%dv%dm0,-%d',
			($_ & 1 ? 0 : 2),  2 + ($_ & 2) + ($_ & 1) * 2,
			($_ & 1 ? 0 : 2) + 2 + ($_ & 2) + ($_ & 1) * 2,
		}
		split //, $_
	}
	qw(
		                    2121 2301
		0132 0312 0330 2112 2130 2310
		1023 1203 1221 3003 3021 3201
		1032 1212 1230 3012 3030 3210
		1122 1302 1320 3102 3120 3300
	)
],
wingdings => [qw{ ✌ 👌 👍 👎 ☜ ☞ ☝ ☟ ✋ ☺ 😐 ☹ 💣 ☠ ⚐ 🏱 ✈ ☼ 💧 ❄ 🕆 ✞ 🕈 ✠ ✡ ☪ }],
);
