'use strict';function _0x3319(){const _0x2bc044=['12OfErhq','end','NODE_ENV','setCORSHeaders','2aRLLQh','allowedOrigins','GET,\x20POST,\x20PUT,\x20DELETE,\x20PATCH,\x20OPTIONS','true','__esModule','1144587bvgCnz','8044176AjVIbR','6208548VeqRep','3050070xyexmo','9RpmlOt','36930870EhWyTH','3035464PpAFSG','writeHeader','http://localhost:3000','Access-Control-Allow-Methods','553313lRlgGH','env','origin','includes'];_0x3319=function(){return _0x2bc044;};return _0x3319();}const _0x20f4cd=_0x4c87;(function(_0xfaabcf,_0x49e92e){const _0x48890e=_0x4c87,_0x4b2a69=_0xfaabcf();while(!![]){try{const _0x40ff29=-parseInt(_0x48890e(0x78))/0x1*(-parseInt(_0x48890e(0x80))/0x2)+parseInt(_0x48890e(0x85))/0x3*(-parseInt(_0x48890e(0x7c))/0x4)+-parseInt(_0x48890e(0x88))/0x5+-parseInt(_0x48890e(0x87))/0x6+-parseInt(_0x48890e(0x86))/0x7+-parseInt(_0x48890e(0x74))/0x8*(-parseInt(_0x48890e(0x72))/0x9)+parseInt(_0x48890e(0x73))/0xa;if(_0x40ff29===_0x49e92e)break;else _0x4b2a69['push'](_0x4b2a69['shift']());}catch(_0x227a5a){_0x4b2a69['push'](_0x4b2a69['shift']());}}}(_0x3319,0xa7cca));function _0x4c87(_0x40fbf3,_0x517525){_0x40fbf3=_0x40fbf3-0x72;const _0x3319b1=_0x3319();let _0x4c8738=_0x3319b1[_0x40fbf3];return _0x4c8738;}Object['defineProperty'](exports,_0x20f4cd(0x84),{'value':!![]}),exports['handlePreflightRequest']=handlePreflightRequest,exports['applyCorsHeaders']=applyCorsHeaders;const utils_1=require('../../utils'),isDev=process[_0x20f4cd(0x79)][_0x20f4cd(0x7e)]==='development';function handlePreflightRequest(_0x287ef0,_0x8d9df3){const _0x386d4f=_0x20f4cd,_0x10dcde=getOriginFromRequest(_0x8d9df3);if(isDev)(0x0,utils_1['setCORSHeaders'])(_0x287ef0,_0x10dcde||'http://localhost:3000');else{const _0x161efa=_0x10dcde&&utils_1['allowedOrigins'][_0x386d4f(0x7b)](_0x10dcde);_0x161efa&&(0x0,utils_1[_0x386d4f(0x7f)])(_0x287ef0,_0x10dcde);}_0x287ef0[_0x386d4f(0x7d)]();}function applyCorsHeaders(_0x3c6122,_0x49238c){const _0x4be9bc=_0x20f4cd,_0xdc96fa=getOriginFromRequest(_0x49238c);if(isDev)setCORSHeadersCompat(_0x3c6122,_0xdc96fa||_0x4be9bc(0x76));else{const _0x496032=_0xdc96fa&&utils_1[_0x4be9bc(0x81)]['includes'](_0xdc96fa);_0x496032&&setCORSHeadersCompat(_0x3c6122,_0xdc96fa);}}function setCORSHeadersCompat(_0x1ee182,_0x4145f9){const _0x33e689=_0x20f4cd;_0x1ee182['writeHeader']&&(_0x1ee182[_0x33e689(0x75)]('Access-Control-Allow-Origin',_0x4145f9),_0x1ee182[_0x33e689(0x75)](_0x33e689(0x77),_0x33e689(0x82)),_0x1ee182[_0x33e689(0x75)]('Access-Control-Allow-Headers','Content-Type,\x20Authorization,\x20X-Requested-With,\x20Accept,\x20Origin,\x20accesstoken,\x20sessionid,\x20csrftoken,\x20platform,\x20x-api-key,\x20client-platform'),_0x1ee182['writeHeader']('Access-Control-Allow-Credentials',_0x33e689(0x83)),_0x1ee182['writeHeader']('Access-Control-Max-Age','86400'));}function getOriginFromRequest(_0x1d15d2){const _0x17654c=_0x20f4cd;var _0x34358b,_0x347ac2,_0x35a938,_0x3f2cb1;return((_0x34358b=_0x1d15d2['getHeader'])===null||_0x34358b===void 0x0?void 0x0:_0x34358b['call'](_0x1d15d2,_0x17654c(0x7a)))||((_0x347ac2=_0x1d15d2['getHeader'])===null||_0x347ac2===void 0x0?void 0x0:_0x347ac2['call'](_0x1d15d2,'Origin'))||((_0x35a938=_0x1d15d2['headers'])===null||_0x35a938===void 0x0?void 0x0:_0x35a938['origin'])||((_0x3f2cb1=_0x1d15d2['headers'])===null||_0x3f2cb1===void 0x0?void 0x0:_0x3f2cb1['Origin']);}