Your IP : 216.73.216.26


Current Path : /home2/wtmwscom/public_html/post/scripts/
Upload File :
Current File : /home2/wtmwscom/public_html/post/scripts/Portal_017.js

define("Portal.Careers.CareerLoginModal.mvc$model", ["OutSystems/ClientRuntime/Main", "Portal.model", "MultiLingual.controller", "Portal.controller", "MultiLingual.controller$GetTranslation", "Portal.referencesHealth", "Portal.referencesHealth$MultiLingual", "Portal.controller$ClickSubmit", "Portal.model$OSLoginRequestRec", "Portal.model$OSLoginRec", "Portal.controller$CacheUserSession", "Portal.controller$UserLogout", "Portal.model$PostVerifyRequestRec", "Portal.model$PostVerifyResponseRec", "Portal.model$ItemFromCartRec", "Portal.controller$RequireCaptcha"], function (OutSystems, PortalModel, MultiLingualController, PortalController) {
var OS = OutSystems.Internal;

var IsCaptchaEnabledDataActRec = (function (_super) {
__extends(IsCaptchaEnabledDataActRec, _super);
function IsCaptchaEnabledDataActRec(defaults) {
_super.apply(this, arguments);
}
IsCaptchaEnabledDataActRec.attributesToDeclare = function () {
return [
this.attr("Result", "resultOut", "Result", true, false, OS.Types.Boolean, function () {
return false;
}, true)
].concat(_super.attributesToDeclare.call(this));
};
IsCaptchaEnabledDataActRec.fromStructure = function (str) {
return new IsCaptchaEnabledDataActRec(new IsCaptchaEnabledDataActRec.RecordClass({
resultOut: OS.DataTypes.ImmutableBase.getData(str)
}));
};
IsCaptchaEnabledDataActRec.init();
return IsCaptchaEnabledDataActRec;
})(OS.Model.DataSourceRecord);
var CaptchaConfigDataActRec = (function (_super) {
__extends(CaptchaConfigDataActRec, _super);
function CaptchaConfigDataActRec(defaults) {
_super.apply(this, arguments);
}
CaptchaConfigDataActRec.attributesToDeclare = function () {
return [
this.attr("Result", "resultOut", "Result", true, false, OS.Types.Boolean, function () {
return false;
}, true), 
this.attr("ScoreThreshold", "scoreThresholdOut", "ScoreThreshold", true, false, OS.Types.Decimal, function () {
return OS.DataTypes.Decimal.defaultValue;
}, true)
].concat(_super.attributesToDeclare.call(this));
};
CaptchaConfigDataActRec.init();
return CaptchaConfigDataActRec;
})(OS.Model.DataSourceRecord);

var VariablesRecord = (function (_super) {
__extends(VariablesRecord, _super);
function VariablesRecord(defaults) {
_super.apply(this, arguments);
}
VariablesRecord.attributesToDeclare = function () {
return [
this.attr("Username", "usernameVar", "Username", true, false, OS.Types.Text, function () {
return "";
}, false), 
this.attr("Password", "passwordVar", "Password", true, false, OS.Types.Text, function () {
return "";
}, false), 
this.attr("ErrorMessage", "errorMessageVar", "ErrorMessage", true, false, OS.Types.Text, function () {
return "";
}, false), 
this.attr("DisplayErrorMessage", "displayErrorMessageVar", "DisplayErrorMessage", true, false, OS.Types.Boolean, function () {
return false;
}, false), 
this.attr("IsLoggingUserIn", "isLoggingUserInVar", "IsLoggingUserIn", true, false, OS.Types.Boolean, function () {
return false;
}, false), 
this.attr("IsRedirectingToRegistration", "isRedirectingToRegistrationVar", "IsRedirectingToRegistration", true, false, OS.Types.Boolean, function () {
return false;
}, false), 
this.attr("CaptchaToken", "captchaTokenVar", "CaptchaToken", true, false, OS.Types.Text, function () {
return "";
}, false), 
this.attr("ExtendedClass", "extendedClassIn", "ExtendedClass", true, false, OS.Types.Text, function () {
return "";
}, false), 
this.attr("_extendedClassInDataFetchStatus", "_extendedClassInDataFetchStatus", "_extendedClassInDataFetchStatus", true, false, OS.Types.Integer, function () {
return /*Fetched*/ 1;
}, false), 
this.attr("ShowModal", "showModalIn", "ShowModal", true, false, OS.Types.Boolean, function () {
return false;
}, false), 
this.attr("_showModalInDataFetchStatus", "_showModalInDataFetchStatus", "_showModalInDataFetchStatus", true, false, OS.Types.Integer, function () {
return /*Fetched*/ 1;
}, false), 
this.attr("locale", "localeIn", "locale", true, false, OS.Types.Text, function () {
return "";
}, false), 
this.attr("_localeInDataFetchStatus", "_localeInDataFetchStatus", "_localeInDataFetchStatus", true, false, OS.Types.Integer, function () {
return /*Fetched*/ 1;
}, false), 
this.attr("IsCaptchaEnabled", "isCaptchaEnabledDataAct", "isCaptchaEnabledDataAct", true, true, OS.Types.Record, function () {
return OS.DataTypes.ImmutableBase.getData(new IsCaptchaEnabledDataActRec());
}, true, IsCaptchaEnabledDataActRec), 
this.attr("CaptchaConfig", "captchaConfigDataAct", "captchaConfigDataAct", true, true, OS.Types.Record, function () {
return OS.DataTypes.ImmutableBase.getData(new CaptchaConfigDataActRec());
}, true, CaptchaConfigDataActRec)
].concat(_super.attributesToDeclare.call(this));
};
VariablesRecord.init();
return VariablesRecord;
})(OS.DataTypes.GenericRecord);
var WidgetsRecord = (function (_super) {
__extends(WidgetsRecord, _super);
function WidgetsRecord() {
_super.apply(this, arguments);
}
WidgetsRecord.getWidgetsType = function () {
return {
Form1: OS.Model.ValidationWidgetRecord,
Input_Username: OS.Model.ValidationWidgetRecord,
Input_Password: OS.Model.ValidationWidgetRecord
};
};

return WidgetsRecord;
})(OS.Model.BaseWidgetRecordMap);
var Model = (function (_super) {
__extends(Model, _super);
function Model() {
_super.apply(this, arguments);
}
Model.getVariablesRecordConstructor = function () {
return VariablesRecord;
};
Model.getWidgetsRecordConstructor = function () {
return WidgetsRecord;
};
Object.defineProperty(Model, "hasValidationWidgets", {
enumerable: true,
configurable: true,
get: function () {
return true;
}
});

Model.prototype.setInputs = function (inputs) {
if("ExtendedClass" in inputs) {
this.variables.extendedClassIn = inputs.ExtendedClass;
if("_extendedClassInDataFetchStatus" in inputs) {
this.variables._extendedClassInDataFetchStatus = inputs._extendedClassInDataFetchStatus;
}

}

if("ShowModal" in inputs) {
this.variables.showModalIn = inputs.ShowModal;
if("_showModalInDataFetchStatus" in inputs) {
this.variables._showModalInDataFetchStatus = inputs._showModalInDataFetchStatus;
}

}

if("locale" in inputs) {
this.variables.localeIn = inputs.locale;
if("_localeInDataFetchStatus" in inputs) {
this.variables._localeInDataFetchStatus = inputs._localeInDataFetchStatus;
}

}

};
return Model;
})(OS.Model.BaseViewModel);
return new OS.Model.ModelFactory(Model);
});
define("Portal.Careers.CareerLoginModal.mvc$view", ["OutSystems/ClientRuntime/Main", "Portal.model", "Portal.controller", "MultiLingual.controller", "react", "OutSystems/ReactView/Main", "Portal.Careers.CareerLoginModal.mvc$model", "Portal.Careers.CareerLoginModal.mvc$controller", "Portal.clientVariables", "Portal.EP_Common.Modal.mvc$view", "OutSystems/ReactWidgets/Main", "Portal.EP_Common.Title.mvc$view", "Portal.EP_Common.Tagline.mvc$view", "Portal.EP_Inputs.Input.mvc$view", "Portal.EP_FormComponents.Captcha.mvc$view", "Portal.EP_Common.ErrorMessage.mvc$view", "Portal.EP_Common.CaptchaBrandingMessage.mvc$view", "Portal.EP_FormComponents.TwoButtonContainer.mvc$view", "Portal.EP_Buttons.ButtonTransparent.mvc$view", "Portal.EP_Buttons.ButtonPrimary.mvc$view", "MultiLingual.controller$GetTranslation", "Portal.referencesHealth", "Portal.referencesHealth$MultiLingual", "Portal.controller$ClickSubmit", "Portal.model$OSLoginRequestRec", "Portal.model$OSLoginRec", "Portal.controller$CacheUserSession", "Portal.controller$UserLogout", "Portal.model$PostVerifyRequestRec", "Portal.model$PostVerifyResponseRec", "Portal.model$ItemFromCartRec", "Portal.controller$RequireCaptcha"], function (OutSystems, PortalModel, PortalController, MultiLingualController, React, OSView, Portal_Careers_CareerLoginModal_mvc_model, Portal_Careers_CareerLoginModal_mvc_controller, PortalClientVariables, Portal_EP_Common_Modal_mvc_view, OSWidgets, Portal_EP_Common_Title_mvc_view, Portal_EP_Common_Tagline_mvc_view, Portal_EP_Inputs_Input_mvc_view, Portal_EP_FormComponents_Captcha_mvc_view, Portal_EP_Common_ErrorMessage_mvc_view, Portal_EP_Common_CaptchaBrandingMessage_mvc_view, Portal_EP_FormComponents_TwoButtonContainer_mvc_view, Portal_EP_Buttons_ButtonTransparent_mvc_view, Portal_EP_Buttons_ButtonPrimary_mvc_view) {
    var OS = OutSystems.Internal;
var PlaceholderContent = OSView.Widget.PlaceholderContent;
var IteratorPlaceholderContent = OSView.Widget.IteratorPlaceholderContent;


    var View = (function (_super) {
        __extends(View,_super);
        function View() {
            try {
                this.initialize.apply(this, arguments);
            } catch (error) {
                View.handleError(error);
                throw error;
            }
        }
        View.prototype.initialize = function() {
            _super.apply(this, arguments);
        };
        View.displayName = "Careers.CareerLoginModal";
        View.getCssDependencies = function() {
            return ["css/OutSystemsReactWidgets.css"];
        };
        View.getJsDependencies = function() {
            return [];
        };
        View.getBlocks = function() {
            return [Portal_EP_Common_Modal_mvc_view, Portal_EP_Common_Title_mvc_view, Portal_EP_Common_Tagline_mvc_view, Portal_EP_Inputs_Input_mvc_view, Portal_EP_FormComponents_Captcha_mvc_view, Portal_EP_Common_ErrorMessage_mvc_view, Portal_EP_Common_CaptchaBrandingMessage_mvc_view, Portal_EP_FormComponents_TwoButtonContainer_mvc_view, Portal_EP_Buttons_ButtonTransparent_mvc_view, Portal_EP_Buttons_ButtonPrimary_mvc_view];
        };
        Object.defineProperty(View.prototype, "modelFactory", {
            get: function () {
                return Portal_Careers_CareerLoginModal_mvc_model;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(View.prototype, "controllerFactory", {
            get: function () {
                return Portal_Careers_CareerLoginModal_mvc_controller;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(View.prototype, "title", {
            get: function () {
                return "";
            },
            enumerable: true,
            configurable: true
        });
        View.prototype.internalRender = function() {
            var model = this.model;
            var controller = this.controller;
            var idService = this.idService;
            var validationService = controller.validationService;
            var widgetsRecordProvider = this.widgetsRecordProvider;
            var callContext = controller.callContext();
            var $if = View.ifWidget;
            var asPrimitiveValue = View.asPrimitiveValue;
            var _this = this;

            return React.createElement("div", this.getRootNodeProperties(), React.createElement(Portal_EP_Common_Modal_mvc_view, {
inputs: {
ShouldDisplayCloseButton: true,
ExtendedClass: (("LoginModal " + " ") + model.variables.extendedClassIn),
_extendedClassInDataFetchStatus: OS.Model.calculateDataFetchStatus(model.variables._extendedClassInDataFetchStatus),
HasSpecialTopBorder: false,
ShowModal: model.variables.showModalIn,
_showModalInDataFetchStatus: OS.Model.calculateDataFetchStatus(model.variables._showModalInDataFetchStatus)
},
events: {
_handleError: function (ex) {
controller.handleError(ex);
},
closeModalRequested$Action: function () {
var eventHandlerContext = callContext.clone();
controller.requestCloseLoginModal$Action(controller.callContext(eventHandlerContext));

;
}
},
_validationProps: {
validationService: validationService
},
_idProps: {
service: idService,
name: "Modal",
alias: "1"
},
_widgetRecordProvider: widgetsRecordProvider,
placeholders: {
content: new PlaceholderContent(function () {
return [React.createElement(OSWidgets.Container, {
align: /*Default*/ 0,
animate: false,
visible: true,
_idProps: {
service: idService,
name: "LogInFormContainer"
},
_widgetRecordProvider: widgetsRecordProvider
}, React.createElement(OSWidgets.Form, {
_validationProps: {
validationService: validationService
},
gridProperties: {
classes: "OSFillParent"
},
style: "form card LoginForm ",
_idProps: {
service: idService,
name: "Form1"
},
_widgetRecordProvider: widgetsRecordProvider
}, React.createElement(OSWidgets.Container, {
align: /*Default*/ 0,
animate: false,
style: "modal-top",
visible: true,
_idProps: {
service: idService,
uuid: "3"
},
_widgetRecordProvider: widgetsRecordProvider
}, React.createElement(OSWidgets.Container, {
align: /*Default*/ 0,
animate: false,
style: "Header",
visible: true,
_idProps: {
service: idService,
name: "Header"
},
_widgetRecordProvider: widgetsRecordProvider
}, React.createElement(Portal_EP_Common_Title_mvc_view, {
inputs: {
HasBottomMargin: false,
TitleColor: "var(--color-neutral-10)"
},
events: {
_handleError: function (ex) {
controller.handleError(ex);
}
},
_validationProps: {
validationService: validationService,
validationParentId: idService.getId("Form1")
},
_idProps: {
service: idService,
name: "Title",
alias: "2"
},
_widgetRecordProvider: widgetsRecordProvider,
placeholders: {
icon: PlaceholderContent.Empty,
text: new PlaceholderContent(function () {
return [React.createElement(OSWidgets.Text, {
extendedProperties: {
"data-trans": "careers-login-title"
},
text: ["Career Portal Login"],
_idProps: {
service: idService,
uuid: "6"
},
_widgetRecordProvider: widgetsRecordProvider
})];
})
},
_dependencies: []
}), React.createElement(Portal_EP_Common_Tagline_mvc_view, {
inputs: {
HasBottomMargin: false,
TextColor: "var(--color-neutral-6)"
},
events: {
_handleError: function (ex) {
controller.handleError(ex);
}
},
_validationProps: {
validationService: validationService,
validationParentId: idService.getId("Form1")
},
_idProps: {
service: idService,
name: "Tagline",
alias: "3"
},
_widgetRecordProvider: widgetsRecordProvider,
placeholders: {
tagline: new PlaceholderContent(function () {
return [React.createElement(OSWidgets.Text, {
extendedProperties: {
"data-trans": "careers-login-tagline"
},
text: ["Do note that Career Portal requires different credentials from the main EPG website."],
_idProps: {
service: idService,
uuid: "8"
},
_widgetRecordProvider: widgetsRecordProvider
})];
})
},
_dependencies: []
}))), React.createElement(OSWidgets.Container, {
align: /*Default*/ 0,
animate: false,
style: "modal-content",
visible: true,
_idProps: {
service: idService,
uuid: "9"
},
_widgetRecordProvider: widgetsRecordProvider
}, React.createElement(Portal_EP_Inputs_Input_mvc_view, {
inputs: {},
events: {
_handleError: function (ex) {
controller.handleError(ex);
}
},
_validationProps: {
validationService: validationService,
validationParentId: idService.getId("Form1")
},
_idProps: {
service: idService,
name: "UsernameTextInput",
alias: "4"
},
_widgetRecordProvider: widgetsRecordProvider,
placeholders: {
label: new PlaceholderContent(function () {
return [React.createElement(OSWidgets.Text, {
extendedProperties: {
"data-trans": "home-login-user-title"
},
text: ["Email"],
_idProps: {
service: idService,
uuid: "11"
},
_widgetRecordProvider: widgetsRecordProvider
})];
}),
input: new PlaceholderContent(function () {
return [React.createElement(OSWidgets.Input, {
_validationProps: {
validationService: validationService,
validationParentId: idService.getId("Form1")
},
enabled: true,
gridProperties: {
classes: "OSFillParent"
},
inputType: /*Text*/ 0,
mandatory: true,
maxLength: 50,
prompt: "example@example.com",
style: "form-control",
variable: model.createVariable(OS.Types.Text, model.variables.usernameVar, function (value) {
model.variables.usernameVar = value;
}),
_idProps: {
service: idService,
name: "Input_Username"
},
_widgetRecordProvider: widgetsRecordProvider
})];
})
},
_dependencies: [asPrimitiveValue(model.variables.usernameVar)]
}), React.createElement(Portal_EP_Inputs_Input_mvc_view, {
inputs: {},
events: {
_handleError: function (ex) {
controller.handleError(ex);
}
},
_validationProps: {
validationService: validationService,
validationParentId: idService.getId("Form1")
},
_idProps: {
service: idService,
name: "PasswordTextInput",
alias: "5"
},
_widgetRecordProvider: widgetsRecordProvider,
placeholders: {
label: new PlaceholderContent(function () {
return [React.createElement(OSWidgets.Text, {
extendedProperties: {
"data-trans": "home-login-pass-title"
},
text: ["Password"],
_idProps: {
service: idService,
uuid: "14"
},
_widgetRecordProvider: widgetsRecordProvider
})];
}),
input: new PlaceholderContent(function () {
return [React.createElement(OSWidgets.Input, {
_validationProps: {
validationService: validationService,
validationParentId: idService.getId("Form1")
},
enabled: true,
gridProperties: {
classes: "OSFillParent"
},
inputType: /*Password*/ 1,
mandatory: true,
maxLength: 30,
style: " form-control",
variable: model.createVariable(OS.Types.Text, model.variables.passwordVar, function (value) {
model.variables.passwordVar = value;
}),
_idProps: {
service: idService,
name: "Input_Password"
},
_widgetRecordProvider: widgetsRecordProvider
})];
})
},
_dependencies: [asPrimitiveValue(model.variables.passwordVar)]
}), React.createElement(Portal_EP_FormComponents_Captcha_mvc_view, {
inputs: {},
events: {
_handleError: function (ex) {
controller.handleError(ex);
}
},
_validationProps: {
validationService: validationService,
validationParentId: idService.getId("Form1")
},
_idProps: {
service: idService,
uuid: "16",
alias: "6"
},
_widgetRecordProvider: widgetsRecordProvider,
_dependencies: []
}), React.createElement(OSWidgets.Container, {
align: /*Default*/ 0,
animate: false,
style: "RememberUserAndResetPassword",
visible: true,
_idProps: {
service: idService,
name: "RememberUserAndResetPassword"
},
_widgetRecordProvider: widgetsRecordProvider
}, React.createElement(OSWidgets.Container, {
align: /*Default*/ 0,
animate: false,
style: "ResetPassword",
visible: true,
_idProps: {
service: idService,
name: "ResetPassword"
},
_widgetRecordProvider: widgetsRecordProvider
}, React.createElement(OSWidgets.Link, {
enabled: true,
onClick: function () {
var eventHandlerContext = callContext.clone();
controller.forgotPassword$Action(controller.callContext(eventHandlerContext));

;
},
visible: true,
_idProps: {
service: idService,
uuid: "19"
},
_widgetRecordProvider: widgetsRecordProvider
}, React.createElement(OSWidgets.Text, {
extendedProperties: {
"data-trans": "home-login-forgot-label"
},
text: ["Forgot Credentials"],
_idProps: {
service: idService,
uuid: "20"
},
_widgetRecordProvider: widgetsRecordProvider
})))), React.createElement(Portal_EP_Common_ErrorMessage_mvc_view, {
inputs: {
Text: model.variables.errorMessageVar,
ShouldShow: model.variables.displayErrorMessageVar
},
events: {
_handleError: function (ex) {
controller.handleError(ex);
}
},
_validationProps: {
validationService: validationService,
validationParentId: idService.getId("Form1")
},
_idProps: {
service: idService,
uuid: "21",
alias: "7"
},
_widgetRecordProvider: widgetsRecordProvider,
_dependencies: []
})), React.createElement(OSWidgets.Container, {
align: /*Default*/ 0,
animate: false,
style: "modal-footer",
visible: true,
_idProps: {
service: idService,
uuid: "22"
},
_widgetRecordProvider: widgetsRecordProvider
}, React.createElement(OSWidgets.Container, {
align: /*Default*/ 0,
animate: false,
style: "Actions",
visible: true,
_idProps: {
service: idService,
name: "Actions"
},
_widgetRecordProvider: widgetsRecordProvider
}, React.createElement(Portal_EP_Common_CaptchaBrandingMessage_mvc_view, {
inputs: {
ShouldShow: model.variables.captchaConfigDataAct.resultOut,
_shouldShowInDataFetchStatus: OS.Model.calculateDataFetchStatus(model.variables.captchaConfigDataAct.dataFetchStatusAttr)
},
events: {
_handleError: function (ex) {
controller.handleError(ex);
}
},
_validationProps: {
validationService: validationService,
validationParentId: idService.getId("Form1")
},
_idProps: {
service: idService,
uuid: "24",
alias: "8"
},
_widgetRecordProvider: widgetsRecordProvider,
_dependencies: []
}), React.createElement(OSWidgets.Container, {
align: /*Default*/ 0,
animate: false,
style: "margin-top-m",
visible: true,
_idProps: {
service: idService,
uuid: "25"
},
_widgetRecordProvider: widgetsRecordProvider
}, React.createElement(Portal_EP_FormComponents_TwoButtonContainer_mvc_view, {
inputs: {},
events: {
_handleError: function (ex) {
controller.handleError(ex);
}
},
_validationProps: {
validationService: validationService,
validationParentId: idService.getId("Form1")
},
_idProps: {
service: idService,
uuid: "26",
alias: "9"
},
_widgetRecordProvider: widgetsRecordProvider,
placeholders: {
buttonLeft: new PlaceholderContent(function () {
return [React.createElement(Portal_EP_Buttons_ButtonTransparent_mvc_view, {
inputs: {
ButtonText: model.getCachedValue(idService.getId("7YcBqJsuAkyCEic8DlCExw.ButtonText"), function () {
return MultiLingualController.default.getTranslation$Action("home-login-action-btnlabel1", "New Account", callContext).translationOut;
}),
IsSubmitting: model.variables.isRedirectingToRegistrationVar
},
events: {
_handleError: function (ex) {
controller.handleError(ex);
},
onClick$Action: function () {
return Promise.resolve().then(function () {
var eventHandlerContext = callContext.clone();
controller.newAccount$Action(controller.callContext(eventHandlerContext));
});
;
}
},
_validationProps: {
validationService: validationService,
validationParentId: idService.getId("Form1")
},
_idProps: {
service: idService,
uuid: "27",
alias: "10"
},
_widgetRecordProvider: widgetsRecordProvider,
_dependencies: []
})];
}),
buttonRight: new PlaceholderContent(function () {
return [React.createElement(Portal_EP_Buttons_ButtonPrimary_mvc_view, {
inputs: {
ButtonText: model.getCachedValue(idService.getId("3cu8frcMcUWaWbPDo+7xTg.ButtonText"), function () {
return MultiLingualController.default.getTranslation$Action("home-login-action-btnlabel2", "Login", callContext).translationOut;
}),
IsSubmitting: model.variables.isLoggingUserInVar
},
events: {
_handleError: function (ex) {
controller.handleError(ex);
},
onClick$Action: function () {
var eventHandlerContext = callContext.clone();
controller.submit$Action(controller.callContext(eventHandlerContext));

;
}
},
_validationProps: {
validationService: validationService,
validationParentId: idService.getId("Form1")
},
_idProps: {
service: idService,
uuid: "28",
alias: "11"
},
_widgetRecordProvider: widgetsRecordProvider,
_dependencies: []
})];
})
},
_dependencies: [asPrimitiveValue(model.variables.isLoggingUserInVar), asPrimitiveValue(model.variables.isRedirectingToRegistrationVar)]
})), React.createElement(OSWidgets.Link, {
enabled: true,
onClick: function () {
_this.validateWidget(idService.getId("Form1"));
return Promise.resolve().then(function () {
var eventHandlerContext = callContext.clone();
controller.login$Action(controller.callContext(eventHandlerContext));
});

;
},
style: "SubmitLink",
visible: true,
_idProps: {
service: idService,
name: "Submit2"
},
_widgetRecordProvider: widgetsRecordProvider
})))))];
})
},
_dependencies: [asPrimitiveValue(model.variables.isLoggingUserInVar), asPrimitiveValue(model.variables.isRedirectingToRegistrationVar), asPrimitiveValue(model.variables.captchaConfigDataAct.dataFetchStatusAttr), asPrimitiveValue(model.variables.captchaConfigDataAct.resultOut), asPrimitiveValue(model.variables.displayErrorMessageVar), asPrimitiveValue(model.variables.errorMessageVar), asPrimitiveValue(model.variables.passwordVar), asPrimitiveValue(model.variables.usernameVar)]
}));
        };
        return View;
    })(OSView.BaseView.BaseWebBlock);
	
    return View;
});
define("Portal.Careers.CareerLoginModal.mvc$controller", ["OutSystems/ClientRuntime/Main", "Portal.model", "Portal.controller", "MultiLingual.controller", "Portal.languageResources", "Portal.clientVariables", "Portal.Careers.CareerLoginModal.mvc$controller.Login.CheckCaptchaJS", "MultiLingual.controller$GetTranslation", "Portal.referencesHealth", "Portal.referencesHealth$MultiLingual", "Portal.controller$ClickSubmit", "Portal.model$OSLoginRequestRec", "Portal.model$OSLoginRec", "Portal.controller$CacheUserSession", "Portal.controller$UserLogout", "Portal.model$PostVerifyRequestRec", "Portal.model$PostVerifyResponseRec", "Portal.model$ItemFromCartRec", "Portal.controller$RequireCaptcha"], function (OutSystems, PortalModel, PortalController, MultiLingualController, PortalLanguageResources, PortalClientVariables, Portal_Careers_CareerLoginModal_mvc_controller_Login_CheckCaptchaJS) {
var OS = OutSystems.Internal;
var Controller = (function (_super) {
__extends(Controller, _super);
function Controller() {
_super.apply(this, arguments);
var controller = this.controller;
this.clientActionProxies = {
assignToken$Action: function (valueIn) {
valueIn = (valueIn === undefined) ? "" : valueIn;
return controller.executeActionInsideJSNode(controller._assignToken$Action.bind(controller, OS.DataConversion.JSNodeParamConverter.from(valueIn, OS.Types.Text)), controller.callContext(), function (actionResults) {
return {};
});
}
};
this.dataFetchDependenciesOriginal = {
isCaptchaEnabled$DataActRefresh: 0,
captchaConfig$DataActRefresh: 0
};
this.dataFetchDependentsGraph = {
isCaptchaEnabled$DataActRefresh: [],
captchaConfig$DataActRefresh: []
};
this.useImprovedDataFetch = false;
this.hasDependenciesBetweenSources = false;
this.shouldSendClientVarsToDataSources = false;
}
// Server Actions
Controller.prototype.getIP$ServerAction = function (callContext) {
var controller = this.controller;
return controller.callServerAction("GetIP", "screenservices/Portal/Careers/CareerLoginModal/ActionGetIP", "xR0wDPFB6cNvgt9fpRUo9Q", {}, controller.callContext(callContext)).then(function (outputs) {
var executeServerActionResult = new (controller.constructor.getVariableGroupType("Portal.Careers.CareerLoginModal$rssextensionhttprequesthandler_ActionGetIP"))();
executeServerActionResult.userIPOut = OS.DataConversion.ServerDataConverter.from(outputs.UserIP, OS.Types.Text);
return executeServerActionResult;
});
};
Controller.registerVariableGroupType("Portal.Careers.CareerLoginModal$rssextensionhttprequesthandler_ActionGetIP", [{
name: "UserIP",
attrName: "userIPOut",
mandatory: false,
dataType: OS.Types.Text,
defaultValue: function () {
return "";
}
}]);
Controller.prototype.getSessionTimeoutMinutes$ServerAction = function (callContext) {
var controller = this.controller;
return controller.callServerAction("GetSessionTimeoutMinutes", "screenservices/Portal/Careers/CareerLoginModal/ActionGetSessionTimeoutMinutes", "UZi+QRDflROISkuVECxpvg", {}, controller.callContext(callContext)).then(function (outputs) {
var executeServerActionResult = new (controller.constructor.getVariableGroupType("Portal.Careers.CareerLoginModal$ActionGetSessionTimeoutMinutes"))();
executeServerActionResult.outTimeoutMinsOut = OS.DataConversion.ServerDataConverter.from(outputs.OutTimeoutMins, OS.Types.Integer);
return executeServerActionResult;
});
};
Controller.registerVariableGroupType("Portal.Careers.CareerLoginModal$ActionGetSessionTimeoutMinutes", [{
name: "OutTimeoutMins",
attrName: "outTimeoutMinsOut",
mandatory: false,
dataType: OS.Types.Integer,
defaultValue: function () {
return 0;
}
}]);
Controller.prototype.user_Login$ServerAction = function (usernameIn, passwordIn, rememberLoginIn, callContext) {
var controller = this.controller;
var inputs = {
Username: OS.DataConversion.ServerDataConverter.to(usernameIn, OS.Types.Text),
Password: OS.DataConversion.ServerDataConverter.to(passwordIn, OS.Types.Text),
RememberLogin: OS.DataConversion.ServerDataConverter.to(rememberLoginIn, OS.Types.Boolean)
};
return controller.callServerAction("User_Login", "screenservices/Portal/Careers/CareerLoginModal/ActionUser_Login", "XiZVCpoj9OuZBE5Pd15rZw", inputs, controller.callContext(callContext)).then(function (outputs) {
});
};
Controller.prototype.oSLogin$ServerAction = function (oSLoginRequestIn, callContext) {
var controller = this.controller;
var inputs = {
OSLoginRequest: OS.DataConversion.ServerDataConverter.to(oSLoginRequestIn, OS.Types.Record)
};
return controller.callServerAction("OSLogin", "screenservices/Portal/Careers/CareerLoginModal/ActionOSLogin", "oMWXgD8lzWx60bH__2xZSA", inputs, controller.callContext(callContext)).then(function (outputs) {
var executeServerActionResult = new (controller.constructor.getVariableGroupType("Portal.Careers.CareerLoginModal$ActionOSLogin"))();
executeServerActionResult.responseOut = OS.DataConversion.ServerDataConverter.from(outputs.Response, PortalModel.OSLoginRec);
return executeServerActionResult;
});
};
Controller.registerVariableGroupType("Portal.Careers.CareerLoginModal$ActionOSLogin", [{
name: "Response",
attrName: "responseOut",
mandatory: false,
dataType: OS.Types.Record,
defaultValue: function () {
return new PortalModel.OSLoginRec();
},
complexType: PortalModel.OSLoginRec
}]);
Controller.prototype.postVerify$ServerAction = function (requestIn, callContext) {
var controller = this.controller;
var inputs = {
Request: OS.DataConversion.ServerDataConverter.to(requestIn, OS.Types.Record)
};
return controller.callServerAction("PostVerify", "screenservices/Portal/Careers/CareerLoginModal/ActionPostVerify", "fnsnsnF+Q09ehrys8AUjDg", inputs, controller.callContext(callContext)).then(function (outputs) {
var executeServerActionResult = new (controller.constructor.getVariableGroupType("Portal.Careers.CareerLoginModal$ActionPostVerify"))();
executeServerActionResult.responseOut = OS.DataConversion.ServerDataConverter.from(outputs.Response, PortalModel.PostVerifyResponseRec);
return executeServerActionResult;
});
};
Controller.registerVariableGroupType("Portal.Careers.CareerLoginModal$ActionPostVerify", [{
name: "Response",
attrName: "responseOut",
mandatory: false,
dataType: OS.Types.Record,
defaultValue: function () {
return new PortalModel.PostVerifyResponseRec();
},
complexType: PortalModel.PostVerifyResponseRec
}]);
Controller.prototype.getOrderIdQuantity$ServerAction = function (authenticationIn, callContext) {
var controller = this.controller;
var inputs = {
Authentication: OS.DataConversion.ServerDataConverter.to(authenticationIn, OS.Types.Text)
};
return controller.callServerAction("GetOrderIdQuantity", "screenservices/Portal/Careers/CareerLoginModal/ActionGetOrderIdQuantity", "LgsNgNNkuGGeRT_lAGFpsQ", inputs, controller.callContext(callContext)).then(function (outputs) {
var executeServerActionResult = new (controller.constructor.getVariableGroupType("Portal.Careers.CareerLoginModal$ActionGetOrderIdQuantity"))();
executeServerActionResult.responseOut = OS.DataConversion.ServerDataConverter.from(outputs.Response, PortalModel.ItemFromCartRec);
return executeServerActionResult;
});
};
Controller.registerVariableGroupType("Portal.Careers.CareerLoginModal$ActionGetOrderIdQuantity", [{
name: "Response",
attrName: "responseOut",
mandatory: false,
dataType: OS.Types.Record,
defaultValue: function () {
return new PortalModel.ItemFromCartRec();
},
complexType: PortalModel.ItemFromCartRec
}]);
Controller.prototype.sleep$ServerAction = function (sleepInMsIn, callContext) {
var controller = this.controller;
var inputs = {
SleepInMs: OS.DataConversion.ServerDataConverter.to(sleepInMsIn, OS.Types.Integer)
};
return controller.callServerAction("Sleep", "screenservices/Portal/Careers/CareerLoginModal/ActionSleep", "DSNaCUbnddE6e_EeAGS6Bw", inputs, controller.callContext(callContext)).then(function (outputs) {
});
};

// Aggregates and Data Actions
Controller.prototype.isCaptchaEnabled$DataActRefresh = function (callContext) {
var model = this.model;
var controller = this.controller;
var callContext = controller.callContext(callContext);
return controller.callDataAction("DataActionIsCaptchaEnabled", "screenservices/Portal/Careers/CareerLoginModal/DataActionIsCaptchaEnabled", "nTgYZxx+w2WslhBrjzkCcw", function (b) {
model.variables.isCaptchaEnabledDataAct.dataFetchStatusAttr = b;
}, function (json) {
model.variables.isCaptchaEnabledDataAct.replaceWith(OS.DataConversion.ServerDataConverter.from(json, model.variables.isCaptchaEnabledDataAct.constructor));
}, undefined, undefined, undefined, callContext);
};
Controller.prototype.captchaConfig$DataActRefresh = function (callContext) {
var model = this.model;
var controller = this.controller;
var callContext = controller.callContext(callContext);
return controller.callDataAction("DataActionCaptchaConfig", "screenservices/Portal/Careers/CareerLoginModal/DataActionCaptchaConfig", "eHfoyeYMZyCB6QDWbUDQJA", function (b) {
model.variables.captchaConfigDataAct.dataFetchStatusAttr = b;
}, function (json) {
model.variables.captchaConfigDataAct.replaceWith(OS.DataConversion.ServerDataConverter.from(json, model.variables.captchaConfigDataAct.constructor));
}, undefined, undefined, undefined, callContext);
};

Controller.prototype.dataFetchActionNames = ["isCaptchaEnabled$DataActRefresh", "captchaConfig$DataActRefresh"];
// Client Actions
Controller.prototype._submit$Action = function (callContext) {
var model = this.model;
var controller = this.controller;
var idService = this.idService;
controller.ensureControllerAlive("Submit");
callContext = controller.callContext(callContext);
// Execute Action: Submit
PortalController.default.clickSubmit$Action(idService.getId("Submit2"), callContext);
};
Controller.prototype._login$Action = function (callContext) {
var model = this.model;
var controller = this.controller;
var idService = this.idService;
controller.ensureControllerAlive("Login");
callContext = controller.callContext(callContext);
var allExceptionsVar = new OS.DataTypes.VariableHolder(new OS.DataTypes.ErrorHandlerOutputType());
var getIPVar = new OS.DataTypes.VariableHolder();
var getSessionTimeoutMinutesVar = new OS.DataTypes.VariableHolder();
var oSLoginVar = new OS.DataTypes.VariableHolder();
var postVerifyVar = new OS.DataTypes.VariableHolder();
var getOrderIdQuantityVar = new OS.DataTypes.VariableHolder();
return OS.Flow.executeAsyncFlow(function () {
// IsLoading
// IsLoggingUserIn = True
model.variables.isLoggingUserInVar = true;
// DisplayErrorMessage = False
model.variables.displayErrorMessageVar = false;
// ErrorMessage = ""
model.variables.errorMessageVar = "";
// IsCaptchaConfigFetched?
return OS.Flow.executeSequence(function () {
if((model.variables.captchaConfigDataAct.isDataFetchedAttr)) {
// IsCaptchaEnabled?
return OS.Flow.executeSequence(function () {
if((model.variables.captchaConfigDataAct.resultOut)) {
controller.safeExecuteJSNode(Portal_Careers_CareerLoginModal_mvc_controller_Login_CheckCaptchaJS, "CheckCaptcha", "Login", {
SiteKey: OS.DataConversion.JSNodeParamConverter.to(PortalClientVariables.getreCAPTCHA_SiteKey(), OS.Types.Text),
Action: OS.DataConversion.JSNodeParamConverter.to("candidateLogin", OS.Types.Text)
}, function ($parameters) {
}, {
AssignToken: controller.clientActionProxies.assignToken$Action
}, {});
// Execute Action: GetIP
model.flush();
return controller.getIP$ServerAction(callContext).then(function (value) {
getIPVar.value = value;
}).then(function () {
// Execute Action: Sleep
model.flush();
return controller.sleep$ServerAction(300, callContext);
}).then(function () {
// Execute Action: PostVerify
model.flush();
return controller.postVerify$ServerAction(function () {
var rec = new PortalModel.PostVerifyRequestRec();
rec.clientIPAttr = getIPVar.value.userIPOut;
rec.tokenAttr = model.variables.captchaTokenVar;
return rec;
}(), callContext).then(function (value) {
postVerifyVar.value = value;
});
});
}

}).then(function () {
// InValid?
return OS.Flow.executeSequence(function () {
if((!(!(model.widgets.get(idService.getId("Form1")).validAttr)))) {
// Execute Action: UserLogout
model.flush();
return PortalController.default.userLogout$Action(callContext).then(function () {
// Execute Action: OSLogin
model.flush();
return controller.oSLogin$ServerAction(function () {
var rec = new PortalModel.OSLoginRequestRec();
rec.userNameAttr = model.variables.usernameVar;
rec.passwordAttr = model.variables.passwordVar;
return rec;
}(), callContext).then(function (value) {
oSLoginVar.value = value;
});
}).then(function () {
// IsSucc?
return OS.Flow.executeSequence(function () {
if(((oSLoginVar.value.responseOut.response_codeAttr === (PortalModel.staticEntities.responseCode.oK).toString()))) {
// Execute Action: User_Login
model.flush();
return controller.user_Login$ServerAction(model.variables.usernameVar, model.variables.passwordVar, false, callContext).then(function () {
// Execute Action: GetOrderIdQuantity
model.flush();
return controller.getOrderIdQuantity$ServerAction(oSLoginVar.value.responseOut.payloadAttr.sessionTokenAttr, callContext).then(function (value) {
getOrderIdQuantityVar.value = value;
});
}).then(function () {
// ResetLocals
// DisplayErrorMessage = False
model.variables.displayErrorMessageVar = false;
// ErrorMessage = ""
model.variables.errorMessageVar = "";
// IsLoggingUserIn = False
model.variables.isLoggingUserInVar = false;
// ShowModal = False
model.variables.showModalIn = false;
// Execute Action: GetSessionTimeoutMinutes
model.flush();
return controller.getSessionTimeoutMinutes$ServerAction(callContext).then(function (value) {
getSessionTimeoutMinutesVar.value = value;
});
}).then(function () {
// Execute Action: CacheUserSession
PortalController.default.cacheUserSession$Action(model.variables.usernameVar, oSLoginVar.value.responseOut.payloadAttr.userInfoAttr.nameAttr, oSLoginVar.value.responseOut.payloadAttr.userInfoAttr.firstNameAttr, oSLoginVar.value.responseOut.payloadAttr.userInfoAttr.lastNameAttr, oSLoginVar.value.responseOut.payloadAttr.sessionTokenAttr, oSLoginVar.value.responseOut.payloadAttr.refreshTokenAttr, oSLoginVar.value.responseOut.payloadAttr.userInfoAttr.emailAddressAttr, OS.BuiltinFunctions.longIntegerToInteger(OS.BuiltinFunctions.longIntegerToIdentifier(oSLoginVar.value.responseOut.payloadAttr.userInfoAttr.userIdAttr)), oSLoginVar.value.responseOut.payloadAttr.userInfoAttr.mobileNumberAttr, false, getOrderIdQuantityVar.value.responseOut.payloadAttr.orderIdAttr, OS.BuiltinFunctions.longIntegerToInteger(getOrderIdQuantityVar.value.responseOut.payloadAttr.quantityAttr), oSLoginVar.value.responseOut.payloadAttr.userInfoAttr.isdCodeAttr, oSLoginVar.value.responseOut.payloadAttr.userInfoAttr.isdLabelAttr, OS.BuiltinFunctions.addMinutes(OS.BuiltinFunctions.currDateTime(), getSessionTimeoutMinutesVar.value.outTimeoutMinsOut), callContext);
// Trigger Event: UserLoggedIn
return controller.userLoggedIn$Action(callContext);
}).then(function () {
return OS.Flow.returnAsync();

});
} else {
// DispError
// DisplayErrorMessage = True
model.variables.displayErrorMessageVar = true;
// ErrorMessage = OSLogin.Response.message
model.variables.errorMessageVar = oSLoginVar.value.responseOut.messageAttr;
}

});
});
}

});
}).then(function () {
// LoaderOff
// IsLoggingUserIn = False
model.variables.isLoggingUserInVar = false;
});
}

});
}).catch(function (ex) {
OS.Logger.trace("CareerLoginModal.Login", OS.Exceptions.getMessage(ex), ex.name);
// Handle Error: AllExceptions
if(!(OS.Exceptions.isSystem(ex))) {
OS.Logger.error(null, ex);
allExceptionsVar.value.exceptionMessageAttr = OS.Exceptions.getMessage(ex);
return OS.Flow.executeAsyncFlow(function () {
OS.FeedbackMessageService.showFeedbackMessage(allExceptionsVar.value.exceptionMessageAttr, /*Info*/ 0);
return OS.Flow.returnAsync();

});
}

throw ex;
});
};
Controller.prototype._forgotPassword$Action = function (callContext) {
var model = this.model;
var controller = this.controller;
var idService = this.idService;
controller.ensureControllerAlive("ForgotPassword");
callContext = controller.callContext(callContext);
var allExceptionsVar = new OS.DataTypes.VariableHolder(new OS.DataTypes.ErrorHandlerOutputType());
try {} catch (ex) {
(function () {
OS.Logger.trace("CareerLoginModal.ForgotPassword", OS.Exceptions.getMessage(ex), ex.name);
// Handle Error: AllExceptions
if(!(OS.Exceptions.isSystem(ex))) {
OS.Logger.error(null, ex);
allExceptionsVar.value.exceptionMessageAttr = OS.Exceptions.getMessage(ex);
OS.FeedbackMessageService.showFeedbackMessage(allExceptionsVar.value.exceptionMessageAttr, /*Info*/ 0);
return ;

}

throw ex;
})();
}

};
Controller.prototype._newAccount$Action = function (callContext) {
var model = this.model;
var controller = this.controller;
var idService = this.idService;
controller.ensureControllerAlive("NewAccount");
callContext = controller.callContext(callContext);
var allExceptionsVar = new OS.DataTypes.VariableHolder(new OS.DataTypes.ErrorHandlerOutputType());
return OS.Flow.executeAsyncFlow(function () {
// IsRedirectingToRegistration = True
model.variables.isRedirectingToRegistrationVar = true;
// Trigger Event: RequestCloseLoginModal
return controller.requestCloseLoginModal$Action(callContext).then(function () {
// IsRedirectingToRegistration = False
model.variables.isRedirectingToRegistrationVar = false;
// Destination: /Portal/CandidateDetails
return OS.Flow.returnAsync(OS.Navigation.navigateTo(OS.Navigation.generateScreenURL("/Portal/CandidateDetails", {
locale: model.variables.localeIn
}), OS.Transitions.createTransition(OS.Transitions.TransitionAnimation.Default), callContext, true));
});
}).catch(function (ex) {
OS.Logger.trace("CareerLoginModal.NewAccount", OS.Exceptions.getMessage(ex), ex.name);
// Handle Error: AllExceptions
if(!(OS.Exceptions.isSystem(ex))) {
OS.Logger.error(null, ex);
allExceptionsVar.value.exceptionMessageAttr = OS.Exceptions.getMessage(ex);
return OS.Flow.executeAsyncFlow(function () {
OS.FeedbackMessageService.showFeedbackMessage(allExceptionsVar.value.exceptionMessageAttr, /*Info*/ 0);
return OS.Flow.returnAsync();

});
}

throw ex;
});
};
Controller.prototype._onInitialize$Action = function (callContext) {
var model = this.model;
var controller = this.controller;
var idService = this.idService;
controller.ensureControllerAlive("OnInitialize");
callContext = controller.callContext(callContext);
return OS.Flow.executeAsyncFlow(function () {
// Execute Action: RequireCaptcha
model.flush();
return PortalController.default.requireCaptcha$Action(callContext);
});
};
Controller.prototype._assignToken$Action = function (valueIn, callContext) {
var model = this.model;
var controller = this.controller;
var idService = this.idService;
controller.ensureControllerAlive("AssignToken");
callContext = controller.callContext(callContext);
var vars = new OS.DataTypes.VariableHolder(new (controller.constructor.getVariableGroupType("Portal.Careers.CareerLoginModal.AssignToken$vars"))());
vars.value.valueInLocal = valueIn;
// Token
// CaptchaToken = Value
model.variables.captchaTokenVar = vars.value.valueInLocal;
};
Controller.registerVariableGroupType("Portal.Careers.CareerLoginModal.AssignToken$vars", [{
name: "Value",
attrName: "valueInLocal",
mandatory: true,
dataType: OS.Types.Text,
defaultValue: function () {
return "";
}
}]);

Controller.prototype.submit$Action = function (callContext) {
var controller = this.controller;
return controller.safeExecuteClientAction(controller._submit$Action, callContext);

};
Controller.prototype.login$Action = function (callContext) {
var controller = this.controller;
return controller.safeExecuteClientAction(controller._login$Action, callContext);

};
Controller.prototype.forgotPassword$Action = function (callContext) {
var controller = this.controller;
return controller.safeExecuteClientAction(controller._forgotPassword$Action, callContext);

};
Controller.prototype.newAccount$Action = function (callContext) {
var controller = this.controller;
return controller.safeExecuteClientAction(controller._newAccount$Action, callContext);

};
Controller.prototype.onInitialize$Action = function (callContext) {
var controller = this.controller;
return controller.safeExecuteClientAction(controller._onInitialize$Action, callContext);

};
Controller.prototype.assignToken$Action = function (valueIn, callContext) {
var controller = this.controller;
return controller.safeExecuteClientAction(controller._assignToken$Action, callContext, valueIn);

};
Controller.prototype.requestCloseLoginModal$Action = function () {
return Promise.resolve();
};
Controller.prototype.userLoggedIn$Action = function () {
return Promise.resolve();
};

// Event Handler Actions
Controller.prototype.onInitializeEventHandler = function (callContext) {
var controller = this.controller;
var model = this.model;
var idService = this.idService;

return controller.onInitialize$Action(callContext);

};
Controller.prototype.onReadyEventHandler = null;
Controller.prototype.onRenderEventHandler = null;
Controller.prototype.onDestroyEventHandler = null;
Controller.prototype.onParametersChangedEventHandler = null;
Controller.prototype.handleError = function (ex) {
return controller.handleError(ex);
};
Controller.checkPermissions = function () {
};
Controller.prototype.getDefaultTimeout = function () {
return PortalController.default.defaultTimeout;
};
return Controller;
})(OS.Controller.BaseViewController);
return new OS.Controller.ControllerFactory(Controller, PortalLanguageResources);
});
define("Portal.Careers.CareerLoginModal.mvc$controller.Login.CheckCaptchaJS", [], function () {
return function ($parameters, $actions, $roles, $public) {
grecaptcha.ready(function () {
    grecaptcha.execute($parameters.SiteKey, { action: $parameters.Action }).then(function (token) {
    $actions.AssignToken(token);
    });
});
};
});