-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchunk-UC6IEEZ5.js
1 lines (1 loc) · 30.3 KB
/
chunk-UC6IEEZ5.js
1
import{a as ge}from"./chunk-YA72FBKR.js";import{a as pe,b as P}from"./chunk-IBGKW3YC.js";import{a as he}from"./chunk-LBZNYUHD.js";import{b as ue,c as T,d as B,e as C,f as j,g as A}from"./chunk-DQ47BEOY.js";import{b as D,d as V}from"./chunk-A7YDWOAO.js";import{a as me}from"./chunk-GNGLHN23.js";import{$ as L,Cb as U,Db as Y,Eb as F,Fb as r,Gb as ne,Ha as ee,Hb as m,Ib as k,Jb as re,M as G,O as X,P as Z,Pb as s,Q as J,Qb as ae,Rb as d,Sa as te,Ua as a,Ub as M,Va as R,ba as q,bb as ie,cc as le,gb as b,jc as ce,kc as oe,l as $,mb as H,nb as u,nc as se,o as K,oc as de,p as Q,pb as I,qb as y,tb as n,ub as i,va as v,vb as _,wa as f,wb as N,xa as w,xb as x,ya as O,yb as h}from"./chunk-PPE7DTG5.js";var Ee=["chartContainer"],ye=["chart"];function Ce(o,c){if(o&1){let e=N();n(0,"button",44),x("click",function(){v(e);let l=h(2);return f(l.setExchange(l.ExchangeName.NSE))}),r(1," NSE "),i()}if(o&2){let e=h(),t=h();I("rounded-lg",!e.scripCode.bse),u("ngClass",t.activeExchange===t.ExchangeName.NSE?"bg-primary-700 text-white dark:bg-primary-600":"bg-white text-gray-900 dark:bg-gray-800 dark:text-white hover:bg-gray-100 hover:text-primary-700 dark:hover:bg-gray-700 dark:hover:text-primary-500 focus:text-primary-700 dark:focus:text-primary-500"),H("disabled",!e.scripCode.bse)}}function be(o,c){if(o&1){let e=N();n(0,"button",45),x("click",function(){v(e);let l=h(2);return f(l.setExchange(l.ExchangeName.BSE))}),r(1," BSE "),i()}if(o&2){let e=h(),t=h();I("rounded-lg",!e.scripCode.nse),u("ngClass",t.activeExchange===t.ExchangeName.BSE?"bg-primary-700 text-white dark:bg-primary-600":"bg-white text-gray-900 dark:bg-gray-800 dark:text-white hover:bg-gray-100 hover:text-primary-700 dark:hover:bg-gray-700 dark:hover:text-primary-500 focus:text-primary-700 dark:focus:text-primary-500"),H("disabled",!e.scripCode.nse)}}function _e(o,c){if(o&1&&(n(0,"div",48)(1,"div",47),r(2,"Change:\xA0"),i(),r(3),s(4,"number"),s(5,"number"),i()),o&2){let e=h(3);u("ngClass",e.chartCrosshairData.change.direction===e.Direction.UP?"text-green-500 dark:text-green-400":"text-red-600 dark:text-red-500"),a(3),k(" ",d(4,3,e.chartCrosshairData.change.value,"1.2-2")," (",d(5,6,e.chartCrosshairData.change.percentage,"1.2-2"),"%) ")}}function ke(o,c){if(o&1&&(n(0,"div",46)(1,"div",47),r(2,"Open:\xA0"),i(),r(3),s(4,"number"),i(),n(5,"div",46)(6,"div",47),r(7,"Close:\xA0"),i(),r(8),s(9,"number"),i(),n(10,"div",46)(11,"div",47),r(12,"Low:\xA0"),i(),r(13),s(14,"number"),i(),n(15,"div",46)(16,"div",47),r(17,"High:\xA0"),i(),r(18),s(19,"number"),i(),n(20,"div",46)(21,"div",47),r(22,"Volume:\xA0"),i(),r(23),s(24,"number"),i(),b(25,_e,6,9,"div",48)),o&2){let e=h(2);a(3),m(" ",d(4,6,e.chartCrosshairData.open,"1.2-2")," "),a(5),m(" ",d(9,9,e.chartCrosshairData.close,"1.2-2")," "),a(5),m(" ",d(14,12,e.chartCrosshairData.low,"1.2-2")," "),a(5),m(" ",d(19,15,e.chartCrosshairData.high,"1.2-2")," "),a(5),m(" ",d(24,18,e.chartCrosshairData.volume,"1.0")," "),a(2),y(e.chartCrosshairData.change?25:-1)}}function Se(o,c){o&1&&(n(0,"div",23),w(),n(1,"svg",49),_(2,"path",50)(3,"path",51),i(),O(),n(4,"span",52),r(5,"Loading..."),i()())}function we(o,c){o&1&&(n(0,"div",24),w(),n(1,"svg",53),_(2,"path",54),i(),O(),n(3,"span"),r(4,"No Data"),i()())}function Te(o,c){o&1&&(n(0,"span",52),r(1,"Minimize"),i(),w(),n(2,"svg",55),_(3,"path",56),i())}function De(o,c){o&1&&(n(0,"span",52),r(1,"Expand"),i(),w(),n(2,"svg",55),_(3,"path",57),i())}function Re(o,c){if(o&1){let e=N();n(0,"div",4)(1,"div",5)(2,"div",6),r(3),i(),n(4,"div")(5,"div",7),b(6,Ce,2,4,"button",8)(7,be,2,4,"button",9),i()()(),n(8,"div",10)(9,"div",11),r(10),s(11,"number"),i(),n(12,"div",12),r(13),s(14,"number"),s(15,"number"),i(),n(16,"div",13),r(17),s(18,"number"),i()()(),n(19,"div",14,0)(21,"div",15)(22,"div",16)(23,"div",17),b(24,ke,26,21),i(),n(25,"div",18)(26,"div",7)(27,"button",19),x("click",function(){v(e);let l=h();return f(l.setChartTimeRange(l.ChartTimeRange.ONE_DAY))}),r(28," 1D "),i(),n(29,"button",20),x("click",function(){v(e);let l=h();return f(l.setChartTimeRange(l.ChartTimeRange.ONE_WEEK))}),r(30," 1W "),i(),n(31,"button",20),x("click",function(){v(e);let l=h();return f(l.setChartTimeRange(l.ChartTimeRange.ONE_MONTH))}),r(32," 1M "),i(),n(33,"button",20),x("click",function(){v(e);let l=h();return f(l.setChartTimeRange(l.ChartTimeRange.THREE_MONTHS))}),r(34," 3M "),i(),n(35,"button",20),x("click",function(){v(e);let l=h();return f(l.setChartTimeRange(l.ChartTimeRange.SIX_MONTHS))}),r(36," 6M "),i(),n(37,"button",20),x("click",function(){v(e);let l=h();return f(l.setChartTimeRange(l.ChartTimeRange.ONE_YEAR))}),r(38," 1Y "),i(),n(39,"button",21),x("click",function(){v(e);let l=h();return f(l.setChartTimeRange(l.ChartTimeRange.FIVE_YEAR))}),r(40," 5Y "),i()()()(),n(41,"div",22,1),b(43,Se,6,0,"div",23)(44,we,5,0,"div",24),i(),n(45,"div",25)(46,"button",26),x("click",function(){v(e);let l=h();return f(l.toggleFullscreen())}),b(47,Te,4,0)(48,De,4,0),i()()()(),n(49,"div",27)(50,"div",28)(51,"h5",29),r(52," Overview "),i(),n(53,"div",30)(54,"div",31)(55,"div",32)(56,"div",33),r(57," Open "),i(),r(58),s(59,"number"),i(),n(60,"div",32)(61,"div",33),r(62," Prev. Close "),i(),r(63),s(64,"number"),i()(),n(65,"div",34)(66,"div")(67,"div",33),r(68," Day Range (\u20B9) "),i(),n(69,"div",35)(70,"div",32),r(71),s(72,"number"),i(),n(73,"div"),r(74),s(75,"number"),i()(),n(76,"div",36)(77,"div",37),r(78," L "),i(),_(79,"input",38),n(80,"div",39),r(81," H "),i()()(),n(82,"div")(83,"div",33),r(84," 52 Week Range (\u20B9) "),i(),n(85,"div",35)(86,"div",32),r(87),s(88,"number"),i(),n(89,"div"),r(90),s(91,"number"),i()(),n(92,"div",36)(93,"div",37),r(94," L "),i(),_(95,"input",38),n(96,"div",39),r(97," H "),i()()()()()(),n(98,"div",28)(99,"h5",29),r(100," Metrics "),i(),n(101,"div",40)(102,"div",41)(103,"div",32)(104,"div",33),r(105," EPS (TTM) "),i(),n(106,"div",42),r(107),s(108,"number"),i()(),n(109,"div",32)(110,"div",33),r(111," P/E Ratio "),i(),n(112,"div",42),r(113),s(114,"number"),i()(),n(115,"div",32)(116,"div",33),r(117," VWAP "),i(),n(118,"div",42),r(119),s(120,"number"),i()()(),n(121,"div",41)(122,"div",32)(123,"div",33),r(124," Dividend Yield "),i(),n(125,"div",42),r(126),s(127,"number"),i()(),n(128,"div",32)(129,"div",33),r(130," Market Cap "),i(),n(131,"div",42),r(132),s(133,"number"),i()(),n(134,"div",32)(135,"div",33),r(136," Face Value "),i(),n(137,"div",42),r(138),s(139,"number"),i()()()()(),n(140,"div",28)(141,"h5",29),r(142," Returns "),i(),n(143,"div",40)(144,"div",41)(145,"div",43)(146,"div",33),r(147," 1 Month "),i(),n(148,"div",42),r(149),s(150,"number"),i()(),n(151,"div",43)(152,"div",33),r(153," 3 Months "),i(),n(154,"div",42),r(155),s(156,"number"),i()(),n(157,"div",43)(158,"div",33),r(159," 6 Months "),i(),n(160,"div",42),r(161),s(162,"number"),i()()(),n(163,"div",41)(164,"div",43)(165,"div",33),r(166," 1 Year "),i(),n(167,"div",42),r(168),s(169,"number"),i()(),n(170,"div",43)(171,"div",33),r(172," 3 Years "),i(),n(173,"div",42),r(174),s(175,"number"),i()(),n(176,"div",43)(177,"div",33),r(178," 5 Years "),i(),n(179,"div",42),r(180),s(181,"number"),i()()()()(),n(182,"div",28)(183,"h5",29),r(184," Scrip Info "),i(),n(185,"div",40)(186,"div",41)(187,"div",32)(188,"div",33),r(189,"NSE"),i(),n(190,"div",42),r(191),i()(),n(192,"div",32)(193,"div",33),r(194,"BSE"),i(),n(195,"div",42),r(196),i()(),n(197,"div",32)(198,"div",33),r(199," ISIN "),i(),n(200,"div",42),r(201),i()()(),n(202,"div",41)(203,"div",32)(204,"div",33),r(205," Sector "),i(),n(206,"div",42),r(207),i()(),n(208,"div",32)(209,"div",33),r(210," Industry "),i(),n(211,"div",42),r(212),i()(),n(213,"div",32)(214,"div",33),r(215," Market Cap Type "),i(),n(216,"div",42),r(217),i()()()()()()}if(o&2){let e=c,t=h();a(3),ne(e.name),a(3),y(e.scripCode.nse?6:-1),a(),y(e.scripCode.bse?7:-1),a(3),m(" \u20B9",d(11,67,e.quote==null||e.quote[t.activeExchange]==null?null:e.quote[t.activeExchange].price,"1.2-2")," "),a(2),u("ngClass",(e.quote==null||e.quote[t.activeExchange]==null||e.quote[t.activeExchange].change==null?null:e.quote[t.activeExchange].change.direction)===t.Direction.UP?"text-green-500 dark:text-green-400":"text-red-600 dark:text-red-500"),a(),re(" ",(e.quote==null||e.quote[t.activeExchange]==null||e.quote[t.activeExchange].change==null?null:e.quote[t.activeExchange].change.direction)===t.Direction.UP?"\u25B2":"\u25BC"," \u20B9",d(14,70,e.quote==null||e.quote[t.activeExchange]==null||e.quote[t.activeExchange].change==null?null:e.quote[t.activeExchange].change.value,"1.2-2")," (",d(15,73,e.quote==null||e.quote[t.activeExchange]==null||e.quote[t.activeExchange].change==null?null:e.quote[t.activeExchange].change.percentage,"1.2-2"),"%) "),a(4),m(" Volume: ",d(18,76,e.quote==null||e.quote[t.activeExchange]==null?null:e.quote[t.activeExchange].volume,"1.0")," "),a(2),I("md:px-4",!t.isChartInFullscreen),a(2),u("ngClass",t.isChartInFullscreen?"pe-4":"md:shadow md:rounded-lg md:border md:border-gray-200 md:dark:border-gray-700"),a(3),y(t.chartCrosshairData?24:-1),a(3),u("ngClass",t.activeChartTimeRange===t.ChartTimeRange.ONE_DAY?"bg-primary-700 text-white dark:bg-primary-600":"bg-white text-gray-900 dark:bg-gray-800 dark:text-white hover:bg-gray-100 hover:text-primary-700 dark:hover:bg-gray-700 dark:hover:text-primary-500 focus:text-primary-700 dark:focus:text-primary-500"),a(2),u("ngClass",t.activeChartTimeRange===t.ChartTimeRange.ONE_WEEK?"bg-primary-700 text-white dark:bg-primary-600":"bg-white text-gray-900 dark:bg-gray-800 dark:text-white hover:bg-gray-100 hover:text-primary-700 dark:hover:bg-gray-700 dark:hover:text-primary-500 focus:text-primary-700 dark:focus:text-primary-500"),a(2),u("ngClass",t.activeChartTimeRange===t.ChartTimeRange.ONE_MONTH?"bg-primary-700 text-white dark:bg-primary-600":"bg-white text-gray-900 dark:bg-gray-800 dark:text-white hover:bg-gray-100 hover:text-primary-700 dark:hover:bg-gray-700 dark:hover:text-primary-500 focus:text-primary-700 dark:focus:text-primary-500"),a(2),u("ngClass",t.activeChartTimeRange===t.ChartTimeRange.THREE_MONTHS?"bg-primary-700 text-white dark:bg-primary-600":"bg-white text-gray-900 dark:bg-gray-800 dark:text-white hover:bg-gray-100 hover:text-primary-700 dark:hover:bg-gray-700 dark:hover:text-primary-500 focus:text-primary-700 dark:focus:text-primary-500"),a(2),u("ngClass",t.activeChartTimeRange===t.ChartTimeRange.SIX_MONTHS?"bg-primary-700 text-white dark:bg-primary-600":"bg-white text-gray-900 dark:bg-gray-800 dark:text-white hover:bg-gray-100 hover:text-primary-700 dark:hover:bg-gray-700 dark:hover:text-primary-500 focus:text-primary-700 dark:focus:text-primary-500"),a(2),u("ngClass",t.activeChartTimeRange===t.ChartTimeRange.ONE_YEAR?"bg-primary-700 text-white dark:bg-primary-600":"bg-white text-gray-900 dark:bg-gray-800 dark:text-white hover:bg-gray-100 hover:text-primary-700 dark:hover:bg-gray-700 dark:hover:text-primary-500 focus:text-primary-700 dark:focus:text-primary-500"),a(2),u("ngClass",t.activeChartTimeRange===t.ChartTimeRange.FIVE_YEAR?"bg-primary-700 text-white dark:bg-primary-600":"bg-white text-gray-900 dark:bg-gray-800 dark:text-white hover:bg-gray-100 hover:text-primary-700 dark:hover:bg-gray-700 dark:hover:text-primary-500 focus:text-primary-700 dark:focus:text-primary-500"),a(2),u("ngClass",t.isChartInFullscreen?"flex-1":"w-full h-80"),a(2),y(t.isChartLoading?43:-1),a(),y(t.isChartNoData?44:-1),a(),u("ngClass",t.isChartInFullscreen?"block bottom-2 right-3":"block sm:hidden bottom-1 right-1"),a(2),y(t.isChartInFullscreen?47:48),a(11),m(" \u20B9",d(59,79,e.quote==null||e.quote[t.activeExchange]==null?null:e.quote[t.activeExchange].open,"1.2-2")," "),a(5),m(" \u20B9",d(64,82,e.quote==null||e.quote[t.activeExchange]==null?null:e.quote[t.activeExchange].close,"1.2-2")," "),a(8),m(" ",d(72,85,e.quote==null||e.quote[t.activeExchange]==null?null:e.quote[t.activeExchange].low,"1.2-2")," "),a(3),m(" ",d(75,88,e.quote==null||e.quote[t.activeExchange]==null?null:e.quote[t.activeExchange].high,"1.2-2")," "),a(5),u("min",e.quote==null||e.quote[t.activeExchange]==null?null:e.quote[t.activeExchange].low)("max",e.quote==null||e.quote[t.activeExchange]==null?null:e.quote[t.activeExchange].high)("value",e.quote==null||e.quote[t.activeExchange]==null?null:e.quote[t.activeExchange].price),a(8),m(" ",d(88,91,e.quote==null||e.quote[t.activeExchange]==null?null:e.quote[t.activeExchange].fiftyTwoWeekLow,"1.2-2")," "),a(3),m(" ",d(91,94,e.quote==null||e.quote[t.activeExchange]==null?null:e.quote[t.activeExchange].fiftyTwoWeekHigh,"1.2-2")," "),a(5),u("min",e.quote==null||e.quote[t.activeExchange]==null?null:e.quote[t.activeExchange].fiftyTwoWeekLow)("max",e.quote==null||e.quote[t.activeExchange]==null?null:e.quote[t.activeExchange].fiftyTwoWeekHigh)("value",e.quote==null||e.quote[t.activeExchange]==null?null:e.quote[t.activeExchange].price),a(12),m(" \u20B9",d(108,97,e.metrics==null||e.metrics[t.activeExchange]==null?null:e.metrics[t.activeExchange].eps,"1.2-2")," "),a(6),m(" ",d(114,100,e.metrics==null||e.metrics[t.activeExchange]==null?null:e.metrics[t.activeExchange].pe,"1.2-2")," "),a(6),m(" \u20B9",d(120,103,e.metrics==null||e.metrics[t.activeExchange]==null?null:e.metrics[t.activeExchange].vwap,"1.2-2")," "),a(7),m(" ",d(127,106,e.metrics==null||e.metrics[t.activeExchange]==null?null:e.metrics[t.activeExchange].dividendYield,"1.2-2"),"% "),a(6),m(" \u20B9",d(133,109,e.metrics==null||e.metrics[t.activeExchange]==null?null:e.metrics[t.activeExchange].marketCap,"1.2-2")," Cr. "),a(6),m(" \u20B9",d(139,112,e.metrics==null||e.metrics[t.activeExchange]==null?null:e.metrics[t.activeExchange].faceValue,"1.2-2")," "),a(7),u("ngClass",(e.performance==null||e.performance[t.activeExchange]==null||e.performance[t.activeExchange].monthly==null?null:e.performance[t.activeExchange].monthly.direction)===t.Direction.UP?"text-green-500 dark:text-green-400":"text-red-600 dark:text-red-500"),a(4),k(" ",(e.performance==null||e.performance[t.activeExchange]==null||e.performance[t.activeExchange].monthly==null?null:e.performance[t.activeExchange].monthly.direction)===t.Direction.UP?"\u25B2":"\u25BC"," ",d(150,115,e.performance==null||e.performance[t.activeExchange]==null||e.performance[t.activeExchange].monthly==null?null:e.performance[t.activeExchange].monthly.percentage,"1.2-2"),"% "),a(2),u("ngClass",(e.performance==null||e.performance[t.activeExchange]==null||e.performance[t.activeExchange].quarterly==null?null:e.performance[t.activeExchange].quarterly.direction)===t.Direction.UP?"text-green-500 dark:text-green-400":"text-red-600 dark:text-red-500"),a(4),k(" ",(e.performance==null||e.performance[t.activeExchange]==null||e.performance[t.activeExchange].quarterly==null?null:e.performance[t.activeExchange].quarterly.direction)===t.Direction.UP?"\u25B2":"\u25BC"," ",d(156,118,e.performance==null||e.performance[t.activeExchange]==null||e.performance[t.activeExchange].quarterly==null?null:e.performance[t.activeExchange].quarterly.percentage,"1.2-2"),"% "),a(2),u("ngClass",(e.performance==null||e.performance[t.activeExchange]==null||e.performance[t.activeExchange].halfYearly==null?null:e.performance[t.activeExchange].halfYearly.direction)===t.Direction.UP?"text-green-500 dark:text-green-400":"text-red-600 dark:text-red-500"),a(4),k(" ",(e.performance==null||e.performance[t.activeExchange]==null||e.performance[t.activeExchange].halfYearly==null?null:e.performance[t.activeExchange].halfYearly.direction)===t.Direction.UP?"\u25B2":"\u25BC"," ",d(162,121,e.performance==null||e.performance[t.activeExchange]==null||e.performance[t.activeExchange].halfYearly==null?null:e.performance[t.activeExchange].halfYearly.percentage,"1.2-2"),"% "),a(3),u("ngClass",(e.performance==null||e.performance[t.activeExchange]==null||e.performance[t.activeExchange].yearly==null||e.performance[t.activeExchange].yearly.one==null?null:e.performance[t.activeExchange].yearly.one.direction)===t.Direction.UP?"text-green-500 dark:text-green-400":"text-red-600 dark:text-red-500"),a(4),k(" ",(e.performance==null||e.performance[t.activeExchange]==null||e.performance[t.activeExchange].yearly==null||e.performance[t.activeExchange].yearly.one==null?null:e.performance[t.activeExchange].yearly.one.direction)===t.Direction.UP?"\u25B2":"\u25BC"," ",d(169,124,e.performance==null||e.performance[t.activeExchange]==null||e.performance[t.activeExchange].yearly==null||e.performance[t.activeExchange].yearly.one==null?null:e.performance[t.activeExchange].yearly.one.percentage,"1.2-2"),"% "),a(2),u("ngClass",(e.performance==null||e.performance[t.activeExchange]==null||e.performance[t.activeExchange].yearly==null||e.performance[t.activeExchange].yearly.three==null?null:e.performance[t.activeExchange].yearly.three.direction)===t.Direction.UP?"text-green-500 dark:text-green-400":"text-red-600 dark:text-red-500"),a(4),k(" ",(e.performance==null||e.performance[t.activeExchange]==null||e.performance[t.activeExchange].yearly==null||e.performance[t.activeExchange].yearly.three==null?null:e.performance[t.activeExchange].yearly.three.direction)===t.Direction.UP?"\u25B2":"\u25BC"," ",d(175,127,e.performance==null||e.performance[t.activeExchange]==null||e.performance[t.activeExchange].yearly==null||e.performance[t.activeExchange].yearly.three==null?null:e.performance[t.activeExchange].yearly.three.percentage,"1.2-2"),"% "),a(2),u("ngClass",(e.performance==null||e.performance[t.activeExchange]==null||e.performance[t.activeExchange].yearly==null||e.performance[t.activeExchange].yearly.five==null?null:e.performance[t.activeExchange].yearly.five.direction)===t.Direction.UP?"text-green-500 dark:text-green-400":"text-red-600 dark:text-red-500"),a(4),k(" ",(e.performance==null||e.performance[t.activeExchange]==null||e.performance[t.activeExchange].yearly==null||e.performance[t.activeExchange].yearly.five==null?null:e.performance[t.activeExchange].yearly.five.direction)===t.Direction.UP?"\u25B2":"\u25BC"," ",d(181,130,e.performance==null||e.performance[t.activeExchange]==null||e.performance[t.activeExchange].yearly==null||e.performance[t.activeExchange].yearly.five==null?null:e.performance[t.activeExchange].yearly.five.percentage,"1.2-2"),"% "),a(11),m(" ",e.scripCode.nse||t.NO_VALUE_PLACEHOLDER," "),a(5),m(" ",e.scripCode.bse||t.NO_VALUE_PLACEHOLDER," "),a(5),m(" ",e.scripCode.isin||t.NO_VALUE_PLACEHOLDER," "),a(6),m(" ",(e.details==null?null:e.details.sector)||t.NO_VALUE_PLACEHOLDER," "),a(5),m(" ",(e.details==null?null:e.details.industry)||t.NO_VALUE_PLACEHOLDER," "),a(5),m(" ",(e.metrics==null||e.metrics[t.activeExchange]==null?null:e.metrics[t.activeExchange].marketCapType)||t.NO_VALUE_PLACEHOLDER," ")}}function Be(o,c){o&1&&(n(0,"div",3),w(),n(1,"svg",49),_(2,"path",50)(3,"path",51),i(),O(),n(4,"span",52),r(5,"Loading..."),i()())}var E=function(o){return o.ONE_DAY="1D",o.ONE_WEEK="1W",o.ONE_MONTH="1M",o.THREE_MONTHS="3M",o.SIX_MONTHS="6M",o.ONE_YEAR="1Y",o.FIVE_YEAR="5Y",o}(E||{}),xe=class z{constructor(c,e,t,l){this.document=c,this.cdr=e,this.id=ee(""),this.activeChartTimeRange=E.ONE_DAY,this.activeExchange=T.NSE,this.isChartLoading=!0,this.isChartInFullscreen=!1,this.isChartNoData=!1,this.ExchangeName=T,this.Direction=B,this.ChartTimeRange=E,this.NO_VALUE_PLACEHOLDER=me.placeholders.NO_VALUE,this.showIntraDayChart$=new $(!0),this.isMarketOpen=!1,t.marketStatus$.pipe(P(this)).subscribe(({status:g})=>{this.isMarketOpen=g===ue.OPEN}),this.stock$=he(this.id).pipe(L(g=>t.getStock(g,!0)),q(g=>{if(g&&!g.scripCode.nse&&(this.activeExchange=T.BSE),g&&!this.chart&&(g.scripCode.nse||g.scripCode.bse)){let ve=t.getIntraDayChart((this.activeExchange===T.NSE?g.scripCode.nse:g.scripCode.bse)||"",j.STOCK),fe=t.getHistoricalChart(g.vendorCode.etm.chart||"",j.STOCK).pipe(q(S=>{S.length>0&&(this.historicChartData=S.reduce((p,W)=>(p.set(W.time,W),p),new Map))}));this.showIntraDayChart$.pipe(Z(),q(()=>{this.chart&&(this.chart.clearCrosshairPosition(),this.chart.applyOptions({timeScale:{visible:!1},rightPriceScale:{visible:!1}}),this.areaSeries&&this.areaSeries.setData([])),this.isChartLoading=!0}),L(S=>S?ve.pipe(P(this)):fe.pipe(G(1)))).pipe(X(100)).subscribe(S=>{if(S.length>0){if(this.isChartNoData=!1,this.initChart(S),this.areaSeries){let p=this.activeExchange===T.NSE?g.quote?.nse?.change?.direction:g.quote?.bse?.change?.direction;this.areaSeries.applyOptions({lineColor:p?p===B.UP?"#22c55e":"#ef4444":"#2962FF",topColor:p?p===B.UP?"rgba(34, 197, 94, 0.4)":"rgba(239, 68, 68, 0.4)":"rgba(41, 98, 255, 0.4)",bottomColor:p?p===B.UP?"rgba(34, 197, 94, 0.1)":"rgba(239, 68, 68, 0.1)":"rgba(41, 98, 255, 0.1)"})}l.resize$.pipe(P(this)).subscribe(()=>{this.chart&&this.chartRef&&(this.chart.resize(this.chartRef.nativeElement.offsetWidth,this.chartRef.nativeElement.offsetHeight),this.chart.timeScale().fitContent(),this.setChartTimeRange(this.activeChartTimeRange))}),l.settings$.pipe(P(this),J("colorScheme")).subscribe(({colorScheme:p})=>{p&&this.chart&&this.chart.applyOptions({layout:{textColor:p===D.DARK?"#fff":"#111827"},timeScale:{visible:!0,borderColor:p===D.DARK?"#374151":"#E5E7EB"},rightPriceScale:{visible:!0,borderColor:p===D.DARK?"#374151":"#E5E7EB"},crosshair:{horzLine:{labelBackgroundColor:p===D.DARK?"#111827":"#f3f4f6"},vertLine:{labelBackgroundColor:p===D.DARK?"#111827":"#f3f4f6"}}})})}else this.isChartNoData=!0;this.isChartLoading=!1,this.cdr.markForCheck()})}}))}setChartTimeRange(c){if(c){if(this.activeChartTimeRange=c,this.showIntraDayChart$.next(c===E.ONE_DAY),c!==E.ONE_DAY){let e=new Date,t;switch(c){case E.ONE_WEEK:t=C.getTimestampSince(e,10);break;case E.ONE_MONTH:t=C.getTimestampSince(e,30);break;case E.THREE_MONTHS:t=C.getTimestampSince(e,90);break;case E.SIX_MONTHS:t=C.getTimestampSince(e,180);break;case E.ONE_YEAR:t=C.getTimestampSince(e,365);break;case E.FIVE_YEAR:t=C.getTimestampSince(e,5*356);break;default:console.warn(`Invalid range: ${c}`)}this.chart&&t>0&&(this.chart.applyOptions({timeScale:{timeVisible:!1}}),this.areaSeries&&this.areaSeries.applyOptions({lastPriceAnimation:0}),this.areaSeries&&this.areaSeries.data().length>0&&this.chart.timeScale().setVisibleRange({from:C.epochToUtcTimestamp(t),to:C.epochToUtcTimestamp(e.getTime())}));return}this.chart&&(this.chart.applyOptions({timeScale:{timeVisible:!0}}),this.areaSeries&&this.areaSeries.applyOptions({lastPriceAnimation:this.isMarketOpen?1:0}),this.chart.timeScale().setVisibleLogicalRange({from:0,to:375}))}}setExchange(c){c&&(this.activeExchange=c)}onFullscreenChange(){this.document.fullscreenElement?this.isChartInFullscreen=!0:this.isChartInFullscreen=!1,this.chart&&this.chartRef&&(this.chart.resize(this.chartRef.nativeElement.offsetWidth,this.chartRef.nativeElement.offsetHeight),this.chart.timeScale().fitContent(),this.setChartTimeRange(this.activeChartTimeRange))}toggleFullscreen(){this.document.fullscreenElement?this.document.exitFullscreen():this.chartContainerRef&&this.chartContainerRef.nativeElement.requestFullscreen().then(()=>{screen.orientation.lock("landscape").catch(c=>{console.error(`An error occurred while trying to lock screen orientation to landscape: ${c.message} (${c.name})`)}),this.cdr.markForCheck()}).catch(c=>{console.error(`An error occurred while trying to switch into fullscreen mode: ${c.message} (${c.name})`)})}ngOnDestroy(){this.chart&&this.chart.unsubscribeCrosshairMove(this.chartCrosshairMoveEventHandler.bind(this))}initChart(c){if(this.chartRef?.nativeElement){let e=this.showIntraDayChart$.getValue();this.chart||(this.chart=ge(this.chartRef.nativeElement,{layout:{background:{color:"transparent"}},grid:{horzLines:{visible:!1},vertLines:{visible:!1}},handleScroll:!1,handleScale:!1,timeScale:{lockVisibleTimeRangeOnResize:!0,timeVisible:e,secondsVisible:!1}})),this.areaSeries||(this.areaSeries=this.chart.addAreaSeries({lineWidth:1,lastPriceAnimation:this.isMarketOpen&&e?1:0})),this.areaSeries.setData(c),this.setChartTimeRange(this.activeChartTimeRange),this.chart.subscribeCrosshairMove(this.chartCrosshairMoveEventHandler.bind(this))}}chartCrosshairMoveEventHandler({time:c}){c&&this.historicChartData&&this.historicChartData.size>0?this.chartCrosshairData=this.historicChartData.get(c.toLocaleString()):this.chartCrosshairData=void 0,this.cdr.markForCheck()}static{this.\u0275fac=function(e){return new(e||z)(R(le),R(M),R(A),R(V))}}static{this.\u0275cmp=ie({type:z,selectors:[["app-stocks"]],viewQuery:function(e,t){if(e&1&&(U(Ee,5),U(ye,5)),e&2){let l;Y(l=F())&&(t.chartContainerRef=l.first),Y(l=F())&&(t.chartRef=l.first)}},hostBindings:function(e,t){e&1&&x("fullscreenchange",function(){return t.onFullscreenChange()},!1,te)},inputs:{id:[1,"id"]},decls:4,vars:3,consts:[["chartContainer",""],["chart",""],[1,"flex","h-full","flex-col"],["role","status",1,"flex","flex-1","items-center","justify-center"],[1,"space-y-2","p-4"],[1,"flex","space-x-4"],[1,"flex-1","text-2xl","font-semibold"],["role","group",1,"inline-flex","h-8","rounded-md","shadow-sm"],["type","button",1,"focus:ring-primary-700","dark:focus:ring-primary-500","inline-flex","h-8","w-10","items-center","rounded-s-lg","border","border-r-0","border-gray-200","px-2","text-xs","focus:z-10","focus:ring-2","dark:border-gray-700",3,"ngClass","rounded-lg"],["type","button",1,"focus:ring-primary-700","dark:focus:ring-primary-500","inline-flex","h-8","w-10","items-center","rounded-e-lg","border","border-gray-200","px-2","text-xs","focus:z-10","focus:ring-2","dark:border-gray-700",3,"ngClass","rounded-lg"],[1,"text-gray-900","dark:text-white"],[1,"text-lg","font-semibold"],[1,"flex","items-center",3,"ngClass"],[1,"pt-2","text-sm","text-gray-500","dark:text-gray-400"],[1,"flex","flex-col"],[1,"relative","flex","flex-1","flex-col","bg-white","py-4","dark:bg-gray-800",3,"ngClass"],[1,"flex","max-w-full","px-4","pb-4"],[1,"flex","h-8","min-w-36","max-w-36","flex-col","pe-2","text-xs","text-gray-900","md:max-w-none","md:flex-row","md:space-x-3","md:pe-4","dark:text-white"],[1,"flex","flex-1","justify-end"],["type","button",1,"focus:ring-primary-700","dark:focus:ring-primary-500","inline-flex","h-8","w-8","items-center","justify-center","rounded-s-lg","border","border-r-0","border-gray-200","text-xs","focus:z-10","focus:ring-2","dark:border-gray-700",3,"click","ngClass"],["type","button",1,"focus:ring-primary-700","dark:focus:ring-primary-500","inline-flex","h-8","w-8","items-center","justify-center","border","border-r-0","border-gray-200","text-xs","focus:z-10","focus:ring-2","dark:border-gray-700",3,"click","ngClass"],["type","button",1,"focus:ring-primary-700","dark:focus:ring-primary-500","inline-flex","h-8","w-8","items-center","justify-center","rounded-e-lg","border","border-gray-200","text-xs","focus:z-10","focus:ring-2","dark:border-gray-700",3,"click","ngClass"],[3,"ngClass"],["role","status",1,"flex","h-full","flex-1","items-center","justify-center"],["role","status",1,"flex","h-full","flex-col","items-center","justify-center","text-gray-500","dark:text-gray-400"],[1,"absolute",3,"ngClass"],["type","button",1,"rounded-lg","p-2","text-gray-500","hover:bg-gray-100","hover:text-gray-900","dark:text-gray-400","dark:hover:bg-gray-700","dark:hover:text-white",3,"click"],[1,"grid","grid-cols-1","gap-4","p-4","sm:grid-cols-2","xl:grid-cols-3"],[1,"flex-1","rounded-lg","border","border-gray-200","bg-white","p-4","shadow","dark:border-gray-700","dark:bg-gray-800"],[1,"mb-4","text-xl","font-semibold","leading-none","text-gray-900","dark:text-white"],[1,"flex","space-x-10","text-sm","text-gray-900","dark:text-white"],[1,"flex","flex-col","space-y-4"],[1,"flex-1"],[1,"pb-1","text-xs","text-gray-500","dark:text-gray-400"],[1,"flex","flex-1","flex-col","space-y-4"],[1,"flex","text-xs"],[1,"flex","items-center"],[1,"text-xs","font-bold","text-red-600","dark:text-red-500"],["type","range","disabled","",1,"slider","mx-1","h-1","flex-1","appearance-none","rounded-lg","bg-gray-200","dark:bg-gray-700",3,"min","max","value"],[1,"text-xs","font-bold","text-green-500","dark:text-green-400"],[1,"flex","flex-col","space-y-4","text-sm"],[1,"flex","justify-between"],[1,"flex"],[1,"flex-1",3,"ngClass"],["type","button",1,"focus:ring-primary-700","dark:focus:ring-primary-500","inline-flex","h-8","w-10","items-center","rounded-s-lg","border","border-r-0","border-gray-200","px-2","text-xs","focus:z-10","focus:ring-2","dark:border-gray-700",3,"click","ngClass"],["type","button",1,"focus:ring-primary-700","dark:focus:ring-primary-500","inline-flex","h-8","w-10","items-center","rounded-e-lg","border","border-gray-200","px-2","text-xs","focus:z-10","focus:ring-2","dark:border-gray-700",3,"click","ngClass"],[1,"flex","md:flex-col"],[1,"text-gray-500","dark:text-gray-400"],[1,"flex","whitespace-nowrap","md:flex-col",3,"ngClass"],["aria-hidden","true","viewBox","0 0 100 101","fill","none","xmlns","http://www.w3.org/2000/svg",1,"h-8","w-8","animate-spin","fill-blue-600","text-gray-200","dark:text-gray-600"],["d","M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z","fill","currentColor"],["d","M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z","fill","currentFill"],[1,"sr-only"],["aria-hidden","true","xmlns","http://www.w3.org/2000/svg","fill","none","viewBox","0 0 20 20",1,"mx-auto","mb-4","h-12","w-12"],["stroke","currentColor","stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M10 11V6m0 8h.01M19 10a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"],["aria-hidden","true","xmlns","http://www.w3.org/2000/svg","width","24","height","24","fill","none","viewBox","0 0 24 24",1,"h-6","w-6"],["stroke","currentColor","stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M5 9h4m0 0V5m0 4L4 4m15 5h-4m0 0V5m0 4 5-5M5 15h4m0 0v4m0-4-5 5m15-5h-4m0 0v4m0-4 5 5"],["stroke","currentColor","stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M8 4H4m0 0v4m0-4 5 5m7-5h4m0 0v4m0-4-5 5M8 20H4m0 0v-4m0 4 5-5m7 5h4m0 0v-4m0 4-5-5"]],template:function(e,t){if(e&1&&(n(0,"div",2),b(1,Re,218,133),s(2,"async"),b(3,Be,6,0,"div",3),i()),e&2){let l;a(),y((l=ae(2,1,t.stock$))?1:3,l)}},dependencies:[de,ce,oe,se],styles:[".slider[_ngcontent-%COMP%]::-moz-range-thumb{height:.625rem;width:.125rem;cursor:default;border-radius:0}.slider[_ngcontent-%COMP%]::-webkit-slider-thumb{height:.625rem;width:.125rem;cursor:default;border-radius:0}"],changeDetection:0})}};xe=K([pe(),Q("design:paramtypes",[Document,M,A,V])],xe);export{xe as StocksPage};