Files
neo 932ec3ac8f KPI cards: Bloomberg stock ticker style
- Redesign KPI cards to look like stock tickers
- Add ticker ID (e.g. ВЫРУЧК:KPI, AOV:KPI)
- Arrow up/down SVG indicators for change direction
- Mini trend-line (50px) inside each card
- Change color: green (#16a34a) for up, red (#e21d1d) for down
- Remove sparkline background area, keep only line
- Fix duplicate arrowUp variable naming (bArrowUp/bArrowDown/bArrowNeutral)
2026-06-21 18:14:08 +05:00

1 line
9.6 KiB
JavaScript

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["fast-path"]=t():e["fast-path"]=t()}(this,(()=>(()=>{"use strict";var e={r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function r(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}e.r(t);var n=function e(t,n){function o(e,o,i){if("undefined"!=typeof document){"number"==typeof(i=r({},n,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var s in i)i[s]&&(a+="; "+s,!0!==i[s]&&(a+="="+i[s].split(";")[0]));return document.cookie=e+"="+t.write(o,e)+a}}return Object.create({set:o,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var r=document.cookie?document.cookie.split("; "):[],n={},o=0;o<r.length;o++){var i=r[o].split("="),a=i.slice(1).join("=");try{var s=decodeURIComponent(i[0]);if(n[s]=t.read(a,s),e===s)break}catch(e){}}return e?n[e]:n}},remove:function(e,t){o(e,"",r({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,r({},this.attributes,t))},withConverter:function(t){return e(r({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});const o="_user-data";var i,a;!function(e){e.BLOOMBERG_ALL="bbg-all",e.BLOOMBERG_DIGITAL="bbg-digital",e.BUSINESSWEEK_PRINT="bw-print",e.BUSINESSWEEK_DIGITAL="bw-digital",e.BUSINESSWEEK_ZINIO="bw-zinio",e.NEWSLETTER="newsletter-digital"}(i||(i={})),function(e){e.TECH_NEWSLETTER="TECH_NEWSLETTER"}(a||(a={}));const s="businessweek",l=["bingbot","googlebot","googlebot-news","mediapartners-google","facebot","publication-access-for-facebook","facebookcatalog","facebookexternalhit","slurp","spinn3r","wazzupcrawler","socialflow/0.10","socialflow/2014","socialflow/2015","socialflow/2016","isentia-ingestion-bloomberg","meltwaternews"];const c=function(e=window.location.href){const t={},r=new URL(e),n=r.searchParams.keys();for(const e of n){const n=r.searchParams.get(e);t[e]=n||!0}return t};var u,d;!function(e){e[e.error=0]="error",e[e.warn=1]="warn",e[e.info=2]="info",e[e.debug=3]="debug",e[e.trace=4]="trace"}(u||(u={})),function(e){e.unexpectedTSError="Unexpected TS error",e.breg="BLOOMBERG REGISTRATION",e.gatehouse="GATEHOUSE",e.eco="EMBEDDED CHECKOUT",e.abbaClient="ABBA Client",e.abbaParsing="ABBA CONFIG PARSING",e.extendedAccess="EXTENDED ACCESS",e.personalization="Personalization",e.urgentError="Urgent Error should trigger a BF",e.unexpectedNonCriticalError="Unexpected, but not critical error",e.rateplan="Rate plan related issue",e.wallE="WALL-E",e.wallEImpressionTracking="WALL-E IMPRESSION TRACKING",e.theWall="THE-WALL",e.statsigClient="STATSIG CLIENT",e.japanWall="JAPAN WALL",e.videoWall="VIDEO WALL",e.experiments="EXPERIMENTS"}(d||(d={}));const f=new class{constructor(e){this.isProd=e.isProd,this.isGreaterThanStg=e.isGreaterThanStg,this.prefix=e.prefix,this.logLevelLimit=this.isProd?u.warn:u.trace}log(e,...t){const r=u[e];let n,o;try{n=c().fortressLog,o=n&&u[n]}catch(e){console.log(`${this.prefix} unable to find query params`)}r>this.logLevelLimit&&o&&r>o||this.isProd&&!o||console[e](this.prefix,new Date(Date.now()).toISOString(),...t)}logError(e,t,r){var n;const o=r||new Error(t);console.error(this.prefix,new Date(Date.now()).toISOString(),e,t,o),this.isGreaterThanStg&&(null===(n=window.newrelic)||void 0===n||n.noticeError(o,{errorGroup:e,applicationCaller:"fortressClient",displayMessage:t}))}}({isProd:!0,isGreaterThanStg:!0,prefix:"[FORTRESS]"});function w(e,...t){f.log(e,...t)}const g=function(){return"www.bloomberg.com"===window.location.hostname},p=e=>{try{return window.localStorage.getItem(e)}catch(e){return null}},h=e=>{try{window.localStorage.removeItem(e)}catch(t){throw new Error(`Error removing key: ${e} from localStorage`)}},m=(e,t)=>{const r=p(e);if(!r)return null;const n=p(t);if(!n||(e=>{const t=new Date(e).getTime();return!!isNaN(t)||t<=Date.now()})(n))return h(e),h(t),null;try{return JSON.parse(r)}catch(e){return null}},E=()=>{var e;let t;const r=m("__$$user-data","__$$user-data-expiry");try{t=JSON.parse(n.get(o))}catch(e){}try{if(r&&Object.keys(r).length>0){if(!((e,t)=>{if(!e&&!t)return!0;if(!e||!t)return!1;if(e.status!==t.status)return!1;if(e.linkedAccounts!==t.linkedAccounts)return!1;const r=e.newsletterIds||[],n=t.newsletterIds||[];if(r.length!==n.length)return!1;for(let e=0;e<r.length;e++)if(r[e]!==n[e])return!1;const o=e.subscriptionsData||[],i=t.subscriptionsData||[];if(o.length!==i.length)return!1;for(let e=0;e<o.length;e++){const t=o[e],r=i[e];if(t.product!==r.product)return!1;if(t.type!==r.type)return!1;const n=t.entitlements||[],a=r.entitlements||[];if(n.length!==a.length)return!1;for(let e=0;e<n.length;e++)if(n[e]!==a[e])return!1;const s=t.features||[],l=r.features||[];if(s.length!==l.length)return!1;for(let e=0;e<s.length;e++)if(s[e]!==l[e])return!1}return!0})(r,t))throw new Error("User data cookie does not match locally stored cookie data")}}catch(n){null===(e=window.newrelic)||void 0===e||e.addPageAction("fortressClient_getUserDataFromCookie",{action:"getUserDataFromCookieFailure",message:"User data cookie does not match locally stored cookie data",userData:t,locallyStoredCookieData:{status:null==r?void 0:r.status,linkedAccounts:null==r?void 0:r.linkedAccounts,newsletterIds:null==r?void 0:r.newsletterIds,subscriptionsData:null==r?void 0:r.subscriptionsData},userId:D()})}return t},S=()=>{const e=E();if(!g()){const e=new URL(window.location.href).searchParams.get("mockSub");if("bbg"===(null==e?void 0:e.toLowerCase()))return(new Set).add(i.BLOOMBERG_DIGITAL);if("newsletter"===(null==e?void 0:e.toLowerCase()))return(new Set).add(i.NEWSLETTER);if("bw"===(null==e?void 0:e.toLowerCase()))return(new Set).add(i.BUSINESSWEEK_DIGITAL)}return(null==e?void 0:e.subscriptionsData)?e.subscriptionsData.reduce(((e,{entitlements:t})=>(t&&t.forEach((t=>e.add(t))),e)),new Set):new Set},b=e=>[i.BLOOMBERG_ALL,i.BLOOMBERG_DIGITAL].some((t=>e.has(t))),v=e=>[i.BUSINESSWEEK_DIGITAL,i.BUSINESSWEEK_PRINT,i.BUSINESSWEEK_ZINIO].some((t=>e.has(t))),I=()=>{var e;const t=E();return(null==t?void 0:t.subscriptionsData)&&(null===(e=t.subscriptionsData.filter((e=>"NEWSLETTER"===e.product))[0])||void 0===e?void 0:e.features)||[]},L=()=>{let e;if(!g()){const e=new URL(window.location.href).searchParams.get("mockUserStatus");if(e)return e}try{e=JSON.parse(n.get(o))}catch(e){}if(e)return e.status},T=()=>{if(!g()&&new URL(window.location.href).searchParams.get("mockSub"))return!0;return!!E()&&"logged_in"===L()},R=(e,t,r,n,o)=>b(e)||((e,t,r,n)=>v(e)&&(t===s||r===s||n===s))(e,t,r,n)||(e=>{if(0===e.length)return!1;const t=I();return 0!==t.length&&(w("info",`Comparing if any of the newsletters in ${e} are in ${t}`),Boolean(e.find((e=>t.includes(e)))))})(o);const y=e=>!g()&&new URL(window.location.href).searchParams.get("showPaywall")===e,A=()=>"milk"!==n.get("tagalong")&&!y("true")&&!function(){const e=new URL(window.location.href).searchParams;return null!==e.get("abbaPreview")&&null===e.get("accesslistMembership")}()&&(!((g()||"milk"!==n.get("samoa"))&&!y("false"))||!!n.get("_accesslist-membership")),C=e=>{var t;if("undefined"!=typeof window){if("true"===new URLSearchParams(window.location.search).get("mockIsMetered"))return!1}if(window.location.pathname.includes("/press-releases/"))return!0;if(e&&!e.contentId)return!0;if(null==e?void 0:e.contentAccess){const{contentAccess:t}=e;return!(e=>{const{restrictAccessDate:t}=e;return!t||new Date(t).getTime()<(new Date).getTime()})(t)&&"SUBSCRIBER"!==t.openAccessLevel&&("REGISTERED"!==t.openAccessLevel||T())}return!(null==e?void 0:e.archived)&&!(null==e?void 0:e.premium)&&(!1===(null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.isMetered)&&!e.metadata.registrationWall)},D=()=>n.get("_breg-uid"),k=["/graphics/","/features/","/billionaires/","/business-schools/"];function O(e){return function(e){return k.some((t=>e.pathname.startsWith(t)))}(e)?e.href.includes("/jp/"):"/jp"===e.pathname||e.pathname.startsWith("/jp/")}const U=e=>{if(!e)return!1;if("string"!=typeof e.locale)return!1;const t=e.locale.toLowerCase();return"en"!==t&&"ja"!==t&&(!O(new URL(window.location.href))||(r=d.japanWall,n=`Japanese content accessed with non-JP locale: ${t}`,f.logError(r,n,o),!1));var r,n,o},B={runChecks:e=>{var t,r,n;w("info",`article info in fast path is ${JSON.stringify(e)}`);return U(e)||R(S(),(null==e?void 0:e.brand)||"",(null==e?void 0:e.franchise)||"",(null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.cobrand)||"",(null===(n=null===(r=null==e?void 0:e.metadata)||void 0===r?void 0:r.collections)||void 0===n?void 0:n.newsletterEntitlements)||[])||A()||l.includes(window.navigator.userAgent.toLowerCase())||C(e)?"allow":"indeterminate"}},N=e=>{window.fastPath&&(window.fastPath.result=e)};return window.performance||Object.defineProperty(window,"performance",{value:{mark:()=>{},now:()=>0,getEntriesByName:()=>[]},writable:!1}),window.fastPath={evaluate(e,t){w("info","Running evaluate from fast-path-456");const r=B.runChecks(null==t?void 0:t.articleInfo);var n;w("info",`fast-path result is ${r}`),w("info","<performance mark>",n="fortress: fast-path decision made"),performance.mark(n),r&&"indeterminate"!==r?function(e,t){N(e),t(e,{isUsingOverlay:"block"===e})}(r,e):N(r)}},t})()));