import r from"@babel/runtime/helpers/defineProperty";function e(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);e&&(c=c.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,c)}return t}function t(t){for(var c=1;c<arguments.length;c++){var n=null!=arguments[c]?arguments[c]:{};c%2?e(Object(n),!0).forEach((function(e){r(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))}))}return t}var c=/corva\.ai\/(.+?)\/packages/,n=/app\/(.+?)\/.*\.chunk\.js/;function a(){var r=Error.stackTraceLimit;Error.stackTraceLimit=300;var e=new Error,t=e.stack.match(c)||e.stack.match(n);return Error.stackTraceLimit=r,t?t[1].replace("/app/","."):null}function o(r){var e=r.config,c=r.appKey,n=t({},e.headers||{});return c&&(n["x-corva-app"]=c),t(t({},e),{},{headers:n})}export{o as attachHTTPHeaders,a as getAppKeyFromStackTrace};
