Please help debug this script

I’m looking to target each bar that precedes an inside bar (source bar) and have it’s bar height printed out above and below the source bar. I’m missing something here, it’s not printing anything.

const predef = require("./tools/predef");
const { px, du, op, min } = require("./tools/graphics");

class SourceHeight {

     map(d, i, history) {
 
        const prior = history.prior();
        if (!prior) {
            return;
        }
        
        let isInside = false;
        if ( prior.high() > d.high() && prior.low() < d.low() )
            isInside = true;
        
        const rtn = {};

        if (isInside) {

            let hVal = prior.high() - prior.low();
            hVal = txtVal.toFixed(2);
                
            let items = [];
            let top;
            let bottom;
                  
            top = {
                tag: 'Text',
                key: 'height1',
                point: {
                    x: du(prior.index()),
                    y: op(du(prior.high()), "-", px(18))
                },
                text: hVal,
                style: { fontSize: 13, fontWeight: "normal", fill: "#F00" },
                textAlignment: 'centerMiddle',
                global: true,
            };
            bottom = {
                tag: 'Text',
                key: 'height2',
                point: {
                    x: du(prior.index()),
                    y: op(du(prior.low()), "+", px(18))
                },
                text: htxtVal,
                style: { fontSize: 13, fontWeight: "normal", fill: "#F00" },
                textAlignment: 'centerMiddle',
                global: true,
            };
                    
            items.push(top);
            items.push(bottom);
            rtn["graphics"] = { items };
                
        }
            return rtn;
            
        }
}

module.exports = {
    name: "DEL_Source Height",
    description: "Source Height",
    tags: ['DEL Custom'],
    calculator: SourceHeight,
    params: { }
};