!function(){"use strict";var m=function(){return(m=Object.assign||function(n){for(var t,e=1,r=arguments.length;e>>((3&e)<<3)&255;return n}();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(n){for(var t=[],e=0;e<256;++e)t[e]=(e+256).toString(16).substr(1);var r=0,o=t;return[o[n[r++]],o[n[r++]],o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],o[n[r++]],o[n[r++]],o[n[+r]],o[n[15]]].join("")}(n)}function P(r,n){var t=[];try{t=n.reduce(function(n,t){try{var e=t(r);"function"==typeof e&&n.push(e)}catch(n){}return n},[])}catch(n){}return function(n){return P(n,t)}}function N(n,r){var o=T(n,1)[0];return function(t,n){var e=o(function(n){return q(r)(n)?t(n):y});n(function(){e()})}}var B=function(n){function t(n){a=j(a,n),f||s()}var e,r,o,i,u,a=[],c=[],f=!1,s=(r=function(){return a.length},o=function(){f=!0,e&&e[0](),c.forEach(function(n){return n()}),c.length=0,e=void 0},-1===(i=n=void(u=0)===n?3e5:n)?y:function(){if(r())return u&&clearTimeout(u),void(u=0);0===u&&(u=setTimeout(o,i))});return{next:function(n){return P(n,a)},complete:function(n){c.push(n)},attach:function(n,t){e=[n,t]},subscribe:function(n){if(f)throw new Error("Observer is closed");return a.push(n),e&&e[1]&&e[1](n),s(),function(){return t(n)}},unsubscribe:t}},H=function(n,t,e){e=B(e);try{n(e.next,e.attach),t&&e.complete(t)}catch(n){}return[e.subscribe,e.unsubscribe]};function M(){function r(n){n.length&&n.forEach(function(n){try{n()}catch(n){}}),n.length=0}function t(n){i[n]&&i[n].forEach(function(n){r(n[1])}),i[n]=void 0}var o=!1,i={};return{set:function(n,t,e){i[n]?i[n].push([t,e]):i[n]=[[t,e]],o&&r(e)},has:function(n){return!!i[n]},remove:t,removeByEvType:function(t){Object.keys(i).forEach(function(n){i[n]&&i[n].forEach(function(n){n[0]===t&&r(n[1])})})},clear:function(){o=!0,Object.keys(i).forEach(function(n){t(n)})}}}var U=function(n,t,e,r){return n.destroyAgent.set(t,e,r)};var z=function(n){var e,r,o,t=(e={},r={},o={set:function(n,t){return e[n]=t,r[n]=f(t),o},merge:function(t){return e=m(m({},e),t),Object.keys(t).forEach(function(n){r[n]=f(t[n])}),o},delete:function(n){return delete e[n],delete r[n],o},clear:function(){return e={},r={},o},get:function(n){return r[n]},toString:function(){return m({},r)}});n.provide("context",t),n.on("report",function(n){return n.extra||(n.extra={}),n.extra.context=t.toString(),n})},W=function(a,c,e){function f(){for(var n=[],t=0;t([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),u=e.replace(o,"$1").trim());t=$()?i:void 0}catch(n){return}var u}function En(n,t,e){var r;if(!(e<=0))try{localStorage.setItem(n,(r=JSON.stringify(m(m({},t),{expires:$()+e})),mn()?btoa(encodeURI(r)):r))}catch(n){}}function wn(n){return!1===n?0:!0!==n&&void 0!==n&&a(n)?n:7776e6}function Sn(){var t=new RegExp("\\/monitor_web\\/collect|\\/monitor_browser\\/collect\\/batch","i");return function(n){return t.test(n)}}function jn(r){return function(){for(var n,t=[],e=0;e=400)){c.request.body=u?""+u:undefined;c.response.body=n.response?""+n.response:undefined}}catch(n){}return c}(n,a);setTimeout(function(){i&&(t.response.timing=i),kn(t,d),o&&o({ev_type:zn,payload:t}),u()},100)}}))};function $n(n){return w(n)&&n?n.split("\r\n").reduce(function(n,t){var e;return w(t)&&(t=(e=T(t.split(": "),2))[0],e=e[1],Cn(t,e)||(n[t.toLowerCase()]=e)),n},{}):{}}function Kn(e){return Object.keys(e).reduce(function(n,t){return Cn(t,e[t])||(n[t.toLowerCase()]=e[t]),n},{})}var Vn="ajax",Qn={autoWrap:!0,setContextAtReq:function(){return x},ignoreUrls:[],collectBodyOnError:!1};var Zn=function(n,t,l){var e=T(t,2),t=e[0],r=e[1],o=l.setTraceHeader,d=l.ignoreUrls,p=l.setContextAtReq,v=l.extractUrl,h=window.Headers,g=window.Request;g&&h&&n.push(t[0](function(n){var n=T(n,2),i=n[0],u=n[1],t=tn(i instanceof g?i.url:i);if(!function(n){if(!w(n))return false;var t=T(n.split(":"),2),e=t[0],r;return!t[1]||e==="http"||e==="https"}(t)||R(d,t))return y;o&&o(t,function(n,t){return function(n,t,e,r,o,i){var u;if(nt(e,o))e.headers.set(n,t);else if(r.headers instanceof i)r.headers.set(n,t);else r.headers=m(m({},r.headers),(u={},u[n]=t,u))}(n,t,i,u,g,h)});var a=p(),c=$(),f=void 0,s=r()[0](function(n){t!==n.name||f||(f=n)});return function(n){var t,e,r=function(r,o,n,i,t,e,u){var a={api:"fetch",request:{method:tt(r,o,i),timestamp:u,url:tn(r instanceof i?r.url:r),headers:et(t,r.headers,o.headers)},response:{status:n&&n.status||0,is_custom_error:false,timestamp:$()},duration:$()-u},c=e.collectBodyOnError,f=e.extraExtractor,s=function(){var n;c&&(a.request.body=(n=rt(r,o,i))===null||n===void 0?void 0:n.toString())};if(n)try{var l=et(t,n.headers);a.response.headers=l;try{(l["content-type"]||"").indexOf("application/json")!==-1&&f&&n.clone().json().then(function(n){var t;var e=f(n,a,(t=rt(r,o,i))===null||t===void 0?void 0:t.toString());if(e){a.extra=e;a.response.is_custom_error=true;s()}}).catch(y)}catch(n){}n.status>=400&&s()}catch(n){}else s();return a}(i,u,n,g,h,l,c),o=(e=!(t=function(n){f&&(n.response.timing=f),kn(n,v),a&&a({ev_type:zn,payload:n}),s()}),function(n){e||(e=!0,t(n))});setTimeout(function(){o(r)},1e3)}}))},nt=function(n,t){return n instanceof t},tt=function(n,t,e){t=t&&t.method||"get";return(t=nt(n,e)?n.method||t:t).toLowerCase()},et=function(t){for(var n=[],e=1;et.frustrating_threshold?2:r>t.satisfying_threshold||0===e?0:1}function lt(o,i){return function(n,t){var e=n.payload;switch(n.ev_type){case"performance":var r=e.name;e.isSupport&&o(t[wt],r,e.value);break;case"action":o(t[wt],"action",e.duration||0);break;case Un:i(t[xt],0);break;case zn:e.response.is_custom_error||400<=e.response.status?i(t[xt],1):(r=e.response.timing)&&o(t[Et],0,r.duration);break;case"resource_error":i(t[xt],2);break;case"blank_screen":i(t[xt],3);break;case"resource":o(t[Et],1,e.duration);break;case"performance_longtask":e.longtasks.forEach(function(n){o(t[Et],2,n.duration)})}}}function dt(){function n(){o=[0,0,0],i={error_count:[0,0,0,0],duration_count:[0,0,0],perf_apdex:{}}}var o,i;return n(),[function(n,t,e){var r=n&&n[t];!r||e<=0||(n=e<(r[0].threshold||0)?0:e>(r[1].threshold||0)?2:1,o[n]+=r[n].weight,"string"==typeof t?(r=i[wt][e=t+"_"+n],i[wt][e]=(r||0)+1):2==n&&(i.duration_count[t]+=1))},function(n,t){n&&(o[2]+=n[t],i.error_count[t]+=1)},function(){return[o,i]},n]}var pt=["name","message","stack","filename","lineno","colno"],vt="jsError",ht=["hidden_3",function(t,n){var e,r,o,i=V(),u=K();i&&u&&(r=vn(i,"visibilitychange",e=function(n){t("pagehide"===n.type||ct(i))},!0),o=pn(u,"pagehide",e,!0),n(function(){r(),o()},function(n){n(ct(i))}))}],gt=["unload_0",function(n,t){var e,r,o,i=K();i&&(e=T(yn(n),1)[0],r=function(){e()},o=[],["unload","beforeunload","pagehide"].forEach(function(n){o.push(pn(i,n,r,!1))}),t(function(){o.forEach(function(n){return n()})}))}],mt=["hash_0",function(n,t){var e,r=K();r&&(e=pn(r,"hashchange",function(){return n(location.href)},!0),t(function(){e()}))}],yt=["history_0",function(n,t){var e,r,o,i=K()&&window.history,u=K();i&&u&&(r=function(){return n(location.href)},(e=[]).push(h(i,"pushState",o=function(e){return function(){for(var n=[],t=0;tt[0];case"gte":return n>=t[0];case"lt":return n=u&&l.call(this),clearTimeout(f),f=setTimeout(l.bind(this),a)},flush:function(){clearTimeout(f),l.call(this)},getBatchData:function(){return c.length?p(c):""},clear:function(){clearTimeout(f),c=[]},fail:function(n){r=n}});function l(){var t;c.length&&(t=this.getBatchData(),o.post({url:i,data:t,fail:function(n){r&&r(n,t)}}),c=[])}var d=s.send;return hn(function(){var t,n;e.transport.useBeacon?(t=Pt(),(n=s.getBatchData())&&(t.post(s.getEndpoint(),n),s.clear()),s.send=function(n){t.post(s.getEndpoint(),p([n]))},gn(function(){s.send=d})):s.flush()}),s}var zt="https://"+(en((null===(ze=nn())||void 0===ze?void 0:ze.getAttribute("src"))||"").domain||"sf16-short-sg.bytedapm.com")+"/slardar/fe/sdk-web/plugins",Wt="1.14.4",Gt="/monitor_web/settings/browser-settings",Jt="/monitor_browser/collect/batch/",Xt=["/log/sentry/",Jt,Gt],Ft="session",Yt=["blankScreen","action"],$t={sample_rate:1,include_users:[],sample_granularity:Ft,rules:{}},Kt=20,Vt="";function Qt(n,t,e){var r,o,i;void 0===e&&(e=ee),r=function(){n.on("init",function(){e(n,t)})},o=K(),i=V(),o&&i&&("complete"!==i.readyState?pn(o,"load",function(){setTimeout(function(){r()},0)},!1):r())}function Zt(o){return function(n,t){var e,r=o.config().pluginBundle;o.destroyAgent.has(n)&&o.destroyAgent.remove(n),void 0!==t&&o.set({plugins:m(m({},o.config().plugins),((e={})[n]=t,e))}),(r&&~r.plugins.indexOf(n)?ne:te)([n],o)}}var ne=function(n,t,e,r){void 0===r&&(r=re);var o=t.config(),i=o.plugins,o=o.pluginBundle,u=n.filter(function(n){return i[n]&&!t.destroyAgent.has(n)}),n=function(){return u.forEach(function(n){return oe(t,n,e)})};u.every(function(n){return ue(n,e)})?n():r(t,{name:o.name},n)},te=function(n,t,e,r){void 0===r&&(r=re);var o=t.config().plugins;n.filter(function(n){return o[n]&&!t.destroyAgent.has(n)}).forEach(function(n){ue(n,e)?oe(t,n,e):r(t,{name:n,config:o[n]},function(){return oe(t,n,e)})})};function ee(n,t,e){void 0===e&&(e=re);var r=n.config().pluginBundle,r=r?r.plugins:[];ne(r,n,t,e),te(Yt,n,t,e),n.provide("reloadPlugin",Zt(n))}function re(n,t,e,r){var o=t.name,t=t.config;(r=void 0===r?bn:r)((n=n,o=o,null!==(t=null==(t=t)?void 0:t.path)&&void 0!==t?t:n.config().pluginPathPrefix+"/"+c(o)+"."+Wt+"."+Vt+"js"),function(){e()})}function oe(n,t,e){if(e=void 0===e?sn(K()):e){e=ie(e,t);if(e)try{if(n.destroyAgent.has(t))return;e.apply(n)}catch(n){un(n),O("[loader].applyPlugin failed",t,n)}else O("[loader].applyPlugin not found",t)}}function ie(n,t){return n.plugins.filter(function(n){return n.name===t&&n.version===Wt})[0]}function ue(n,t){return!(!(t=void 0===t?sn(K()):t)||!t.plugins)&&!!ie(t,n)}function ae(n,t,e){(e=void 0===e?sn(K()):e)&&e.plugins&&(ie(e,n)||e.plugins.push({name:n,version:Wt,apply:t}))}function ce(n){var t,e;try{for(var r=function(n){var t="function"==typeof Symbol&&Symbol.iterator,e=t&&n[t],r=0;if(e)return e.call(n);if(n&&"number"==typeof n.length)return{next:function(){return{value:(n=n&&r>=n.length?void 0:n)&&n[r++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(["userId","deviceId","sessionId","env"]),o=r.next();!o.done;o=r.next()){var i=o.value;n[i]||delete n[i]}}catch(n){t={error:n}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return n}function fe(n){var t,e=n.plugins||{};for(t in e)e[t]&&!E(e[t])&&(e[t]={});return ce(m(m({},n),{plugins:e}))}function se(n){return E(n)&&"bid"in n}function le(n){return ce(m({},n))}function de(r){var o=[];return r.observe=function(n){o.push(n)},r.push=function(){for(var n,t=[],e=0;e