How is the `mage.modal` jQuery UI widget implemented?

See also: