"),this.$document=$(this.getElementDocument()),this.$element.on("mousedown",this.onMouseDown.bind(this)),this.$head.addClass("oo-ui-window-head"),this.$body.addClass("oo-ui-window-body"),this.$foot.addClass("oo-ui-window-foot"),this.$content.append(this.$head,this.$body,this.$foot),this},a.ui.Window.prototype.onFocusTrapFocused=function(t){var e=this.$focusTrapBefore.is(t.target),i=a.ui.findFocusable(this.$content,e);i?i.focus():this.$content.trigger("focus")},a.ui.Window.prototype.open=function(t){if(!this.manager)throw new Error("Cannot open window, must be attached to a manager");return this.manager.openWindow(this,t)},a.ui.Window.prototype.close=function(t){if(!this.manager)throw new Error("Cannot close window, must be attached to a manager");return this.manager.closeWindow(this,t)},a.ui.Window.prototype.setup=function(t){var e=this;return this.toggle(!0),this.focusTrapHandler=a.ui.bind(this.onFocusTrapFocused,this),this.$focusTraps.on("focus",this.focusTrapHandler),this.getSetupProcess(t).execute().then(function(){e.updateSize(),e.$element.addClass("oo-ui-window-active oo-ui-window-setup").width(),e.$content.addClass("oo-ui-window-content-setup").width()})},a.ui.Window.prototype.ready=function(t){var e=this;return this.$content.trigger("focus"),this.getReadyProcess(t).execute().then(function(){e.$element.addClass("oo-ui-window-ready").width(),e.$content.addClass("oo-ui-window-content-ready").width()})},a.ui.Window.prototype.hold=function(t){var e=this;return this.getHoldProcess(t).execute().then(function(){var t=e.$content.find(a.ui.Element.static.getDocument(e.$content).activeElement);t.length&&t[0].blur(),e.$element.removeClass("oo-ui-window-ready oo-ui-window-setup").width(),e.$content.removeClass("oo-ui-window-content-ready oo-ui-window-content-setup").width()})},a.ui.Window.prototype.teardown=function(t){var e=this;return this.getTeardownProcess(t).execute().then(function(){e.$element.removeClass("oo-ui-window-active").width(),e.$focusTraps.off("focus",e.focusTrapHandler),e.toggle(!1)})},a.ui.Dialog=function(t){a.ui.Dialog.super.call(this,t),a.ui.mixin.PendingElement.call(this),this.actions=new a.ui.ActionSet,this.attachedActions=[],this.currentAction=null,this.onDialogKeyDownHandler=this.onDialogKeyDown.bind(this),this.actions.connect(this,{click:"onActionClick",change:"onActionsChange"}),this.$element.addClass("oo-ui-dialog").attr("role","dialog")},a.inheritClass(a.ui.Dialog,a.ui.Window),a.mixinClass(a.ui.Dialog,a.ui.mixin.PendingElement),a.ui.Dialog.static.name="",a.ui.Dialog.static.title="",a.ui.Dialog.static.actions=[],a.ui.Dialog.static.escapable=!0,a.ui.Dialog.prototype.onDialogKeyDown=function(t){var e;t.which===a.ui.Keys.ESCAPE&&this.constructor.static.escapable?(this.executeAction(""),t.preventDefault(),t.stopPropagation()):t.which===a.ui.Keys.ENTER&&(t.ctrlKey||t.metaKey)&&0<(e=this.actions.get({flags:"primary",visible:!0,disabled:!1})).length&&(this.executeAction(e[0].getAction()),t.preventDefault(),t.stopPropagation())},a.ui.Dialog.prototype.onActionClick=function(t){this.isPending()||this.executeAction(t.getAction())},a.ui.Dialog.prototype.onActionsChange=function(){this.detachActions(),this.isClosing()||(this.attachActions(),this.isOpening()||this.updateSize())},a.ui.Dialog.prototype.getActions=function(){return this.actions},a.ui.Dialog.prototype.getActionProcess=function(t){return(new a.ui.Process).next(function(){t||this.close()},this)},a.ui.Dialog.prototype.getSetupProcess=function(o){return o=o||{},a.ui.Dialog.super.prototype.getSetupProcess.call(this,o).next(function(){var t=this.constructor.static,e=void 0!==o.actions?o.actions:t.actions,i=void 0!==o.title?o.title:t.title;this.title.setLabel(i).setTitle(i),this.actions.add(this.getActionWidgets(e)),this.$element.on("keydown",this.onDialogKeyDownHandler)},this)},a.ui.Dialog.prototype.getTeardownProcess=function(t){return a.ui.Dialog.super.prototype.getTeardownProcess.call(this,t).first(function(){this.$element.off("keydown",this.onDialogKeyDownHandler),this.actions.clear(),this.currentAction=null},this)},a.ui.Dialog.prototype.initialize=function(){a.ui.Dialog.super.prototype.initialize.call(this),this.title=new a.ui.LabelWidget,this.$content.addClass("oo-ui-dialog-content"),this.$element.attr("aria-labelledby",this.title.getElementId()),this.setPendingElement(this.$head)},a.ui.Dialog.prototype.getActionWidgets=function(t){var e,i,o=[];for(e=0,i=t.length;e
"),this.container=new a.ui.PanelLayout({scrollable:!0,classes:["oo-ui-messageDialog-container"]}),this.text=new a.ui.PanelLayout({padded:!0,expanded:!1,classes:["oo-ui-messageDialog-text"]}),this.message=new a.ui.LabelWidget({classes:["oo-ui-messageDialog-message"]}),this.title.$element.addClass("oo-ui-messageDialog-title"),this.$content.addClass("oo-ui-messageDialog-content"),this.container.$element.append(this.text.$element),this.text.$element.append(this.title.$element,this.message.$element),this.$body.append(this.container.$element),this.$actions.addClass("oo-ui-messageDialog-actions"),this.$foot.append(this.$actions)},a.ui.MessageDialog.prototype.getActionWidgetConfig=function(t){return $.extend({},t,{framed:!1})},a.ui.MessageDialog.prototype.attachActions=function(){var t,e,i,o;for(a.ui.MessageDialog.super.prototype.attachActions.call(this),i=this.actions.getSpecial(),o=this.actions.getOthers(),i.safe&&(this.$actions.append(i.safe.$element),i.safe.toggleFramed(!0)),t=0,e=o.length;ti.$element[0].clientWidth){this.toggleVerticalActionLayout(!0);break}this.$body.css("bottom",this.$foot.outerHeight(!0)),this.verticalActionLayout!==o&&this.updateSize()},a.ui.ProcessDialog=function(t){a.ui.ProcessDialog.super.call(this,t),this.fitOnOpen=!1,this.$element.addClass("oo-ui-processDialog"),a.ui.isMobile()&&this.$element.addClass("oo-ui-isMobile")},a.inheritClass(a.ui.ProcessDialog,a.ui.Dialog),a.ui.ProcessDialog.prototype.onDismissErrorButtonClick=function(){this.hideErrors()},a.ui.ProcessDialog.prototype.onRetryButtonClick=function(){this.hideErrors(),this.executeAction(this.currentAction)},a.ui.ProcessDialog.prototype.initialize=function(){a.ui.ProcessDialog.super.prototype.initialize.call(this),this.$navigation=$(""),this.$location=$("
"),this.$safeActions=$("
"),this.$primaryActions=$("
"),this.$otherActions=$("
"),this.dismissButton=new a.ui.ButtonWidget({label:a.ui.msg("ooui-dialog-process-dismiss")}),this.retryButton=new a.ui.ButtonWidget,this.$errors=$("
"),this.$errorsTitle=$("
"),this.dismissButton.connect(this,{click:"onDismissErrorButtonClick"}),this.retryButton.connect(this,{click:"onRetryButtonClick"}),this.title.connect(this,{labelChange:"fitLabel"}),this.title.$element.addClass("oo-ui-processDialog-title"),this.$location.append(this.title.$element).addClass("oo-ui-processDialog-location"),this.$safeActions.addClass("oo-ui-processDialog-actions-safe"),this.$primaryActions.addClass("oo-ui-processDialog-actions-primary"),this.$otherActions.addClass("oo-ui-processDialog-actions-other"),this.$errorsTitle.addClass("oo-ui-processDialog-errors-title").text(a.ui.msg("ooui-dialog-process-error")),this.$errors.addClass("oo-ui-processDialog-errors oo-ui-element-hidden").append(this.$errorsTitle,$("
").addClass("oo-ui-processDialog-errors-actions").append(this.dismissButton.$element,this.retryButton.$element)),this.$content.addClass("oo-ui-processDialog-content").append(this.$errors),this.$navigation.addClass("oo-ui-processDialog-navigation").append(this.$primaryActions,this.$location,this.$safeActions),this.$head.append(this.$navigation),this.$foot.append(this.$otherActions)},a.ui.ProcessDialog.prototype.getActionWidgetConfig=function(e){function t(t){return e.flags===t||Array.isArray(e.flags)&&-1!==e.flags.indexOf(t)}return e=$.extend({framed:!0},e),t("close")?$.extend(e,{icon:"close",invisibleLabel:!0}):t("back")&&$.extend(e,{icon:"previous",invisibleLabel:!0}),e},a.ui.ProcessDialog.prototype.attachActions=function(){var t,e,i,o,n;for(a.ui.ProcessDialog.super.prototype.attachActions.call(this),o=this.actions.getSpecial(),n=this.actions.getOthers(),o.primary&&this.$primaryActions.append(o.primary.$element),t=0,e=n.length;t