protected function parseActions(array $actions, $renderer = false)
    {
        $this->actionsPriority = $this->defaultActionPriority();

        $parsedActions = [];
        foreach ($actions as $ident => $action) {
            $ident  = $this->parseActionIdent($ident, $action);
            $action = $this->parseActionItem($action, $ident, $renderer);

            if (!isset($action['priority'])) {
                $action['priority'] = $this->actionsPriority++;
            }

            if (isset($parsedActions[$ident])) {
                $hasPriority = ($action['priority'] > $parsedActions[$ident]['priority']);
                if ($hasPriority || $action['isSubmittable']) {
                    $parsedActions[$ident] = array_replace($parsedActions[$ident], $action);
                } else {
                    $parsedActions[$ident] = array_replace($action, $parsedActions[$ident]);
                }
            } else {
                $parsedActions[$ident] = $action;
            }
        }

        usort($parsedActions, [ $this, 'sortActionsByPriority' ]);

        while (($first = reset($parsedActions)) && $first['isSeparator']) {
            array_shift($parsedActions);
        }

        while (($last = end($parsedActions)) && $last['isSeparator']) {
            array_pop($parsedActions);
        }

        return $parsedActions;
    }