openModal( name, context = null, data = null, priority ) {
		if ( !getOwner( this ).hasRegistration( `component:modal-${name}` ) ) {
			throw new Error( `Modal component 'modal-${name}' does not exist` );
		}

		context = context || {};
		priority <<= 0;

		if ( typeof context !== "object" ) {
			throw new Error( "Missing context object" );
		}

		if ( data ) {
			setProperties( context, data );
		}

		const { modals } = this;
		const idx = modals.findIndex( ({ name: n, context: c }) => n === name && c === context );
		let pos = modals.findIndex( ({ priority: p }) => p > priority );
		if ( pos === -1 ) {
			pos = modals.length;
		}

		// create new modal dialog
		if ( idx === -1 ) {
			modals.insertAt( pos, { name, context, priority } );
			this.trigger( "open", name, context, priority );

		} else {
			const obj = modals.objectAt( idx );
			obj.priority = priority;

			// set new position of existing modal dialog only if a different priority justifies it
			if ( idx !== pos ) {
				modals.removeAt( idx );
				if ( pos > idx ) {
					--pos;
				}
				modals.insertAt( pos, obj );
			}
		}

		return context;
	}
@param {string} name
@param {Object?} context
@param {Object?} data
@param {number?} priority
@returns {Object} context