{"version":3,"file":"js/ajax.39dfce7d384dcae3e7f2.js","mappings":"kHAAAA,OAAOC,GAAKD,OAAOC,IAAM,CAAC,EAE1BD,OAAOC,GAAGC,KAAO,IAAI,WAINC,KAENC,YAAc,SACfC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,GAoBA,IAAIC,EAAU,IAAIC,eA0ClB,OAxCAD,EAAQE,KAAKR,EAAQD,GAErBO,EAAQG,iBACJ,mBAAoB,kBAExBH,EAAQG,iBACJ,eAAgB,oBAEhBJ,GACAA,EAAgBC,GAGpBA,EAAQI,mBAAqB,WACzB,GAA2B,IAAvBJ,EAAQK,WACR,GAAIL,EAAQM,OAAS,KAAON,EAAQM,OAAS,IACrCV,GACAA,EAAcI,EAAQM,OAAQN,EAAQO,kBAGzC,CACD,IAAIC,EAAWR,EAAQO,cAED,IAAhBT,GAAqC,KAAbU,IAC1BA,EAAWC,KAAKC,MAAMF,IAGtBb,GACAA,EAAgBa,EAExB,CAER,EAEIX,EACAG,EAAQW,KAAKd,GAGbG,EAAQW,QAGL,CACX,CACJ,C","sources":["webpack://netzkern.am/./src/Feature/Common/code/Scripts/Common/ajax.js"],"sourcesContent":["window.am = window.am || {};\r\n\r\nwindow.am.ajax = new function () {\r\n /// \r\n /// Holds all methods which have to do with ajax calls.\r\n /// \r\n var that = this;\r\n\r\n that.sendRequest = function (\r\n url,\r\n method,\r\n successCallback,\r\n errorCallback,\r\n optionalPostBody,\r\n rawResponse,\r\n decorateRequest) {\r\n /// \r\n /// Sends the ajax request defined by the passed params.\r\n /// \r\n /// \r\n /// The url where the call should be sent to.\r\n /// \r\n /// \r\n /// The method which should be used. (GET, POST)\r\n /// \r\n /// \r\n /// The function which should be called if the ajax call is successful.\r\n /// \r\n /// \r\n /// The function which should be called if something go wrong with \r\n /// the ajax call.\r\n /// \r\n /// \r\n /// (Optional) The content which should be posted.\r\n /// \r\n var request = new XMLHttpRequest();\r\n\r\n request.open(method, url);\r\n\r\n request.setRequestHeader(\r\n 'X-Requested-With', 'XMLHttpRequest');\r\n\r\n request.setRequestHeader(\r\n 'Content-Type', 'application/json');\r\n\r\n if (decorateRequest) {\r\n decorateRequest(request);\r\n }\r\n\r\n request.onreadystatechange = function () {\r\n if (request.readyState === 4) {\r\n if (request.status < 200 || request.status > 299) {\r\n if (errorCallback) {\r\n errorCallback(request.status, request.responseText);\r\n }\r\n }\r\n else {\r\n var response = request.responseText;\r\n\r\n if (!(rawResponse === true || response === '')) {\r\n response = JSON.parse(response);\r\n }\r\n\r\n if (successCallback) {\r\n successCallback(response);\r\n }\r\n }\r\n }\r\n };\r\n\r\n if (optionalPostBody) {\r\n request.send(optionalPostBody);\r\n }\r\n else {\r\n request.send();\r\n }\r\n\r\n return true;\r\n };\r\n};"],"names":["window","am","ajax","this","sendRequest","url","method","successCallback","errorCallback","optionalPostBody","rawResponse","decorateRequest","request","XMLHttpRequest","open","setRequestHeader","onreadystatechange","readyState","status","responseText","response","JSON","parse","send"],"sourceRoot":""}