function prepareConfigNodeSelect(node, property, type, prefix, filter, env) {
        let nodeValue
        if (prefix === 'node-input-subflow-env') {
            nodeValue = env?.value
        } else {
            nodeValue = node[property]
        }

        const addBtnId = `${prefix}-btn-${property}-add`;
        const editBtnId = `${prefix}-btn-${property}-edit`;
        const selectId = prefix + '-' + property;
        const input = $(`#${selectId}`);
        if (input.length === 0) {
            return;
        }
        const attrStyle = input.attr('style');
        let newWidth;
        let m;
        if ((m = /(^|\s|;)width\s*:\s*([^;]+)/i.exec(attrStyle)) !== null) {
            newWidth = m[2].trim();
        } else {
            newWidth = "70%";
        }
        const outerWrap = $("<div></div>").css({
            width: newWidth,
            display: 'inline-flex'
        });
        const select = $('<select id="' + selectId + '"></select>').appendTo(outerWrap);
        input.replaceWith(outerWrap);
        // set the style attr directly - using width() on FF causes a value of 114%...
        select.css({
            'flex-grow': 1
        });

        updateConfigNodeSelect(property, type, nodeValue, prefix, filter);

        // create the edit button
        const editButton = $('<a id="' + editBtnId + '" class="red-ui-button"><i class="fa fa-pencil"></i></a>')
            .css({ "margin-left": "10px" })
            .appendTo(outerWrap);

        RED.popover.tooltip(editButton, RED._('editor.editConfig', { type }));

        // create the add button
        const addButton = $('<a id="' + addBtnId + '" class="red-ui-button"><i class="fa fa-plus"></i></a>')
            .css({ "margin-left": "10px" })
            .appendTo(outerWrap);
        RED.popover.tooltip(addButton, RED._('editor.addNewConfig', { type }));

        const disableButton = function(button, disabled) {
            $(button).prop("disabled", !!disabled)
            $(button).toggleClass("disabled", !!disabled)
        };

        // add the click handler
        addButton.on("click", function (e) {
            if (addButton.prop("disabled")) { return }
            showEditConfigNodeDialog(property, type, "_ADD_", prefix, node);
            e.preventDefault();
        });
        editButton.on("click", function (e) {
            const selectedOpt = select.find(":selected")
            if (selectedOpt.data('env')) { return } // don't show the dialog for env vars items (MVP. Future enhancement: lookup the env, if present, show the associated edit dialog)
            if (editButton.prop("disabled")) { return }
            showEditConfigNodeDialog(property, type, selectedOpt.val(), prefix, node);
            e.preventDefault();
        });

        // dont permit the user to click the button if the selected option is an env var
        select.on("change", function () {
            const selectedOpt = select.find(":selected");
            const optionsLength = select.find("option").length;
            if (selectedOpt?.data('env')) {
                disableButton(addButton, true);
                disableButton(editButton, true);
            // disable the edit button if no options available or 'none' selected
            } else if (optionsLength === 1 || selectedOpt.val() === "_ADD_") {
                disableButton(addButton, false);
                disableButton(editButton, true);
            } else {
                disableButton(addButton, false);
                disableButton(editButton, false);
            }
        });

        // If the value is "", 'add new...' option if no config node available or 'none' option
        // Otherwise, it's a config node
        select.val(nodeValue || '_ADD_');
    }
Create a config-node select box for this property
@param  {Object} node - the node being edited
@param {String} property - the name of the node property
@param {String} type - the type of the config-node
@param {"node-config-input"|"node-input"|"node-input-subflow-env"} prefix - the prefix to use in the input element ids
@param {Function} [filter] - a function to filter the list of config nodes
@param {Object} [env] - the environment variable object (only used for subflow env vars)