<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/usr/bin/env perl
use MIME::Base64;

for (&lt;&gt;) {
    unless (/^'([{}])(\d+)\1(.+?)',$/) {
        print;
        next;
    }

    my ($dir, $amt, $b64) = ($1, $2, $3);

    my $decoded = MIME::Base64::decode($b64) or die "Could not base64-decode line `$_`";

    my $decoded_escaped = join "", map { "\\x$_" } unpack("(H2)*", $decoded);

    print "'${dir}${amt}${dir}${decoded_escaped}',\n";
}
</pre></body></html>