{"version":3,"sources":["datex-http-channel.ts"],"sourcesContent":["/**\n * Send DATEX blocks to a server with a HTTPComInterface\n * (listening to POST requests on /datex-http).\n * No response is returned.\n * \n * This is not the same as datex-over-http implemented in UIX\n * that send unsigned/unencrypted DATEX scripts to an HTTP server\n */\nexport function sendDatexViaHTTPChannel(dxb: ArrayBuffer, origin = globalThis.location.origin) {\n\n\t// fallback to sendBeacon for firefox until fetch keepalive implemented\n\tif (navigator.userAgent.includes(\"Firefox/\")) {\n\t\tnavigator.sendBeacon(origin + \"/datex-http\", dxb);\n\t}\n\telse {\n\t\tfetch(origin + \"/datex-http\", {\n\t\t\tmethod: 'post',\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/datex',\n\t\t\t},\n\t\t\tbody: dxb,\n\t\t\tkeepalive: true\n\t\t})\n\t}\n}"],"names":["sendDatexViaHTTPChannel","dxb","origin","globalThis","location","navigator","userAgent","includes","sendBeacon","fetch","method","headers","body","keepalive"],"mappings":"AAQA,OAAO,SAASA,wBAAwBC,GAAgB,EAAEC,SAASC,WAAWC,QAAQ,CAACF,MAAM;IAGxFG,UAAUC,SAAS,CAACC,QAAQ,CAAC,cAChCF,UAAUG,UAAU,CAACN,SAAS,eAAeD,OAG7CQ,MAAMP,SAAS,eAAe;QAC7BQ,QAAQ;QACRC,SAAS;YACR,gBAAgB;QACjB;QACAC,MAAMX;QACNY,WAAW,CAAA;IACZ;AAEF","sourceRoot":"/lib/datex-core-js-legacy-0.3.15/network/","file":"datex-http-channel.ts"}