prototype(Neos.Form.Builder:NodeBasedFormElement) {
    element {
        @context.elementId = ${elementNode.properties.identifier}

        defaultValue = Neos.Fusion:Case {
            valueParsed {
                condition = ${request.httpRequest.arguments[elementId] != null}
                renderer = ${request.httpRequest.arguments[elementId]}
            }
            default {
                condition = true
                renderer = ${elementNode.properties.defaultValue}
            }
        }
        labelCleaned = Neos.Fusion:Case {
            isSection {
                condition = ${q(elementNode).is('[instanceof Neos.Form.Builder:Section]')}
                renderer = ${null}
            }
            hasDefaultLabel {
                condition = ${elementNode.properties.label == 'Label'}
                renderer = ${null}
            }
            hasDuplicate {
                condition = ${q(documentNode).children('[instanceof Neos.Neos:ContentCollection]').find("[instanceof Neos.Form.Builder:FormElement][label='" + elementNode.properties.label + "']").count() > 1}
                renderer = ${null}
            }
            default {
                condition = true
                renderer = ${String.pregReplace(elementNode.properties.label, '/[^a-zA-Z0-9]+/', '')}
            }
        }

        @context.labelCleaned = ${this.labelCleaned}

        identifier = Neos.Fusion:Case {
            identifier {
                condition = ${elementNode.properties.identifier}
                renderer = ${elementNode.properties.identifier}
            }
            label {
                condition = ${labelCleaned}
                renderer = ${labelCleaned}
            }
            default {
                condition = ${true}
                renderer = ${elementNode.identifier}
            }
        }
    }
}
