{"version":3,"sources":["Login/js/Login/Index.ts","Login/js/Login/Index.js"],"names":["Compilator","Login","texts","errorTitle","errorMessage","okButton","logonTitle","changePasswordTitle","forgotPasswordTitle","logonCurrentUserActionUrl","openChangePasswordWindow","kendoWindowOptions","title","this","width","height","windowName","onWindowClose","onChangePasswordWindowClose","$url","ChangePassword","Index","kendoWindow","$","val","args","document","location","e","openLogonWindow","iframe","onLogonWindowClose","Logon","status","compilator","windowHandler","kendo","dialogResultOk","ajax","url","type","cache","data","branchId","BranchId","departmentId","Department","success","response","window","localStorage","setItem","SecurityToken","UrlRedirect","error","console","log","JSON","stringify","$kendo","openKendoWindowNotification","CancelLogin","openForgotPasswordDialog","openNewKendoWindow","$login"],"mappings":"AAEA,IAAIA,WAAaA,YAAc,CAAA,EAE/BA,WAAWC,MAAQ,CACjBC,MAAO,CACLC,WAAY,GACZC,aAAc,GACdC,SAAU,GACVC,WAAY,GACZC,oBAAqB,GACrBC,oBAAqB,GACrBC,0BAA2B,IAG7BC,yBAA0B,WACxB,IAAIC,EAAqB,CACvBC,MAAOC,KAAKX,MAAMK,oBAClBO,MAAO,IACPC,OAAQ,IACRC,WAAY,oBACZC,cAAeJ,KAAKK,6BAGtBC,KAAKlB,MAAMmB,eAAeC,MAAMC,YAAYC,EAAE,aAAaC,MAAOb,EACpE,EACAO,4BAA6B,SAAUO,GACrC,IACEC,SAASC,SAAWD,SAASC,QCJ3B,CDMJ,MAAOC,GCJH,CDON,EACAC,gBAAiB,WACf,IAAIlB,EAAqB,CACvBC,MAAOC,KAAKX,MAAMI,WAClBQ,MAAO,IACPC,OAAQ,IACRC,WAAY,WACZc,QAAQ,EACRb,cAAeJ,KAAKkB,oBAEtBZ,KAAKlB,MAAM+B,MAAMX,MAAMC,YAAYX,EACrC,EACAoB,mBAAoB,SAAUN,GACxBA,IACEA,EAAKQ,SAAWC,WAAWC,cAAcC,MAAMC,eACjDd,EAAEe,KAAK,CACLC,IAAKvC,WAAWC,MAAMC,MAAMO,0BAC5B+B,KAAM,MACNC,OAAO,EACPC,KAAM,CACJC,SAAUlB,EAAKmB,SACfC,aAAcpB,EAAKqB,YAErBC,QAAS,SAAUC,GACjBC,OAAOC,aAAaC,QAAQ,cAAeH,EAASI,eACpD1B,SAASC,SAAWqB,EAASK,WAC/B,EACAC,MAAO,SAAUN,GACfO,QAAQC,IAAI,2BACZD,QAAQC,IAAIC,KAAKC,UAAUV,IAC3BW,OAAOC,4BAA4B5D,WAAWC,MAAMC,MAAMC,WAAYH,WAAWC,MAAMC,MAAME,aAAcJ,WAAWC,MAAMC,MAAMG,UAAU,GAAO,GAAO,WACxJqB,SAASC,SAAWD,SAASC,QAC/B,GACF,IAIFR,KAAKlB,MAAMA,MAAM4D,YAAYvB,KAAK,CAChCS,QAAS,SAAUC,GACjBtB,SAASC,SAAWqB,CACtB,EACAM,MAAO,SAAUN,GACfO,QAAQC,IAAI,kCACZD,QAAQC,IAAIC,KAAKC,UAAUV,IAC3BtB,SAASC,SAAWD,SAASC,QAC/B,IAIR,EACAmC,yBAA0B,WACxBH,OAAOI,mBAAmB,8BAA+B,CACvDjC,QAAQ,EACRd,WAAY,oBACZJ,MAAOC,KAAKX,MAAMM,oBAClBM,MAAO,KAEX,GAGF,IAAIkD,OAAShE,WAAWC","file":"Index-5.55.8.11.min.js","sourcesContent":["/// \r\n\r\nvar Compilator = Compilator || {};\r\n\r\nCompilator.Login = {\r\n texts: {\r\n errorTitle: '',\r\n errorMessage: '',\r\n okButton: '',\r\n logonTitle: '',\r\n changePasswordTitle: '',\r\n forgotPasswordTitle: '',\r\n logonCurrentUserActionUrl: ''\r\n },\r\n\r\n openChangePasswordWindow: function() {\r\n var kendoWindowOptions = {\r\n title: this.texts.changePasswordTitle, \r\n width: 500,\r\n height: 400,\r\n windowName: 'kw_changePassword',\r\n onWindowClose: this.onChangePasswordWindowClose\r\n };\r\n \r\n $url.Login.ChangePassword.Index.kendoWindow($('#Username').val(), kendoWindowOptions);\r\n }, \r\n onChangePasswordWindowClose: function (args) {\r\n try {\r\n document.location = document.location;\r\n }\r\n catch (e) {\r\n\r\n }\r\n },\r\n openLogonWindow: function () {\r\n var kendoWindowOptions = {\r\n title: this.texts.logonTitle,\r\n width: 400,\r\n height: 300,\r\n windowName: 'kw_login',\r\n iframe: false,\r\n onWindowClose: this.onLogonWindowClose\r\n };\r\n $url.Login.Logon.Index.kendoWindow(kendoWindowOptions);\r\n },\r\n onLogonWindowClose: function (args) {\r\n if (args) {\r\n if (args.status === compilator.windowHandler.kendo.dialogResultOk) {\r\n $.ajax({\r\n url: Compilator.Login.texts.logonCurrentUserActionUrl,\r\n type: 'GET',\r\n cache: false,\r\n data: {\r\n branchId: args.BranchId,\r\n departmentId: args.Department\r\n },\r\n success: function (response) {\r\n window.localStorage.setItem(\"compAuthKey\", response.SecurityToken);\r\n document.location = response.UrlRedirect;\r\n },\r\n error: function (response) {\r\n console.log('Error when logging in: ');\r\n console.log(JSON.stringify(response));\r\n $kendo.openKendoWindowNotification(Compilator.Login.texts.errorTitle, Compilator.Login.texts.errorMessage, Compilator.Login.texts.okButton, false, false, function () {\r\n document.location = document.location;\r\n });\r\n }\r\n });\r\n }\r\n else {\r\n $url.Login.Login.CancelLogin.ajax({\r\n success: function (response) {\r\n document.location = response;\r\n },\r\n error: function (response) {\r\n console.log('Error when cancelling log in: ');\r\n console.log(JSON.stringify(response));\r\n document.location = document.location;\r\n }\r\n });\r\n }\r\n }\r\n },\r\n openForgotPasswordDialog: function () {\r\n $kendo.openNewKendoWindow(\"/Login/Login/ForgotPassword\", {\r\n iframe: false,\r\n windowName: '_kwForgotPassword',\r\n title: this.texts.forgotPasswordTitle,\r\n width: 600\r\n });\r\n }\r\n}\r\n\r\nlet $login = Compilator.Login;\r\n\r\n\r\n\r\n\r\n",null]}