commit 2019-10-28 09:43:13.646727

This commit is contained in:
Jenkins
2019-10-28 12:43:15 +03:00
parent b74c2daa8c
commit 87df4df525
33 changed files with 210 additions and 210 deletions

File diff suppressed because one or more lines are too long

View File

@@ -374,26 +374,26 @@ time:[-2717668236,-1633298400,-1615154400,-1601848800,-1583704800,-1563746400,-1
offset:[-21036,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600]},"America/Phoenix":{time:[-2717670498,-1633298400,-1615154400,-1601848800,-1583704800,-880236e3,-820540740,-812678340,-796867140,-84405600,-68680800,1924966800],offset:[-26898,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200]},"America/Toronto":{
time:[-2366755200,-1632088800,-1615154400,-1601771400,-1583712e3,-1567375200,-1554681600,-1534716e3,-1524088800,-1503266400,-149238e4,-1471816800,-1460930400,-1440972e3,-1428876e3,-1409522400,-1397426400,-1378072800,-1365976800,-1346623200,-1333922400,-1315173600,-1301868e3,-1283724e3,-1270418400,-1252274400,-1238968800,-1220824800,-1207519200,-1188770400,-1176069600,-1157320800,-1144015200,-1125871200,-1112565600,-1094421600,-1081116e3,-1062972e3,-1049666400,-1031522400,-1018216800,-1000072800,-986767200,-968018400,-955317600,-936568800,-880232400,-76941e4,-765410400,-747266400,-733960800,-715824e3,-702518400,-684374400,-671068800,-652924800,-634176e3,-620863200,-602719200,-589413600,-576108e3,-557964e3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-450309600,-431560800,-418255200,-400111200,-384386400,-368661600,-352936800,-337212e3,-321487200,-305762400,-289432800,-273708e3,-257983200,-242258400,-226533600,-210808800,-195084e3,-179359200,-163634400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,136346400,152071200,167796e3,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],
offset:[-19052,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-14400,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3]},"America/Vancouver":{
time:[-2713910400,-1632088800,-1615154400,-880236e3,-769420800,-765410400,-747266400,-732751200,-715816800,-702511200,-684367200,-671061600,-652917600,-639612e3,-620863200,-608162400,-589413600,-576108e3,-557964e3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-450309600,-431560800,-418255200,-400111200,-386805600,-368661600,-355356e3,-337212e3,-323906400,-305762400,-292456800,-273708e3,-261007200,-242258400,-226533600,-210808800,-195084e3,-179359200,-163634400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,136346400,152071200,167796e3,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],
time:[-2713910400,-1632088800,-1615154400,-880236e3,-769420800,-765410400,-747266400,-733960800,-715816800,-702511200,-684367200,-671061600,-652917600,-639612e3,-620863200,-608162400,-589413600,-576108e3,-557964e3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-450309600,-431560800,-418255200,-400111200,-386805600,-368661600,-355356e3,-337212e3,-323906400,-305762400,-292456800,-273708e3,-261007200,-242258400,-226533600,-210808800,-195084e3,-179359200,-163634400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,136346400,152071200,167796e3,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],
offset:[-29548,-28800,-25200,-28800,-25200,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800]},"America/Argentina/Buenos_Aires":{time:[-2372112e3,-1567468800,-1233446400,-1222992e3,-1205971200,-1194048e3,-117288e4,-1162512e3,-1141344e3,-1130976e3,-1109808e3,-109944e4,-1078272e3,-1067817600,-1046649600,-1036281600,-1015113600,-1004745600,-983577600,-973209600,-952041600,-941587200,-931046400,-900892800,-890352e3,-83376e4,-82728e4,-752284800,-733795200,-197337600,-190857600,-184204800,-164505600,-152668800,-132969600,-121132800,-101433600,-86832e3,-71107200,-54777600,-39052800,-23328e3,-7603200,128131200,136598400,596937600,605059200,624412800,636508800,656467200,667958400,687916800,699408e3,719366400,731462400,938908800,952041600,1198972800,1205625600,1224374400,1237075200,1924981200],offset:[-14028,-15408,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-10800,-10800,-7200,-10800,-7200,-10800]},"America/El_Salvador":{time:[-1546300800,546998400,559699200,578448e3,591148800,1924970400],offset:[-21408,-21600,-18e3,-21600,-18e3,-21600]},"America/Sao_Paulo":{
time:[-1767225600,-1206968400,-1191369600,-1175385600,-1159833600,-633830400,-622076400,-602294400,-59184e4,-570758400,-560217600,-539136e3,-53136e4,-195436800,-184204800,-155174400,-150076800,-128908800,-121132800,-99964800,-89596800,-68428800,-57974400,499737600,511228800,530582400,540259200,562118400,571190400,592963200,602035200,624412800,634694400,656467200,666748800,687916800,697593600,719971200,728438400,750816e3,761702400,782265600,793152e3,813715200,823996800,84456e4,856051200,876096e3,888710400,908064e3,919555200,938908800,951609600,970963200,982454400,1003017600,1013904e3,1036281600,1045353600,1066521600,1076803200,1099353600,1108857600,1129420800,1140307200,1162684800,1172361600,119232e4,1203206400,1224374400,1234656e3,1255824e3,1266710400,1287273600,129816e4,1318723200,1330214400,1350777600,1361059200,1382227200,1392508800,1413676800,1424563200,1445126400,1456012800,1476576e3,1487462400,1508025600,1518912e3,1541289600,1550361600,1572739200,1581811200,1604188800,1613865600,1636243200,1645315200,1667692800,1677369600,1699142400,1708214400,1730592e3,1739664e3,1762041600,1771718400,1793491200,1803168e3,1825545600,1834617600,1856995200,1866067200,1888444800,1897516800,1919894400,1928966400],offset:[-11188,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200]},"America/Bogota":{time:[-2707689600,-1739059200,704851200,733881600,1924974e3],offset:[-17776,-17776,-18e3,-14400,-18e3]},"America/Caracas":{time:[-2524521600,-1826755200,-157766400,1197169200,1462069800,1924977600],offset:[-16064,-16060,-16200,-14400,-16200,-14400]},"Europe/Moscow":{
time:[-2840140800,-1688256e3,-165681e4,-1641340800,-1627956e3,-1618700400,-1596416400,-1593804521,-1589846400,-1542416400,-1539478800,-1525305600,-1522713600,-1491177600,-1247529600,354931200,370742400,386467200,402278400,418003200,433814400,449625600,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,695786400,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1414288800,1925002800],offset:[9017,9017,9079,12679,9079,16279,12679,16279,14400,10800,14400,18e3,14400,10800,7200,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,10800,7200,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800]},"Europe/Athens":{time:[-2344636800,-1686095940,-1182988800,-1178150400,-906854400,-904867200,-85725e4,-844473600,-828230400,-812419200,-552355200,-541641600,166492800,186195600,198036e3,213764400,228880800,244090800,260330400,275457600,291805200,307418400,323395200,338947200,354682800,370411200,386132400,401860800,417582e3,433310400,449031600,465364800,481086e3,496814400,512535600,528264e3,543985200,559713600,575434800,591163200,606884400,622612800,638334e3,654667200,670388400,686116800,701838e3,717566400,733287600,749016e3,764737200,780465600,796186800,811915200,828241200,846388800,859690800,877838400,891140400,909288e3,92259e4,941342400,954039600,972792e3,985489200,1004241600,1017543600,1035691200,1048993200,1067140800,1080442800,1099195200,1111892400,1130644800,1143342e3,1162094400,1174791600,1193544e3,1206846e3,1224993600,1238295600,1256443200,1269745200,1288497600,1301194800,1319947200,1332644400,1351396800,1364698800,1382846400,1396148400,1414296e3,1427598e3,1445745600,1459047600,14778e5,1490497200,1509249600,1521946800,1540699200,1554001200,1572148800,1585450800,1603598400,1616900400,1635652800,164835e4,1667102400,1679799600,1698552e3,1711854e3,1730001600,1743303600,1761451200,1774753200,1792900800,1806202800,1824955200,1837652400,1856404800,1869102e3,1887854400,1901156400,1919304e3,1932606e3],
offset:[5692,5692,7200,10800,7200,10800,7200,3600,7200,3600,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"Europe/Belgrade":{time:[-2713910400,-905821200,-85725e4,-844552800,-828219600,-812498400,-79677e4,-777938400,-766616400,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[4920,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Berlin":{
time:[-2422051200,-1693702800,-1680476400,-1663452e3,-1650142800,-1632002400,-1618693200,-938901600,-85725e4,-844552800,-828219600,-812498400,-79677e4,-781048800,-776556e3,-765925200,-761173200,-748476e3,-733266e3,-717627600,-714603600,-71037e4,-701902800,-684972e3,-670453200,-654127200,-639003600,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[3208,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,10800,7200,3600,7200,3600,7200,10800,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/London":{
time:[-1767225600,-1206968400,-1191369600,-1175385600,-1159833600,-633830400,-622076400,-602294400,-59184e4,-570758400,-560217600,-539136e3,-53136e4,-195436800,-184204800,-155174400,-150076800,-128908800,-121132800,-99964800,-89596800,-68428800,-57974400,499737600,511228800,530582400,540259200,562118400,571190400,592963200,602035200,624412800,634694400,656467200,666748800,687916800,697593600,719971200,728438400,750816e3,761702400,782265600,793152e3,813715200,823996800,84456e4,856051200,876096e3,888710400,908064e3,919555200,938908800,951609600,970963200,982454400,1003017600,1013904e3,1036281600,1045353600,1066521600,1076803200,1099353600,1108857600,1129420800,1140307200,1162684800,1172361600,119232e4,1203206400,1224374400,1234656e3,1255824e3,1266710400,1287273600,129816e4,1318723200,1330214400,1350777600,1361059200,1382227200,1392508800,1413676800,1424563200,1445126400,1456012800,1476576e3,1487462400,1508025600,1518912e3,1541289600,1550361600,1924981200],offset:[-11188,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800]},"America/Bogota":{time:[-2707689600,-1739059200,704851200,733881600,1924974e3],offset:[-17776,-17776,-18e3,-14400,-18e3]},"America/Caracas":{time:[-2524521600,-1826755200,-157766400,1197169200,1462069800,1924977600],offset:[-16064,-16060,-16200,-14400,-16200,-14400]},"Europe/Moscow":{time:[-2840140800,-1688256e3,-165681e4,-1641340800,-1627956e3,-1618700400,-1596416400,-1593804521,-1589846400,-1542416400,-1539478800,-1525305600,-1522713600,-1491177600,-1247529600,354931200,370742400,386467200,402278400,418003200,433814400,449625600,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,695786400,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1414288800,1925002800],
offset:[9017,9017,9079,12679,9079,16279,12679,16279,14400,10800,14400,18e3,14400,10800,7200,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,10800,7200,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800]},"Europe/Athens":{time:[-2344636800,-1686095940,-1182988800,-1178150400,-906854400,-904867200,-85725e4,-844473600,-828230400,-812419200,-552355200,-541641600,166492800,186195600,198036e3,213764400,228880800,244090800,260330400,275457600,291805200,307418400,323395200,338947200,354682800,370411200,386132400,401860800,417582e3,433310400,449031600,465364800,481086e3,496814400,512535600,528264e3,543985200,559713600,575434800,591163200,606884400,622612800,638334e3,654667200,670388400,686116800,701838e3,717566400,733287600,749016e3,764737200,780465600,796186800,811915200,828241200,846388800,859690800,877838400,891140400,909288e3,92259e4,941342400,954039600,972792e3,985489200,1004241600,1017543600,1035691200,1048993200,1067140800,1080442800,1099195200,1111892400,1130644800,1143342e3,1162094400,1174791600,1193544e3,1206846e3,1224993600,1238295600,1256443200,1269745200,1288497600,1301194800,1319947200,1332644400,1351396800,1364698800,1382846400,1396148400,1414296e3,1427598e3,1445745600,1459047600,14778e5,1490497200,1509249600,1521946800,1540699200,1554001200,1572148800,1585450800,1603598400,1616900400,1635652800,164835e4,1667102400,1679799600,1698552e3,1711854e3,1730001600,1743303600,1761451200,1774753200,1792900800,1806202800,1824955200,1837652400,1856404800,1869102e3,1887854400,1901156400,1919304e3,1932606e3],offset:[5692,5692,7200,10800,7200,10800,7200,3600,7200,3600,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"Europe/Belgrade":{
time:[-2713910400,-905821200,-85725e4,-844552800,-828219600,-812498400,-79677e4,-777938400,-766616400,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[4920,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Berlin":{time:[-2422051200,-1693702800,-1680476400,-1663452e3,-1650142800,-1632002400,-1618693200,-938901600,-85725e4,-844552800,-828219600,-812498400,-79677e4,-781048800,-776556e3,-765925200,-761173200,-748476e3,-733266e3,-717627600,-714603600,-71037e4,-701902800,-684972e3,-670453200,-654127200,-639003600,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],
offset:[3208,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,10800,7200,3600,7200,3600,7200,10800,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/London":{
time:[-3852662400,-1691964e3,-1680469200,-1664143200,-1650142800,-1633903200,-1617483600,-1601848800,-1586034e3,-1570399200,-1552165200,-1538344800,-152253e4,-15075e5,-1490562e3,-1473631200,-1460926800,-1442786400,-1428872400,-1410732e3,-1396213200,-1379282400,-1364763600,-1348437600,-1333314e3,-1315778400,-1301259600,-1284328800,-126981e4,-1253484e3,-1238360400,-1221429600,-1206910800,-118998e4,-1175461200,-1159135200,-1143406800,-1126476e3,-1111957200,-1095631200,-1080507600,-1063576800,-1049058e3,-1032127200,-1017608400,-1001282400,-986158800,-969228e3,-950475600,-942012e3,-904514400,-896043600,-875484e3,-864594e3,-844034400,-832539600,-812584800,-798066e3,-781048800,-772059600,-764802e3,-748476e3,-733352400,-719445600,-717026400,-706741200,-699483600,-687996e3,-668034e3,-654732e3,-636584400,-622072800,-605739600,-590623200,-57429e4,-558568800,-542235600,-527119200,-512600400,-496274400,-481150800,-46422e4,-449701200,-432165600,-417646800,-401320800,-386197200,-369266400,-354747600,-337816800,-323298e3,-306972e3,-291848400,-276732e3,-257979600,-245282400,-22653e4,-213228e3,-195080400,-182383200,-163630800,-150933600,-132181200,-119484e3,-100731600,-88034400,-68677200,-59004e3,-37238400,57726e3,69818400,89175600,101268e3,120625200,132717600,152074800,164167200,183524400,196221600,214974e3,227671200,246423600,259120800,278478e3,290570400,309927600,32202e4,341377200,354675600,372823200,386125200,404272800,417574800,435722400,449024400,467776800,481078800,499226400,512528400,530676e3,543978e3,562125600,575427600,593575200,606877200,625629600,638326800,657079200,670381200,688528800,701830800,719978400,733280400,751428e3,76473e4,782877600,796179600,814327200,828234e3,846381600,859683600,877831200,891133200,909280800,922582800,941335200,954032400,972784800,985482e3,1004234400,1017536400,1035684e3,1048986e3,1067133600,1080435600,1099188e3,1111885200,1130637600,1143334800,1162087200,1174784400,1193536800,1206838800,1224986400,1238288400,1256436e3,1269738e3,1288490400,1301187600,131994e4,1332637200,1351389600,1364691600,1382839200,1396141200,1414288800,1427590800,1445738400,1459040400,1477792800,149049e4,1509242400,1521939600,1540692e3,1553994e3,1572141600,1585443600,1603591200,1616893200,1635645600,1648342800,1667095200,1679792400,1698544800,1711846800,1729994400,1743296400,1761444e3,1774746e3,1792893600,1806195600,1824948e3,1837645200,1856397600,1869094800,1887847200,1901149200,1919296800,1932598800],
offset:[-75,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,0,3600,0,3600,7200,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0]},"Europe/Luxembourg":{time:[-2069712e3,-1692493200,-1680476400,-1662339600,-165015e4,-1632002400,-1618693200,-1612656e3,-1604278800,-1585515600,-1574038800,-1552255200,-1539997200,-1520546400,-1507510800,-1490569200,-1473642e3,-1459116e3,-1444006800,-142767e4,-1411866e3,-1396220400,-1379293200,-1364770800,-1348448400,-1333321200,-1316394e3,-1301266800,-1284339600,-126981e4,-1253484e3,-1238360400,-1221429600,-1206910800,-1191189600,-1175461200,-1160344800,-1143406800,-1127685600,-1111957200,-1096840800,-1080507600,-1063576800,-1049058e3,-1033336800,-1017608400,-1002492e3,-986158800,-969228e3,-950475600,-942012e3,-935182800,-85725e4,-844552800,-828219600,-812498400,-797979600,-781048800,-766616400,-745452e3,-733266e3,228880800,244004400,260330400,276058800,29178e4,307508400,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],
offset:[1476,3600,7200,3600,7200,3600,7200,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Madrid":{time:[-2177453684,-1631926800,-1616886e3,-1601168400,-158535e4,-1442451600,-142767e4,-1379293200,-1364770800,-1348448400,-1333321200,-1316390400,-1301266800,-1284339600,-1269817200,-1026954e3,-1017615600,-1001898e3,-999478800,-986083200,-951433200,-940208400,-873075600,-862614e3,-842835600,-828313200,-811386e3,-796863600,-779936400,-765414e3,-748486800,-733964400,-652323600,-639010800,135126e3,150253200,166575600,181702800,196815600,212547600,22887e4,243997200,260330400,276058800,29178e4,307508400,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],
offset:[-884,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,0,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Paris":{time:[-2486678340,-1855958340,-1689814800,-1680393600,-1665363600,-1648339200,-1635123600,-1616889600,-1604278800,-158544e4,-1574038800,-1552262400,-1539997200,-1520553600,-1507510800,-1490572800,-1470618e3,-1459123200,-1444006800,-1427673600,-1411952400,-1396224e3,-1379293200,-1364774400,-1348448400,-1333324800,-1316394e3,-1301270400,-1284339600,-1269820800,-1253494800,-1238371200,-1221440400,-1206921600,-1191200400,-1175472e3,-1160355600,-1143417600,-1127696400,-1111968e3,-1096851600,-1080518400,-1063587600,-1049068800,-1033347600,-1017619200,-1002502800,-986169600,-969238800,-950486400,-942012e3,-932432400,-85725e4,-844552800,-828219600,-812498400,-800064e3,-796258800,-781048800,-766616400,196822800,212547600,228880800,244004400,260330400,276058800,29178e4,307508400,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],
offset:[561,561,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,7200,3600,7200,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Rome":{time:[-3259094400,-2403562204,-1690761600,-168048e4,-1664755200,-1648944e3,-163512e4,-1616889600,-1604275200,-1585526400,-1571011200,-1555286400,-932428800,-85725e4,-844552800,-828219600,-812498400,-798066e3,-781048800,-76671e4,-750895200,-733352400,-719452800,-70191e4,-689205600,-670453200,-114048e3,-103161600,-81993600,-71708400,-50544e3,-40258800,-18489600,-8204400,1296e4,23245200,43804800,54694800,75859200,86749200,107913600,118198800,138758400,149648400,170812800,181098e3,202262400,212547600,233107200,243997200,265161600,276051600,296611200,307501200,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],
offset:[561,561,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,7200,3600,7200,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Rome":{time:[-3252096e3,-2403562204,-1690761600,-168048e4,-1664755200,-1648944e3,-163512e4,-1616889600,-1604275200,-1585526400,-1571011200,-1555286400,-932428800,-85725e4,-844552800,-828219600,-812498400,-798066e3,-781048800,-76671e4,-750895200,-733352400,-719452800,-70191e4,-689205600,-670453200,-114048e3,-103161600,-81993600,-71708400,-50544e3,-40258800,-18489600,-8204400,1296e4,23245200,43804800,54694800,75859200,86749200,107913600,118198800,138758400,149648400,170812800,181098e3,202262400,212547600,233107200,243997200,265161600,276051600,296611200,307501200,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],
offset:[2996,2996,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Warsaw":{time:[-2840140800,-1717027200,-1693702800,-1680476400,-1663452e3,-1650142800,-1632002400,-1618693200,-1600466400,-1587157200,-1501718400,-931730400,-85725e4,-844552800,-828219600,-812498400,-796600800,-778723200,-762652800,-748483200,-733266e3,-715212e3,-701902800,-684972e3,-670453200,-654127200,-639003600,-397090800,-386805600,-371084400,-355356e3,-334191600,-323301600,-307580400,-291852e3,-271292400,-260402400,-239842800,-228952800,-208393200,-197503200,-176338800,-166053600,228877200,244000800,260326800,276055200,291776400,307504800,323830800,338954400,354675600,370404e3,386125200,401853600,417574800,433303200,449024400,465357600,481078800,496807200,512528400,528256800,543978e3,559706400,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],
offset:[5040,5040,3600,7200,3600,7200,3600,7200,7200,10800,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Istanbul":{time:[-2840140800,-1869868800,-1693699200,-168048e4,-1570406400,-1552176e3,-1538352e3,-1522540800,-1507507200,-1490572800,-1440201600,-1428019200,-1409702400,-1396483200,-931132800,-922752e3,-917827200,-892425600,-875836800,-857347200,-781056e3,-764726400,-744336e3,-733795200,-716428800,-701913600,-684979200,-670464e3,-654134400,-639014400,-621820800,-60696e4,-590025600,-575424e3,-235612800,-228268800,-177724800,-165715200,10540800,23846400,41990400,55296e3,74044800,87350400,107917200,12123e4,133927200,152686800,165369600,183513600,202435200,215568e3,228873600,245808e3,260323200,277257600,308793600,323838e3,340243200,354682800,371692800,386132400,403142400,428457600,433900800,482803200,496713600,512528400,528256800,543978e3,559706400,575427600,591156e3,606877200,622605600,638326800,65466e4,670381200,686109600,701830800,717559200,733280400,749008800,764125200,780458400,796179600,811908e3,828234e3,846381600,859683600,877831200,891133200,909280800,922582800,941335200,954032400,972784800,985482e3,1004234400,1017536400,1035684e3,1048986e3,1067133600,1080435600,1099188e3,1111885200,1130637600,1143334800,1162087200,1174791600,1193544e3,1206846e3,1224993600,1238295600,1256443200,1269745200,1288497600,1301281200,1319947200,1332644400,1351396800,1364698800,1382846400,1396234800,1414296e3,1427598e3,1446955200,1459047600,1473206400,1925002800],offset:[6952,7016,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,10800]},"Europe/Zurich":{
offset:[5040,5040,3600,7200,3600,7200,3600,7200,7200,10800,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Istanbul":{time:[-2840140800,-1869868800,-1693699200,-168048e4,-1570406400,-1552176e3,-1538352e3,-1522540800,-1507507200,-1490572800,-1440201600,-1428019200,-1409702400,-1396483200,-931046400,-922665600,-917827200,-892425600,-875836800,-764726400,-744336e3,-733795200,-716428800,-701913600,-684979200,-670464e3,-654134400,-639014400,-62208e4,-60696e4,-590025600,-575510400,-235612800,-194832e3,-177724800,-165715200,107917200,121226400,133927200,152676e3,164685600,184125600,196221600,215575200,228880800,245815200,260330400,267926400,428464800,433908e3,468122400,482806800,496720800,512528400,528256800,543978e3,559706400,575427600,591156e3,606877200,622605600,638326800,65466e4,670381200,686109600,701830800,717559200,733280400,749008800,764125200,780458400,796179600,811908e3,828234e3,846381600,859683600,877831200,891133200,909280800,922582800,941335200,954032400,972784800,985482e3,1004234400,1017536400,1035684e3,1048986e3,1067133600,1080435600,1099188e3,1111885200,1130637600,1143334800,1162087200,1174791600,1193544e3,1206846e3,1224993600,1238295600,1256443200,1269745200,1288497600,1301281200,1319947200,1332644400,1351396800,1364698800,1382846400,1396234800,1414296e3,1427598e3,1446955200,1459047600,1473206400,1925002800],offset:[6952,7016,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,10800,14400,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,10800]},"Europe/Zurich":{
time:[-3675196800,-2385244800,-904431600,-891122400,-872982e3,-859672800,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[2048,1786,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Australia/Sydney":{time:[-2364076800,-1672531140,-1665352800,-883605600,-876088800,-860364e3,-844639200,-828309600,-813189600,57722400,68007600,89172e3,100062e3,120621600,131511600,152071200,162961200,183520800,195015600,215575200,226465200,247024800,257914800,278474400,289364400,309924e3,320814e3,341373600,352263600,372823200,386737200,404877600,415767600,436327200,447217200,467776800,478666800,499226400,511326e3,530071200,542775600,562125600,57483e4,59418e4,606279600,625629600,636519600,657079200,667969200,688528800,699418800,719978400,731473200,752032800,762922800,783482400,794372400,814932e3,828241200,846381600,859690800,877831200,891140400,909280800,92259e4,941335200,954039600,967341600,985489200,1004234400,1017543600,1035684e3,1048993200,1067133600,1080442800,1099188e3,1111892400,1130637600,1143946800,1162087200,1174791600,1193536800,1207450800,1223172e3,1238900400,1254621600,127035e4,1286071200,1301799600,1317520800,1333249200,1349575200,1365303600,1381024800,1396753200,1412474400,1428202800,1443924e3,1459652400,1475373600,1491102e3,1506823200,1522551600,1538877600,1554606e3,1570327200,1586055600,1601776800,1617505200,1633226400,1648954800,1664676e3,1680404400,1696125600,1712458800,172818e4,1743908400,1759629600,1775358e3,1791079200,1806807600,1822528800,1838257200,1853978400,1869706800,1886032800,1901761200,1917482400,1933210800],
offset:[36292,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600]},"Australia/Brisbane":{time:[-2366755200,-1672531140,-1665352800,-883605600,-876088800,-860364e3,-844639200,-828309600,-813189600,57722400,68007600,625629600,636519600,657079200,667969200,688528800,699418800,1925028e3],offset:[36728,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3]},"Australia/Adelaide":{time:[-2364076800,-2230156800,-1672531140,-1665352800,-883605600,-876088800,-860364e3,-844639200,-828309600,-813189600,57722400,68007600,89172e3,100062e3,120621600,131511600,152071200,162961200,183520800,195015600,215575200,226465200,247024800,257914800,278474400,289364400,309924e3,320814e3,341373600,352263600,372823200,384318e3,404877600,415767600,436327200,447217200,467776800,478666800,499226400,511326e3,530071200,542775600,562125600,57483e4,59418e4,606279600,625629600,637729200,657079200,667969200,688528800,701233200,719978400,731473200,752032800,764132400,783482400,796186800,814932e3,828241200,846381600,859690800,877831200,891140400,909280800,92259e4,941335200,954039600,972784800,985489200,1004234400,1017543600,1035684e3,1048993200,1067133600,1080442800,1099188e3,1111892400,1130637600,1143946800,1162087200,1174791600,1193536800,1207450800,1223172e3,1238900400,1254621600,127035e4,1286071200,1301799600,1317520800,1333249200,1349575200,1365303600,1381024800,1396753200,1412474400,1428202800,1443924e3,1459652400,1475373600,1491102e3,1506823200,1522551600,1538877600,1554606e3,1570327200,1586055600,1601776800,1617505200,1633226400,1648954800,1664676e3,1680404400,1696125600,1712458800,172818e4,1743908400,1759629600,1775358e3,1791079200,1806807600,1822528800,1838257200,1853978400,1869706800,1886032800,1901761200,1917482400,1933210800],
offset:[33260,32400,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800]},"Australia/ACT":{time:[-2364076800,-1672531140,-1665352800,-883605600,-876088800,-860364e3,-844639200,-828309600,-813189600,57722400,68007600,89172e3,100062e3,120621600,131511600,152071200,162961200,183520800,195015600,215575200,226465200,247024800,257914800,278474400,289364400,309924e3,320814e3,341373600,352263600,372823200,386737200,404877600,415767600,436327200,447217200,467776800,478666800,499226400,511326e3,530071200,542775600,562125600,57483e4,59418e4,606279600,625629600,636519600,657079200,667969200,688528800,699418800,719978400,731473200,752032800,762922800,783482400,794372400,814932e3,828241200,846381600,859690800,877831200,891140400,909280800,92259e4,941335200,954039600,967341600,985489200,1004234400,1017543600,1035684e3,1048993200,1067133600,1080442800,1099188e3,1111892400,1130637600,1143946800,1162087200,1174791600,1193536800,1207450800,1223172e3,1238900400,1254621600,127035e4,1286071200,1301799600,1317520800,1333249200,1349575200,1365303600,1381024800,1396753200,1412474400,1428202800,1443924e3,1459652400,1475373600,1491102e3,1506823200,1522551600,1538877600,1554606e3,1570327200,1586055600,1601776800,1617505200,1633226400,1648954800,1664676e3,1680404400,1696125600,1712458800,172818e4,1743908400,1759629600,1775358e3,1791079200,1806807600,1822528800,1838257200,1853978400,1869706800,1886032800,1901761200,1917482400,1933210800],offset:[36292,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600]},"Asia/Almaty":{
time:[-1441152e3,-1247529600,354931200,370742400,386467200,402278400,418003200,433814400,449625600,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,695786400,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1925013600],offset:[18468,18e3,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,21600,18e3,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600]},"Asia/Ashkhabad":{time:[-1441152e3,-1247529600,354931200,370742400,386467200,402278400,418003200,433814400,449625600,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,695786400,192501e4],offset:[14012,14400,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,18e3,14400,18e3]},"Asia/Tokyo":{time:[-2587678861,-683769600,-672274800,-654739200,-640825200,-620265600,-609375600,-588816e3,-577926e3,1925024400],offset:[33539,32400,36e3,32400,36e3,32400,36e3,32400,36e3,32400]},"Asia/Taipei":{time:[-2335219200,-1017792e3,-766191600,-745804800,-733795200,-716860800,-699580800,-683856e3,-670636800,-65232e4,-639100800,-620784e3,-607564800,-589248e3,-576028800,-562896e3,-541728e3,-528681600,-510192e3,-497145600,-478656e3,-465609600,-449798400,-433987200,-418176e3,-402451200,-38664e4,-370915200,-355104e3,-339379200,-323568e3,-302486400,-291945600,-270950400,-260409600,134006400,149817600,165542400,181353600,299635200,307584e3,1925020800],offset:[29160,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Asia/Singapore":{time:[-2177452800,-2038176e3,-1167609600,-1073001600,-894153600,-879638400,-766972800,378691200,1925020800],offset:[24925,24925,25200,26400,26400,27e3,32400,27e3,28800]},"Asia/Shanghai":{time:[-2177452800,-933638400,-922060800,-908841600,-888796800,-881020800,-767836800,-745804800,-733795200,-716860800,-699580800,-683856e3,-670636800,-65232e4,-649987200,515556e3,527047200,545191200,558496800,577245600,589946400,608695200,622000800,640144800,653450400,671594400,6849e5,1925020800],offset:[29143,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Asia/Seoul":{
time:[-1948752e3,-1830384e3,-767318400,-498096e3,-462672e3,-451699200,-429753600,-418262400,-399513600,-387417600,-368064e3,-355968e3,-336614400,-324518400,-305164800,-293068800,-264902400,547610400,560919600,57906e4,592369200,1925024400],offset:[30472,30600,32400,32400,30600,34200,30600,34200,30600,34200,30600,34200,30600,34200,30600,34200,30600,32400,36e3,32400,36e3,32400]},"Asia/Tehran":{time:[-1704153600,-757382400,247190400,259286400,277776e3,283996800,290822400,306547200,322444800,338515200,673228800,685497600,701222400,71712e4,732758400,748656e3,764294400,780192e3,795830400,811728e3,827366400,843264e3,858988800,874886400,890524800,906422400,922060800,937958400,953596800,969494400,985219200,1001116800,1016755200,1032652800,1048291200,1064188800,1079827200,1095724800,1111449600,1127347200,1206057600,1221955200,123768e4,1253577600,1269216e3,1285113600,1300752e3,1316649600,1332288e3,1348185600,1363910400,1379808e3,1395446400,1411344e3,1426982400,144288e4,1458518400,1474416e3,1490140800,1506038400,1521676800,1537574400,1553212800,1569110400,1584748800,1600646400,1616371200,1632268800,1647907200,1663804800,1679443200,1695340800,1710979200,1726876800,1742601600,1758499200,1774137600,1790035200,1805673600,1821571200,1837209600,1853107200,1868745600,1884643200,1900368e3,1916265600,1931904e3],offset:[12344,12344,12600,14400,18e3,14400,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600]},"Asia/Dubai":{time:[-1577923200,1925006400],offset:[13272,14400]},"Asia/Kolkata":{time:[-3645216e3,-3155673600,-2019686400,-891561600,-872035200,-862617600,-764121600,1925011800],offset:[21208,21200,19270,19800,23400,19800,23400,19800]},"Asia/Hong_Kong":{time:[-2056665600,-907360200,-891635400,-884217600,-766713600,-747952200,-728512200,-717021e3,-694470600,-683757e3,-668032200,-654726600,-636582600,-623277e3,-605133e3,-591827400,-573683400,-559773e3,-542320200,-528323400,-510179400,-498083400,-478729800,-466633800,-446675400,-435184200,-415225800,-403129800,-383776200,-371680200,-352326600,-340230600,-320877e3,-308781e3,-288822600,-277331400,-257373e3,-245881800,-225923400,-213827400,-194473800,-182377800,-163024200,-148509e3,-132784200,-117059400,-101334600,-85609800,-69280200,-53555400,-37830600,-22105800,-6381e3,9343800,25068600,40793400,56518200,72243e3,88572600,104297400,120022200,126070200,151471800,167196600,182921400,198646200,214371e3,295414200,309324600,1925020800],
offset:[27402,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Asia/Bangkok":{time:[-2840140800,-1570060800,1925017200],offset:[24124,24124,25200]},"Asia/Chongqing":{time:[-2177452800,-933638400,-922060800,-908841600,-888796800,-881020800,-767836800,-745804800,-733795200,-716860800,-699580800,-683856e3,-670636800,-65232e4,-649987200,515556e3,527047200,545191200,558496800,577245600,589946400,608695200,622000800,640144800,653450400,671594400,6849e5,1925020800],offset:[29143,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Asia/Jerusalem":{time:[-2840140800,-1640995200,-933638400,-857347200,-844293600,-825811200,-812678400,-794188800,-779846400,-762645600,-748303200,-731116800,-681955200,-673228800,-667951200,-65232e4,-636415200,-62208e4,-608936400,-59184e4,-572475600,-558568800,-542840400,-527724e3,-514414800,-490838400,-482976e3,-459468e3,-451526400,-428544e3,-418251600,-400024800,-387417600,142387200,150854400,167184e3,178675200,482284800,495590400,516758400,526435200,545443200,558489600,576633600,589334400,609897600,620784e3,638323200,651628800,669772800,683683200,701827200,715737600,733708800,747187200,765158400,778032e3,796608e3,810086400,826848e3,842832e3,858902400,874195200,890352e3,90504e4,923018400,936324e3,955677600,970794e3,986778e3,1001293200,1017363600,1033952400,1048813200,1065142800,1081299600,1095814800,1112320800,1128823200,1143770400,1159668e3,117522e4,1189908e3,1206669600,1223172e3,1238119200,1254016800,1269568800,1284256800,1301623200,1317520800,1333072800,1348365600,1364522400,1382839200,1395972e3,1414288800,1427421600,1445738400,1458871200,1477792800,1490320800,1509242400,1521770400,1540692e3,1553824800,1572141600,1585274400,1603591200,1616724e3,1635645600,1648173600,1667095200,1679623200,1698544800,1711677600,1729994400,1743127200,1761444e3,1774576800,1792893600,1806026400,1824948e3,1837476e3,1856397600,1868925600,1887847200,190098e4,1919296800,1932429600],
offset:[8454,8440,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,14400,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"Asia/Kuwait":{time:[-719625600,1925002800],offset:[11212,10800]},"Asia/Muscat":{time:[-1577923200,1925006400],offset:[13272,14400]},"Asia/Qatar":{time:[-1577923200,76204800,1925002800],offset:[12368,14400,10800]},"Asia/Riyadh":{time:[-719625600,1925002800],offset:[11212,10800]},"Pacific/Auckland":{time:[-3192393600,-1330293600,-1320012e3,-1300658400,-1287352800,-1269208800,-1255903200,-1237759200,-1224453600,-1206309600,-1192399200,-117486e4,-1160949600,-1143410400,-1125871200,-1112565600,-1094421600,-1081116e3,-1062972e3,-1049666400,-1031522400,-1018216800,-1000072800,-986767200,-968018400,-955317600,-936568800,-923263200,-757382400,152676e3,162356400,183520800,195015600,215575200,226465200,247024800,257914800,278474400,289364400,309924e3,320814e3,341373600,352263600,372823200,384318e3,404877600,415767600,436327200,447217200,467776800,478666800,499226400,510116400,530676e3,541566e3,562125600,573620400,59418e4,60507e4,623815200,637729200,655264800,669178800,686714400,700628400,718164e3,732682800,749613600,764132400,781063200,795582e3,812512800,827031600,844567200,858481200,876016800,889930800,907466400,921985200,938916e3,953434800,970365600,984884400,100242e4,1016334e3,1033869600,1047783600,1065319200,1079838e3,1096768800,1111287600,1128218400,1142737200,1159668e3,1174186800,1191117600,1207450800,1222567200,1238900400,1254016800,127035e4,1285466400,1301799600,1316916e3,1333249200,1348970400,1365303600,138042e4,1396753200,1411869600,1428202800,1443319200,1459652400,1474768800,1491102e3,1506218400,1522551600,1538272800,1554606e3,1569722400,1586055600,1601172e3,1617505200,1632621600,1648954800,1664071200,1680404400,1695520800,1712458800,1727575200,1743908400,1759024800,1775358e3,1790474400,1806807600,1821924e3,1838257200,1853373600,1869706800,1885428e3,1901761200,1916877600,1933210800],
time:[-1948752e3,-1830384e3,-767318400,-681177600,-672192e3,-654739200,-640828800,-623376e3,-609379200,-588816e3,-577929600,-498096e3,-462672e3,-451699200,-429753600,-418262400,-399513600,-387417600,-368064e3,-355968e3,-336614400,-324518400,-305164800,-293068800,-264902400,547610400,560919600,57906e4,592369200,1925024400],offset:[30472,30600,32400,32400,36e3,32400,36e3,32400,36e3,32400,36e3,32400,30600,34200,30600,34200,30600,34200,30600,34200,30600,34200,30600,34200,30600,32400,36e3,32400,36e3,32400]},"Asia/Tehran":{time:[-1704153600,-757382400,247190400,259286400,277776e3,283996800,290822400,306547200,322444800,338515200,673228800,685497600,701222400,71712e4,732758400,748656e3,764294400,780192e3,795830400,811728e3,827366400,843264e3,858988800,874886400,890524800,906422400,922060800,937958400,953596800,969494400,985219200,1001116800,1016755200,1032652800,1048291200,1064188800,1079827200,1095724800,1111449600,1127347200,1206057600,1221955200,123768e4,1253577600,1269216e3,1285113600,1300752e3,1316649600,1332288e3,1348185600,1363910400,1379808e3,1395446400,1411344e3,1426982400,144288e4,1458518400,1474416e3,1490140800,1506038400,1521676800,1537574400,1553212800,1569110400,1584748800,1600646400,1616371200,1632268800,1647907200,1663804800,1679443200,1695340800,1710979200,1726876800,1742601600,1758499200,1774137600,1790035200,1805673600,1821571200,1837209600,1853107200,1868745600,1884643200,1900368e3,1916265600,1931904e3],offset:[12344,12344,12600,14400,18e3,14400,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600]},"Asia/Dubai":{time:[-1577923200,1925006400],offset:[13272,14400]},"Asia/Kolkata":{time:[-3645216e3,-3155673600,-2019686400,-891561600,-872035200,-862617600,-764121600,1925011800],offset:[21208,21200,19270,19800,23400,19800,23400,19800]},"Asia/Hong_Kong":{time:[-2056663398,-900882e3,-891547200,-884217600,-761176800,-747878400,-728508600,-717021e3,-697059e3,-683757e3,-668028600,-654726600,-636579e3,-623277e3,-605129400,-591827400,-573679800,-559773e3,-541625400,-528323400,-510179400,-498083400,-478729800,-466633800,-446675400,-435184200,-415225800,-403129800,-383776200,-371680200,-352326600,-340230600,-320877e3,-308781e3,-288822600,-277331400,-257373e3,-245881800,-225923400,-213827400,-194473800,-182377800,-163024200,-148509e3,-132784200,-117059400,-101334600,-85609800,-69280200,-53555400,-37830600,-22105800,-6381e3,9343800,25068600,40793400,56518200,72243e3,88572600,104297400,120022200,126070200,151471800,167196600,182921400,198646200,214371e3,295414200,309324600,1925020800],
offset:[27402,28800,32400,30600,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Asia/Bangkok":{time:[-2840140800,-1570060800,1925017200],offset:[24124,24124,25200]},"Asia/Chongqing":{time:[-2177452800,-933638400,-922060800,-908841600,-888796800,-881020800,-767836800,-745804800,-733795200,-716860800,-699580800,-683856e3,-670636800,-65232e4,-649987200,515556e3,527047200,545191200,558496800,577245600,589946400,608695200,622000800,640144800,653450400,671594400,6849e5,1925020800],offset:[29143,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Asia/Jerusalem":{time:[-2840140800,-1640995200,-933638400,-857347200,-844293600,-825811200,-812678400,-794188800,-779846400,-762645600,-748303200,-731116800,-681955200,-673228800,-667951200,-65232e4,-636415200,-62208e4,-608936400,-59184e4,-572475600,-558568800,-542840400,-527724e3,-514414800,-490838400,-482976e3,-459468e3,-451526400,-428544e3,-418251600,-400024800,-387417600,142387200,150854400,167184e3,178675200,334022400,337654800,452563200,462243600,482284800,495590400,516758400,526435200,545443200,558489600,576633600,589334400,609897600,620784e3,638323200,651628800,669772800,683683200,701827200,715737600,733708800,747187200,765158400,778032e3,796608e3,810086400,826848e3,842832e3,858902400,874195200,890352e3,90504e4,923018400,936324e3,955677600,970794e3,986778e3,1001293200,1017363600,1033952400,1048813200,1065142800,1081299600,1095814800,1112320800,1128823200,1143770400,1159668e3,117522e4,1189908e3,1206669600,1223172e3,1238119200,1254016800,1269568800,1284256800,1301623200,1317520800,1333072800,1348365600,1364522400,1382839200,1395972e3,1414288800,1427421600,1445738400,1458871200,1477792800,1490320800,1509242400,1521770400,1540692e3,1553824800,1572141600,1585274400,1603591200,1616724e3,1635645600,1648173600,1667095200,1679623200,1698544800,1711677600,1729994400,1743127200,1761444e3,1774576800,1792893600,1806026400,1824948e3,1837476e3,1856397600,1868925600,1887847200,190098e4,1919296800,1932429600],
offset:[8454,8440,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,14400,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"Asia/Kuwait":{time:[-719625600,1925002800],offset:[11212,10800]},"Asia/Muscat":{time:[-1577923200,1925006400],offset:[13272,14400]},"Asia/Qatar":{time:[-1577923200,76204800,1925002800],offset:[12368,14400,10800]},"Asia/Riyadh":{time:[-719625600,1925002800],offset:[11212,10800]},"Pacific/Auckland":{time:[-3192393600,-1330293600,-1320012e3,-1300658400,-1287352800,-1269208800,-1255903200,-1237759200,-1224453600,-1206309600,-1192399200,-117486e4,-1160949600,-1143410400,-1125871200,-1112565600,-1094421600,-1081116e3,-1062972e3,-1049666400,-1031522400,-1018216800,-1000072800,-986767200,-968018400,-955317600,-936568800,-923263200,-757382400,152676e3,162356400,183520800,195015600,215575200,226465200,247024800,257914800,278474400,289364400,309924e3,320814e3,341373600,352263600,372823200,384318e3,404877600,415767600,436327200,447217200,467776800,478666800,499226400,510116400,530676e3,541566e3,562125600,573620400,59418e4,60507e4,623815200,637729200,655264800,669178800,686714400,700628400,718164e3,732682800,749613600,764132400,781063200,795582e3,812512800,827031600,844567200,858481200,876016800,889930800,907466400,921985200,938916e3,953434800,970365600,984884400,100242e4,1016334e3,1033869600,1047783600,1065319200,1079838e3,1096768800,1111287600,1128218400,1142737200,1159668e3,1174186800,1191117600,1207450800,1222567200,1238900400,1254016800,127035e4,1285466400,1301799600,1316916e3,1333249200,1348970400,1365303600,138042e4,1396753200,1411869600,1428202800,1443319200,1459652400,1474768800,1491102e3,1506218400,1522551600,1538272800,1554606e3,1569722400,1586055600,1601172e3,1617505200,1632621600,1648954800,1664071200,1680404400,1695520800,1712458800,1727575200,1743908400,1759024800,1775358e3,1790474400,1806807600,1821924e3,1838257200,1853373600,1869706800,1885428e3,1901761200,1916877600,1933210800],
offset:[41944,41400,45e3,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800]},"Pacific/Chatham":{time:[-3192393600,-757382400,152678700,162359100,183523500,195018300,215577900,226467900,247027500,257917500,278477100,289367100,309926700,320816700,341376300,352266300,372825900,384320700,404880300,415770300,436329900,447219900,467779500,478669500,499229100,510119100,530678700,541568700,562128300,573623100,594182700,605072700,623817900,637731900,655267500,669181500,686717100,700631100,718166700,732685500,749616300,764135100,781065900,795584700,812515500,827034300,844569900,858483900,876019500,889933500,907469100,921987900,938918700,953437500,970368300,984887100,1002422700,1016336700,1033872300,1047786300,1065321900,1079840700,1096771500,1111290300,1128221100,1142739900,1159670700,1174189500,1191120300,1207453500,1222569900,1238903100,1254019500,1270352700,1285469100,1301802300,1316918700,1333251900,1348973100,1365306300,1380422700,1396755900,1411872300,1428205500,1443321900,1459655100,1474771500,1491104700,1506221100,1522554300,1538275500,1554608700,1569725100,1586058300,1601174700,1617507900,1632624300,1648957500,1664073900,1680407100,1695523500,1712461500,1727577900,1743911100,1759027500,1775360700,1790477100,1806810300,1821926700,1838259900,1853376300,1869709500,1885430700,1901763900,1916880300,1933213500],offset:[44028,44100,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500]},"Pacific/Fakaofo":{time:[-2177452800,1325203200,1925038800],offset:[-41096,-39600,46800]},"Pacific/Honolulu":{time:[-2334139200,-1157320800,-1155470400,-880236e3,-769429800,-765410400,-712188e3,1924956e3],
offset:[-37886,-37800,-34200,-37800,-34200,-34200,-37800,-36e3]},"America/Mexico_City":{time:[-1514763396,-1343091600,-1234828800,-1220317200,-1207180800,-1191369600,-975283200,-963187200,-917136e3,-907372800,-821923200,-810086400,-627523200,-613008e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,989114400,1001815200,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1175392800,1193536800,1207447200,1224986400,1238896800,1256436e3,1270346400,1288490400,1301796e3,131994e4,1333245600,1351389600,13653e5,1382839200,1396749600,1414288800,1428199200,1445738400,1459648800,1477792800,1491098400,1509242400,1522548e3,1540692e3,1554602400,1572141600,1586052e3,1603591200,1617501600,1635645600,1648951200,1667095200,1680400800,1698544800,1712455200,1729994400,1743904800,1761444e3,1775354400,1792893600,1806804e3,1824948e3,1838253600,1856397600,1869703200,1887847200,1901757600,1919296800,1933207200],offset:[-23796,-25200,-21600,-25200,-21600,-25200,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600]},"Africa/Cairo":{time:[-2185401600,-929836800,-923097600,-906163200,-892857600,-875836800,-857779200,-844300800,-825811200,-812678400,-794188800,-779846400,-762652800,-399081600,-38664e4,-368323200,-355104e3,-336783600,-323643600,-305161200,-292021200,-273625200,-260485200,-242089200,-228949200,-210553200,-197413200,-178930800,-165790800,-147394800,-134254800,-115858800,-102632400,-84322800,-71096400,-52700400,-39474e3,-21164400,-7938e3,10371600,23598e3,41907600,55134e3,7353e4,86756400,105066e3,118292400,136602e3,149828400,168138e3,181364400,199760400,212986800,231296400,244522800,262832400,276058800,294368400,307594800,325990800,339217200,357526800,370753200,396406800,402289200,426819600,433825200,452221200,465447600,483757200,496983600,515293200,528519600,546829200,560055600,578451600,591678e3,610419600,623214e3,641523600,65475e4,673059600,686286e3,704682e3,717908400,736218e3,749444400,767754e3,780980400,799027200,812332800,830476800,843782400,861926400,875232e3,893376e3,906681600,925430400,938736e3,95688e4,970185600,988329600,1001635200,1019779200,1033084800,1051228800,1064534400,1083283200,1096588800,1114732800,1128038400,1146182400,1158883200,1177632e3,1189123200,1209081600,1219968e3,1240531200,1250812800,1272585600,1281484800,1284076800,1285891200,1400198400,1403827200,1406851200,1411689600,1924999200],
offset:[7509,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"Africa/Johannesburg":{time:[-2458166400,-2109283200,-860968800,-845244e3,-829519200,-813794400,1924999200],offset:[6720,5400,7200,10800,7200,10800,7200]},"Asia/Kathmandu":{time:[-1577923200,504921600,1925012700],offset:[20476,19800,20700]},"US/Mountain":{time:[-2717668796,-1633298400,-1615154400,-1601848800,-1583704800,-1570399200,-1551650400,-1538949600,-1534111200,-880236e3,-769417200,-765410400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],
@@ -402,171 +402,171 @@ time:[-2871676800,-2208988800,-1692493200,-1680476400,323834400,338958e3,3546792
offset:[3020,3020,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Atlantic/Reykjavik":{time:[-1956614400,-1668214800,-1647212400,-1636678800,-161343e4,-1605142800,-1581894e3,-1539565200,-153135e4,-968029200,-952293600,-942012e3,-920239200,-909961200,-888789600,-877906800,-857944800,-846457200,-826495200,-815007600,-795045600,-783558e3,-762991200,-752108400,-731541600,-717634800,-700092e3,-686185200,-668642400,-654735600,-636588e3,-623286e3,-605743200,-591836400,-573688800,-559782e3,-542239200,-528332400,-510789600,-496882800,-47934e4,-465433200,-447890400,-433983600,-415836e3,-401929200,-384386400,-370479600,-352936800,-33903e4,-321487200,-307580400,-290037600,-276130800,-258588e3,-244681200,-226533600,-212626800,-195084e3,-181177200,-163634400,-149727600,-132184800,-118278e3,-100735200,-86828400,-68680800,-54774e3,1924992e3],offset:[-5280,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0]},"Europe/Tallinn":{time:[-2840140800,-1638316800,-1632002400,-1618693200,-1593820800,-1535932800,-927936e3,-892944e3,-85725e4,-844552800,-828219600,-812498400,-797644800,354931200,370742400,386467200,402278400,418003200,433814400,449625600,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909288e3,92259e4,941342400,1017543600,1035691200,1048993200,1067140800,1080442800,1099195200,1111892400,1130644800,1143342e3,1162094400,1174791600,1193544e3,1206846e3,1224993600,1238295600,1256443200,1269745200,1288497600,1301194800,1319947200,1332644400,1351396800,1364698800,1382846400,1396148400,1414296e3,1427598e3,1445745600,1459047600,14778e5,1490497200,1509249600,1521946800,1540699200,1554001200,1572148800,1585450800,1603598400,1616900400,1635652800,164835e4,1667102400,1679799600,1698552e3,1711854e3,1730001600,1743303600,1761451200,1774753200,1792900800,1806202800,1824955200,1837652400,1856404800,1869102e3,1887854400,1901156400,1919304e3,1932606e3],
offset:[5940,5940,3600,7200,3600,5940,7200,10800,7200,3600,7200,3600,7200,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"Europe/Riga":{time:[-2840140800,-1632002400,-1618693200,-1601676e3,-1597266e3,-1377302400,-928022400,-899510400,-85725e4,-844552800,-828219600,-812498400,-79677e4,-795830400,354931200,370742400,386467200,402278400,418003200,433814400,449625600,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,843966e3,859690800,877838400,891140400,909288e3,92259e4,941342400,985489200,1004241600,1017543600,1035691200,1048993200,1067140800,1080442800,1099195200,1111892400,1130644800,1143342e3,1162094400,1174791600,1193544e3,1206846e3,1224993600,1238295600,1256443200,1269745200,1288497600,1301194800,1319947200,1332644400,1351396800,1364698800,1382846400,1396148400,1414296e3,1427598e3,1445745600,1459047600,14778e5,1490497200,1509249600,1521946800,1540699200,1554001200,1572148800,1585450800,1603598400,1616900400,1635652800,164835e4,1667102400,1679799600,1698552e3,1711854e3,1730001600,1743303600,1761451200,1774753200,1792900800,1806202800,1824955200,1837652400,1856404800,1869102e3,1887854400,1901156400,1919304e3,1932606e3],offset:[5794,5794,9394,5794,9394,5794,7200,10800,7200,3600,7200,3600,7200,3600,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"Europe/Vilnius":{
time:[-2840140800,-1672531200,-1585094400,-1561248e3,-1553558400,-928195200,-900115200,-85725e4,-844552800,-828219600,-812498400,-802137600,354931200,370742400,386467200,402278400,418003200,433814400,449625600,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891140400,909284400,922586400,941338800,1048993200,1067140800,1080442800,1099195200,1111892400,1130644800,1143342e3,1162094400,1174791600,1193544e3,1206846e3,1224993600,1238295600,1256443200,1269745200,1288497600,1301194800,1319947200,1332644400,1351396800,1364698800,1382846400,1396148400,1414296e3,1427598e3,1445745600,1459047600,14778e5,1490497200,1509249600,1521946800,1540699200,1554001200,1572148800,1585450800,1603598400,1616900400,1635652800,164835e4,1667102400,1679799600,1698552e3,1711854e3,1730001600,1743303600,1761451200,1774753200,1792900800,1806202800,1824955200,1837652400,1856404800,1869102e3,1887854400,1901156400,1919304e3,1932606e3],offset:[6076,5040,5736,3600,7200,3600,10800,7200,3600,7200,3600,7200,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,7200,3600,7200,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"America/Lima":{time:[-2524521600,-1938556800,-1009843200,-1002067200,-986774400,-971049600,-955324800,-9396e5,504921600,512697600,536457600,544233600,631152e3,638928e3,757382400,765158400,1924974e3],offset:[-18492,-18516,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3]},"America/Santiago":{
time:[-2524521600,-1892678400,-1688428800,-1619222400,-1593820800,-1336003200,-13176e5,-1304380800,-1286064e3,-1272844800,-1254528e3,-1241308800,-1222992e3,-1209772800,-1191369600,-1178150400,-870566400,-865296e3,-740534400,-736387200,-718070400,-713667600,-36633600,-23932800,-3369600,7516800,24451200,37756800,55900800,69206400,87955200,100656e3,118195200,132105600,150854400,163555200,182304e3,195609600,213753600,227059200,245203200,258508800,277257600,289958400,308707200,321408e3,340156800,353462400,371606400,384912e3,403056e3,416361600,434505600,447811200,46656e4,479260800,498009600,510710400,529459200,545184e3,560908800,574214400,592358400,605664e3,624412800,637113600,653443200,668563200,687312e3,700617600,718761600,732067200,750211200,763516800,781660800,794966400,813715200,826416e3,845164800,85968e4,876614400,88992e4,906854400,923184e3,939513600,952819200,971568e3,984268800,1003017600,1015718400,1034467200,1047168e3,1065916800,1079222400,1097366400,1110672e3,1128816e3,1142121600,1160870400,1173571200,119232e4,1206835200,1223769600,1237075200,1255219200,1270339200,1286668800,1304812800,1313884800,1335657600,1346544e3,1367107200,1378598400,1398556800,1410048e3,1463270400,1471132800,149472e4,1502582400,1526169600,1534032e3,1554595200,1567900800,1586044800,1599350400,1617494400,16308e5,1648944e3,1662249600,1680393600,1693699200,1712448e3,1725753600,1743897600,1757203200,1775347200,1788652800,1806796800,1820102400,1838246400,1851552e3,1870300800,1883001600,1901750400,1915056e3,19332e5],offset:[-16966,-16966,-18e3,-16966,-14400,-16966,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-10800,-14400,-18e3,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800]},"Asia/Bahrain":{time:[-1577923200,76204800,1925002800],offset:[12368,14400,10800]},"Asia/Jakarta":{time:[-3231273600,-1451693568,-117288e4,-876614400,-766022400,-683856e3,-620784e3,-189388800,1925017200],offset:[25632,25632,26400,27e3,32400,27e3,28800,27e3,25200]},"Africa/Lagos":{time:[-1588464e3,1924995600],offset:[816,3600]},"Pacific/Norfolk":{time:[-2177452800,-599616e3,152071200,162957600,1443924e3,1925031600],offset:[40312,40320,41400,45e3,41400,39600]},"America/Juneau":{
time:[-3225169588,-2188987200,-880236e3,-769420800,-765410400,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,438998400,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],offset:[54139,-32261,-28800,-25200,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-28800,-28800,-25200,-28800,-25200,-28800,-25200,-32400,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400]},"Asia/Ho_Chi_Minh":{time:[-2004048e3,-1851552e3,-852080400,-782614800,-767836800,-718070400,-457747200,-315622800,171849600,1925017200],offset:[25600,25590,25200,28800,32400,25200,28800,25200,28800,25200]},"Australia/Perth":{time:[-2337897600,-1672531140,-1665352800,-883605600,-876088800,-860364e3,-844639200,152071200,162961200,436327200,447217200,690343200,699418800,1165111200,1174791600,1193536800,1206846e3,1224986400,1238295600,1925020800],offset:[27804,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Europe/Oslo":{
time:[-2366755200,-1691881200,-1680566400,-927507600,-85725e4,-844552800,-828219600,-812498400,-79677e4,-781048800,-765320400,-340840800,-324507600,-308786400,-293058e3,-277336800,-261608400,-245887200,-230158800,-214437600,-198709200,-182988e3,-166654800,-147909600,-135205200,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[2580,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]}}},function(e,t,i){"use strict";function n(e){this._studyId=e,this._maxToVers=o.ZERO,this._maxFromVers=o.ZERO,this._migrs=[]}var o=i(163).Version,r=i(4).getLogger("Chart.StudyMigration");n.prototype.addMigration=function(e,t,i){var n=o.parse(e),r=o.parse(t);n.isGreater(this._maxFromVers)&&(this._maxFromVers=n),r.isGreater(this._maxToVers)&&(this._maxToVers=r),this._migrs.push({fromVers:n,toVers:r,rules:i})},n.prototype.updateInputs=function(e,t,i){var n,o,s;if(!i)return i;for(n=TradingView.clone(i),o=e;o.isLess(t)&&null!=(s=this._findMigration(o));){if(r.logNormal("Migrating study inputs from "+s.fromVers+" to "+s.toVers+" version, studyId: "+this._studyId+", migration: "+JSON.stringify(s)+", inputs: "+JSON.stringify(i)),n=this._applyMigration(n,s),!o.isLess(s.toVers))throw Error("Problems in study migration process... Possible infinite cycle has been detected and stopped.");o=s.toVers}return o>e&&r.logNormal("Study inputs migration is done, studyId: "+this._studyId+", inputs: "+JSON.stringify(n)),n},n.prototype._findMigration=function(e){
var t,i,n=-1,o=this._maxFromVers;for(t=0;t<this._migrs.length;t++)i=this._migrs[t],i.fromVers.isLess(e)||i.fromVers.isLessOrEqual(o)&&(o=i.fromVers,n=t);return n<0?null:this._migrs[n]},n.prototype._applyMigration=function(e,t){var i,n,o,r=e;for(i=0;i<t.rules.length;i++)n=t.rules[i],o=this._getApplyRuleFun(n.type),r=o(r,n);return r},n.prototype._getApplyRuleFun=function(e){if("inputRemoved"===e)return n._applyInputRemovedRule;if("inputChangedType"===e)return n._applyInputChangedTypeRule;if("inputChangedMinMax"===e)return n._applyInputChangedMinMaxRule;if("inputChangedOptions"===e)return n._applyInputChangedOptionsRule;throw Error("Unknown migration rule type: "+e)},n._applyInputRemovedRule=function(e,t){if(!(t.inputId in e))return e;if("removeVal"!==t.action)throw Error("Unexpected rule.action="+t.action+" in rule.type="+t.type);var i=e[t.inputId];return delete e[t.inputId],r.logNormal("Input "+t.inputId+"="+i+" removed"),e},n._applyInputChangedTypeRule=function(e,t){var i=e[t.inputId];if("resetToDefVal"===t.action)return e[t.inputId]=t.defVal,r.logNormal("Input "+t.inputId+"="+i+" reset to default value "+t.defVal),e;if("convertVal"===t.action){if(null==i)return e;if("float"===t.inputTypeFrom&&"integer"===t.inputType)return e[t.inputId]=Math.round(e[t.inputId]),r.logNormal("Input "+t.inputId+"="+i+" converted to value "+e[t.inputId]),e;if("integer"===t.inputTypeFrom&&"float"===t.inputType)return e;if("text"===t.inputTypeFrom&&"source"===t.inputType)return n._isValidSource(i,t.options)?e:(e[t.inputId]=t.defVal,e);throw Error("Cannot convertVal from "+t.inputTypeFrom+" to "+t.inputType)}throw Error("Unknown action "+t.action+" for rule with type "+t.type)},n._isValidSource=function(e,t){return e.indexOf("$")>=0||t.indexOf(e)>=0},n._applyInputChangedMinMaxRule=function(e,t){if("adjustValIfNeeded"!==t.action)throw Error("Unknown action "+t.action+" for rule with type "+t.type);var i=e[t.inputId];return i<t.minVal?e[t.inputId]=t.minVal:i>t.maxVal&&(e[t.inputId]=t.maxVal),r.logNormal("Input "+t.inputId+"="+i+" adjusted to value "+e[t.inputId]),e},n._applyInputChangedOptionsRule=function(e,t){if(!(["text"].indexOf(t.inputType)>=0&&"resetToDefValIfNeeded"===t.action))throw Error("Unexpected rule.inputType="+t.inputType+" in rule.action="+t.action);var i=e[t.inputId];return t.options.indexOf(i)<0&&(e[t.inputId]=t.defVal,r.logNormal("Input "+t.inputId+"="+i+" reset to default value "+t.defVal)),e},e.exports=n},function(e,t,i){"use strict";(function(t,n,o,r){function s(e){return e instanceof M}function a(e){return e.isNoScale()?null:e.priceScale()}function l(e,t,i,n,o){if(void 0!==o)switch(o){case"right":return e.rightPriceScale();case"left":return e.leftPriceScale();case"no-scale":return null;case"as-series":if(!e.isMainPane()){Y.logWarn('BEWARE: Attempt to set "as-series" price scale to study, but series and study are on different panes');break}return a(t);default:Y.logWarn("Unknown override for priceScale type - "+o+", default will be used")}var r=i.priceScale
;return n?null:(s(t)||e.isMainPane()&&void 0===r)&&i.is_price_study?a(t):r===N.None?i.is_price_study?null:(Y.logWarn("Cannot add study "+i.id+" with 'No Scale' setting, because study is not a price study. Using right price scale."),e.rightPriceScale()):r===N.Left?e.leftPriceScale():e.rightPriceScale()}function c(e,i,r,s,a,l,h,u){var d,p,_;for(u=Object.assign({},Z,u),this._version=c.version,this._readOnly=u.readOnly,this._undoModel=l,this._studiesMetaInfoRepository=a,this._properties=r,this._modelIntervals=[],this._isSnapshot=u.isSnapshot,this.setStudiesMetaData(this._studiesMetaInfoRepository.getInternalMetaInfoArray(),this._studiesMetaInfoRepository.getMigrations()),this.m_timeScale=new x(this,u.timeScale),H.init(),d=this,this.m_panes=[],this.m_gridSource=new P,this.m_crossHairSource=new S(this,H.properties(),{additionalMenuEnabled:u.crossHairMenuEnabled}),this.m_crossHairSource.selectBarMode().subscribe(function(e){if(e&&d.lineBeingCreated()){var t=H.tool.value();d.cancelCreatingLine(),H.tool.setValue(t)}}),this.m_width=0,this._tagsChanged=new t,this._lineCancelled=new t,this._magnet=new T(H.properties().magnet,this.m_timeScale,r.paneProperties.magnetSensivity),p=new j("chartproperties.mainSeriesProperties"),p.addExclusion("minTick"),p.addExclusion("priceAxisProperties.lockScale"),p.addExclusion("priceAxisProperties.percentage"),p.addExclusion("priceAxisProperties.log"),this.createPane(void 0,{rightAxisProperties:p.priceAxisProperties.state(["autoScale"])}),this.m_panes[0]._stretchFactor=2*b.DEFAULT_STRETCH_FACTOR,this.m_panes[0]._isMainPane=!0,this.m_selectedSource=null,this._selectedSourceChanged=new t,this._chartApi=e,this._invalidateHandler=i,this.m_hoveredSource=null,this._properties.listeners().subscribe(this,c.prototype.propertyChangeHandler),this._properties.timezone.listeners().subscribe(null,function(){d._chartApi&&d._chartApi.connected()&&d._chartApi.switchTimezone(d.timezone())}),this.m_timeScale.defaultRightOffsetProperty().listeners().subscribe(null,function(){d.recalculateAllPanes()}),p.merge(r.mainSeriesProperties.state()),this.m_mainSeries=new W(this,p,s),this.m_panes[0].addDataSource(this.m_mainSeries,this.m_panes[0].rightPriceScale()),this._mainSeriesPriceScaleNameChanged=new t,this._mainSeriesPriceScaleNameProperty=new K(this),this._mainSeriesScaleRatioProperty=new G(this),this.m_mainSeries.dataEvents().completed().subscribe(this,function(){if(d.clearCurrentPosition(),d._scrollingState&&d.gotoTime(),n.enabled("fix_left_edge")&&this.m_mainSeries.endOfData()){var e=this.m_mainSeries.bars().first();null!==e&&this.m_timeScale.setLeftEdgeFix(e.index)}}.bind(this)),this.m_mainSeries.onIntervalChanged().subscribe(this,function(){this._oldStartVisibleIndex=-1,this._oldEndVisibleIndex=-1}),this.m_mainSeries.dataEvents().barReceived().subscribe(this,c.prototype.updateTimeScaleBaseIndex),this.m_mainSeries.properties().symbol.listeners().subscribe(this,this.setPriceAutoScaleForAllMainSources),this._readOnly||(p.addChild("priceAxisProperties",this.m_mainSeries.m_priceScale.properties()),
this._properties.paneProperties.legendProperties.showStudyTitles.listeners().subscribe(this,function(e){e.value()||d._properties.paneProperties.legendProperties.showStudyArguments.setValue(!1)})),this._barsMarksSources=h(this),_=0;_<this._barsMarksSources.length;_++)this._barsMarksSources[_].setOwnerSource(this.m_mainSeries);this._syncPointCache={},this.m_watermarkSource=u.watermarkEnabled?new w(this.m_mainSeries):null,this._brandingSource=null,this.strategySources=[],this.strategySources.change=new t,this._activeStrategySource=new o(null),this._oldStartVisibleIndex=-1,this._oldEndVisibleIndex=-1,this._currentTool="",H.hideAllDrawings().subscribe(this,this.visibilityChangeHandler),this._properties.scalesProperties.listeners().subscribe(this,c.prototype.fullUpdate),this._id=q.guid(),this._studyInserted=new t,this._chartThemeLoaded=new t,this._resetScales=new t,this._isScalesResetAvailableChanged=new t,this._isScalesResetAvailable=!1,this._studyShiftColorStartOffset=void 0}var h=i(7).ensureNotNull,u=i(6).Point,d=i(24),p=d.parseRgb,_=d.rgbToBlackWhiteString,f=i(73),m=f.createLineTool,y=f.isLineToolName,g=f.isLineTool,v=f.isStudyLineTool,S=i(598).CrossHair,b=i(176).Pane,w=i(614).Watermark,P=i(615).Grid,T=i(616),x=i(617).TimeScale,C=i(177).PriceScale,L=i(88).BarsMarksContainer,I=i(622).Branding,A=i(28).PriceDataSource,k=i(18),E=i(34),M=E.Study,V=i(180).NonSeriesStudy,D=i(285).createStudy,O=E.prepareStudyProperties,R=i(168),B=i(124),N=i(211).ScaleType,F=i(17).PlotRowSearchMode,W=i(63).Series,H=i(32),j=i(3).DefaultProperty,z=i(39).trackEvent,U=i(632).TimeSynchronizer,q=i(33),Y=i(4).getLogger("Chart.ChartModel"),G=i(633).MainSeriesScaleRatioProperty,K=i(634).MainSeriesPriceScaleNameProperty,Z={isSnapshot:!1,readOnly:!1,watermarkEnabled:!0,crossHairMenuEnabled:!1};c.prototype.applyPreferences=function(e){var t,i;for(t in e)void 0!==this._properties[t]&&"m_mainSeries"!==this._properties[t]&&this._properties[t].mergeAndFire(e[t]);void 0!==e.mainSeriesPriceScaleName&&this.setMainSeriesPriceScaleName(this.mainSeriesPriceScaleName(),e.mainSeriesPriceScaleName),this.m_timeScale.defaultRightOffsetProperty().setValue(e.timeScale.defaultRightOffset),this._properties.saveDefaults(),this.m_mainSeries.checkSessStudy(),i=this.m_mainSeries.sessionsStudy(),i&&i.applyPreferences(e.sessionsStudy),this.m_mainSeries.applyPreferences(e.mainSeries),this.recalculateAllPanes(),this.invalidate(new k(k.FULL_UPDATE))},c.prototype.setStudiesMetaData=function(e,t){this._studiesMetaData=e,this._studyVersioning=new R(this._studiesMetaData,t)},c.prototype.isSnapshot=function(){return this._isSnapshot},c.prototype.currentTool=function(){return this._currentTool},c.prototype.setCurrentTool=function(e){this._currentTool=e},c.prototype.timezone=function(){return this._properties.timezone.value()},c.prototype.version=function(){return this._version},c.prototype.initConnection=function(){this._chartApi.switchTimezone(this.timezone())},c.prototype.dumpViews=function(){var e,t,i,n,o={};for(o.panes=[],
e=0;e<this.m_panes.length;e++)o.panes.push(this.m_panes[e].dumpViews());for(o.dataWindow=[],t=this.dataSources(),e=0;e<t.length;e++)i=t[e],(n=i.dataWindowView())&&o.dataWindow.push(n.dump());return o},c.prototype._paneInvalidationMask=function(e,t){var i=new k,n=this.m_panes.indexOf(e);return void 0===t&&(t=k.LIGHT_UPDATE),i.invalidatePane(n,t),i},c.prototype.updatePane=function(e){var t=this._paneInvalidationMask(e);this.invalidate(t)},c.prototype.fullUpdate=function(){this.invalidate(new k(k.FULL_UPDATE))},c.prototype.lightUpdate=function(){this.invalidate(new k(k.LIGHT_UPDATE))},c.prototype.updateSource=function(e){var t=this.paneForSource(e),i=this._paneInvalidationMask(t);this.invalidate(i)},c.prototype.studiesMetaData=function(){return this._studiesMetaData},c.prototype.studyVersioning=function(){return this._studyVersioning},c.prototype.disconnect=function(){var e,t,i=this.dataSources();for(t=0;t<i.length;t++)e=i[t],e.disconnect&&e.disconnect()},c.prototype.restart=function(){var e,t,i;for(this.initConnection(),this.m_timeScale.reset(),this.m_mainSeries.restart(),e=this.dataSources(),t=0;t<e.length;t++)i=e[t],i.restart&&i!==this.m_mainSeries&&i.restart()},c.prototype.startNotStartedStudies=function(){var e,t;if(!this.m_mainSeries.isStarted())throw Error("Cannot start studies: main series is not started");for(e=this.dataSources(),t=0;t<e.length;t++)s(e[t])&&!e[t].isStarted()&&e[t].restart&&e[t]!==this.m_mainSeries&&e[t].restart()},c.prototype.updateLineTools=function(){var e,t,i=this.dataSources();for(e=0;e<i.length;e++)g(i[e])&&(t=i[e],t.tryCreateServerPoints(),t.checkAlert&&t.checkAlert())},c.prototype.realignLineTools=function(){var e,t,i=this.dataSources();for(e=0;e<i.length;e++)g(i[e])&&(t=i[e],t.calcIsActualSymbol());for(e=0;e<this.m_panes.length;e++)this.m_panes[e].invalidateSourcesCache()},c.prototype.readOnly=function(){return this._readOnly},c.prototype.properties=function(){return this._properties},c.prototype.lineCancelled=function(){return this._lineCancelled},c.prototype.crossHairMoved=function(){return this.m_crossHairSource.moved()},c.prototype.chartApi=function(){return this._chartApi},c.prototype.propertyChangeHandler=function(){this.invalidate(new k(k.LIGHT_UPDATE))},c.prototype.visibilityChangeHandler=function(){this.setSelectedSource(),this.invalidate(new k(k.LIGHT_UPDATE))},c.prototype.updateAllPaneViews=function(){var e,t;for(e=0;e<this.m_panes.length;e++)t=this.m_panes[e],t.updateAllViews()},c.prototype.mainSeries=function(){return this.m_mainSeries},c.prototype.timeScale=function(){return this.m_timeScale},c.prototype.panes=function(){return this.m_panes},c.prototype.gridSource=function(){return this.m_gridSource},c.prototype.watermarkSource=function(){return this.m_watermarkSource},c.prototype.brandingSource=function(){return this._brandingSource},c.prototype.crossHairSource=function(){return this.m_crossHairSource},c.prototype.publishedChartsTimelineSource=function(){return null},c.prototype.barsMarksSources=function(){return this._barsMarksSources},c.prototype.width=function(){
return this.m_width},c.prototype.setPaneHeight=function(e,t){e.setHeight(t),this.recalculateAllPanes(),this.invalidate(new k(k.LIGHT_UPDATE))},c.prototype.setWidth=function(e){var t,i;for(this.m_width=e,this.m_timeScale.setWidth(this.m_width),t=0;t<this.m_panes.length;++t)i=this.m_panes[t],i.setWidth(e);this.recalculateAllPanes(),this.recalcVisibleRangeStudy(this.dataSources())},c.prototype.createPane=function(e,t){var i,n;if(this._undoModel._chartWidget.isMaximizedPane()&&this._undoModel._chartWidget.toggleMaximizePane(),i=this._properties.paneProperties,t&&i.merge(t),n=new b(this.m_timeScale,i,this),"number"==typeof e&&isFinite(e)){if(e<0||e>this.m_panes.length)return void Y.logDebug("ChartModel.createPane: invalid index: "+e);this.m_panes.splice(e,0,n)}else this.m_panes.push(n);return n.onTagsChanged().subscribe(this,c.prototype.onPaneTagsChanged),n},c.prototype.removePane=function(e){var t,i;this._undoModel._chartWidget.isMaximizedPane()&&this._undoModel._chartWidget.toggleMaximizePane(),e.destroy(),t=this.m_panes.indexOf(e),-1!==t&&this.m_panes.splice(t,1),i=this.crossHairSource(),i.pane===e&&this.clearCurrentPosition(),this.invalidate(new k(k.FULL_UPDATE))},c.prototype.startScalePrice=function(e,t,i){e.startScalePrice(t,i)},c.prototype.scalePriceTo=function(e,t,i){e.scalePriceTo(t,i),this.mainSeries().priceScale().isLockScale()?this.invalidate(new k(k.LIGHT_UPDATE)):this.invalidate(this._paneInvalidationMask(e,k.LIGHT_UPDATE)),this._setScalesResetAvailable(!0)},c.prototype.endScalePrice=function(e,t){e.endScalePrice(t),this.invalidate(this._paneInvalidationMask(e,k.LIGHT_UPDATE))},c.prototype.startScrollPrice=function(e,t,i){e.startScrollPrice(t,i)},c.prototype.scrollPriceTo=function(e,t,i){e.scrollPriceTo(t,i),this.invalidate(this._paneInvalidationMask(e,k.LIGHT_UPDATE))},c.prototype.endScrollPrice=function(e,t){e.endScrollPrice(t),this.invalidate(this._paneInvalidationMask(e,k.LIGHT_UPDATE))},c.prototype.setPriceAutoScale=function(e,t,i){e.setPriceAutoScale(t,i),this.invalidate(this._paneInvalidationMask(e,k.LIGHT_UPDATE))},c.prototype.restorePriceScaleState=function(e,t,i){e.restorePriceScaleState(t,i),this.invalidate(this._paneInvalidationMask(e,k.LIGHT_UPDATE))},c.prototype.resetPriceScale=function(e,t){this._setScalesResetAvailable(!1),e.resetPriceScale(t),this.invalidate(this._paneInvalidationMask(e,k.LIGHT_UPDATE))},c.prototype.updateScales=function(e,t){this._undoModel._chartWidget._updateScalesActions()},c.prototype.startScaleTime=function(e){this.m_timeScale.startScale(e)},c.prototype.mainSeriesPriceScaleNameProperty=function(){return this._mainSeriesPriceScaleNameProperty},c.prototype.mainSeriesPriceScaleName=function(){var e=this.paneForSource(this.m_mainSeries),t=this._mainSeriesPriceScaleName(),i=null;return"left"===t||"right"===t?i=t:e.isOverlay(this.m_mainSeries)&&(i="none"),i},c.prototype.setMainSeriesPriceScaleName=function(e,t){var i,n=this.paneForSource(this.m_mainSeries);e===t||"none"===t&&!n.actionNoScaleIsEnabled(this.m_mainSeries)||(i=n.priceScaleByName(t),
this.move(this.m_mainSeries,n,i))},c.prototype.mainSeriesPriceScaleNameChanged=function(){return this._mainSeriesPriceScaleNameChanged},c.prototype.onMainSeriesPriceScaleNameChanged=function(){this._mainSeriesPriceScaleNameChanged.fire()},c.prototype.mainSeriesScaleRatioProperty=function(){return this._mainSeriesScaleRatioProperty},c.prototype.mainSeriesScaleRatioPropertyOnChanged=function(){this._mainSeriesScaleRatioProperty.listeners().fire(this._mainSeriesScaleRatioProperty)},c.prototype._mainSeriesPriceScaleName=function(){var e=this.paneForSource(this.m_mainSeries);return e.priceScaleName(e.priceScaleForSource(this.m_mainSeries))},c.prototype.mainSeriesScaleRatio=function(){var e=this.paneForSource(this.m_mainSeries);return"left"===this._mainSeriesPriceScaleName()?e.leftPriceScaleRatio():e.rightPriceScaleRatio()},c.prototype.setMainSeriesScaleRatio=function(e){var t=this.paneForSource(this.m_mainSeries);"left"===this._mainSeriesPriceScaleName()?t.applyLeftPriceScaleRatio(e):t.applyRightPriceScaleRatio(e)},c.prototype.scaleTimeTo=function(e){this.m_timeScale.scaleTo(e),this.recalculateAllPanes(),this.invalidate(new k(k.LIGHT_UPDATE)),this._setScalesResetAvailable(!0)},c.prototype.endScaleTime=function(){this.m_timeScale.endScale(),this.invalidate(new k(k.LIGHT_UPDATE)),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudy(this.dataSources())},c.prototype.startScrollTime=function(e){this.m_timeScale.startScroll(e),this._isTimeScrolling=!0},c.prototype.scrollTimeTo=function(e){this.m_timeScale.scrollTo(e),this.recalculateAllPanes(),this.updateCrossHair(),this.invalidate(new k(k.LIGHT_UPDATE)),this._setScalesResetAvailable(!0)},c.prototype.endScrollTime=function(){this.m_timeScale.endScroll(),this.invalidate(new k(k.LIGHT_UPDATE)),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudy(this.dataSources()),this._isTimeScrolling=!1},c.prototype.recalcStudyBasedLineTools=function(){this.dataSources().forEach(function(e){v(e)&&e.recalcStudyIfNeeded&&e.recalcStudyIfNeeded()})},c.prototype.recalcVisibleRangeStudy=function(e,t){void 0!==this._recalcVRTimerId&&clearTimeout(this._recalcVRTimerId);var i=this;this._recalcVRTimerId=setTimeout(function(){i._recalcVisibleRangeStudy(e,t)},500)},c.prototype._recalcVisibleRangeStudy=function(e,t){var i,n,o,r,a,l,c,h,u,d,p,_,f,m,y,g;if(!this.timeScale().isEmpty()&&(i=this.timeScale().visibleBars(),n=this.mainSeries().nearestData(i.firstBar(),F.NearestRight),o=this.mainSeries().nearestData(i.lastBar(),F.NearestLeft),r=this.mainSeries().bars().lastIndex(),a=n?n.index:void 0,l=o?o.index:void 0,c=a===this._oldStartVisibleIndex,h=l===this._oldEndVisibleIndex,!c||!h||t))for(this._oldStartVisibleIndex=a,this._oldEndVisibleIndex=l,u={first_visible_bar_time:1e3*Math.floor(n&&n.value?n.value[TradingView.TIME_PLOT]:0),last_visible_bar_time:1e3*Math.floor(o&&o.value?o.value[TradingView.TIME_PLOT]:0),subscribeRealtime:o&&o.index===r},d=0;d<e.length;d++)if(s(e[d])){for(p=e[d],_=p.metaInfo().inputs,f=[],m=0;m<_.length;m++)u.hasOwnProperty(_[m].id)&&f.push(_[m].id)
;for(y=p.properties().inputs,m=0;m<f.length;m++)g=f[m],y[g].setValueSilently(u[g]);f.length>0&&y.listeners().fire(y)}},c.prototype.onResetScales=function(){return this._resetScales},c.prototype.resetTimeScale=function(){this.m_timeScale.restoreDefault(),this.recalculateAllPanes(),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudy(this.dataSources()),this.updateCrossHair(),this.invalidate(new k(k.LIGHT_UPDATE)),this._resetScales.fire(),this._setScalesResetAvailable(!1)},c.prototype.restoreTimeScaleState=function(e){this.m_timeScale.restoreState(e),this.recalculateAllPanes(),this.updateCrossHair(),this.invalidate(new k(k.LIGHT_UPDATE)),this._setScalesResetAvailable(!0)},c.prototype.restoreFactoryDefaults=function(e){e.restoreFactoryDefaults(),this.recalcVisibleRangeStudy(this.dataSources(),!0),this.mainSeries().onChartStyleChanged()},c.prototype.restoreDefaults=function(e){e.restoreDefaults(this._studyVersioning),this.recalcVisibleRangeStudy(this.dataSources(),!0),this.mainSeries().onChartStyleChanged()},c.prototype.setSelectedSource=function(e,t){if(!(this.m_selectedSource===e&&this._lastHittestData===t||e&&e.customization&&e.customization.disableSelection)){this._lastHittestData=t;var i=new k;this.m_selectedSource&&(this.m_selectedSource.updateAllViews(),TradingView.alertsDispatcher&&this.m_selectedSource.hasAlert.value()&&this.m_selectedSource.getAlert({fromCache:!0}).done(function(e){e&&e.set("selected",!1)})),this.m_selectedSource=e,this._selectedSourceChanged.fire(e),e&&(e.updateAllViews(),TradingView.alertsDispatcher&&e.hasAlert.value()&&e.getAlert({fromCache:!0}).done(function(e){e&&e.set("selected",!0)})),i.force=!0,this.invalidate(new k(k.LIGHT_UPDATE)),this.setHoveredSource(e,t)}},c.prototype.checkLineToolSelection=function(){this.m_selectedSource&&g(this.m_selectedSource)&&(this.m_selectedSource.calcIsActualSymbol(),this.m_selectedSource.isActualSymbol()||this.setSelectedSource(null))},c.prototype.onSelectedSourceChanged=function(){return this._selectedSourceChanged},c.prototype.setHoveredSource=function(e,t){if(this.m_hoveredSource!==e||this._lastHittestData!==t){this._lastHittestData=t;var i=null;this.m_hoveredSource&&(this.m_hoveredSource.updateAllViews(),i||(i=new k),TradingView.alertsDispatcher&&this.m_hoveredSource.hasAlert.value()&&this.m_hoveredSource.getAlert({fromCache:!0}).done(function(e){e&&e.set("hovered",!1)}),i.merge(this._paneInvalidationMask(this.paneForSource(this.m_hoveredSource),k.LIGHT_UPDATE))),this.m_hoveredSource=e,e&&(e.updateAllViews(),i||(i=new k),i.merge(this._paneInvalidationMask(this.paneForSource(e),k.LIGHT_UPDATE)),TradingView.alertsDispatcher&&e.hasAlert.value()&&e.getAlert({fromCache:!0}).done(function(e){e&&e.set("hovered",!0)})),i&&this.invalidate(i)}},c.prototype.selectedSource=function(){return this.m_selectedSource},c.prototype.hoveredSource=function(){return this.m_hoveredSource},c.prototype.lastHittestData=function(){return this._lastHittestData},c.prototype.invalidate=function(e){this._invalidateHandler&&this._invalidateHandler(e)},
c.prototype.dataSources=function(){var e,t,i,n=[];for(n.push(this.m_crossHairSource),e=0;e<this.m_panes.length;++e)for(t=this.m_panes[e].dataSources(),i=0;i<t.length;i++)n.push(t[i]);return n},c.prototype.orderedDataSources=function(e){var t,i,n=[];for(n.push(this.m_crossHairSource),t=0;t<this.m_panes.length;t++)i=this.m_panes[t].orderedSources().slice(),e&&i.reverse(),n=n.concat(i);return n},c.prototype.dataSourceForId=function(e){var t,i;for(i=0;i<this.m_panes.length;++i)if(t=this.m_panes[i].dataSourceForId(e))return t;return null},c.prototype.children=function(e,t){return this.dataSources().filter(function(i){return(!0!==t||!s(i)||!i.isChildStudy())&&i.ownerSource()===e})},c.prototype.setAndSaveCurrentPosition=function(e,t,i,n){this.m_crossHairSource.saveOriginCoord(e,t),this.setCurrentPosition(e,t,i,n)},c.prototype.setCurrentPosition=function(e,t,i,n){var o,r,s,a,l,c,h,u,d,p,_,f,m,g,v,S=NaN,b=Math.round(this.m_timeScale.coordinateToIndex(e));if(i&&(o=i.defaultPriceScale(),o.isEmpty()||(r=i.mainDataSource().firstValue(),S=o.coordinateToPrice(t,r))),(this._lineBeingCreated||y(this.currentTool()))&&(S=this._magnet.align(S,b,i)),this._isTimeScrolling)return void this.m_crossHairSource.setPosition(this.m_crossHairSource.index,S,i);for(this.m_crossHairSource.setOnHoveredChartWidget(!0),this.m_crossHairSource.setPosition(b,S,i),this.m_crossHairSource.dataWindowView().update(),s=this.m_panes,a=s.length;a--;)for(l=s[a].dataSources(),c=l.length;c--;)h=l[c].dataWindowView(),h&&h.update(),(u=l[c].legendView())&&u.update();this._lineBeingCreated?(this._lineBeingCreated.setLastPoint({index:b,price:S},n),this._lineBeingCreated.updateAllViews(),this.invalidate(new k(k.LIGHT_UPDATE))):this.crossHairSource().startMeasurePoint()?this.invalidate(new k(k.LIGHT_UPDATE)):this.invalidate(new k(k.UPDATE_CURSOR_ONLY)),this._isSettingsExternalPosition||(d=this._undoModel._chartWidget,d._chartWidgetCollection&&(p=this.mainSeries(),(_=p.syncModel())&&(f=this.m_timeScale.points().roughTime(b,_.projectTime.bind(_)),m={timeStamp:f},g=i.mainDataSource(),g instanceof W&&(m.price=S,m.symbol=g.symbol()),m.syncModel=_,v=this._lineBeingCreated||this._linePointBeingEdited||this._sourceBeingMoved,v=v&&H.drawOnAllCharts().value(),d._chartWidgetCollection.syncCrosshair(m,d,v,n))))},c.prototype.clearCurrentPosition=function(){var e,t,i,n,o,r,s,a=this.crossHairSource();for(a.clearPosition(),a.dataWindowView().update(),e=this.m_panes,t=e.length;t--;)for(i=e[t].dataSources(),n=i.length;n--;)o=i[n].dataWindowView(),o&&o.update(),(r=i[n].legendView())&&r.update();this.invalidate(new k(k.UPDATE_CURSOR_ONLY)),s=this._undoModel._chartWidget,s._chartWidgetCollection&&s._chartWidgetCollection.syncCrosshair(NaN,s)},c.prototype.onSyncScrollNeeded=function(e){var t,i,n,o=this._undoModel._chartWidget;o._chartWidgetCollection&&(t=this.mainSeries(),(i=t.syncModel())&&(n=1e3*this.m_timeScale.points().roughTime(e,i.projectTime.bind(i)),o._chartWidgetCollection.syncScroll(n,this)))},c.prototype.gotoTime=function(e,t){function i(){
return p.tickMarks().indexToTime(p.tickMarks().minIndex).valueOf()-e}function n(t){var n,o,r,s,a;if(i()<0){for(n=p.tickMarks().nearestIndex(e),o=h(_.bars().lastIndex()),n=Math.min(n,o),r=p.tickMarks().indexToTime(n).valueOf();r<e&&n<o;)n++,r=p.tickMarks().indexToTime(n).valueOf();return s=p.visibleBars(),a=s.lastBar()-s.firstBar(),!t&&s.contains(n)||(p.zoomToBarsRange(n-a/2,n+a/2),_.requestMoreData()),{timestamp:p.indexToTimePoint(n)}}}var o,r,s,a,l,c,u,d,p=this.timeScale(),_=this.mainSeries();if(t&&t.model&&(o=_.syncModel())&&(r=this._createSyncPoint(t.model.mainSeries().syncModel(),o),e=1e3*r.sourceTimeToTargetTime(e/1e3)),t=t||{centerIfVisible:!0},e)this._scrollingState&&this._scrollingState.deferred.reject(),s=$.Deferred(),this._scrollingState={targetDate:e,deferred:s,centerIfVisible:t.centerIfVisible};else{if(!this._scrollingState)return Y.logError("scrollTo called without an argument"),$.Deferred().reject().promise();e=this._scrollingState.targetDate,s=this._scrollingState.deferred}return a=n(this._scrollingState.centerIfVisible),a||(l=p.tickMarks().minIndex,c=p.visibleBars(),u=c.lastBar()-c.firstBar(),_.endOfData()?(p.zoomToBarsRange(l-u/2,l+u/2),a={timestamp:p.indexToTimePoint(l),eod:!0}):(d=this.timeScale().tickMarks().estimateLeft(e),_.requestMoreData(Math.ceil(d+u/2)))),a&&(this.fullUpdate(),this._scrollingState=null,s.resolve(a)),s.promise()},c.prototype._createSyncPoint=function(e,t){var i,n,o=this._syncPointCache[e.uniqueId()];if(o){if(i=o[t.uniqueId()])return i}else this._syncPointCache[e.uniqueId()]={};return n=new U(e,t),this._syncPointCache[e.uniqueId()][t.uniqueId()]=n,n},c.prototype.setExternalPosition=function(e,t){var i,n,o,r,s,a,l,c,h,u,d,p,_,f=this.crossHairSource();if(f.setOnHoveredChartWidget(!1),!Number.isNaN(e)&&isNumber(e.timeStamp)&&(n=this.mainSeries(),(o=n.syncModel())&&(r=this._createSyncPoint(e.syncModel,o),s=r.sourceTimeToTargetTime(e.timeStamp),i=this.m_timeScale.points().roughIndex(s,o.distance.bind(o)))),this.mainSeries().symbol()===e.symbol)return this._isSettingsExternalPosition=!0,a=this.paneForSource(this.mainSeries()),l=this.m_timeScale.indexToCoordinate(i),c=a.mainDataSource().firstValue(),h=this.mainSeries().priceScale().priceToCoordinate(e.price,c,!0),this.setCurrentPosition(l,h,a,t||{}),f.setOnHoveredChartWidget(!1),void delete this._isSettingsExternalPosition;for(isFinite(i)?f.setPosition(i,NaN,null):(f.clearPosition(),f.dataWindowView().update()),u=this.dataSources(),d=u.length;d--;)p=u[d].dataWindowView(),p&&p.update(),(_=u[d].legendView())&&_.update();this.invalidate(new k(k.UPDATE_CURSOR_ONLY))},c.prototype.updateCrossHair=function(){this.m_crossHairSource.update()},c.prototype.updateTimeScale=function(e,t,i,n,o,r){var s,a,l;if(r)for(this.m_timeScale.reset(),s=this.dataSources(),a=0;a<s.length;a++)s[a].clearData&&s[a].clearData();if(n.length>0)for(s=this.dataSources(),a=0;a<s.length;a++)s[a].moveData&&s[a].moveData(n);this.m_timeScale.update(e,t,i,o),l="ChartModel.prototype.updateTimeScale("+e+","+t+","+i.length+","+n.length+","+o.length+","+r+")",
l+="TimeScale: {first:"+this.m_timeScale.m_points.firstIndex()+",last:"+this.m_timeScale.m_points.lastIndex()+"}",Y.logDebug(l),this.recalculateAllPanes(),this.invalidate(new k(k.LIGHT_UPDATE))},c.prototype.updateTimeScaleBaseIndex=function(e){var t,i,n,o,r,s,a=this.mainSeries().bars();a.isEmpty()||(t=this.timeScale(),i=t.baseIndex(),n=h(a.lastIndex()),o=t.visibleBars(),null!==o&&(r=o.contains(i),e&&e.index>0&&!r&&(s=n-i,t.setRightOffset(t.rightOffset()-s))),t.setBaseIndex(n))},c.prototype.recalculatePane=function(e){e&&e.recalculate()},c.prototype.paneForSource=function(e){for(var t=this.m_panes.length-1;t>=0;t--)if(-1!==this.m_panes[t].dataSources().indexOf(e))return this.m_panes[t];return e instanceof L?this.paneForSource(this.m_mainSeries):null},c.prototype.recalculateAllPanes=function(){for(var e=0;e<this.m_panes.length;++e)this.m_panes[e].recalculate();this.updateAllPaneViews()},c.prototype._invalidateBarColorerCaches=function(){var e,t,i=this.dataSources();for(e=0;e<i.length;++e)(t=i[e])instanceof W&&t.invalidateBarColorerCache()},c.prototype.addStrategySource=function(e){~this.strategySources.indexOf(e)||(this.strategySources.push(e),this.strategySources.change.fire())},c.prototype.removeStrategySource=function(e){var t,i,n=this.strategySources.indexOf(e);~n&&(t=this.strategySources.splice(n,1),t[0]===this._activeStrategySource.value()&&this.unsetActiveStrategySource(),this.strategySources.length>0&&(i=this.strategySources[this.strategySources.length-1],this.setActiveStrategySource(i)),this.strategySources.change.fire())},c.prototype.setActiveStrategySource=function(e){~this.strategySources.indexOf(e)&&this._activeStrategySource.setValue(e)},c.prototype.unsetActiveStrategySource=function(){this._activeStrategySource.setValue(null)},c.prototype.activeStrategySource=function(){return this._activeStrategySource},c.prototype.insertStudy=function(e,t,i,n,o){var r,s,a,c;return null!==n&&void 0!==n||(n=this.mainSeries()),r=["Study_ESD$TV_SPLITS@tv-scripting","Study_ESD$TV_DIVIDENDS@tv-scripting","Study_ESD$TV_SPLITS@tv-scripting","Volume@tv-basicstudies","Sessions@tv-basicstudies"],-1===r.indexOf(e.id)&&z("studies","Study_"+e.id),s=null,i||e.is_price_study?s=this.paneForSource(n):(s=this.createPane(),t&&t.paneSize&&s.setPaneSize(t.paneSize)),"Compare@tv-basicstudies"===e.id&&(z("compare","symbol:"+t.inputs.symbol),this.m_mainSeries.priceScale().setMode({log:!1,percentage:!0})),a=O(e,t,s,this.studyVersioning(),n),c=D(this,a,n,e),this._recalcVisibleRangeStudy([c],!0),c.start(),c.childStudyByRebind().subscribe(null,function(){z("SOS","Apply SOS","Rebind SOS")}),s.addDataSource(c,l(s,n,c.metaInfo(),i,o)),c.properties().linkedToSeries&&c.properties().linkedToSeries.value()&&c.setOwnerSource(this.mainSeries()),this.recalculatePane(s),this.invalidate(new k(k.FULL_UPDATE)),this._invalidateBarColorerCaches(),this.recalcVisibleRangeStudy(this.dataSources(),!0),this._studyInserted.fire(c),c},c.prototype.studyInserted=function(){return this._studyInserted},c.prototype.replaceStudyStub=function(e,t){
var i,n,o,r=this.paneForSource(e);return null!==r&&(i=e.isNoScale()?null:e.priceScale(),n=e.zorder(),o=e.ownerSource(),r.insertDataSource(t,i,n),t.setOwnerSource(o),this.panes().forEach(function(i){i.dataSources().forEach(function(i){i._ownerSource===e&&i.setOwnerSource(t)})}),this.removeSource(e),t.start(),this.recalculatePane(r),this.invalidate(new k(k.FULL_UPDATE)),!0)},c.prototype.insertStudyStub=function(e){var t=this.mainSeries(),i=this.paneForSource(t),n=new B(this,null,e);return i.addDataSource(n,null),this.recalculatePane(i),this.invalidate(new k(k.FULL_UPDATE)),n},c.prototype.removeStudyStub=function(e){var t=this.dataSourceForId(e);return void 0===t?(Y.logNormal("StudyStub id="+e+" is not found in chart model"),!1):(this.removeSource(t),!0)},c.prototype.detachSource=function(e,t){var i=this.paneForSource(e);if(i)return i.removeDataSource(e),i.isEmpty()?(this._lineBeingCreated&&i===this._paneBeingCreatedLineOn&&this.cancelCreatingLine(),this.removePane(i,t),!0):(this.invalidate(new k(k.FULL_UPDATE)),this._alertsList&&this._alertsList.trigger("reset"),!1)},c.prototype.removeSource=function(e,t){var i,n,o,r;if(e===this.m_selectedSource&&this.setSelectedSource(null),e===this._sourceBeingMoved&&(this._sourceBeingMoved=null,this._linePointBeingMoved=null),e===this._lineBeingEdited&&(this._lineBeingEdited=null),e===this._lineBeingCreated&&(this._lineBeingCreated=null),e.stop&&e.stop(),i=this.detachSource(e,t),e.metaInfo&&e.metaInfo()&&"Compare@tv-basicstudies"===e.metaInfo().id){for(n=this.paneForSource(this.m_mainSeries),o=n.dataSources(),r=0;r<o.length;r++)if(o[r].metaInfo&&"Compare@tv-basicstudies"===o[r].metaInfo().id)return;this.m_mainSeries.priceScale().setMode({percentage:!1})}return this.invalidate(new k(k.FULL_UPDATE)),this._invalidateBarColorerCaches(),e.linkKey&&H.removeLineTool({model:this,linkKey:e.linkKey}),s(e)&&e.isChildStudy()&&e.source().unsetChild(e),e.destroy&&e.destroy(),i},c.prototype._unmergeAvailable=function(e){return TradingView.isInherited(e.constructor,M)&&!TradingView.isInherited(e.constructor,V)||e===this.m_mainSeries},c.prototype.isMergeUpAvailableForSource=function(e){return!!this._unmergeAvailable(e)&&this.paneForSource(e)!==this.panes()[0]},c.prototype.mergeSourceUp=function(e){var t,i,n,o;this.isMergeUpAvailableForSource(e)&&(t=this.paneForSource(e),i=this.panes().indexOf(t),n=this.panes()[i-1],o=n.findSuitableScale(e),this.move(e,n,o))},c.prototype.isMergeDownAvailableForSource=function(e){var t,i;return!!this._unmergeAvailable(e)&&(t=this.paneForSource(e),i=this.panes(),t!==i[i.length-1])},c.prototype.mergeSourceDown=function(e){var t,i,n,o;this.isMergeDownAvailableForSource(e)&&(t=this.paneForSource(e),i=this.panes().indexOf(t),n=this.panes()[i+1],o=n.findSuitableScale(e),this.move(e,n,o))},c.prototype.isUnmergeAvailableForSource=function(e){var t,i;return!!this._unmergeAvailable(e)&&(t=this.paneForSource(e),i=t.dataSources().filter(function(e){return TradingView.isInherited(e.constructor,A)&&e.showInObjectTree()}),i.length>1)},c.prototype.unmergeSourceUp=function(e){
var t,i,n,o;this.isUnmergeAvailableForSource(e)&&(t=this.paneForSource(e),i=this.panes().indexOf(t),n=this.createPane(i),o=n.findSuitableScale(e),this.move(e,n,o))},c.prototype.unmergeSourceDown=function(e){var t,i,n,o;this.isUnmergeAvailableForSource(e)&&(t=this.paneForSource(e),i=this.panes().indexOf(t),n=this.createPane(i+1),o=n.findSuitableScale(e),this.move(e,n,o))},c.prototype.isLeftPriceScaleVisible=function(){return this._properties.scalesProperties.showLeftScale.value()},c.prototype.isRightPriceScaleVisible=function(){return this._properties.scalesProperties.showRightScale.value()},c.prototype.setLeftPriceScaleVisible=function(e){this._properties.scalesProperties.showLeftScale.value()!==e&&this._properties.scalesProperties.showLeftScale.setValue(e)},c.prototype.setRightPriceScaleVisible=function(e){this._properties.scalesProperties.showRightScale.value()!==e&&this._properties.scalesProperties.showRightScale.setValue(e)},c.prototype.setPriceScaleVisibility=function(e,t){"left"===e&&this.setLeftPriceScaleVisible(t),"right"===e&&this.setRightPriceScaleVisible(t)},c.prototype.move=function(e,t,i){var n,o,r,s,a=this.children(e,!0),l=this.paneForSource(e),c=t?t.priceScaleName(i):"right";if(l===t){for(n=t.priceScaleByName(c),o=0;o<a.length;o++)t.move(a[o],n);t.move(e,n)}else{for(r=t||this.createPane(),s=r.priceScaleByName(c),o=0;o<a.length;o++)this.detachSource(a[o]);for(this.detachSource(e),r.addDataSource(e,s),o=0;o<a.length;o++)r.addDataSource(a[o],s)}this._alertsList&&this._alertsList.trigger("reset"),e===this.m_mainSeries&&this.onMainSeriesPriceScaleNameChanged(),this.invalidate(new k(k.FULL_UPDATE))},c.prototype.isSingleInstanceLineTool=function(e){return"LineStudyMtpRiskReward"===e||"LineStudyMtpAnalysis"===e},c.prototype._externalTimeStamp=function(e){var t=this.mainSeries().syncModel();return this.m_timeScale.points().roughTime(e,t&&t.projectTime.bind(t))},c.prototype.createLineTool=function(e,t,i,n,o){var r,s,a,l,c,h,d,p,_,f,g,v;return y(i)?(this.isSingleInstanceLineTool(i)&&this._undoModel.removeAllDrawingTools(i),"LineToolExecution"!==i&&z("drawings","Study_Drawing_"+i),n&&(r=n.state(),s=TradingView.factoryDefaults("linetool"),a=i.toLowerCase(),TradingView.merge(s,TradingView.factoryDefaults(a)),n=TradingView[i].prototype.createPropertiesObject(a,s),n.merge(r)),l=m(i,this,n,null,e.mainDataSource()),n||(n=l.properties()),c=!l.linkKey&&!o,H.drawOnAllCharts().value()?l.linkKey=o||q.randomHash():l.linkKey=o,l.toolname=i,l.setOwnerSource(e.mainDataSource()),h=e.defaultPriceScale(),e.addDataSource(l,h),l.isFixed()?(p=e.mainDataSource().firstValue(),_=this.m_timeScale.indexToCoordinate(t.index),f=h.priceToCoordinate(t.price,p),d=l.addFixedPoint(new u(_,f))):(g=l.constructor,g.skipMagnetting||(t.price=this._magnet.align(t.price,t.index,e)),d=l.addPoint(t)),d||(this._lineBeingCreated=l,this._paneBeingCreatedLineOn=e),c&&l.enableCurrentIntervalVisibility(),this.invalidate(new k(k.FULL_UPDATE)),o||!H.drawOnAllCharts().value()||l.properties().singleChartOnly||(v=this._externalTimeStamp(t.index),H.createLineTool({
point:{price:t.price,timeStamp:v},linetool:i,properties:n,symbol:this.mainSeries().symbol(),model:this,linkKey:l.linkKey})),l):null},c.prototype.lineBeingCreated=function(){return this._lineBeingCreated},c.prototype.paneBeingCreatedLineOn=function(){return this._paneBeingCreatedLineOn},c.prototype.coninueCreatingLine=function(e,t,i,n){var o,r,s,a,l,c=this.paneForSource(this._lineBeingCreated);return e.price=this._magnet.align(e.price,e.index,c),o=this._lineBeingCreated.addPoint(e,t,i),r=this._lineBeingCreated,this._lineBeingCreated.updateAllViews(),s=new k(k.LIGHT_UPDATE),a=null,o&&(a={points:this._lineBeingCreated._timePoint,interval:this.mainSeries().interval()},this._paneBeingCreatedLineOn=null,this._lineBeingCreated=null,s.force=!0),this.invalidate(s),n||!H.drawOnAllCharts().value()||r.properties().singleChartOnly||(l=this._externalTimeStamp(e.index),H.continueLineTool({point:{price:e.price,timeStamp:l},envState:t,finalState:a,model:this})),o},c.prototype.cancelCreatingLine=function(){if(this._lineBeingCreated){var e=this._lineBeingCreated;this.removeSource(this._lineBeingCreated),this._lineBeingCreated=null,this._lineCancelled.fire(),H.drawOnAllCharts().value()&&!e.properties().singleChartOnly&&H.cancelLineTool({model:this})}},c.prototype.startChangingLinetool=function(e,t,i,n){var o,r,s;this._lineBeingEdited=e,this._linePointBeingEdited=i,this._lineBeingEdited.startChanging(i,t),o=this.paneForSource(e),t.price=this._magnet.align(t.price,t.index,o),this._lineBeingEdited.startDragPoint&&this._lineBeingEdited.startDragPoint(i,t),this._lineBeingEdited.setPoint(i,t,n),this._lineBeingEdited.updateAllViews(),r=this._paneInvalidationMask(o,k.LIGHT_UPDATE),r.force=!0,this.invalidate(r),e.linkKey&&!e.properties().singleChartOnly&&(s=this._externalTimeStamp(t.index),H.startChangingLineTool({linkKey:e.linkKey,model:this,symbol:this.mainSeries().symbol(),point:{price:t.price,timeStamp:s},pointIndex:i,envState:n}))},c.prototype.lineBeingEdited=function(){return this._lineBeingEdited},c.prototype.linePointBeingEdited=function(){return this._linePointBeingEdited},c.prototype.changeLinePoint=function(e,t){var i,n,o,r,s,a=this.paneForSource(this._lineBeingEdited);void 0!==e.x&&void 0!==e.y?(o=this._lineBeingEdited.priceScale(),r=a.mainDataSource().firstValue(),i=o.coordinateToPrice(e.y,r),n=Math.round(this.timeScale().coordinateToIndex(e.x)),i=this._magnet.align(i,n,a),this._lineBeingEdited.setPoint(this._linePointBeingEdited,{price:i,index:n},t)):this._lineBeingEdited.setPoint(this._linePointBeingEdited,e,t),this._lineBeingEdited.updateAllViews(),this.invalidate(new k(k.LIGHT_UPDATE)),this._lineBeingEdited.linkKey&&!this._lineBeingEdited.properties().singleChartOnly&&(s=this._externalTimeStamp(n),H.changeLineTool({linkKey:this._lineBeingEdited.linkKey,model:this,symbol:this.mainSeries().symbol(),point:{price:i,timeStamp:s},envState:t}))},c.prototype.endChangingLinetool=function(e){var t,i,n=this._lineBeingEdited;this._lineBeingEdited.endChanging(!1,e),this._lineBeingEdited=null,this._linePointBeingEdited=null,
t=new k(k.LIGHT_UPDATE),t.force=!0,this.invalidate(t),i={points:n._timePoint,interval:this.mainSeries().interval()},n.linkKey&&!n.properties().singleChartOnly&&H.finishChangingLineTool({model:this,linkKey:n.linkKey,symbol:this.mainSeries().symbol(),finalState:i})},c.prototype.startMovingSource=function(e,t,i){var n,o,r;this._sourceBeingMoved=e,this._linePointBeingMoved=i,this._sourceBeingMoved.startMoving(t,i),n=this.paneForSource(this._sourceBeingMoved),o=this._paneInvalidationMask(n,k.LIGHT_UPDATE),o.force=!0,this.invalidate(o),e.linkKey&&!e.properties().singleChartOnly&&(r=this._externalTimeStamp(t.index),H.startMovingLineTool({linkKey:e.linkKey,model:this,symbol:this.mainSeries().symbol(),point:{price:t.price,timeStamp:r}}))},c.prototype.sourceBeingMoved=function(){return this._sourceBeingMoved},c.prototype.moveSource=function(e){if(this._sourceBeingMoved.move(e,this._linePointBeingMoved),this.invalidate(new k(k.LIGHT_UPDATE)),this._sourceBeingMoved.linkKey&&!this._sourceBeingMoved.properties().singleChartOnly){var t=this._externalTimeStamp(e.index);H.moveLineTool({linkKey:this._sourceBeingMoved.linkKey,model:this,point:{price:e.price,timeStamp:t}})}},c.prototype.endMovingSource=function(e){var t,i,n=this._sourceBeingMoved,o=this.paneForSource(this._sourceBeingMoved);this._sourceBeingMoved.endMoving(e),this._sourceBeingMoved=null,this._linePointBeingMoved=null,t=this._paneInvalidationMask(o,k.LIGHT_UPDATE),t.invalidateAll(k.LIGHT_UPDATE),t.force=!0,this.invalidate(t),g(n)&&(i={points:n._timePoint,interval:this.mainSeries().interval()},n.linkKey&&!n.properties().singleChartOnly&&H.finishMovingLineTool({linkKey:n.linkKey,model:this,finalState:i}))},c.prototype.finishLineTool=function(e){var t=this.lineBeingCreated();t&&(t.finish&&t.finish(),!e&&H.drawOnAllCharts().value()&&t.linkKey&&!t.properties().singleChartOnly&&H.finishLineTool({linkKey:t.linkKey,model:this}))},c.prototype.calculateDefaultTags=function(){var e,t,i=[],n=this.dataSources();for(e=0;e<n.length;e++)t=n[e],t.tags&&(i=i.concat(t.tags()));return i},c.prototype.changeZOrder=function(e,t){this.paneForSource(e).changeZOrder(e,t),this.invalidate(new k(k.FULL_UPDATE))},c.prototype.sendToBack=function(e){this.paneForSource(e).sendToBack(e),this.invalidate(new k(k.FULL_UPDATE))},c.prototype.bringToFront=function(e){this.paneForSource(e).bringToFront(e),this.invalidate(new k(k.FULL_UPDATE))},c.prototype.onTagsChanged=function(){return this._tagsChanged},c.prototype.onPaneTagsChanged=function(){this._tagsChanged.fire()},c.prototype.setTimeViewport=function(e,t){this.timeScale().zoomToBarsRange(e,t),this.recalculateAllPanes(),this.invalidate(new k(k.LIGHT_UPDATE))},c.prototype.zoomToViewport=function(e,t,i,n,o){var s,a,l;this.setTimeViewport(e,t),s=Math.min(i,n),a=Math.max(i,n),l=o.defaultPriceScale(),l.isPercentage()||l.setMode({autoScale:!1}),l.isLog()&&(s=l.priceToLogical(s),a=l.priceToLogical(a)),l.setPriceRange(new r(s,a)),this.recalculateAllPanes(),this.invalidate(this._paneInvalidationMask(o,k.LIGHT_UPDATE)),this._setScalesResetAvailable(!0)},
c.prototype.clearAllStudies=function(){var e,t=this.dataSources();for(e=0;e<t.length;e++)t[e].clearData&&t[e].clearData()},c.prototype.allStudies=function(){return this._getAllSources(s)},c.prototype.allLineTools=function(){return this._getAllSources(g)},c.prototype.getStudyById=function(e){var t=this.dataSourceForId(e);return null!==t&&s(t)?t:null},c.prototype.getLineToolById=function(e){var t=this.dataSourceForId(e);return null!==t&&g(t)?t:null},c.prototype._getAllSources=function(e){var t,i,n,o,r,s,a=[],l=this.m_panes,c=l.length;for(t=0;t<c;++t)for(i=l[t],n=i.dataSources(),o=n.length,r=0;r<o;++r)s=n[r],e(s)&&a.push(s);return a},c.prototype.getStudyById=function(e){var t=this.dataSourceForId(e);return t instanceof M?t:null},c.prototype.backgroundColor=function(){return this._properties.paneProperties.background._value},c.prototype.backgroundCounterColor=function(){return"black"===_(p(this.backgroundColor()),150)?"white":"black"},c.prototype.isDark=function(){return"white"===this.backgroundCounterColor()},c.prototype.canZoomIn=function(){return this.m_timeScale.canZoomIn()&&n.enabled("chart_zoom")},c.prototype.canZoomOut=function(){return this.m_timeScale.canZoomOut()&&n.enabled("chart_zoom")},c.prototype.updateAllVolumeStudies=function(){var e,t,i,n,o,r,a=this.m_panes;for(e=a.length;e--;)for(t=!1,i=a[e],n=i.dataSources(),o=n.length;o--;)r=n[o],s(r)&&"Volume"===r.metaInfo().shortId&&(r.updateAllViews(),t||(this.updatePane(i),t=!0))},c.prototype.alertsList=function(){return this._alertsList},c.prototype.setAlertsStudiesList=function(e){this._alertsStudiesList=$.map($.grep(e,function(e){var t,i=e.plots||[];for(t=0;t<i.length;t++)if("line"===i[t].type)return!0;return!1}),function(e){return e.id})},c.prototype.canCreateAlertForDataSource=function(e){if(!n.enabled("alerts"))return!1},c.prototype.setInterval=function(e,t){var i=setInterval(e,t);return this._modelIntervals.push(i),i},c.prototype.clearInterval=function(e){clearInterval(e);var t=this._modelIntervals.indexOf(e);t>-1&&this._modelIntervals.splice(t,1)},c.prototype.clearIntervals=function(){for(var e=0;e<this._modelIntervals.length;e++)clearInterval(this._modelIntervals[e]);this._modelIntervals=[]},c.prototype.destroy=function(){var e;for(e=0;e<this._barsMarksSources.length;e++)this._barsMarksSources[e].destroy();for(this.clearIntervals(),H.hideAllDrawings().unsubscribe(this,this.visibilityChangeHandler),this.resetDeferredStudies(),this._brandingSource&&this._brandingSource.destroy(),e=0;e<this._barsMarksSources.length;e++)this._barsMarksSources[e].destroy();for(e=0;e<this.m_panes.length;e++)this.m_panes[e].destroy();this.m_panes.length=0},c.prototype.countUserStudies=function(e){var t,i,n,o,r,a,l=0;for(e=e||{},t=0;t<this.m_panes.length;t++)for(i=this.m_panes[t].dataSources(),n=0;n<i.length;n++)if(o=i[n],s(o)&&o.showInObjectTree()){if(r=o.metaInfo&&o.metaInfo()){if(a=r.id,e.dontCountVolume&&"Volume@tv-basicstudies"===a)continue;if(e.dontCountCompare&&"Compare@tv-basicstudies"===a)continue;if(e.dontCountOverlay&&"Overlay@tv-basicstudies"===a)continue}l++}return l
},c.prototype.isJustClonedChart=function(){return this._undoModel.isJustClonedChart()},c.prototype.undoModel=function(){return this._undoModel},c.prototype.copyToOtherCharts=function(e){var t,i,n,o;e.linkKey=e.linkKey||q.randomHash(),t=this,i=e.state(),n=this.mainSeries(),(o=n.syncModel())&&(i.points=e._timePoint.map(function(e){var i=t.timeScale().timePointToIndex(e.time_t)+e.offset;return{price:e.price,timeStamp:t._externalTimeStamp(i)}}),i.linetool=e.getType(),i.model=this,i.symbol=this.mainSeries().symbol(),i.finalState={points:e._timePoint,interval:this.mainSeries().interval()},H.copyLineTool(i))},c.prototype.restoreSource=function(e,t,i,n,o){var r,s,a,l,c,h,u,d;return r=e?this.createPane(t):this.panes()[t],a=n.type,s=a.toLowerCase().startsWith("study")?r._restoreStudy(n):r._restoreLineTool(n),l=s.ownerSource()?s.ownerSource().priceScale():r.priceScaleByName(o),l?(s.setPriceScale(l),l.addDataSource(s)):(l=new C(this.properties().scalesProperties),l.setHeight(r.m_height),c=s.metaInfo&&"Volume@tv-basicstudies"===s.metaInfo().id,h=c?.75:r.m_rightPriceScale.topMargin(),u=c?0:r.m_rightPriceScale.bottomMargin(),l.setTopMargin(h),l.setBottomMargin(u),l.addDataSource(s),s.setPriceScale(l),s._isOverlay=!0),d=null,n.ownerSource&&(d=r.dataSourceForId(n.ownerSource)),s.setOwnerSource(d),s.setPriceScale(l),s.start(),s.restore&&s.restore(),e&&r.restoreState(i),this.recalculateAllPanes(),this.mainSeries().invalidateBarColorerCache(),this.invalidate(new k(k.FULL_UPDATE,!0)),s.linkKey&&H.restoreLineTool({model:this,linkKey:s.linkKey,state:{restorePane:e,paneIndex:t,paneState:i,sourceState:n,priceScaleName:o}}),s},c.prototype.restoreLineToolState=function(e,t){e.restorePoints(t.points,t.indexes||[]),e.properties().merge(t.state),e.restoreData&&e.restoreData(t),e.createServerPoints(),this.invalidate(new k(k.FULL_UPDATE)),e.linkKey&&H.restoreLineToolState({model:this,linkKey:e.linkKey,state:t})},c.prototype.createBrandingSource=function(){this._brandingSource=new I(this)},c.prototype.onChartThemeLoaded=function(){return this._chartThemeLoaded},c.prototype.chartThemeLoaded=function(){this._chartThemeLoaded.fire()},c.prototype.selectBarMode=function(){return this.m_crossHairSource.selectBarMode()},c.prototype.toggleSelectBarMode=function(){this.m_crossHairSource.toggleSelectBarMode()},c.prototype.onBarSelected=function(){return this.m_crossHairSource.onBarSelected()},c.prototype.isSeriesStyleSupported=function(e){return this.m_mainSeries.isStyleSupported(e)},c.prototype.getStudyShiftColorStartOffset=function(){return this._studyShiftColorStartOffset},c.prototype.setStudyShiftColorStartOffset=function(e){this._studyShiftColorStartOffset=e},c.prototype.setPriceAutoScaleForAllMainSources=function(){var e,t;for(e=0;e<this.m_panes.length;++e)null===(t=this.m_panes[e].mainDataSource())||t.priceScale().isLockScale()||t.priceScale().setMode({autoScale:!0})},c.prototype.isInReplay=function(){return this.m_mainSeries.isInReplay()},c.prototype.switchToReplay=function(e){},c.prototype.switchToRealtime=function(){},
c.prototype.defaultResolutions=function(){return this.chartApi().chartApi().defaultResolutions()},c.prototype._setScalesResetAvailable=function(e){this._isScalesResetAvailable!==e&&(this._isScalesResetAvailable=e,this._isScalesResetAvailableChanged.fire())},c.prototype.isScalesResetAvailable=function(){return this._isScalesResetAvailable},c.prototype.isScalesResetAvailableChanged=function(){return this._isScalesResetAvailableChanged},e.exports=c}).call(t,i(8),i(5),i(16),i(48).PriceRange)},function(e,t,i){"use strict";function n(e,t){this.array=[];for(var i in e)e[i].key=i,this.array.push(e[i]);this.rearrange(t)}n.prototype.rearrange=function(e){if("function"!=typeof e)throw Error("sort param is not a function");return this.array.sort(e)},n.byValue=function(e){return function(e,t){return e-t}},n.byField=function(e){return function(t,i){return t[e]>i[e]?1:t[e]<i[e]?-1:t[e]===i[e]?0:void 0}},n.byOrder=function(e){return function(t,i){return e.indexOf(t.key)-e.indexOf(i.key)}},e.exports=n},function(e,t,i){"use strict";function n(){s.call(this)}function o(e,t){this._constructor="LineToolFibRetracement";var r=t||this.createPropertiesObject("linetoolfibretracement");a.call(this,e,r),this.version=o.version,this._properties._stateVersion=1,e._fibRetracementLabelsCache||(e._fibRetracementLabelsCache=new n),i.e(0).then(function(e){var t=i(753).FibRetracementPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var r=i(19),s=i(68),a=i(0).LineDataSource,l=i(2).propertyPages;inherit(n,s),n.prototype.levelsCount=function(){return o.LevelsCount},inherit(o,a),o.version=2,o.LevelsCount=24,o.prototype.levelsCount=function(){return o.LevelsCount},o.prototype.stop=function(){a.prototype.stop.call(this),this._model._fibRetracementLabelsCache.removeSource(this.id())},o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Fib Retracement"},o.prototype.name=function(){return"Fib Retracement"},o.prototype.migrateVersion=function(e,t,i){1===e&&this.properties().extendLines.setValue(!0)},o.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},o.prototype.createPropertiesObject=function(e,t,i){return new r(e,t,i,{range:[1,24],names:["coeff","color","visible"]})},o.prototype.getStylesPropertyPage=function(){return l.LineToolFibRetracementStylesPropertyPage},t.LineToolFibRetracement=o},function(e,t,i){"use strict";(function(t){function i(e){t.call(this,""),this.subscribe(this,i.prototype.checkSelfColor),this.reloadProperties(e)}inherit(i,t),i.prototype.reloadProperties=function(e){for(;this._childs.length>0;)this.removeProperty(this._childs[0]);this._initValues=[];for(var t=0;t<e.length;++t)this._initValues.push(e[t].defaultValue),this.addChild(t,e[t].property);this.checkSelfColor()},i.prototype.setValue=function(e,i){if(this._value!==e||i){var n=this;this._childs.forEach(function(t){n[t].setValue(e||n._initValues[t])}),t.prototype.setValue.call(this,e,i)}},i.prototype.checkSelfColor=function(){var e,i=!0
;for(e=0;e<this._initValues.length;++e)if(this[e].value()!==this[0].value()){i=!1;break}t.prototype.setValue.call(this,i?this[0].value():"")},e.exports=i}).call(t,i(13))},function(e,t,i){"use strict";function n(){a.call(this)}function o(e,t){this._constructor="LineToolFibChannel";var s=t||this.createPropertiesObject("linetoolfibchannel");r.call(this,e,s),this.version=o.version,e._fibChannelLabelsCache||(e._fibChannelLabelsCache=new n),i.e(0).then(function(e){var t=i(754).FibChannelPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var r=i(0).LineDataSource,s=i(19),a=i(68),l=i(2).propertyPages;inherit(n,a),n.prototype.levelsCount=function(){return o.LevelsCount},inherit(o,r),o.LevelsCount=24,o.version=2,o.prototype.levelsCount=function(){return o.LevelsCount},o.prototype.migrateVersion=function(e,t,i){i.properties.removeProperty("reverse")},o.prototype.pointsCount=function(){return 3},o.prototype.title=function(){return"Fib Channel"},o.prototype.name=function(){return"Fib Channel"},o.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},o.prototype.createPropertiesObject=function(e,t,i){return new s(e,t,i,{range:[1,24],names:["coeff","color","visible"]})},o.prototype.getStylesPropertyPage=function(){return l.LineToolFibChannelStylesPropertyPage},t.LineToolFibChannel=o},function(e,t,i){"use strict";function n(){a.call(this)}function o(e,t){this._constructor="LineToolFibSpeedResistanceArcs";var o=t||this.createPropertiesObject("linetoolfibspeedresistancearcs");r.call(this,e,o),e._fibSpeedResistanceArcsLabelsCache||(e._fibSpeedResistanceArcsLabelsCache=new n),i.e(0).then(function(e){var t=i(755).FibSpeedResistanceArcsPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var r=i(0).LineDataSource,s=i(19),a=i(68),l=i(2).propertyPages;inherit(n,a),n.prototype.levelsCount=function(){return o.LevelsCount},inherit(o,r),o.LevelsCount=11,o.prototype.levelsCount=function(){return o.LevelsCount},o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Fib Speed Resistance Arcs"},o.prototype.name=function(){return"Fib Speed Resistance Arcs"},o.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},o.prototype.createPropertiesObject=function(e,t,i){return new s(e,t,i,{range:[1,11]})},o.prototype.getStylesPropertyPage=function(){return l.LineToolFibSpeedResistanceArcsStylesPropertyPage},t.LineToolFibSpeedResistanceArcs=o},function(e,t,i){"use strict";function n(){a.call(this)}function o(e,t){this._constructor="LineToolProjection";var n=t||this.createPropertiesObject("linetoolprojection");l.call(this,e,n),i.e(0).then(function(e){var t=i(756).ProjectionLinePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var r=i(19),s=i(270).LineToolFibWedge,a=i(68),l=i(0).LineDataSource,c=i(2).propertyPages;inherit(n,a),n.prototype.levelsCount=function(){return 1},
inherit(o,s),o.prototype.title=function(){return"Projection"},o.prototype.name=function(){return"Projection"},o.prototype.getCache=function(){return this._model._projectionLabelsCache||(this._model._projectionLabelsCache=new n),this._model._projectionLabelsCache},o.prototype.createPropertiesObject=function(e,t,i){return new r(e,t,i,{range:[1,1]})},o.prototype.getStylesPropertyPage=function(){return c.LineToolProjectionStylesPropertyPage},t.LineToolProjection=o},function(e,t,i){"use strict";function n(){a.call(this)}function o(e,t){this._constructor="LineToolTrendBasedFibExtension";var s=t||new this.createPropertiesObject("linetooltrendbasedfibextension");r.call(this,e,s),this.version=o.version,e._trendBasedFibExtensionLabelsCache||(e._trendBasedFibExtensionLabelsCache=new n),i.e(0).then(function(e){var t=i(757).TrendBasedFibExtensionPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var r=i(0).LineDataSource,s=i(19),a=i(68),l=i(2).propertyPages;inherit(n,a),n.prototype.levelsCount=function(){return o.LevelsCount},n.prototype.points=function(e){return[e.points()[0],e.points()[1]]},n.prototype.startPoint=function(e,t){return e.points()[2]},n.prototype.priceRange=function(e,t){var i=this.points(e),n=i[0],o=i[1];return t?n.price-o.price:o.price-n.price},n.prototype.sourceIsReady=function(e){return e.points().length>=3},inherit(o,r),o.version=2,o.LevelsCount=24,o.prototype.levelsCount=function(){return o.LevelsCount},o.prototype.stop=function(){r.prototype.stop.call(this),this._model._trendBasedFibExtensionLabelsCache.removeSource(this.id())},o.prototype.pointsCount=function(){return 3},o.prototype.title=function(){return"Trend-Based Fib Extension"},o.prototype.name=function(){return"Trend-Based Fib Extension"},o.prototype.migrateVersion=function(e,t,i){1===e&&this.properties().extendLines.setValue(!0)},o.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},o.prototype.createPropertiesObject=function(e,t,i){return new s(e,t,i,{range:[0,8]})},o.prototype.getStylesPropertyPage=function(){return l.LineToolTrendBasedFibExtensionStylesPropertyPage},t.LineToolTrendBasedFibExtension=o},function(e,t,i){"use strict";function n(){a.call(this)}function o(e,t){this._constructor="LineToolFibCircles";var o=t||this.createPropertiesObject("linetoolfibcircles");r.call(this,e,o),e._fibCirclesLabelsCache||(e._fibCirclesLabelsCache=new n),i.e(0).then(function(e){var t=i(758).FibCirclesPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var r=i(0).LineDataSource,s=i(19),a=i(68),l=i(2).propertyPages;inherit(n,a),n.prototype.levelsCount=function(){return o.LevelsCount},inherit(o,r),o.LevelsCount=11,o.prototype.levelsCount=function(){return o.LevelsCount},o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Fib Circles"},o.prototype.name=function(){return"Fib Circles"},o.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible
;e.setProperty(n,!1,"Erase level line")},o.prototype.createPropertiesObject=function(e,t,i){return new s(e,t,i,{range:[1,11]})},o.prototype.getStylesPropertyPage=function(){return l.LineToolFibCirclesStylesPropertyPage},t.LineToolFibCircles=o},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolVertLine";var n=t||new r("linetoolvertline");this._timeAxisView=new a(this,e),o.call(this,e,n),i.e(0).then(function(e){var t=i(759).VertLinePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages,a=i(271).LineToolVertLineTimeAxisView;inherit(n,o),n.prototype.pointsCount=function(){return 1},n.prototype.title=function(){return"Vertical Line"},n.prototype.name=function(){return"Vertical Line"},n.prototype.timeAxisViews=function(){return this.isSourceHidden()?null:this.properties().showTime.value()?[this._timeAxisView]:null},n.prototype.updateAllViews=function(){o.prototype.updateAllViews.call(this),this._timeAxisView.update()},n.prototype.canHasAlert=function(){return!0},n.prototype._getAlertPlots=function(){var e=this._points[0],t={index:e.index,price:e.price+1};return[this._linePointsToAlertPlot([e,t],null,!0,!0)]},n.prototype.getInputsPropertyPage=function(){return s.LineToolVertLineInputsPropertyPage},n.prototype.getStylesPropertyPage=function(){return s.LineToolVertLineStylesPropertyPage},t.LineToolVertLine=n},function(e,t,i){"use strict";var n,o,r,s,a,l,c;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"LineToolCrossLine",function(){return c}),n=i(1),o=i(3),i.n(o),r=i(174),s=i(271),a=i(0),i.n(a),l=i(2),i.n(l),c=function(e){function t(t,n){var a=e.call(this,t,n||new o.DefaultProperty("linetoolcrossline"))||this;return a._constructor="LineToolCrossLine",a._priceAxisView=new r.LineToolHorzLinePriceAxisView(a),a._timeAxisView=new s.LineToolVertLineTimeAxisView(a,t),i.e(0).then(function(e){var t=i(760).CrossLinePaneView;a._setPaneViews([new t(a,a._model)])}.bind(null,i)).catch(i.oe),a}return n.c(t,e),t.prototype.pointsCount=function(){return 1},t.prototype.title=function(){return"Cross Line"},t.prototype.name=function(){return"Cross Line"},t.prototype.priceAxisViews=function(e,t){return this.isSourceHidden()?null:t===this.priceScale()&&this.properties().showPrice.value()&&this._model.paneForSource(this)===e?[this._priceAxisView]:null},t.prototype.timeAxisViews=function(){return this.isSourceHidden()?null:this.properties().showTime.value()?[this._timeAxisView]:null},t.prototype.updateAllViews=function(){e.prototype.updateAllViews.call(this),this._priceAxisView.update(),this._timeAxisView.update()},t.prototype.canHasAlert=function(){return!1},t.prototype.getInputsPropertyPage=function(){return l.propertyPages.LineToolCrossLineInputsPropertyPage},t.prototype.getStylesPropertyPage=function(){return l.propertyPages.LineToolCrossLineStylesPropertyPage},t.prototype.lineColor=function(){return this.properties().linecolor.value()},t.prototype.lineWidth=function(){return this.properties().linewidth.value()
},t.prototype.lineStyle=function(){return this.properties().linestyle.value()},t}(a.LineDataSource),c.prototype.superclass=a.LineDataSource},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolBarsPattern";var r=t||new s("linetoolbarspattern");o.call(this,e,r),r.mirrored.listeners().subscribe(this,n.prototype.mirror),r.flipped.listeners().subscribe(this,n.prototype.flip),r.addExclusion("mirrored"),r.addExclusion("flipped"),this._scaleCoeff=1,this.version=n.version,this._pattern=[],this._properties.mode.listeners().subscribe(this,n.prototype.onModeChanged),i.e(0).then(function(e){var t=i(761).BarsPatternPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(41).Action,s=i(3).DefaultProperty,a=i(17).PlotRowSearchMode,l=i(2).propertyPages,c=i(203).LineToolBarsPatternMode;inherit(n,o),n.version=2,n.prototype.onModeChanged=function(){var e=this.patternPriceDiff();e*=this._pressCoeff,this._points[1].price=this._timePoint[1].price=this._points[0].price+e},n.prototype.additionalActions=function(e){var t,i,n=new r({checked:this.properties().mirrored.value(),checkable:!0,text:$.t("Mirrored"),callbackContext:{target:this}}),o=new r({checked:this.properties().flipped.value(),checkable:!0,text:$.t("Flipped"),callbackContext:{target:this}});return n.callbacks().subscribe(null,function(t){var i=t.callbackContext(),n=i.target;e.setProperty(n.properties().mirrored,!n.properties().mirrored.value(),"Bats Pattern Mirroring"),n.updateAllViews(),n._model.updateSource(n)}),o.callbacks().subscribe(null,function(t){var i=t.callbackContext(),n=i.target;e.setProperty(n.properties().flipped,!n.properties().flipped.value(),"Bats Pattern Flipping"),n.updateAllViews(),n._model.updateSource(n)}),t=new r({checkable:!0,text:$.t("Restore Size")}),i=this,t.callbacks().subscribe(null,function(t){var n=i.points()[0],o=i.patternPriceDiff(),r=n.price+o,s=n.index+i._pattern.length-1;e.startChangingLinetool(i,{price:r,index:s},1,{}),e.changeLinePoint({price:r,index:s},{}),e.endChangingLinetool()}),[n,o,t]},n.prototype.pointsCount=function(){return 2},n.prototype.state=function(e){var t=o.prototype.state.call(this,e);return t.pattern=this._pattern,t},n.prototype.restoreData=function(e){e.pattern&&(this._pattern=e.pattern)},n.prototype.title=function(){return"Bars Pattern"},n.prototype.name=function(){return"Bars Pattern"},n.prototype.cloneData=function(e){this._pattern=TradingView.clone(e._pattern)},n.prototype.mirror=function(){var e,t,i,n,o,r=this._pattern,s=r[0][TradingView.HIGH_PLOT],a=Math.min(r[0][TradingView.LOW_PLOT],r[0][TradingView.HIGH_PLOT]),l=Math.max(r[0][TradingView.LOW_PLOT],r[0][TradingView.HIGH_PLOT]);for(e=1;e<r.length;e++)a=Math.min(a,r[e][TradingView.LOW_PLOT]),l=Math.max(l,r[e][TradingView.HIGH_PLOT]);if(a<l)for(t=(a+l)/2,i=function(e){return t-(e-t)},e=0;e<r.length;e++)r[e][TradingView.HIGH_PLOT]=i(r[e][TradingView.HIGH_PLOT]),r[e][TradingView.LOW_PLOT]=i(r[e][TradingView.LOW_PLOT]),r[e][TradingView.OPEN_PLOT]=i(r[e][TradingView.OPEN_PLOT]),
r[e][TradingView.CLOSE_PLOT]=i(r[e][TradingView.CLOSE_PLOT]);n=r[0][TradingView.HIGH_PLOT]-s,o=r[r.length-1][TradingView.LOW_PLOT]-r[0][TradingView.HIGH_PLOT],this._points[0].price+=n,this._points[1].price=this._points[0].price+o,this.updateAllViews()},n.prototype.flip=function(){var e,t,i;for(this._points[0].price=this._points[1].price,e=0;e<this._pattern.length/2;e++)t=this._pattern[e],this._pattern[e]=this._pattern[this._pattern.length-e-1],this._pattern[this._pattern.length-e-1]=t;i=this._pattern[this._pattern.length-1][TradingView.LOW_PLOT]-this._pattern[0][TradingView.HIGH_PLOT],this._points[1].price=this._points[0].price+i,this.updateAllViews()},n.prototype.firstPatternPrice=function(){var e,t,i=parseInt(this.properties().mode.value(),10);return i===c.LineHL2?(this._pattern[0][TradingView.HIGH_PLOT]+this._pattern[0][TradingView.LOW_PLOT])/2:(e={0:TradingView.HIGH_PLOT,1:TradingView.CLOSE_PLOT,2:TradingView.OPEN_PLOT,3:TradingView.OPEN_PLOT,4:TradingView.HIGH_PLOT,5:TradingView.LOW_PLOT},t=e[i],this._pattern[0][t])},n.prototype.lastPatternPrice=function(){var e,t,i=parseInt(this.properties().mode.value(),10);return i===c.LineHL2?(this._pattern[this._pattern.length-1][TradingView.HIGH_PLOT]+this._pattern[this._pattern.length-1][TradingView.LOW_PLOT])/2:(e={0:TradingView.LOW_PLOT,1:TradingView.CLOSE_PLOT,2:TradingView.CLOSE_PLOT,3:TradingView.OPEN_PLOT,4:TradingView.HIGH_PLOT,5:TradingView.LOW_PLOT},t=e[i],this._pattern[this._pattern.length-1][t])},n.prototype.patternPriceDiff=function(){return this.lastPatternPrice()-this.firstPatternPrice()},n.prototype.pressCoeff=function(){var e=this.patternPriceDiff(),t=this.points()[0].price,i=this.points()[1].price,n=i-t,o=n/e;return this._pressCoeff=o,o},n.prototype.addPoint=function(e,t){var i,n,r,s,l,h,u,d,p,_,f,m=this._model.mainSeries(),y=m.nearestIndex(e.index,a.NearestRight);if(this.properties().mode.value()===c.Bars?e.price=m.bars().valueAt(y)[TradingView.HIGH_PLOT]:e.price=m.bars().valueAt(y)[TradingView.CLOSE_PLOT],i=this.priceScale(),n=this.ownerSource().firstValue(),r=.05*i.height(),s=i.priceToCoordinate(e.price,n)-r,e.price=i.coordinateToPrice(s,n),l=o.prototype.addPoint.call(this,e,t,!0)){for(h=Math.min(this.points()[0].index,this.points()[1].index),u=Math.max(this.points()[0].index,this.points()[1].index),y=this._model.mainSeries().nearestIndex(h,a.NearestRight),d=this._model.mainSeries().nearestIndex(u,a.NearestLeft),this.points()[0].index>this.points()[1].index&&(this._points[0].price=this._points[1].price),this._pattern=[],p=y;p<=d;p++)_=this._model.mainSeries().data().valueAt(p),this._pattern.push(TradingView.clone(_));this._pattern.length>0&&(f=this.patternPriceDiff(),this._points[1].price=this._points[0].price+f,this._points[1].index=this._points[0].index+(d-y),this.normalizePoints(),this.createServerPoints())}return l},n.prototype.setPoint=function(e,t,i){1===e&&t.index<=this._points[0].index&&(t.index=this._points[0].index+1),0===e&&t.index>=this._points[1].index&&(t.index=this._points[1].index-1),o.prototype.setPoint.call(this,e,t,i)},
n.prototype.migrateVersion=function(e,t,i){if(1===e&&this._pattern.length>0){var n=this.patternPriceDiff();2===this._timePoint.length&&(this._timePoint[1].price=this._timePoint[0].price+n),2===this._points.length&&(this._points[1].price=this._points[0].price+n)}},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return l.LineToolBarsPatternStylesPropertyPage},t.LineToolBarsPattern=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolTrendBasedFibTime";var r=t||new this.createPropertiesObject("linetooltrendbasedfibtime");o.call(this,e,r),this.version=n.version,i.e(0).then(function(e){var t=i(762).TrendBasedFibTimePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(19),s=i(2).propertyPages;inherit(n,o),n.version=1,n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Trend-Based Fib Time"},n.prototype.name=function(){return"Trend-Based Fib Time"},n.prototype.migrateVersion=function(e,t,i){},n.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},n.prototype.createPropertiesObject=function(e,t,i){return new r(e,t,i,{range:[1,11]})},n.prototype.getStylesPropertyPage=function(){return s.LineToolTrendBasedFibTimeStylesPropertyPage},t.LineToolTrendBasedFibTime=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolFibTimeZone";var r=t||this.createPropertiesObject("linetoolfibtimezone");o.call(this,e,r),this.version=n.version,i.e(0).then(function(e){var t=i(763).FibTimeZonePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(19),s=i(2).propertyPages;inherit(n,o),n.version=2,n.prototype.migrateVersion=function(e,t,i){var n;if(1===e){for(i.properties.level1.color.setValue(i.properties.baselinecolor.value()),n=2;n<=11;n++)i.properties["level"+n].color.setValue(i.properties.linecolor.value());for(n=1;n<=11;n++)i.properties["level"+n].linewidth.setValue(i.properties.linewidth.value()),i.properties["level"+n].linestyle.setValue(i.properties.linestyle.value())}},n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Fib Time Zone"},n.prototype.name=function(){return"Fib Time Zone"},n.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},n.prototype.createPropertiesObject=function(e,t,i){return new r(e,t,i,{range:[1,11]})},n.prototype.getStylesPropertyPage=function(){return s.LineToolFibTimeZoneStylesPropertyPage},t.LineToolFibTimeZone=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolCircleLines";var n=t||new r("linetoolcirclelines");o.call(this,e,n),i.e(0).then(function(e){var t=i(764).LineToolCircleLinesPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),
n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Cyclic Lines"},n.prototype.name=function(){return"Cyclic Lines"},n.prototype.getStylesPropertyPage=function(){return s.LineToolCircleLinesStylesPropertyPage},t.LineToolCircleLines=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolDateRange";var n=t||new r("linetooldaterange");o.call(this,e,n),i.e(0).then(function(e){var t=i(765).DateRangePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Date Range"},n.prototype.name=function(){return"Date Range"},n.prototype.getStylesPropertyPage=function(){return s.LineToolDateRangeStylesPropertyPage},t.LineToolDateRange=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolPriceRange";var n=t||new r("linetoolpricerange");o.call(this,e,n),i.e(0).then(function(e){var t=i(766).PriceRangePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Price Range"},n.prototype.name=function(){return"Price Range"},n.prototype.getStylesPropertyPage=function(){return s.LineToolDateRangeStylesPropertyPage},t.LineToolPriceRange=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolDateAndPriceRange";var n=t||new r("linetooldateandpricerange");o.call(this,e,n),i.e(0).then(function(e){var t=i(767).DateAndPriceRangePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Date and Price Range"},n.prototype.name=function(){return"Date and Price Range"},n.prototype.getStylesPropertyPage=function(){return s.LineToolDateAndPriceRangeStylesPropertyPage},t.LineToolDateAndPriceRange=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolParallelChannel";var n=t||new r("linetoolparallelchannel");o.call(this,e,n),i.e(0).then(function(e){var t=i(768).ParallelChannelPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.addPoint=function(e){var t,i=o.prototype.addPoint.call(this,e);return i&&(t=this.points()[0],this._points[2].index=t.index,this._points[2].price=t.price+this._priceOffset),i},n.prototype.calculatePriceDiff=function(){var e,t,i,n,o,r,s,a,l,c,h,u,d,p,_,f,m,y,g,v;if(3===this.points().length){if(e=this.points()[0],t=this.points()[1],i=this.points()[2],e.index===t.index)return;if(null===(n=this.priceScale()))return;if(n.isLog()){if(o=this._model.timeScale(),o.isEmpty())return;r=this.ownerSource().firstValue(),
s=o.indexToCoordinate(e.index),a=o.indexToCoordinate(t.index),l=n.priceToCoordinate(e.price,r),c=n.priceToCoordinate(t.price,r),h=o.indexToCoordinate(i.index),u=(c-l)/(a-s),d=l+u*(h-s),p=n.priceToCoordinate(i.price,r),_=p-d,r=this.ownerSource().firstValue(),f=.5*(l+c),m=n.coordinateToPrice(f,r),y=f+_,g=n.coordinateToPrice(y,r),this._priceOffset=g-m}else u=(t.price-e.price)/(t.index-e.index),v=e.price+u*(i.index-e.index),this._priceOffset=i.price-v}},n.prototype.setLastPoint=function(e,t){t&&t.shift&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[0]),o.prototype.setLastPoint.call(this,e),this.calculatePriceDiff()},n.prototype.restorePoints=function(e,t,i){o.prototype.restorePoints.call(this,e,t,i),e&&e.length>=3&&(this._priceOffset=e[2].price-e[0].price)},n.prototype.setPoint=function(e,t,i){i&&i.shift&&e<2&&this._snapPoint45Degree(t,this.points()[1-e]),o.prototype.setPoint.call(this,e,t,i),2===e&&this.calculatePriceDiff();var n=this.points()[0];this._points[2].index=n.index,this._points[2].price=n.price+this._priceOffset},n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Parallel Channel"},n.prototype.name=function(){return"Parallel Channel"},n.prototype.addPoint=function(e,t){return t&&t.shift&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[0]),o.prototype.addPoint.call(this,e,t)},n.prototype.fixAfterRestorePriceAxis=function(){this.priceScale().isLog()||delete this._priceOffset},n.prototype.cloneData=function(e){this._priceOffset=e._priceOffset},n.prototype.restoreData=function(e){e.priceOffset&&(this._priceOffset=e.priceOffset)},n.prototype.state=function(e){var t=o.prototype.state.call(this,e);return t.priceOffset=this._priceOffset,t},n.prototype.canHasAlert=function(){return!0},n.prototype._getAlertPlots=function(){function e(e,t){return e.index<=t.index?[e,t]:[t,e]}var t,i,n,o,r,s,a,l,c=[].concat(this._points).splice(0,2);return c=c.concat([{price:c[0].price+this._priceOffset,time:c[0].time,index:c[0].index},{price:c[1].price+this._priceOffset,time:c[1].time,index:c[1].index}]),t=e(c[0],c[1]),i=e(c[2],c[3]),this._priceOffset<0?(o=i,n=t):(o=t,n=i),a=this.properties().extendLeft.value(),l=this.properties().extendRight.value(),c[0].index<=c[1].index?(r=a,s=l):(r=l,s=a),[this._linePointsToAlertPlot(n,"Upper",r,s),this._linePointsToAlertPlot(o,"Lower",r,s)]},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return s.LineToolParallelChannelStylesPropertyPage},t.LineToolParallelChannel=n},function(e,t,i){"use strict";(function(e){function n(e,t){this._constructor="LineToolTrendAngleLine";var o=t||new s("linetooltrendangle");r.call(this,e,o),this._properties.addProperty("angle"),this._properties.angle=new n.AngleProperty(this),i.e(0).then(function(e){var t=i(769).TrendAnglePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(6).Point,r=i(0).LineDataSource,s=i(3).DefaultProperty,a=i(2).propertyPages;inherit(n,r),n.AngleProperty=function(t){e.call(this),
this._lineSource=t},inherit(n.AngleProperty,e),n.AngleProperty.prototype.value=function(){var e=this._lineSource._angle,t=180*e/Math.PI;return Math.round(t)},n.AngleProperty.prototype.setValue=function(e){var t,i,n,r,s,a,l=e*Math.PI/180;this._lineSource._angle=l,t=this._lineSource.pointToScreenPoint(this._lineSource.points()[0])[0],i=Math.cos(this._lineSource._angle),n=-Math.sin(this._lineSource._angle),r=new o(i,n),s=t.addScaled(r,this._lineSource._distance),a=this._lineSource.screenPointToPoint(s),this._lineSource._points[1]=a,this._lineSource._model.updateSource(this._lineSource),this._lineSource.updateAllViews(),this._lineSource._model.updateSource(this._lineSource)},n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Trend Angle"},n.prototype.name=function(){return"Trend Angle"},n.prototype._calculateAngle=function(){var e,t=this.pointToScreenPoint(this.points()[0])[0],i=this.pointToScreenPoint(this.points()[1])[0],n=i.subtract(t);n.length()>0?(n=n.normalized(),this._angle=Math.acos(n.x),n.y>0&&(this._angle=-this._angle),this._distance=i.subtract(t).length()):delete this._angle,e=this.properties(),e.hasOwnProperty("angle")&&this.properties().angle.listeners().fire(this.properties().angle)},n.prototype.addPoint=function(e,t){var i=r.prototype.addPoint.call(this,e,t);return i&&this._calculateAngle(),i},n.prototype.setLastPoint=function(e,t){r.prototype.setLastPoint.call(this,e,t),this.points().length>1&&this._calculateAngle()},n.prototype.axisPoints=function(){var e,t,i,n,r,s;return this.points().length<2?[]:(e=[this.points()[0]],t=this.pointToScreenPoint(this.points()[0])[1],i=Math.cos(this._angle)*this._distance,n=-Math.sin(this._angle)*this._distance,r=t.add(new o(i,n)),s=this.screenPointToPoint(r),e.push(s),e)},n.prototype.setPoint=function(e,t,i){r.prototype.setPoint.call(this,e,t,i),this.points().length>1&&1===e&&this._calculateAngle()},n.prototype.restoreData=function(e){this._angle=e.angle,this._distance=e.distance},n.prototype.state=function(e){var t=r.prototype.state.call(this,e);return t.angle=this._angle,t.distance=this._distance,t},n.prototype.cloneData=function(e){this._angle=e._angle,this._distance=e._distance},n.prototype.canHasAlert=function(){return!0},n.prototype._getAlertPlots=function(){return[this._linePointsToAlertPlot(this._points,null,this.properties().extendLeft.value(),this.properties().extendRight.value())]},n.prototype.getInputsPropertyPage=function(){return a.LineToolTrendAngleInputsPropertyPage},n.prototype.getStylesPropertyPage=function(){return a.LineToolTrendAngleStylesPropertyPage},t.LineToolTrendAngle=n}).call(t,i(13))},function(e,t,i){"use strict";var n,o,r,s,a;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"LineToolInfoLine",function(){return a}),n=i(1),o=i(3),i.n(o),r=i(101),i.n(r),s=i(2),i.n(s),a=function(e){function t(t,i){var n=e.call(this,t,i||new o.DefaultProperty("linetoolinfoline"))||this;return n._constructor="LineToolInfoLine",n}return n.c(t,e),t.prototype.pointsCount=function(){return 2},t.prototype.title=function(){
return"Info Line"},t.prototype.name=function(){return"Info Line"},t.prototype.getStylesPropertyPage=function(){return s.propertyPages.LineToolInfoLineStylesPropertyPage},t}(r.LineToolTrendLine),a.prototype.superclass=r.LineToolTrendLine},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolPitchfan";var n=t||this.createPropertiesObject("linetoolpitchfan");o.call(this,e,n),i.e(0).then(function(e){var t=i(772).PitchfanLinePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(19),s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Pitchfan"},n.prototype.name=function(){return"Pitchfan"},n.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},n.prototype.createPropertiesObject=function(e,t,i){return new r(e,t,i,{range:[0,8]})},n.prototype.getStylesPropertyPage=function(){return s.LineToolPitchfanStylesPropertyPage},t.LineToolPitchfan=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolGannSquare";var n=t||this.createPropertiesObject("linetoolgannsquare");s.call(this,e,n),i.e(0).then(function(e){var t=i(773).GannSquarePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o,r,s=i(0).LineDataSource,a=i(19),l=i(2).propertyPages;inherit(n,s),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Gann Box"},n.prototype.name=function(){return"Gann Box"},o=[4.5,9,11.25,18,22.5,36,45],r=function(){for(var e=[],t=1e10,i=o.length-1,n=1,r=0,s=0;s<t;)s=o[r]*n,e.push(Math.round(s)),e.push(Math.ceil(-s)),r===i-1&&(n*=10),r=(r+1)%i;return e.sort(function(e,t){return e<t?-1:e>t?1:0}),e}(),n.prototype._alignPriceOnPattern=function(e,t){var i,n,r,s,a,l,c=Math.round(1e6*(e.price-t.price))/1e6;if(0===c)return t.price;for(i=o[0],n=o[o.length-1],r=1,s=Math.abs(c);s<i*r||n*r<s;)s<i*r?r*=.1:n*r<s&&(r*=10);for(a=n*r,l=o.length-2;l>=0&&!(o[l]*r<s);--l)a=o[l]*r;return e.price=t.price+(c>=0?a:-a),e},n.prototype._alignTimeOnPattern=function(e,t){var i,n=e.index-t.index;if(0===n)return 0;for(i=r.length-2;i>=0&&!(r[i]<n);--i);return i+=n>0?1:0,e.index=t.index+r[i],e},n.prototype._alignPointsFixedIncrement=function(e,t){return this._alignTimeOnPattern(e,t),this._alignPriceOnPattern(e,t),e},n.prototype._preparePoint=function(e,t){return t&&t.shift&&0!==this._points.length&&this._alignPointsFixedIncrement(e,this._points[0]),s.prototype._preparePoint.call(this,e,t)},n.prototype.setPoint=function(e,t,i){if(i&&i.shift){var n=0===e?this._points[1]:this._points[0];this._alignPointsFixedIncrement(t,n)}s.prototype.setPoint.call(this,e,t,i)},n.prototype.createPropertiesObject=function(e,t,i){return new a(e,t,i,{range:[1,7],prefixes:["h","v"],names:["coeff","color","visible"]})},n.prototype.getStylesPropertyPage=function(){return l.LineToolGannSquareStylesPropertyPage},t.LineToolGannSquare=n},function(e,t,i){"use strict";function n(e,t){
this._constructor="LineToolFibSpeedResistanceFan";var n=t||this.createPropertiesObject("linetoolfibspeedresistancefan");o.call(this,e,n),i.e(0).then(function(e){var t=i(774).FibSpeedResistanceFanPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(19),s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Fib Speed Resistance Fan"},n.prototype.name=function(){return"Fib Speed Resistance Fan"},n.prototype.processErase=function(e,t){var i="h"===t.type?"hlevel"+t.index:"vlevel"+t.index,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},n.prototype.createPropertiesObject=function(e,t,i){return new r(e,t,i,{range:[1,7],prefixes:["h","v"],names:["coeff","color","visible"]})},n.prototype.getStylesPropertyPage=function(){return s.LineToolFibSpeedResistanceFanStylesPropertyPage},t.LineToolFibSpeedResistanceFan=n},function(e,t,i){"use strict";var n,o,r,s,a,l,c,h,u;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"LineToolGannComplex",function(){return u}),n=i(1),o=i(6),i.n(o),r=i(7),i.n(r),s=i(193),a=i(0),i.n(a),l=i(121),c=i(2),i.n(c),h=i(273),u=function(e){function t(t,n){var o,r=e.call(this,t,null==n?Object(h.a)("linetoolganncomplex"):n)||this;return r.version=2,r._constructor="LineToolGannComplex",r._scaleRatioFormatter=new s.LimitedPrecisionNumericFormatter(7),i.e(0).then(function(e){var t=i(775).GannComplexPaneView;r._setPaneViews([new t(r,r.model())])}.bind(null,i)).catch(i.oe),o=r.properties(),r._adjustScaleRatio(o),o.subscribe(r,r._adjustScaleRatio),o.scaleRatio.subscribe(r,r._correctFirstPoint),r._syncStateExclusions=["scaleRatio"],o.addExclusion("scaleRatio"),r._onRestoringFactoryDefaults.subscribe(r,r._handleRestoringFactoryDefaults),r._onTemplateApplying.subscribe(r,r._handleTemplateApplying),r._onTemplateApplied.subscribe(r,r._correctFirstPoint),r}return n.c(t,e),t.prototype.migrateVersion=function(e,t,i){var n=this;1===e&&(this._points.length>=this.pointsCount()?setTimeout(function(){return n._migratePoint()}):this._timePoint.length>=this.pointsCount()&&this._pointAdded.subscribe(this,this._migratePoint))},t.prototype.destroy=function(){var e=this.properties();e.unsubscribe(this,this._adjustScaleRatio),e.scaleRatio.unsubscribe(this,this._correctFirstPoint),this._onRestoringFactoryDefaults.unsubscribe(this,this._handleRestoringFactoryDefaults),this._onTemplateApplying.unsubscribe(this,this._handleTemplateApplying),this._onTemplateApplied.unsubscribe(this,this._correctFirstPoint)},t.prototype.pointsCount=function(){return 2},t.prototype.title=function(){return"Gann Square"},t.prototype.name=function(){return"Gann Square"},t.prototype.addPoint=function(t,i,n){var o,s,a;return this._points.length>1&&this._points.pop(),o=e.prototype.addPoint.call(this,t,i,n),s=this.priceScale(),a=Object(r.ensureNotNull)(s).isLog(),!a&&o&&this._correctFirstPoint(),o},t.prototype.setPoint=function(t,i,n){e.prototype.setPoint.call(this,t,i,n),
void 0!==n&&n.shift?this._correctPoint(t):this._correctScaleRatio()},t.prototype.setLastPoint=function(t,i){var n=this.priceScale();Object(r.ensureNotNull)(n).isLog()||(this._points[1]=t,this._correctPoint(1)),e.prototype.setLastPoint.call(this,t,i)},t.prototype.createPropertiesObject=function(e,t,i){return Object(h.a)(e,t,i)},t.prototype.getStylesPropertyPage=function(){return c.propertyPages.LineToolGannComplexStylesPropertyPage},t.prototype.isReversed=function(){return this.properties().reverse.value()},t.prototype.levelsCount=function(){return this.properties().levels.childCount()},t.prototype.levels=function(){var e,t,i=[],n=this.properties(),o=n.levels.childCount();for(e=0;e<o;e++)t=n.levels[e],i.push({index:e,visible:t.visible.value(),color:t.color.value(),width:t.width.value()});return i},t.prototype.fanLinesCount=function(){return this.properties().fanlines.childCount()},t.prototype.fanLines=function(){var e,t,i=[],n=this.properties(),o=n.fanlines.childCount();for(e=0;e<o;e++)t=n.fanlines[e],i.push({index:e,visible:t.visible.value(),x:t.x.value(),y:t.y.value(),color:t.color.value(),width:t.width.value()});return i},t.prototype.arcsCount=function(){return this.properties().arcs.childCount()},t.prototype.arcs=function(){var e,t,i=[],n=this.properties(),o=n.arcs.childCount();for(e=0;e<o;e++)t=n.arcs[e],i.push({index:e,visible:t.visible.value(),x:t.x.value(),y:t.y.value(),color:t.color.value(),width:t.width.value()});return i},t.prototype.arcsBackgroundTransparency=function(){return this.properties().arcsBackground.transparency.value()},t.prototype.isArcsBackgroundFilled=function(){return this.properties().arcsBackground.fillBackground.value()},t.prototype.isLabelsVisible=function(){return this.properties().showLabels.value()},t.prototype.getLabelsStyle=function(){var e=this.properties(),t=e.labelsStyle,i=t.font,n=t.fontSize,o=t.bold,r=t.italic,s=e.levels.childCount();return{textColor:e.levels[s-1].color.value(),font:i.value(),fontSize:n.value(),bold:o.value(),italic:r.value()}},t.prototype.getScaleRatioStep=function(){return 1e-7},t.prototype.getScaleRatioFormatter=function(){return this._scaleRatioFormatter},t.prototype.getPriceDiff=function(){var e,t,i=this.points();return i.length<2?null:(e=i[0],t=i[1],t.price-e.price)},t.prototype.getIndexDiff=function(){var e,t,i=this.points();return i.length<2?null:(e=i[0],t=i[1],t.index-e.index)},t.prototype.getScaleRatio=function(){var e=this.getPriceDiff(),t=this.getIndexDiff();return null!==e&&null!==t&&0!==t?Math.abs(e/t):null},t.prototype._correctScaleRatio=function(){var e=this.properties(),t=this.getScaleRatio();e.scaleRatio.setValue(t)},t.prototype._getAdjustedScaleRatio=function(){var e=this.model().mainSeries().priceScale(),t=this.model().timeScale();return Object(l.scaleRatio)(t,e)},t.prototype._adjustScaleRatio=function(e){var t=e.scaleRatio.value();""!==t&&null!==t||e.scaleRatio.setValue(this._getAdjustedScaleRatio())},t.prototype._correctPoint=function(e){var t,i,n,o,r,s,a,l;this._points.length<2||null!==(t=this.getIndexDiff())&&(i=this.properties(),
n=i.scaleRatio.value(),null!==n&&(o=this._points[e],r=0===e?this._points[1]:this._points[0],s=o.price-r.price>0,a=o.index-r.index>0,l=s&&!a||!s&&a?-1:1,0===e&&(l=-l),o.price=r.price+l*t*n,this._pointChanged.fire(e)),this.normalizePoints())},t.prototype._correctFirstPoint=function(){this._correctPoint(this.isReversed()?0:1)},t.prototype._handleRestoringFactoryDefaults=function(){this.properties().scaleRatio.setValue(this._getAdjustedScaleRatio())},t.prototype._handleTemplateApplying=function(e){""===e.scaleRatio&&(e.scaleRatio=this._getAdjustedScaleRatio())},t.prototype._migratePoint=function(){var e,t;this.points().length<this.pointsCount()||null!==(e=this._getScreenPoints())&&(t=this.screenPointToPoint(e[1]),this.setPoint(1,t),this._pointAdded.unsubscribe(this,this._migratePoint))},t.prototype._getScreenPoints=function(){var e,t,i,n,r,s,a,l,c,h,u,d=this._calcAngle();return null===d?null:(t=this.points(),i=t[0],n=t[1],this.isReversed()&&(e=[n,i],i=e[0],n=e[1]),r=this.pointToScreenPoint(i)[0],s=this.pointToScreenPoint(n)[0],a=Math.sqrt(Math.pow(r.x-s.x,2)+Math.pow(r.y-s.y,2)),l=new o.Point(Math.cos(d),-Math.sin(d)),c=l.normalized(),h=c.x<0?-1:1,u=c.y<0?-1:1,[r.addScaled(l,a),r.add(new o.Point(5*a*h,5*a*u))])},t.prototype._calcAngle=function(){var e,t=this.points(),i=t[0],n=t[1],o=this.pointToScreenPoint(i)[0],r=this.pointToScreenPoint(n)[0],s=r.subtract(o);return s.length()>0?(s=s.normalized(),e=Math.acos(s.x),s.y>0&&(e=-e),e):null},t}(a.LineDataSource),u.prototype.superclass=a.LineDataSource},function(e,t,i){"use strict";var n,o,r,s,a,l;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"LineToolGannFixed",function(){return l}),n=i(1),o=i(6),i.n(o),r=i(0),i.n(r),s=i(273),a=i(2),i.n(a),l=function(e){function t(t,n){var o=e.call(this,t,null==n?Object(s.a)("linetoolgannfixed"):n)||this;return o._constructor="LineToolGannFixed",i.e(0).then(function(e){var t=i(776).GannFixedPaneView;o._setPaneViews([new t(o,o.model())])}.bind(null,i)).catch(i.oe),o.properties().reverse.subscribe(o,o._reversePoints),o}return n.c(t,e),t.prototype.pointsCount=function(){return 2},t.prototype.title=function(){return"Gann Square Fixed"},t.prototype.name=function(){return"Gann Square Fixed"},t.prototype.createPropertiesObject=function(e,t,i){return Object(s.a)(e,t,i)},t.prototype.getStylesPropertyPage=function(){return a.propertyPages.LineToolGannFixedStylesPropertyPage},t.prototype.axisPoints=function(){var e=this.points(),t=this.getScreenPoints();return e.length<2||t.length<2?[]:[e[0],this.screenPointToPoint(t[1])]},t.prototype.getScreenPoints=function(){var e,t,i,n,r,s,a,l,c,h,u=this.points();return u.length<2?[]:null===(e=this._calcAngle())?[]:(t=u[0],i=u[1],n=this.pointToScreenPoint(t)[0],r=this.pointToScreenPoint(i)[0],s=Math.sqrt(Math.pow(n.x-r.x,2)+Math.pow(n.y-r.y,2)),a=new o.Point(Math.cos(e),-Math.sin(e)),l=a.normalized(),c=l.x<0?-1:1,h=l.y<0?-1:1,[n.addScaled(a,s),n.add(new o.Point(5*s*c,5*s*h))])},t.prototype.levelsCount=function(){return this.properties().levels.childCount()},t.prototype.levels=function(){
var e,t,i=[],n=this.properties(),o=n.levels.childCount();for(e=0;e<o;e++)t=n.levels[e],i.push({index:e,visible:t.visible.value(),color:t.color.value(),width:t.width.value()});return i},t.prototype.fanLinesCount=function(){return this.properties().fanlines.childCount()},t.prototype.fanLines=function(){var e,t,i=[],n=this.properties(),o=n.fanlines.childCount();for(e=0;e<o;e++)t=n.fanlines[e],i.push({index:e,visible:t.visible.value(),x:t.x.value(),y:t.y.value(),color:t.color.value(),width:t.width.value()});return i},t.prototype.arcsCount=function(){return this.properties().arcs.childCount()},t.prototype.arcs=function(){var e,t,i=[],n=this.properties(),o=n.arcs.childCount();for(e=0;e<o;e++)t=n.arcs[e],i.push({index:e,visible:t.visible.value(),x:t.x.value(),y:t.y.value(),color:t.color.value(),width:t.width.value()});return i},t.prototype.arcsBackgroundTransparency=function(){return this.properties().arcsBackground.transparency.value()},t.prototype.isArcsBackgroundFilled=function(){return this.properties().arcsBackground.fillBackground.value()},t.prototype._calcAngle=function(){var e,t,i,n,o,r,s=this.points();return s.length<2?null:(e=s[0],t=s[1],i=this.pointToScreenPoint(e)[0],n=this.pointToScreenPoint(t)[0],o=n.subtract(i),o.length()<=0?null:(o=o.normalized(),r=Math.acos(o.x),o.y>0&&(r=-r),r))},t.prototype._reversePoints=function(){var e=this._points,t=e[0],i=e[1];this._points[0]=i,this._points[1]=t,this.normalizePoints(),this.restart()},t}(r.LineDataSource),l.prototype.superclass=r.LineDataSource},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolGannFan";var n=t||this.createPropertiesObject("linetoolgannfan");o.call(this,e,n),i.e(0).then(function(e){var t=i(777).GannFanPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(19),s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Gann Fan"},n.prototype.name=function(){return"Gann Fan"},n.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},n.prototype.createPropertiesObject=function(e,t,i){return new r(e,t,i,{range:[1,9]})},n.prototype.getStylesPropertyPage=function(){return s.LineToolGannFanStylesPropertyPage},t.LineToolGannFan=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolDisjointAngle";var s=t||new r("linetooldisjointangle");o.call(this,e,s),this.version=n.version,i.e(0).then(function(e){var t=i(779).DisjointAnglePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.version=1,n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Disjoint Angle"},n.prototype.name=function(){return"Disjoint Angle"},n.prototype.addPoint=function(e,t){return t&&t.shift&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[this.points().length-2]),o.prototype.addPoint.call(this,e)
},n.prototype.setLastPoint=function(e,t){return t&&t.shift&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[this.points().length-2]),o.prototype.setLastPoint.call(this,e)},n.prototype.setPoint=function(e,t,i){var n,r,s,a=.5*(this._points[1].price+this._points[2].price);i&&i.shift&&1===e&&(n=0,this._snapPoint45Degree(t,this.points()[n])),e<3&&o.prototype.setPoint.call(this,e,t),0!==e&&2!==e&&(1===e?(r=this._points[1].price-a,this._points[2].price=this._points[1].price-2*r):3===e&&(s=t.price,r=s-this._points[2].price,this._points[0].price=this._points[1].price-r,this._points[0].index=t.index))},n.prototype.canHasAlert=function(){return!0},n.prototype._getAlertPlots=function(){var e,t,i,n,o,r,s,a,l,c=this._points[0],h=this._points[1],u=[];return c.index<=h.index?(u.push(c),u.push(h)):(u.push(h),u.push(c)),e=this._points[2],e.time=h.time,e.index=h.index,t={price:e.price+(h.price-c.price),time:c.time,index:c.index},i=[],e.index<=t.index?(i.push(e),i.push(t)):(i.push(t),i.push(e)),u[0].price>i[0].price?(n=u,o=i):i[0].price>u[0].price?(n=i,o=u):i[1].price>u[1].price?(n=i,o=u):(n=u,o=i),a=this.properties().extendLeft.value(),l=this.properties().extendRight.value(),c.index<=h.index?(r=a,s=l):(r=l,s=a),[this._linePointsToAlertPlot(n,"Upper",r,s),this._linePointsToAlertPlot(o,"Lower",r,s)]},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return s.LineToolDisjointAngleStylesPropertyPage},t.LineToolDisjointAngle=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolFlatBottom";var s=t||new r("linetoolflatbottom");o.call(this,e,s),this.version=n.version,i.e(0).then(function(e){var t=i(780).FlatBottomPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.version=1,n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Flat Bottom"},n.prototype.name=function(){return"Flat Bottom"},n.prototype.addPoint=function(e,t){return t&&t.shift&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[this.points().length-2]),o.prototype.addPoint.call(this,e)},n.prototype.setLastPoint=function(e,t){return t&&t.shift&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[this.points().length-2]),o.prototype.setLastPoint.call(this,e)},n.prototype.setPoint=function(e,t,i){if(i&&i.shift&&1===e){this._snapPoint45Degree(t,this.points()[0])}e<3?o.prototype.setPoint.call(this,e,t):this._points[0].index=t.index},n.prototype.canHasAlert=function(){return!0},n.prototype._getAlertPlots=function(){var e,t,i,n,o,r,s,a,l,c=this._points[0],h=this._points[1],u=[];return c.index<=h.index?(u.push(c),u.push(h)):(u.push(h),u.push(c)),e=this._points[2],e.time=h.time,e.index=h.index,t={price:e.price,time:c.time,index:c.index},i=[],e.index<=t.index?(i.push(e),i.push(t)):(i.push(t),i.push(e)),u[0].price>i[0].price?(n=u,o=i):i[0].price>u[0].price?(n=i,o=u):i[1].price>u[1].price?(n=i,o=u):(n=u,o=i),
a=this.properties().extendLeft.value(),l=this.properties().extendRight.value(),c.index<=h.index?(r=a,s=l):(r=l,s=a),[this._linePointsToAlertPlot(n,"Upper",r,s),this._linePointsToAlertPlot(o,"Lower",a,s)]},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return s.LineToolFlatBottomStylesPropertyPage},t.LineToolFlatBottom=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolIcon";var s=t||new r("linetoolicon");s.addExclusion("angle"),s.addExclusion("scale"),o.call(this,e,s),this.version=n.version,i.e(0).then(function(e){var t=i(781).IconPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.version=1,n.anchorLimit=80,n.prototype.getAnchorLimit=function(){return n.anchorLimit},n.prototype.pointsCount=function(){return 1},n.prototype.title=function(){return"Icon"},n.prototype.name=function(){return"Icon"},n.prototype.startChanging=function(e,t){var i,r;o.prototype.startChanging.call(this,e,t),i=this.properties(),r=65536*i.icon.value()+i.size.value(),this._startChangeWidth=this._paneViews[0]._cache[r],i.size.value()<n.anchorLimit?this._sizeScale=i.size.value()/n.anchorLimit:this._sizeScale=1,this._origScale=i.scale.value(),this._startChangeWidth*this._origScale<n.anchorLimit?this._resizeRatio=this._startChangeWidth/n.anchorLimit:this._resizeRatio=1},n.prototype.endChanging=function(){o.prototype.endChanging.call(this),delete this._startChangeWidth,delete this._sizeScale,delete this._resizeRatio},n.prototype.setPoint=function(e,t,i){var o,r,s,a,l,c,h,u,d,p=$.extend({},t);i&&i.shift&&this._properties.snapTo45Degrees&&this._snapPoint45Degree(p,this.points()[0]),o=this.pointToScreenPoint(this.points()[0])[1],r=this.pointToScreenPoint(p)[1],0===e||1===e?(s=r.subtract(o).normalized(),a=2*r.subtract(o).length(),a*=this._sizeScale,this._properties.size.setValue(a),l=-s.x,c=Math.acos(l),Math.asin(s.y)>0&&(c=2*Math.PI-c),0===e&&(c+=Math.PI),this._properties.angle.setValue(c)):(h=this._startChangeWidth,u=r.subtract(o).length(),this._origScale*h<n.anchorLimit?(d=n.anchorLimit/2,this._properties.scale.setValue(this._origScale*u/d)):(d=h/2,this._properties.scale.setValue(u/d)))},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return s.LineToolIconStylesPropertyPage},n.prototype.getSourceIcon=function(){return{type:"text",text:String.fromCharCode(this.properties().icon.value())}},t.LineToolIcon=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolRotatedRectangle";var n=t||new a("linetoolrotatedrectangle");s.call(this,e,n),i.e(0).then(function(e){var t=i(782).RotatedRectanglePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(6).Point,r=i(30).distanceToLine,s=i(0).LineDataSource,a=i(3).DefaultProperty,l=i(2).propertyPages;inherit(n,s),n.prototype.startChanging=function(e,t){var i,n,o,a
;s.prototype.startChanging.call(this,e,t),0!==e&&1!==e||(i=this._paneViews[0],n=i._points[0],o=i._points[1],a=i._points[2],this._distance=r(n,o,a).distance)},n.prototype.setPoint=function(e,t,i){var n,r,a,l,c,h,u;s.prototype.setPoint.call(this,e,t,i),0!==e&&1!==e||(n=this._paneViews[0],n.update(),r=n._points[0],a=n._points[1],l=a.subtract(r),c=new o(l.y,-l.x).normalized().scaled(this._distance),h=r.add(c),u=this.screenPointToPoint(h),this._points[2]=u)},n.prototype.endChanging=function(){delete this._distance},n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Rotated Rectangle"},n.prototype.name=function(){return"Rotated Rectangle"},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return l.LineToolRectangleStylesPropertyPage},t.LineToolRotatedRectangle=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolFibSpiral";var n=t||new r("linetoolfibspiral");o.call(this,e,n),i.e(0).then(function(e){var t=i(783).FibSpiralPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Fib Spiral"},n.prototype.name=function(){return"Fib Spiral"},n.prototype.getStylesPropertyPage=function(){return s.LineToolFibSpiralStylesPropertyPage},t.LineToolFibSpiral=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolHeadAndShoulders";var n=t||new r("linetoolheadandshoulders");o.call(this,e,n),i.e(0).then(function(e){var t=i(784).LineToolHeadAndShouldersPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 7},n.prototype.title=function(){return"Head and Shoulders"},n.prototype.name=function(){return"Head and Shoulders"},n.prototype.getStylesPropertyPage=function(){return s.LineToolLineTool5PointsPatternStylesPropertyPage},t.LineToolHeadAndShoulders=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolTriangle";var n=t||new r("linetooltriangle");o.call(this,e,n),i.e(0).then(function(e){var t=i(785).TrianglePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Triangle"},n.prototype.name=function(){return"Triangle"},n.prototype.getStylesPropertyPage=function(){return s.LineToolTriangleStylesPropertyPage},t.LineToolTriangle=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolTrianglePattern";var n=t||new r("linetooltrianglepattern");o.call(this,e,n),i.e(0).then(function(e){var t=i(786).LineToolTrianglePatternPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}
var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 4},n.prototype.title=function(){return"Triangle Pattern"},n.prototype.name=function(){return"Triangle Pattern"},n.prototype.getStylesPropertyPage=function(){return s.LineToolTrianglePatternStylesPropertyPage},t.LineToolTrianglePattern=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolThreeDrivers";var n=t||new r("linetoolthreedrivers");o.call(this,e,n),i.e(0).then(function(e){var t=i(787).LineToolThreeDrivesPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 7},n.prototype.title=function(){return"Three Drives Pattern"},n.prototype.name=function(){return"Three Drives Pattern"},n.prototype.getStylesPropertyPage=function(){return s.LineToolABCDPatternStylesPropertyPage},t.LineToolThreeDrivers=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolABCD";var n=t||new r("linetoolabcd");o.call(this,e,n),i.e(0).then(function(e){var t=i(788).ABCDPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(275).DateTimeFormatter,a=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 4},n.prototype.title=function(){return"ABCD Pattern"},n.prototype.name=function(){return"ABCD Pattern"},n.prototype._tooltipFieldsHash={time0:{title:"Date 1",value:null},price0:{title:"Price 1",value:null},time1:{title:"Date 2",value:null},price1:{title:"Price 2",value:null},time2:{title:"Date 3",value:null},price2:{title:"Price 3",value:null},time3:{title:"Date 4",value:null},price3:{title:"Price 4",value:null}},n.prototype._updateTooltip=function(){var e,t,i,n,o=this._tooltipFieldsHash,r=this.points().m_values;r[0]&&(e=this._model.timeScale().indexToUserTime(r[0].index),o.time0.value=e?new s(this._model.mainSeries().isDWM()).format(e):0,o.price0.value=this._model.mainSeries()._formatter.format(r[0].price)),r[1]&&(t=this._model.timeScale().indexToUserTime(r[1].index),o.time1.value=t?new s(this._model.mainSeries().isDWM()).format(t):0,o.price1.value=this._model.mainSeries()._formatter.format(r[1].price)),r[2]&&(i=this._model.timeScale().indexToUserTime(r[2].index),o.time2.value=i?new s(this._model.mainSeries().isDWM()).format(i):0,o.price2.value=this._model.mainSeries()._formatter.format(r[2].price)),r[3]&&(n=this._model.timeScale().indexToUserTime(r[3].index),o.time3.value=n?new s(this._model.mainSeries().isDWM()).format(n):0,o.price3.value=this._model.mainSeries()._formatter.format(r[3].price))},n.prototype.tooltip=function(){return this._updateTooltip(),this._formatTooltip()},n.prototype.getStylesPropertyPage=function(){return a.LineToolABCDPatternStylesPropertyPage},t.LineToolABCD=n},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),
i.d(t,"LineToolRiskRewardPriceAxisView",function(){return r}),n=i(1),o=i(58),r=function(e){function t(t,i){var n=e.call(this)||this;return n._source=t,n._data=i,n}return n.c(t,e),t.prototype._updateRendererData=function(e){var t,i,n,o,r;e.visible=!1,t=this._source.priceScale(),0===this._source.points().length||null===t||t.isEmpty()||(i=this._source.ownerSource(),null!=(n=null!==i?i.firstValue():null)&&(o=this._data.priceProperty.value(),r=this._data.colorProperty.value(),e.background=r,e.color=this.generateTextColor(r),e.coordinate=t.priceToCoordinate(o,n),e.text=t.formatPrice(o,n),e.visible=!0))},t}(o.a)},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolPolyline";var n;t?n=t:(n=new s("linetoolpolyline"),n.filled.setValue(!1)),r.call(this,e,n),n.addExclusion("filled"),i.e(0).then(function(e){var t=i(790).PolylinePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(6).Point,r=i(0).LineDataSource,s=i(3).DefaultProperty,a=i(2).propertyPages;inherit(n,r),n.prototype.pointsCount=function(){return-1},n.prototype.title=function(){return"Polyline"},n.prototype.name=function(){return"Polyline"},n.prototype.addPoint=function(e){var t,i,n,s,a,l,c,h,u=this._model.timeScale().indexToCoordinate(e.index),d=e.price,p=this.ownerSource().firstValue(),_=this.priceScale().priceToCoordinate(d,p),f=5;if(this._points.length>0){if(t=this._points[this._points.length-1],i=this._model.timeScale().indexToCoordinate(t.index),n=t.price,s=this.priceScale().priceToCoordinate(n,p),new o(u,_).subtract(new o(i,s)).length()<f)return this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0;if(a=this._points[0],l=this._model.timeScale().indexToCoordinate(a.index),c=a.price,h=this.priceScale().priceToCoordinate(c,p),new o(u,_).subtract(new o(l,h)).length()<f)return this._properties.filled.setValue(!0),this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0}return r.prototype.addPoint.call(this,e)},n.prototype.setPoint=function(e,t){var i,n,s,a,l,c,h;r.prototype.setPoint.call(this,e,t),this._model.timeScale().isEmpty()||this.priceScale().isEmpty()||e!==this._points.length-1&&0!==e||(i=5,n=this.ownerSource().firstValue(),s=this._model.timeScale().indexToCoordinate(t.index),a=this.priceScale().priceToCoordinate(t.price,n),l=e===this._points.length-1?this._points[0]:this._points[this._points.length-1],c=this._model.timeScale().indexToCoordinate(l.index),h=this.priceScale().priceToCoordinate(l.price,n),new o(s,a).subtract(new o(c,h)).length()<i&&this._properties.filled.setValue(!0))},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return a.LineToolPolylineStylesPropertyPage},t.LineToolPolyline=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolPrediction";var n=t||new s("linetoolprediction");n.merge({status:l.AlertStatus.Waiting}),r.call(this,e,n),i.e(0).then(function(e){var t=i(791).PredictionPaneView;this._setPaneViews([new t(this,this._model)])
}.bind(this).bind(null,i)).catch(i.oe)}var o=i(7).ensureNotNull,r=i(0).LineDataSource,s=i(3).DefaultProperty,a=i(2).propertyPages,l=i(353);inherit(n,r),n.prototype.status=function(){return this._properties.status.value()},n.prototype.setStatus=function(e){return this._properties.status.setValue(e)},n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Forecast"},n.prototype.name=function(){return"Forecast"},n.prototype.restorePoints=function(e,t,i){r.prototype.restorePoints.call(this,e,t,i),this.checkAlert()},n.prototype.checkAlert=function(){var e,t,i,n;if(!(this._points.length<2||this._model.mainSeries().bars().isEmpty())){if(e=this._points[1],this.status())return void(e.index>this._model.timeScale().baseIndex()&&this.setStatus(l.AlertStatus.Waiting));t=this._model.mainSeries().bars().valueAt(e.index),null!==t&&(i=this.direction(),i===l.Direction.Up&&t[TradingView.HIGH_PLOT]>=e.price?this.setStatus(l.AlertStatus.Success):i===l.Direction.Down&&t[TradingView.LOW_PLOT]<=e.price?this.setStatus(l.AlertStatus.Success):(n=o(this._model.mainSeries().bars().lastIndex()),e.index!==n&&this.setStatus(l.AlertStatus.Failure)))}},n.prototype.addPoint=function(e){var t=r.prototype.addPoint.call(this,e);return t&&this.checkAlert(),t},n.prototype.endChanging=function(){r.prototype.endChanging.call(this),this.setStatus(l.AlertStatus.Waiting),this.checkAlert()},n.prototype.onData=function(e){r.prototype.onData.call(this,e),this.checkAlert()},n.prototype.endMoving=function(){r.prototype.endMoving.call(this),this.setStatus(l.AlertStatus.Waiting),this.checkAlert()},n.prototype.direction=function(){var e,t;return this.points().length<2?l.Direction.Up:(e=this.points()[0],t=this.points()[1],t.price>e.price?l.Direction.Up:l.Direction.Down)},n.prototype.getStylesPropertyPage=function(){return a.LineToolPredictionStylesPropertyPage},t.LineToolPrediction=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolPriceLabel";var n=t||new r("linetoolpricelabel");o.call(this,e,n),i.e(0).then(function(e){var t=i(792).PriceLabelPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 1},n.prototype.title=function(){return"Price Label"},n.prototype.name=function(){return"Price Label"},n.prototype.getStylesPropertyPage=function(){return s.LineToolPriceLabelStylesPropertyPage},t.LineToolPriceLabel=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolBrush";var n=t||new r("linetoolbrush");o.call(this,e,n),this._finished=!1,i.e(0).then(function(e){var t=i(794).BrushPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return-1},n.prototype.finished=function(){return this._finished},n.prototype.finish=function(){this._finished=!0,this._lastPoint=null,this.normalizePoints(),
this.createServerPoints()},n.prototype.title=function(){return"Brush"},n.prototype.name=function(){return"Brush"},n.prototype.percentDistance=function(e,t){return Math.abs((t-e)/e)},n.prototype.addPoint=function(e){var t,i,n;return!!this._finished||(this._lastPoint=null,this._points.length>0&&(t=this._points[this._points.length-1],i=this.pointToScreenPoint(t)[1],n=this.pointToScreenPoint(e)[1],n.subtract(i).length()<2)?this._finished:(o.prototype.addPoint.call(this,e),this._finished))},n.prototype.restorePoints=function(e,t,i){o.prototype.restorePoints.call(this,e,t,i),this._finished=!0},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return s.LineToolBrushStylesPropertyPage},t.LineToolBrush=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolArc";var o=t||new d("linetoolarc");u.call(this,e,o),this.version=n.version,i.e(0).then(function(e){var t=i(795).ArcPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(6).Point,r=i(30).distanceToLine,s=i(321),a=s.rotationMatrix,l=s.scalingMatrix,c=s.translationMatrix,h=s.transformPoint,u=i(0).LineDataSource,d=i(3).DefaultProperty,p=i(2).propertyPages;inherit(n,u),n.prototype.startChanging=function(e,t){var i,n,s,a,l,c,h;u.prototype.startChanging.call(this,e,t),0!==e&&1!==e||(i=this.pointToScreenPoint(this._points[0])[0],n=this.pointToScreenPoint(this._points[1])[0],s=this.pointToScreenPoint(this._points[2])[0],this._dist=r(i,n,s).distance,a=n.subtract(i),l=new o(-a.y,a.x),c=i.add(n).scaled(.5),h=s.subtract(c),h.dotProduct(l)<0&&(this._dist=-this._dist))},n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Arc"},n.prototype.name=function(){return"Arc"},n.prototype.setPoint=function(e,t){var i,n,s,u,d,p,_,f,m,y,g,v,S=$.extend({},t),b=this.pointToScreenPoint(this._points[0])[0],w=this.pointToScreenPoint(this._points[1])[0],P=this.pointToScreenPoint(this._points[2])[0];switch(e){case 0:b=this.pointToScreenPoint(S)[0],i=w.subtract(b),n=b.add(w).scaled(.5),s=new o(-i.y,i.x),s=s.normalized(),P=n.add(s.scaled(this._dist)),P=this.screenPointToPoint(P),this._points[0]=S,this._points[2]=P;break;case 1:u=r(b,w,P).distance,w=this.pointToScreenPoint(S)[0],i=w.subtract(b),n=b.add(w).scaled(.5),s=new o(-i.y,i.x),s=s.normalized(),P=n.add(s.scaled(this._dist)),P=this.screenPointToPoint(P),this._points[1]=S,this._points[2]=P;break;case 2:S=this.pointToScreenPoint(S)[0],u=r(b,w,S).distance,i=w.subtract(b),n=b.add(w).scaled(.5),s=new o(-i.y,i.x),s=s.normalized(),P=n.add(s.scaled(u)),d=n.add(s.scaled(-u)),p=i.length(),_=i.x/p,f=i.y/p,m=Math.acos(_),f<0&&(m=-m),y=c(-n.x,-n.y),S=h(y,S),g=h(y,P),y=a(-m),S=h(y,S),g=h(y,g),y=l(1,p/(2*u)),S=h(y,S),g=h(y,g),v=S.y*g.y>=0?new o(P.x,P.y):new o(d.x,d.y),v=this.screenPointToPoint(v),this._points[2]=v}this.normalizePoints()},n.version=2,n.prototype.migrateVersion=function(e,t,i){var n,o;1===e&&2===this._points.length&&(n=(2*this._points[0].price+3*this._points[1].price)/5,this._points.append({price:n,
index:this._points[1].index})),1===e&&2===this._timePoint.length&&(n=(2*this._timePoint[0].price+3*this._timePoint[1].price)/5,o={price:n,offset:this._timePoint[1].offset,time_t:this._timePoint[1].time_t},this._timePoint.append(o))},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return p.LineToolArcStylesPropertyPage},t.LineToolArc=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolCallout";var n=t||new a("linetoolcallout");n.hasChild("text")||n.addChild("text",new s($.t("Text"))),n.addExclusion("text"),o.call(this,e,n),this._barOffset=0,this._timeScale=e.timeScale(),i.e(0).then(function(e){var t=i(796).CalloutPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(28).DataSource,s=i(13),a=i(3).DefaultProperty,l=i(2).propertyPages,c=i(354).CalloutConsts;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Callout"},n.prototype.name=function(){return"Callout"},n.prototype.correctPoints=function(e){var t=this._currentMovingPoint.index-this._startMovingPoint.index,i=this._currentMovingPoint.price-this._startMovingPoint.price,n=e[1];n.index+=t,n.price+=i,e[1]=n},n.prototype.addPoint=function(e){var t=o.prototype.addPoint.call(this,e);return t&&this._calculateBarOffset(),t},n.prototype._calculateBarOffset=function(){this.points().length>1&&(this._barOffset=this.points()[1].index-this.points()[0].index)},n.prototype.setLastPoint=function(e){o.prototype.setLastPoint.call(this,e),2===this.points().length&&this._calculateBarOffset()},n.prototype.setPoint=function(e,t){var i,n,r,s,a;switch(e){case 0:o.prototype.setPoint.call(this,e,t),this._calculateBarOffset();break;case 1:if(i=this.properties(),!i.wordWrapWidth)return;if(n=this._points,r=this._dragStartLeftEdgeIndex,s=Math.round((t.index-r)/2),isFinite(r)&&isFinite(s)){if(n[1]={index:r+s,price:n[1].price},this._calculateBarOffset(),this.normalizePoints(),a=this._timeScale.indexToCoordinate(r+2*s)-this._timeScale.indexToCoordinate(r)-c.RoundRadius-c.TextMargins,!isFinite(a))return;i.wordWrapWidth.setValue(Math.max(c.MinWidth,a));break}n[1]=t,this._calculateBarOffset(),this.normalizePoints()}},n.prototype.startDragPoint=function(e,t){var i=this.properties();1===e&&i.wordWrap&&i.wordWrap.value()&&(this._dragStartLeftEdgeIndex=2*this.points()[1].index-t.index)},n.prototype.move=function(e){o.prototype.move.call(this,e),this._calculateBarOffset()},n.prototype.state=function(e){var t=o.prototype.state.call(this,e);return t.barOffset=this._barOffset,t},n.prototype.restoreData=function(e){e.barOffset?this._barOffset=e.barOffset:this._calculateBarOffset(),this._calculatePoint2()},n.prototype.setPriceScale=function(e){r.prototype.setPriceScale.call(this,e),e&&e.priceRange()&&this._calculatePoint2()},n.prototype._calculatePoint2=function(){var e,t;this._model.lineBeingEdited()!==this&&this._model.sourceBeingMoved()!==this&&(this._points.length<2||(e=this.points()[0],t=this.points()[1],
this._points[1]={price:t.price,index:e.index+this._barOffset}))},n.prototype.getStylesPropertyPage=function(){return l.LineToolCalloutStylesPropertyPage},t.LineToolCallout=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolBalloon";var n=t||new s("linetoolballoon");n.hasChild("text")||n.addChild("text",new r($.t("Comment"))),n.addExclusion("text"),o.call(this,e,n),i.e(0).then(function(e){var t=i(797).BalloonPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(13),s=i(3).DefaultProperty,a=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 1},n.prototype.title=function(){return"Balloon"},n.prototype.name=function(){return"Balloon"},n.prototype.getStylesPropertyPage=function(){return a.LineToolBalloonStylesPropertyPage},t.LineToolBalloon=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolHorzLine";var n=t||new a("linetoolhorzline");n.hasChild("text")||n.addChild("text",new s("")),n.addExclusion("text"),this._priceAxisView=new r(this),o.call(this,e,n),i.e(0).then(function(e){var t=i(798).HorzLinePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(174).LineToolHorzLinePriceAxisView,s=i(13),a=i(3).DefaultProperty,l=i(2).propertyPages;inherit(n,o),n.prototype.state=function(e){var t=o.prototype.state.call(this,e);return t.points&&0!==t.points.length&&(t.points[0].offset=0),t},n.prototype.pointsCount=function(){return 1},n.prototype.title=function(){return"Horizontal Line"},n.prototype.name=function(){return"Horizontal Line"},n.prototype.priceAxisViews=function(e,t){return this.isSourceHidden()?null:t===this.priceScale()&&this.properties().showPrice.value()&&this._model.paneForSource(this)===e?[this._priceAxisView]:null},n.prototype.updateAllViews=function(){o.prototype.updateAllViews.call(this),this._priceAxisView.update()},n.prototype.canHasAlert=function(){return!0},n.prototype._getAlertPlots=function(){return[this.points()[0].price]},n.prototype.getInputsPropertyPage=function(){return l.LineToolHorzLineInputsPropertyPage},n.prototype.getStylesPropertyPage=function(){return l.LineToolHorzLineStylesPropertyPage},t.LineToolHorzLine=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolHorzRay";var n=t||new a("linetoolhorzray");n.hasChild("text")||n.addChild("text",new s("")),n.addExclusion("text"),this._priceAxisView=new r(this),o.call(this,e,n),i.e(0).then(function(e){var t=i(799).HorzRayPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(174).LineToolHorzLinePriceAxisView,s=i(13),a=i(3).DefaultProperty,l=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 1},n.prototype.title=function(){return"Horizontal Ray"},n.prototype.name=function(){return"Horizontal Ray"},n.prototype.priceAxisViews=function(e,t){
return this.isSourceHidden()?null:t===this.priceScale()&&this.properties().showPrice.value()&&this._model.paneForSource(this)===e?[this._priceAxisView]:null},n.prototype.updateAllViews=function(){o.prototype.updateAllViews.call(this),this._priceAxisView.update()},n.prototype.canHasAlert=function(){return!0},n.prototype._getAlertPlots=function(){var e=this._points[0],t={index:e.index+1,price:e.price};return[this._linePointsToAlertPlot([e,t],null,!1,!0)]},n.prototype.getStylesPropertyPage=function(){return l.LineToolHorzLineStylesPropertyPage},t.LineToolHorzRay=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolRectangle";var n=t||new r("linetoolrectangle");o.call(this,e,n),i.e(0).then(function(e){var t=i(800).RectanglePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Rectangle"},n.prototype.name=function(){return"Rectangle"},n.prototype.setPoint=function(e,t,i){var n,r,s;if(e<2)return void o.prototype.setPoint.call(this,e,t,i);i&&i.shift&&this._properties.snapTo45Degrees&&(n=this.points()[0],r=this.points()[1],s={price:2===e?n.price:r.price,index:2===e?r.index:n.index},this._snapPoint45Degree(t,s)),3===e?(this._points[0].price=t.price,this._points[1].index=t.index):(this._points[1].price=t.price,this._points[0].index=t.index),this.normalizePoints()},n.prototype.getStylesPropertyPage=function(){return s.LineToolRectangleStylesPropertyPage},t.LineToolRectangle=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolEllipse";var o=t||new a("linetoolellipse");s.call(this,e,o),this.version=n.version,i.e(0).then(function(e){var t=i(801).EllipsePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(6).Point,r=i(30).distanceToLine,s=i(0).LineDataSource,a=i(3).DefaultProperty,l=i(2).propertyPages;inherit(n,s),n.prototype.startChanging=function(e,t){var i,n,o;s.prototype.startChanging.call(this,e,t),0!==e&&1!==e||(i=this.pointToScreenPoint(this._points[0])[0],n=this.pointToScreenPoint(this._points[1])[0],o=this.pointToScreenPoint(this._points[2])[0],this._dist=r(i,n,o).distance||0)},n.prototype._preparePoint=function(e,t){var i=this._preparePointInternal(e,t,!1);return t&&t.shift&&this._points[0].index===this._points[1].index&&this._fixVerticalDiameterPoints(this._points[1],this._points[0],i),i},n.prototype._preparePointInternal=function(e,t,i){var n,r,a,l,c,h,u,d,p,_,f=$.extend({},e);if(t&&t.shift){if(n=this.points().length,!this._fakePointAdded&&3===n&&!i)return f;(this._fakePointAdded||2===n||i)&&(this._snapPoint45Degree(e,this._points[0]),this._fakePointAdded?this._points[1]=e:i||(this._fakePointAdded=!0,s.prototype._addPointIntenal.call(this,e)),r=this.pointToScreenPoint(this._points[0])[0],a=this.pointToScreenPoint(this._points[1])[0],l=a.x-r.x,c=a.y-r.y,h=Math.sqrt(l*l+c*c)/2,u=a.subtract(r),d=r.add(a).scaled(.5),
p=new o(-u.y,u.x),p=p.normalized(),_=d.add(p.scaled(h)),f=this.screenPointToPoint(_),(TradingView.isNaN(f.price)||TradingView.isNaN(f.index))&&(f=this.screenPointToPoint(d)))}else this._fakePointAdded&&(this._points.splice(1,1),this._fakePointAdded=!1);return f},n.prototype._fixVerticalDiameterPoints=function(e,t,i){var n=this.pointToScreenPoint(e)[0],o=this.pointToScreenPoint(t)[0],r=this._model.timeScale(),s=r.indexToCoordinate(e.index),a=r.indexToCoordinate(i.index),l=2*Math.abs(s-a);l*=t.price>e.price?1:-1,e.price=this.screenPointToPoint({x:n.x,y:o.y+l}).price},n.prototype.addPoint=function(e,t,i){var n=s.prototype.addPoint.call(this,e,t,i);return n&&(this._fakePointAdded=!1),n},n.prototype.setPoint=function(e,t,i){var n,s,a,l,c=$.extend({},t),h=this.pointToScreenPoint(this._points[0])[0],u=this.pointToScreenPoint(this._points[1])[0],d=this.pointToScreenPoint(this._points[2])[0];switch(e){case 0:if(i&&i.shift){this._snapPoint45Degree(c,this._points[1]),this._points[0]=c,this._points[2]=this._preparePointInternal(this._points[2],i,!0),this._points[0].index===this._points[1].index&&this._fixVerticalDiameterPoints(this._points[0],this._points[1],this._points[2]);break}h=this.pointToScreenPoint(c)[0],n=u.subtract(h),s=h.add(u).scaled(.5),a=new o(-n.y,n.x),a=a.normalized(),d=s.add(a.scaled(this._dist)),d=this.screenPointToPoint(d),this._points[0]=c,this._points[2]=d;break;case 1:if(i&&i.shift){this._snapPoint45Degree(c,this._points[0]),this._points[1]=c,this._points[2]=this._preparePointInternal(this._points[2],i,!0),this._points[0].index===this._points[1].index&&this._fixVerticalDiameterPoints(this._points[1],this._points[0],this._points[2]);break}u=this.pointToScreenPoint(c)[0],n=u.subtract(h),s=h.add(u).scaled(.5),a=new o(-n.y,n.x),a=a.normalized(),d=s.add(a.scaled(this._dist)),d=this.screenPointToPoint(d),this._points[1]=c,this._points[2]=d;break;case 2:case 3:c=this.pointToScreenPoint(c)[0],l=r(h,u,c).distance,n=u.subtract(h),s=h.add(u).scaled(.5),a=new o(-n.y,n.x),a=a.normalized(),d=s.add(a.scaled(l)),d=this.screenPointToPoint(d),this._points[2]=d}this.normalizePoints()},n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Ellipse"},n.prototype.name=function(){return"Ellipse"},n.version=2,n.prototype.migrateVersion=function(e,t,i){var n,o,r;1===e&&2===this._points.length&&(n=this._points[0].price,o=.5*(this._points[0].price+this._points[1].price),this._points[0]={price:o,index:this._points[0].index},this._points[1]={price:o,index:this._points[1].index},this._points.push({price:n,index:this._points[0].index})),1===e&&2===this._timePoint.length&&(n=this._timePoint[0].price,o=.5*(this._timePoint[0].price+this._timePoint[1].price),this._timePoint[0].price=o,this._timePoint[1].price=o,r={price:n,offset:this._timePoint[0].offset,time_t:this._timePoint[0].time_t},this._timePoint.push(r))},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return l.LineToolEllipseStylesPropertyPage},t.LineToolEllipse=n},function(e,t,i){"use strict"
;function n(e,t){this._constructor="LineToolTimeCycles";var n=t||new r("linetooltimecycles");o.call(this,e,n),i.e(0).then(function(e){var t=i(802).TimeCyclesPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Time Cycles"},n.prototype.name=function(){return"Time Cycles"},n.prototype.setPoint=function(e,t,i){var n=$.extend({},t),o=this._points[0],r=this._points[1];o.price=n.price,r.price=n.price,this._points[e]=n,this.normalizePoints()},n.prototype.addPoint=function(e,t,i){var n,r,s=o.prototype.addPoint.call(this,e,t,!0);return s&&(n=this._points[0],r=this._points[1],r.price=n.price,i||(this.normalizePoints(),this.createServerPoints())),s},n.prototype.getStylesPropertyPage=function(){return s.LineToolTimeCyclesPropertyPage},t.LineToolTimeCycles=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolSineLine";var n=t||new r("linetoolsineline");o.call(this,e,n),i.e(0).then(function(e){var t=i(803).SineLinePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Sine Line"},n.prototype.name=function(){return"Sine Line"},n.prototype.getStylesPropertyPage=function(){return s.LineToolTimeCyclesPropertyPage},t.LineToolSineLine=n},function(e,t,i){"use strict";function n(e,t,i){this._source=e,this._index=t,this._bars=i||[]}function o(e,t,i){this._source=e,l.call(this,"linetoolghostfeed",t,i)}function r(e,t,n){var s,l;this._constructor="LineToolGhostFeed",t?(s=t,s._source=this):s=new o(this),n||(l=Math.round(this.calculateATR(e)),s.averageHL.setValue(l)),a.call(this,e,s),this._segments=[],s.averageHL.listeners().subscribe(this,r.prototype.regenerate),s.variance.listeners().subscribe(this,r.prototype.regenerate),s.points||s.addProperty("points"),this._currentAverageHL=this._properties.averageHL.value(),this._currentVariance=this._properties.variance.value(),this._currentInterval=e.mainSeries().interval(),i.e(0).then(function(e){var t=i(804).GhostFeedPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var s=i(50).sign,a=i(0).LineDataSource,l=i(3).DefaultProperty,c=i(2).propertyPages;n.prototype.setBars=function(e){this._bars=e||[]},n.prototype.clone=function(e){return new n(e,this._index,TradingView.clone(this._bars))},n.prototype.createBar=function(){var e,t,i,n,o,r=this._source.properties().averageHL.value(),s=this._source.properties().variance.value()/100,a=this._source._model.mainSeries().base(),l=Math.random(),c=r*(1-2*l)*s;return l=Math.random(),e=r*(1+(.5-l)*s),t=c-e/2,i=t+e,n=t+Math.random()*e,o=t+Math.random()*e,{o:n/a,h:i/a,l:t/a,c:o/a}},n.prototype.generate=function(){var e,t,i,n,o,r;if(this._bars=[],e=this._source.points(),t=e[this._index],i=e[this._index+1],
t&&i&&t.index!==i.index)for(this._avgHL=this._source.properties().averageHL.value(),this._variance=this._source.properties().variance.value()/100,n=this._index?t.index+1:t.index,o=s(i.index-t.index),r=n;r!==i.index;r+=o)this._bars.push(this.createBar())},n.prototype.bars=function(){return this._bars},n.prototype.setSize=function(e){if(e<this._bars.length)this._bars.splice(e,this._bars.length-e);else for(;this._bars.length<e;)this._bars.push(this.createBar())},inherit(o,l),o.prototype.restoreFactoryDefaults=function(){l.prototype.restoreFactoryDefaults.call(this);var e=Math.round(this._source.calculateATR());this.averageHL.setValue(e)},inherit(r,a),r.prototype.createPropertiesObject=function(e,t,i){return new o(null,t,i)},r.prototype.regenerate=function(){this._currentAverageHL=this._properties.averageHL.value(),this._currentVariance=this._properties.variance.value(),this._segments.forEach(function(e){e.generate()}),this.updateAllViews(),this._model.updateSource(this)},r.prototype.propertiesChanged=function(){a.prototype.propertiesChanged.call(this),this._currentAverageHL===this._properties.averageHL.value()&&this._currentVariance===this._properties.variance.value()||this.regenerate()},r.prototype.pointsCount=function(){return-1},r.prototype.title=function(){return"Ghost Feed"},r.prototype.name=function(){return"Ghost Feed"},r.prototype.segmentBars=function(e){return this._segments[e].bars()},r.prototype.segments=function(){return this._segments},r.prototype.generateBars=function(e){this._segments.length<=e&&this._segments.push(new n(this,e)),this._segments[e].generate()},r.prototype.addPoint=function(e){var t,i,n;if(this._points.length>0&&(t=this._points[this._points.length-1],t.index===e.index)){for(this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),i=0;i<this._points.length;i++)this._createPointProperty(i);return!0}return n=a.prototype.addPoint.call(this,e),this._finished&&(this._lastPoint=null),this._points.length>1&&this.generateBars(this._points.length-2),n||this._finished},r.prototype.finish=function(){this._finished=!0,this._lastPoint=null,this.normalizePoints(),this.createServerPoints()},r.prototype.setPoint=function(e,t,i){var n,o,r;a.prototype.setPoint.call(this,e,t,i),e>0&&(n=this.points()[e-1],o=t.index-n.index,this._segments[e-1].setSize(Math.abs(o))),e<this.points().length-1&&(r=this.points()[e+1],o=r.index-t.index,this._segments[e].setSize(Math.abs(o)))},r.prototype.state=function(e){var t=a.prototype.state.call(this,e);return t.segments=this._segments.map(function(e){return{bars:e.bars()}}),t},r.prototype.restoreData=function(e){var t=this;e.segments&&(this._segments=e.segments.map(function(e,i){return new n(t,i,[].concat(e.bars))})),this._currentAverageHL=this._properties.averageHL.value(),this._currentVariance=this._properties.variance.value()},r.prototype.onData=function(e){if(a.prototype.onData.call(this,e),0===this.properties().points._childs.length)for(var t=0;t<this._points.length;t++)this._createPointProperty(t)
;this._currentInterval!==this._model.mainSeries().interval()&&(this.regenerate(),this._currentInterval=this._model.mainSeries().interval())},r.prototype.cloneData=function(e){var t=this;this._segments=e._segments.map(function(e){return e.clone(t)})},r.prototype.calculateATR=function(e){var t,i=(void 0!==e?e:this._model).mainSeries(),n=[];return i.bars().each(function(e,t){n.push(t[TradingView.HIGH_PLOT]-t[TradingView.LOW_PLOT])}),t=0===n.length?0:n.reduce(function(e,t){return e+t},0)/n.length,t*=i.base()},r.prototype.getInputsPropertyPage=function(){return c.LineToolGhostFeedInputsPropertyPage},r.prototype.getStylesPropertyPage=function(){return c.LineToolGhostFeedStylesPropertyPage},t.LineToolGhostFeed=r},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolBezierQuadro";var n=t||new r("linetoolbezierquadro");o.call(this,e,n),i.e(0).then(function(e){var t=i(805).BezierQuadroPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Curve"},n.prototype.name=function(){return"Curve"},n.prototype.controlPoint=function(){var e=this.pointToScreenPoint(this.points()[0])[0],t=this.pointToScreenPoint(this.points()[1])[0],i=t.subtract(e).scaled(.5),n=i.transposed().scaled(.3),o=e.add(t).scaled(.5),r=o.add(n);return this.screenPointToPoint(r)},n.prototype.setLastPoint=function(e,t){o.prototype.setLastPoint.call(this,e,t),this._controlPoint=this.controlPoint()},n.prototype.addPoint=function(e,t,i){var n,r=o.prototype.addPoint.call(this,e,t,!0);return r&&(n=this.controlPoint(),this._points.push(n),delete this._controlPoint,i||(this.normalizePoints(),this.createServerPoints()),this._createPointProperty(2)),r},n.prototype.restorePoints=function(e,t,i){o.prototype.restorePoints.call(this,e,t,i),this._createPointProperty(2)},n.prototype.getStylesPropertyPage=function(){return s.LineToolBezierStylesPropertyPage},t.LineToolBezierQuadro=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolBezierCubic";var n=t||new r("linetoolbeziercubic");o.call(this,e,n),i.e(0).then(function(e){var t=i(806).BezierCubicPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Double Curve"},n.prototype.name=function(){return"Double Curve"},n.prototype.controlPoints=function(){var e=this.pointToScreenPoint(this.points()[0])[0],t=this.pointToScreenPoint(this.points()[1])[0],i=t.subtract(e).scaled(.5),n=i.transposed().scaled(.3),o=e.add(t).scaled(.33),r=e.add(t).scaled(.67),s=o.add(n),a=r.subtract(n);return[this.screenPointToPoint(s),this.screenPointToPoint(a)]},n.prototype.setLastPoint=function(e,t){o.prototype.setLastPoint.call(this,e,t),this._controlPoints=this.controlPoints()},n.prototype.addPoint=function(e,t,i){
var n,r=o.prototype.addPoint.call(this,e,t,!0);return r&&(n=this.controlPoints(),delete this._controlPoints,this._points.push(n[0]),this._points.push(n[1]),i||(this.normalizePoints(),this.createServerPoints()),this._createPointProperty(2),this._createPointProperty(3)),r},n.prototype.restorePoints=function(e,t,i){o.prototype.restorePoints.call(this,e,t,i),this._createPointProperty(2),this._createPointProperty(3)},n.prototype.getStylesPropertyPage=function(){return s.LineToolBezierStylesPropertyPage},t.LineToolBezierCubic=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolArrow";var i=t||new r("linetoolarrow");o.call(this,e,i)}var o=i(101).LineToolTrendLine,r=i(3).DefaultProperty;inherit(n,o),n.prototype.title=function(){return"Arrow"},n.prototype.name=function(){return"Arrow"},t.LineToolArrow=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolRay";var i=t||new r("linetoolray");o.call(this,e,i)}var o=i(101).LineToolTrendLine,r=i(3).DefaultProperty;inherit(n,o),n.prototype.title=function(){return"Ray"},n.prototype.name=function(){return"Ray"},t.LineToolRay=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolExtended";var i=t||new r("linetoolextended");o.call(this,e,i)}var o=i(101).LineToolTrendLine,r=i(3).DefaultProperty;inherit(n,o),n.prototype.title=function(){return"Extended Line"},n.prototype.name=function(){return"Extended Line"},t.LineToolExtended=n},function(e,t,i){"use strict";function n(e,t){var i=t||this.createPropertiesObject("linetoolschiffpitchfork");r.call(this,e,i),this._constructor="LineToolSchiffPitchfork"}var o=i(19),r=i(122).LineToolPitchfork;inherit(n,r),n.prototype.title=function(){return $.t("Modified Schiff Pitchfork")},n.prototype.name=function(){return"Modified Schiff Pitchfork"},n.prototype.createPropertiesObject=function(e,t,i){return new o(e,t,i,{range:[0,8]})},t.LineToolSchiffPitchfork=n},function(e,t,i){"use strict";function n(e,t){var i=t||this.createPropertiesObject("linetoolschiffpitchfork2");r.call(this,e,i),this._constructor="LineToolSchiffPitchfork2"}var o=i(19),r=i(122).LineToolPitchfork;inherit(n,r),n.prototype.title=function(){return $.t("Schiff Pitchfork")},n.prototype.name=function(){return"Schiff Pitchfork"},n.prototype.createPropertiesObject=function(e,t,i){return new o(e,t,i,{range:[0,8]})},t.LineToolSchiffPitchfork2=n},function(e,t,i){"use strict";function n(e,t){var i=t||this.createPropertiesObject("linetoolinsidepitchfork");r.call(this,e,i),this._constructor="LineToolInsidePitchfork"}var o=i(19),r=i(122).LineToolPitchfork;inherit(n,r),n.prototype.title=function(){return $.t("Inside Pitchfork")},n.prototype.name=function(){return"Inside Pitchfork"},n.prototype.createPropertiesObject=function(e,t,i){return new o(e,t,i,{range:[0,8]})},t.LineToolInsidePitchfork=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolFlagMark";var n=t||new s("linetoolflagmark");r.call(this,e,n),i.e(0).then(function(t){var n=i(351).MarkPaneView,r=new n(this,e,this.image,25,25,-8,-21)
;r.setAnchors(new o(0,0)),this._setPaneViews([r])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(6).Point,r=i(0).LineDataSource,s=i(3).DefaultProperty;inherit(n,r),n.prototype.image=new Image,n.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAAsElEQVR4AWMYWcDExOS/YUd4hWF7+H90bNAePpO2liDwJTxyi2htyVXLvlBOWlry2bAtVIumwWXQERFF4zgJ20iPiP8JDCpLeqSuJ6ZdoRJ0SMIRx7QbQtmItgSXnGFbRCzMEnIzK8ISWgL6WzJqibGxsYaFhYUC7SxBWMQPNMjazMxMjebBZWhoKAq00NHc3FyL5nFiaWkpDTTYz8jISI/mEW9qaqoExGFgS+gFRgEAaE0hWxrw50oAAAAASUVORK5CYII=",n.prototype.pointsCount=function(){return 1},n.prototype.title=function(){return"Flag Mark"},n.prototype.name=function(){return"Flag Mark"},n.prototype.version=2,t.LineToolFlagMark=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolCypherPattern";var n=t||new r("linetoolcypherpattern");o.call(this,e,n),i.e(0).then(function(e){var t=i(807).CypherPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(274).LineTool5PointsPattern;inherit(n,s),t.LineToolCypherPattern=n},function(e,t,i){"use strict";(function(e){function n(e){this._line=e,this._data={bodyText:"position",quantityText:"0"},this._closeEnabled=!0}function o(e,t){var o,s,a,l,u,d;this._adapter=new n(this),this._constructor="LineToolPosition",o=t||new c("linetoolposition",void 0,!1,!1),r.call(this,e,o),i.e(0).then(function(e){var t=i(808).PositionPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe),s=e.mainSeries().symbolInfo(),a=null!==s?s.pricescale:100,l=null!==s&&s.fractional?s.minmov:1,u=null!==s&&s.fractional,d=null!==s?s.minmove2:void 0,this._formatter=new h(a,l,u,d)}var r=i(173),s=i(0).LineDataSource,a=i(596).PositionAveragePriceAxisView,l=i(131),c=i(3).DefaultProperty,h=i(21).PriceFormatter;n.prototype.getPrice=function(){return this._line.points().length>0?this._line.points()[0].price:this._line._timePoint.length>0?this._line._timePoint[0].price:void 0},n.prototype.setPrice=function(e){if(this._line.points().length>0){var t=this._line.points()[0];t.price=e,this._line._points[0]=t,this._line.normalizePoints(),this._line.updateAllViewsAndRedraw()}return this._line._timePoint.length>0&&(this._line._timePoint[0].price=e),this},n.prototype.getText=function(){return this._data.bodyText},n.prototype.setText=function(e){return this._data.bodyText=e||"",this._line.updateAllViewsAndRedraw(),this},n.prototype.setTooltip=function(e){return null==e?e="":e+="",this._line.properties().tooltip.setValue(e),this},n.prototype.getTooltip=function(){return this._line.properties().tooltip.value()},n.prototype.getQuantity=function(){return this._data.quantityText},n.prototype.setQuantity=function(e){return this._data.quantityText=e||"",this._line.updateAllViewsAndRedraw(),this},n.prototype.getExtendLeft=function(){var e=this._line.properties().extendLeft.value();return"inherit"===e?this._line._model.properties().tradingProperties.extendLeft.value():e},
n.prototype.setExtendLeft=function(e){return this._line.properties().extendLeft.setValue(e),this},n.prototype.getLineLength=function(){var e=this._line.properties().lineLength.value();return"inherit"===e?this._line._model.properties().tradingProperties.lineLength.value():e},n.prototype.setLineLength=function(e){return this._line.properties().lineLength.setValue(Math.max(0,Math.min(e,100))),this},n.prototype.getLineColor=function(){return l.getColorFromProperties(this._line.properties().lineColor,this._line.properties().lineTransparency)},n.prototype.setLineColor=function(e){return l.setColorToProperties(e,this._line.properties().lineColor,this._line.properties().lineTransparency),this},n.prototype.getLineStyle=function(){var e=this._line.properties().lineStyle.value();return"inherit"===e?this._line._model.properties().tradingProperties.lineStyle.value():e},n.prototype.setLineStyle=function(e){return this._line.properties().lineStyle.setValue(e),this},n.prototype.getLineWidth=function(){var e=this._line.properties().lineWidth.value();return"inherit"===e?this._line._model.properties().tradingProperties.lineWidth.value():e},n.prototype.setLineWidth=function(e){return this._line.properties().lineWidth.setValue(e),this},n.prototype.getBodyBorderColor=function(){return l.getColorFromProperties(this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency)},n.prototype.setBodyBorderColor=function(e){return l.setColorToProperties(e,this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency),this},n.prototype.getBodyBackgroundColor=function(){return l.getColorFromProperties(this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency)},n.prototype.setBodyBackgroundColor=function(e){return l.setColorToProperties(e,this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency),this},n.prototype.getBodyTextColor=function(){return l.getColorFromProperties(this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency)},n.prototype.setBodyTextColor=function(e){return l.setColorToProperties(e,this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency),this},n.prototype.getBodyFont=function(){return l.getFontFromProperties(this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic)},n.prototype.setBodyFont=function(e){return l.setFontToProperties(e,this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic),this},n.prototype.getQuantityBorderColor=function(){return l.getColorFromProperties(this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency)},n.prototype.setQuantityBorderColor=function(e){return l.setColorToProperties(e,this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency),this},
n.prototype.getQuantityBackgroundColor=function(){return l.getColorFromProperties(this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency)},n.prototype.setQuantityBackgroundColor=function(e){return l.setColorToProperties(e,this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency),this},n.prototype.getQuantityTextColor=function(){return l.getColorFromProperties(this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency)},n.prototype.setQuantityTextColor=function(e){return l.setColorToProperties(e,this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency),this},n.prototype.getQuantityFont=function(){return l.getFontFromProperties(this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic)},n.prototype.setQuantityFont=function(e){return l.setFontToProperties(e,this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic),this},n.prototype.getReverseButtonBorderColor=function(){return l.getColorFromProperties(this._line.properties().reverseButtonBorderColor,this._line.properties().reverseButtonBorderTransparency)},n.prototype.setReverseButtonBorderColor=function(e){return l.setColorToProperties(e,this._line.properties().reverseButtonBorderColor,this._line.properties().reverseButtonBorderTransparency),this},n.prototype.getReverseButtonBackgroundColor=function(){return l.getColorFromProperties(this._line.properties().reverseButtonBackgroundColor,this._line.properties().reverseButtonBackgroundTransparency)},n.prototype.setReverseButtonBackgroundColor=function(e){return l.setColorToProperties(e,this._line.properties().reverseButtonBackgroundColor,this._line.properties().reverseButtonBackgroundTransparency),this},n.prototype.getReverseButtonIconColor=function(){return l.getColorFromProperties(this._line.properties().reverseButtonIconColor,this._line.properties().reverseButtonIconTransparency)},n.prototype.setReverseButtonIconColor=function(e){return l.setColorToProperties(e,this._line.properties().reverseButtonIconColor,this._line.properties().reverseButtonIconTransparency),this},n.prototype.getCloseButtonBorderColor=function(){return l.getColorFromProperties(this._line.properties().closeButtonBorderColor,this._line.properties().closeButtonBorderTransparency)},n.prototype.setCloseButtonBorderColor=function(e){return l.setColorToProperties(e,this._line.properties().closeButtonBorderColor,this._line.properties().closeButtonBorderTransparency),this},n.prototype.getCloseButtonBackgroundColor=function(){return l.getColorFromProperties(this._line.properties().closeButtonBackgroundColor,this._line.properties().closeButtonBackgroundTransparency)},n.prototype.setCloseButtonBackgroundColor=function(e){
return l.setColorToProperties(e,this._line.properties().closeButtonBackgroundColor,this._line.properties().closeButtonBackgroundTransparency),this},n.prototype.getCloseButtonIconColor=function(){return l.getColorFromProperties(this._line.properties().closeButtonIconColor,this._line.properties().closeButtonIconTransparency)},n.prototype.setCloseButtonIconColor=function(e){return l.setColorToProperties(e,this._line.properties().closeButtonIconColor,this._line.properties().closeButtonIconTransparency),this},n.prototype.block=function(){this._blocked=!0,this._line.updateAllViewsAndRedraw()},n.prototype.unblock=function(){this._blocked=!1,this._line.updateAllViewsAndRedraw()},n.prototype.isFunction=function(e){return"function"==typeof e},n.prototype.onReverse=function(e,t){return t?this.isFunction(t)&&(this._onReverseData=e,this._onReverseCallback=t):this.isFunction(e)&&(this._onReverseCallback=e),this},n.prototype.callOnReverse=function(){this.isFunction(this._onReverseCallback)&&this._onReverseCallback.call(this,this._onReverseData)},n.prototype.isOnReverseCallbackPresent=function(){return this.isFunction(this._onReverseCallback)},n.prototype.onClose=function(e,t){return t?this.isFunction(t)&&(this._onCloseData=e,this._onCloseCallback=t):this.isFunction(e)&&(this._onCloseCallback=e),this},n.prototype.setCloseEnabled=function(e){return this._closeEnabled===e?this:(this._closeEnabled=e,this._onCloseCallback&&this._line.updateAllViewsAndRedraw(),this)},n.prototype.isCloseEnabled=function(){return this._closeEnabled},n.prototype.callOnClose=function(){this.isFunction(this._onCloseCallback)&&this._closeEnabled&&this._onCloseCallback.call(this,this._onCloseData)},n.prototype.isOnCloseCallbackPresent=function(){return this._closeEnabled&&this.isFunction(this._onCloseCallback)},n.prototype.onModify=function(e,t){return t?this.isFunction(t)&&(this._onModifyData=e,this._onModifyCallback=t):this.isFunction(e)&&(this._onModifyCallback=e),this},n.prototype.callOnModify=function(){this.isFunction(this._onModifyCallback)&&this._onModifyCallback.call(this,this._onModifyData)},n.prototype.onContextMenu=function(e,t){return t?this.isFunction(t)&&(this._onContextMenuData=e,this._onContextMenuCallback=t):this.isFunction(e)&&(this._onContextMenuCallback=e),this},n.prototype.callOnContextMenu=function(){if(this.isFunction(this._onContextMenuCallback))return this._onContextMenuCallback.call(this,this._onContextMenuData)},n.prototype.remove=function(){this._line._model.removeSource(this._line),delete this._line},inherit(o,r),o.prototype.setPoint=function(e,t,i){this._points[e]=t,this.normalizePoints()},o.prototype.addPoint=function(e,t){return this._points.push(e),this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0},o.skipMagnetting=!0,o.prototype.title=function(){return"Position"},o.prototype.name=function(){return"Position"},o.prototype.createPriceAxisView=function(e){return this._priceAxisView=new a(this,{pointIndex:e,backgroundProperty:this.properties().lineColor}),this._priceAxisView},
o.prototype.paneViews=function(t){return TradingView.printing&&!e.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showPositions.value()?s.prototype.paneViews.call(this,t):null},o.prototype.priceAxisViews=function(t,i){return TradingView.printing&&!e.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showPositions.value()?s.prototype.priceAxisViews.call(this,t,i):null},o.prototype.hasContextMenu=function(){return!0},o.prototype.contextMenuItems=function(){return this._adapter.callOnContextMenu()},o.prototype.formatter=function(){return this._formatter},t.LineToolPosition=o}).call(t,i(5))},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"PositionAveragePriceAxisView",function(){return r}),n=i(1),o=i(169),r=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.c(t,e),t.prototype._formatPrice=function(e,t){return this._source.formatter().format(e)},t}(o.LineToolPriceAxisView)},function(e,t,i){"use strict";(function(e){function n(e){this._line=e,this._data={bodyText:"order",quantityText:"0"},this._editable=!0}function o(e,t){this._adapter=new n(this),this._constructor="LineToolOrder";var o=t||new c("linetoolorder",void 0,!1,!1);r.call(this,e,o),i.e(0).then(function(e){var t=i(809).OrderPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var r=i(173),s=i(169).LineToolPriceAxisView,a=i(131),l=i(0).LineDataSource,c=i(3).DefaultProperty;n.prototype.setEditable=function(e){return this._editable=e,this},n.prototype.getPrice=function(){return this._line.points().length>0?this._line.points()[0].price:this._line._timePoint.length>0?this._line._timePoint[0].price:void 0},n.prototype.setPrice=function(e){if(this._line.points().length>0){var t=this._line.points()[0];t.price=e,this._line._points[0]=t,this._line.normalizePoints(),this._line.updateAllViewsAndRedraw()}return this._line._timePoint.length>0&&(this._line._timePoint[0].price=e),this},n.prototype.getText=function(){return this._data.bodyText},n.prototype.setText=function(e){return this._data.bodyText=e||"",this._line.updateAllViewsAndRedraw(),this},n.prototype.setTooltip=function(e){return null==e?e="":e+="",this._line.properties().tooltip.setValue(e),this},n.prototype.getTooltip=function(){return this._line.properties().tooltip.value()},n.prototype.getQuantity=function(){return this._data.quantityText},n.prototype.setQuantity=function(e){return this._data.quantityText=e||"",this._line.updateAllViewsAndRedraw(),this},n.prototype.getExtendLeft=function(){var e=this._line.properties().extendLeft.value();return"inherit"===e?this._line._model.properties().tradingProperties.extendLeft.value():e},n.prototype.setExtendLeft=function(e){return this._line.properties().extendLeft.setValue(e),this},n.prototype.getLineLength=function(){var e=this._line.properties().lineLength.value();return"inherit"===e?this._line._model.properties().tradingProperties.lineLength.value():e},
n.prototype.setLineLength=function(e){return this._line.properties().lineLength.setValue(Math.max(0,Math.min(e,100))),this},n.prototype.getLineColor=function(){return a.getColorFromProperties(this._line.properties().lineColor,this._line.properties().lineTransparency)},n.prototype.setLineColor=function(e){return a.setColorToProperties(e,this._line.properties().lineColor,this._line.properties().lineTransparency),this},n.prototype.getLineStyle=function(){var e=this._line.properties().lineStyle.value();return"inherit"===e?this._line._model.properties().tradingProperties.lineStyle.value():e},n.prototype.setLineStyle=function(e){return this._line.properties().lineStyle.setValue(e),this},n.prototype.getLineWidth=function(){var e=this._line.properties().lineWidth.value();return"inherit"===e?this._line._model.properties().tradingProperties.lineWidth.value():e},n.prototype.setLineWidth=function(e){return this._line.properties().lineWidth.setValue(e),this},n.prototype.getBodyBorderColor=function(){return a.getColorFromProperties(this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency)},n.prototype.setBodyBorderColor=function(e){return a.setColorToProperties(e,this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency),this},n.prototype.getBodyBackgroundColor=function(){return a.getColorFromProperties(this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency)},n.prototype.setBodyBackgroundColor=function(e){return a.setColorToProperties(e,this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency),this},n.prototype.getBodyTextColor=function(){return a.getColorFromProperties(this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency)},n.prototype.setBodyTextColor=function(e){return a.setColorToProperties(e,this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency),this},n.prototype.getBodyFont=function(){return a.getFontFromProperties(this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic)},n.prototype.setBodyFont=function(e){return a.setFontToProperties(e,this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic),this},n.prototype.getQuantityBorderColor=function(){return a.getColorFromProperties(this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency)},n.prototype.setQuantityBorderColor=function(e){return a.setColorToProperties(e,this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency),this},n.prototype.getQuantityBackgroundColor=function(){return a.getColorFromProperties(this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency)},n.prototype.setQuantityBackgroundColor=function(e){
return a.setColorToProperties(e,this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency),this},n.prototype.getQuantityTextColor=function(){return a.getColorFromProperties(this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency)},n.prototype.setQuantityTextColor=function(e){return a.setColorToProperties(e,this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency),this},n.prototype.getQuantityFont=function(){return a.getFontFromProperties(this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic)},n.prototype.setQuantityFont=function(e){return a.setFontToProperties(e,this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic),this},n.prototype.getCancelButtonBorderColor=function(){return a.getColorFromProperties(this._line.properties().cancelButtonBorderColor,this._line.properties().cancelButtonBorderTransparency)},n.prototype.setCancelButtonBorderColor=function(e){return a.setColorToProperties(e,this._line.properties().cancelButtonBorderColor,this._line.properties().cancelButtonBorderTransparency),this},n.prototype.getCancelButtonBackgroundColor=function(){return a.getColorFromProperties(this._line.properties().cancelButtonBackgroundColor,this._line.properties().cancelButtonBackgroundTransparency)},n.prototype.setCancelButtonBackgroundColor=function(e){return a.setColorToProperties(e,this._line.properties().cancelButtonBackgroundColor,this._line.properties().cancelButtonBackgroundTransparency),this},n.prototype.getCancelButtonIconColor=function(){return a.getColorFromProperties(this._line.properties().cancelButtonIconColor,this._line.properties().cancelButtonIconTransparency)},n.prototype.setCancelButtonIconColor=function(e){return a.setColorToProperties(e,this._line.properties().cancelButtonIconColor,this._line.properties().cancelButtonIconTransparency),this},n.prototype.block=function(){this._blocked=!0,this._line.updateAllViewsAndRedraw()},n.prototype.unblock=function(){this._blocked=!1,this._line.updateAllViewsAndRedraw()},n.prototype.isFunction=function(e){return"function"==typeof e},n.prototype.onCancel=function(e,t){return t?this.isFunction(t)&&(this._onCancelData=e,this._onCancelCallback=t):this.isFunction(e)&&(this._onCancelCallback=e),this},n.prototype.callOnCancel=function(){this.isFunction(this._onCancelCallback)&&this._onCancelCallback.call(this,this._onCancelData)},n.prototype.isOnCancelCallbackPresent=function(){return this.isFunction(this._onCancelCallback)},n.prototype.onModify=function(e,t){return t?this.isFunction(t)&&(this._onModifyData=e,this._onModifyCallback=t):this.isFunction(e)&&(this._onModifyCallback=e),this},n.prototype.callOnModify=function(){this.isFunction(this._onModifyCallback)&&this._onModifyCallback.call(this,this._onModifyData)},
n.prototype.onMove=function(e,t){return t?this.isFunction(t)&&(this._onMoveData=e,this._onMoveCallback=t):this.isFunction(e)&&(this._onMoveCallback=e),this},n.prototype.callOnMove=function(){this.isFunction(this._onMoveCallback)&&this._onMoveCallback.call(this,this._onMoveData)},n.prototype.onContextMenu=function(e,t){return t?this.isFunction(t)&&(this._onContextMenuData=e,this._onContextMenuCallback=t):this.isFunction(e)&&(this._onContextMenuCallback=e),this},n.prototype.callOnContextMenu=function(){if(this.isFunction(this._onContextMenuCallback))return this._onContextMenuCallback.call(this,this._onContextMenuData)},n.prototype.remove=function(){this._line._model.removeSource(this._line),delete this._line},n.prototype.shouldShowModifyOrder=function(){return!!this._onModifyCallback},inherit(o,r),o.skipMagnetting=!0,o.prototype.setPoint=function(e,t,i){this._points[e]=t,this.normalizePoints()},o.prototype.addPoint=function(e,t){return this._points.push(e),this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0},o.prototype.title=function(){return"Order"},o.prototype.name=function(){return"Order"},o.prototype.endMoving=function(e){var t=this._startMovingPoint&&this._currentMovingPoint&&this._startMovingPoint.price!==this._currentMovingPoint.price;r.prototype.endMoving.call(this),!e&&t&&this._adapter.callOnMove()},o.prototype.createPriceAxisView=function(e){return this._priceAxisView=new s(this,{pointIndex:e,backgroundProperty:this.properties().lineColor}),this._priceAxisView},o.prototype.paneViews=function(t){return TradingView.printing&&!e.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showOrders.value()?l.prototype.paneViews.call(this,t):null},o.prototype.priceAxisViews=function(t,i){return TradingView.printing&&!e.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showOrders.value()?l.prototype.priceAxisViews.call(this,t,i):null},o.prototype.hasContextMenu=function(){return!0},o.prototype.contextMenuItems=function(){return this._adapter.callOnContextMenu()},o.prototype.onlyYMoving=function(){return!0},o.prototype.userEditEnabled=function(){return this._adapter.shouldShowModifyOrder()},t.LineToolOrder=o}).call(t,i(5))},function(e,t,i){"use strict";(function(e){function n(t,i,n){n=n||{},n=Object.assign({},M,n);var o=this;f.call(this),this._properties=i,this._model=t,this._dataWindowView=new h(this,t),this._priceAxisView=new c(this),this._startMeasurePriceAxisView=new c(this),this._endMeasurePriceAxisView=new c(this),this._timeAxisView=new u(this,t),this._startMeasureTimeAxisView=new u(this,t,"measureStartX"),this._endMeasureTimeAxisView=new u(this,t,"measureEndX"),this.visible=!0,t.readOnly()?this.areLinesVisible=!0:m.cursorTool.subscribe(function(e){o.areLinesVisible="arrow"!==e},{callWithLast:!0}),this._movedDelegate=new e,this._subscribed=!1,this._linesShouldBeHidden=this._model.readOnly(),this._selectBarMode=new I(!1),this._barSelectedDelegate=new e,this._mouseClickBoundedHandler=this._mouseClickHandler.bind(this),
this._isOnHoveredChartWidget=!1}function o(e,t){this._source=e,this._pane=t,this._pipFormatter=null,this._lastSymbolInfo=null,this._horzTrenRenderer=new d,this._vertTrenRenderer=new d,this._bgRenderer=new _,this._labelRenderer=new p({})}function r(e,t,i,n){this.source=e,this.pane=t,this._horzVisible=i,this._mouseClickHandler=n}function s(e,t,i){this.source=e,this.pane=t,this._axis=i||"x"}var a=i(6).Point,l=i(73).isLineToolName,c=i(599).CrossHairPriceAxisView,h=i(600),u=i(601),d=i(185).TrendLineRenderer,p=i(186).TextRenderer,_=i(303).RectangleRenderer,f=i(28).DataSource,m=i(32),y=i(602).PaneRendererCrossHair,g=i(603).PaneRendererCrossHairLock,v=i(69).CompositeRenderer,S=i(18),b=i(70).PercentageFormatter,w=i(318).TimeSpanFormatter,P=i(315).PipFormatter,T=i(29),x=i(104).LineEnd,C=i(85),L=i(12).isNaN,I=i(16),A=i(38),k=A.forceLTRStr,E=A.startWithLTR,M={additionalMenuEnabled:!1};inherit(n,f),n.prototype.index=0,n.prototype.price=NaN,n.prototype.pane=null,n.prototype.color="white",n.prototype.style="",n.prototype.customization={disableSelection:!0},n.prototype.properties=function(){return this._properties},n.prototype.moved=function(){return this._movedDelegate},n.prototype.saveOriginCoord=function(e,t){this._originX=e,this._originY=t},n.prototype.clearOriginCoord=function(){this._originX=NaN,this._originY=NaN},n.prototype.setPosition=function(e,t,i){this._subscribed||(this._model.mainSeries().onRestarted().subscribe(this,n.prototype.clearMeasure),this._subscribed=!0),this.setLockedPosition(i),this.visible=!0,this._tryToUpdateViews(e,t,i)},n.prototype.update=function(){var e,t,i,n,o,r;this.visible&&(e=this._priceScaleByPane(this.pane),t=this._originX||this.x,i=this._originY||this.y,n=this._model.timeScale().coordinateToIndex(t),o=NaN,null!==e&&(r=this.pane.mainDataSource().firstValue(),o=e.coordinateToPrice(i,r)),this._tryToUpdateViews(n,o,this.pane))},n.prototype._priceScaleByPane=function(e){return e&&!e.defaultPriceScale().isEmpty()?e.defaultPriceScale():null},n.prototype._tryToUpdateViews=function(e,t,i){this._tryToUpdateData(e,t,i)&&(this.updateAllViews(),this._movedDelegate.fire({time:this._model.timeScale().points().roughTime(this.index),price:this.price}))},n.prototype._tryToUpdateData=function(e,t,i){var n,o=this.x,r=this.y,s=this.price,a=this.index,l=this.pane,c=this._priceScaleByPane(i);return this.index=e,this.x=L(e)?NaN:this._model.timeScale().indexToCoordinate(e),null!==c?(this.pane=i,this.price=t,n=i.mainDataSource().firstValue(),this.y=c.priceToCoordinate(t,n)):(this.pane=null,this.price=NaN,this.y=NaN),o!==this.x||r!==this.y||a!==this.index||s!==this.price||l!==this.pane},n.prototype.setLockedPosition=function(e){delete this.lockedIndex,delete this.lockedX,e!==this._measurePane&&m.lockTimeAxis().value()&&(this.lockedIndex=this._model.timeScale().points().roughIndex(m.lockTimeAxisTime.value()),this.lockedX=this._model.timeScale().indexToCoordinate(this.lockedIndex))},n.prototype.clearPosition=function(){this.visible=!1;var e=this._model.mainSeries().bars().lastIndex();this.index=null!==e?e:NaN,
this.price=NaN,this.x=NaN,this.y=NaN,this.pane=null,this.clearOriginCoord()},n.prototype.measureStartY=function(){var e=this._startMeasurePoint.price,t=this._measurePane,i=t.mainDataSource().firstValue();return t.defaultPriceScale().priceToCoordinate(e,i)},n.prototype.measureStartX=function(){return this._model.timeScale().indexToCoordinate(this._startMeasurePoint.index)},n.prototype.measureEndY=function(){var e=this._endMeasurePoint.price,t=this._measurePane,i=t.mainDataSource().firstValue();return t.defaultPriceScale().priceToCoordinate(e,i)},n.prototype.measureEndX=function(){return this._model.timeScale().indexToCoordinate(this._endMeasurePoint.index)},n.prototype.paneViews=function(e){var t=this._selectBarMode.value()&&this._isOnHoveredChartWidget,i=e===this.pane&&!t,n=[new r(this,e,i,this._mouseClickBoundedHandler)];return e===this._measurePane&&(this._measurePaneView||(this._measurePaneView=new o(this,e)),this._measurePaneView.update(),n.push(this._measurePaneView)),m.lockTimeAxis().value()&&n.push(this._timeLockPaneView=this._timeLockPaneView||new s(this,e)),n},n.prototype.dataWindowView=function(){return this._dataWindowView},n.prototype.priceAxisViews=function(e,t){var i,n;return this._linesShouldBeHidden||!this.visible||this.pane!==e||t!==e.defaultPriceScale()?null:(i=[],n=this._selectBarMode.value()&&this._isOnHoveredChartWidget,n||i.push(this._priceAxisView),this._startMeasurePoint&&i.push(this._startMeasurePriceAxisView),this._endMeasurePoint&&i.push(this._endMeasurePriceAxisView),i)},n.prototype.timeAxisView=function(){if(this._linesShouldBeHidden||!this.visible&&!m.lockTimeAxis().value())return null;var e=[this._timeAxisView];return this._startMeasurePoint&&e.push(this._startMeasureTimeAxisView),this._endMeasurePoint&&e.push(this._endMeasureTimeAxisView),e},n.prototype.updateAllViews=function(){this._priceAxisView.update(),this._startMeasurePoint&&(this._startMeasurePriceAxisView.update(),this._startMeasureTimeAxisView.update()),this._endMeasurePoint&&(this._endMeasurePriceAxisView.update(),this._endMeasureTimeAxisView.update()),this._timeAxisView.update()},n.prototype.startMeasurePoint=function(){return this._startMeasurePoint},n.prototype.startMeasuring=function(e,t){this._startMeasurePoint=e,this._measurePane=t},n.prototype.finishMeasure=function(e){this._endMeasurePoint=e},n.prototype.endMeasurePoint=function(){return this._endMeasurePoint},n.prototype.clearMeasure=function(e){delete this._measurePane,delete this._startMeasurePoint,delete this._endMeasurePoint,delete this._lastValidMeasurePoint,this._model.invalidate(new S(S.LIGHT_UPDATE))},n.prototype.measurePoints=function(){this.updateAllViews();var e=[this._startMeasurePoint];return this._endMeasurePoint?e.push(this._endMeasurePoint):(this._measurePane===this.pane&&(this._lastValidMeasurePoint={x:this.x,y:this.y,rawPrice:this.price,price:this.price,index:this.index}),e.push(this._lastValidMeasurePoint)),e},n.prototype.currentPoint=function(){return new a(this.x,this.y)},n.prototype.appliedIndex=function(){
return isFinite(this.lockedIndex)&&this.lockedIndex||this.index},n.prototype.appliedX=function(){return isFinite(this.lockedX)&&this.lockedX||this.x},n.prototype.selectBarMode=function(){return this._selectBarMode},n.prototype.toggleSelectBarMode=function(){this._setSelectBarModeState(!this._selectBarMode.value())},n.prototype.onBarSelected=function(){return this._barSelectedDelegate},n.prototype._setSelectBarModeState=function(e){this._selectBarMode.setValue(e),this._model.invalidate(new S(S.LIGHT_UPDATE))},n.prototype._mouseClickHandler=function(){var e;this._model.mainSeries().bars().contains(this.index)&&null!==(e=this._model.timeScale().indexToTimePoint(this.index))&&(this._setSelectBarModeState(!1),this._barSelectedDelegate.fire(e))},n.prototype.handleContextMenuEvent=function(){this._selectBarMode.value()&&this._setSelectBarModeState(!1)},n.prototype.setOnHoveredChartWidget=function(e){this._isOnHoveredChartWidget=e},n.prototype.isOnHoveredChartWidget=function(){return this._isOnHoveredChartWidget},n.prototype.setLinesShouldBeHidden=function(e){this._linesShouldBeHidden=e},n.prototype.linesShouldBeHidden=function(){return this._linesShouldBeHidden},o.prototype.update=function(){var e,t,i,n,o,r,s,l,c,h,u,d,p,_,f,m,y,g,v,S,T,x,C;if(this._source._endMeasurePoint)e=this._source._endMeasurePoint.price,t=this._source._endMeasurePoint.index;else if(this._source._measurePane===this._source.pane)e=this._source.price,t=this._source.index;else{if(!this._source._lastValidMeasurePoint)return;e=this._source._lastValidMeasurePoint.rawPrice,t=this._source._lastValidMeasurePoint.index}i=e-this._source._startMeasurePoint.price,n=t-this._source._startMeasurePoint.index,o=k(n),r=this._source._startMeasurePoint.price,s=this._source._measurePane.mainDataSource(),l=s.formatter().format(i),this._source._startMeasurePoint.price&&(c=i/this._source._startMeasurePoint.price,l+=" ("+(new b).format(100*c)+")"),h=k(l),this._label=h+"\n"+$.t("{0} bars").format(o),r=this._source._model._magnet.align(r,this._source._startMeasurePoint.index,this._source._measurePane),e=this._source._model._magnet.align(e,t,this._source._measurePane),u=s.firstValue(),d=this._source._model.timeScale().indexToCoordinate(this._source._startMeasurePoint.index),p=this._source._model.timeScale().indexToCoordinate(t),_=this._source._measurePane.defaultPriceScale().priceToCoordinate(r,u),f=this._source._measurePane.defaultPriceScale().priceToCoordinate(e,u),this._p1=new a(d,_),this._p2=new a(p,f),m=this._source._model.timeScale().indexToUserTime(this._source._startMeasurePoint.index),y=this._source._model.timeScale().indexToUserTime(t),g=this._pane.model().mainSeries().symbolInfo(),g&&g!==this._lastSymbolInfo&&(this._pipFormatter=new P(g.pricescale,g.minmov,g.type,g.minmove2),this._lastSymbolInfo=g),m&&y&&(v=(y.valueOf()-m.valueOf())/1e3,S=this._pipFormatter?this._pipFormatter.format(i):"",T=S?" , "+S:S,x=(new w).format(v),C=E(x),this._label=k(h+T)+"\n"+$.t("{0} bars").format(o)+", "+C)},o.prototype.renderer=function(){var e,t,i,n,o,r,s,l,c,h,u,d,p=new v,_={}
;return _.points=[this._p1,this._p2],_.width=this._source._model.timeScale().width(),_.height=this._source._measurePane.defaultPriceScale().height(),_.color="#D3E7FF",_.linewidth=0,_.fillBackground=!0,_.transparency=60,_.backcolor="#BADAFF",this._bgRenderer.setData(_),p.append(this._bgRenderer),e=this._p1.add(this._p2).scaled(.5),t=new a(this._p1.x,e.y),i=new a(this._p2.x,e.y),n={points:[t,i],width:_.width,height:_.height,color:"#363c4e",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED,extendleft:!1,extendright:!1,leftend:x.Normal,rightend:x.Arrow},this._horzTrenRenderer.setData(n),p.append(this._horzTrenRenderer),t=new a(e.x,this._p1.y),i=new a(e.x,this._p2.y),n={points:[t,i],width:_.width,height:_.height,color:"#363c4e",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED,extendleft:!1,extendright:!1,leftend:x.Normal,rightend:x.Arrow},this._vertTrenRenderer.setData(n),p.append(this._vertTrenRenderer),o={x:0,y:10},r=function(e,t){return{points:[t],text:e,color:"#FFFFFF",horzAlign:"left",vertAlign:"middle",font:"Arial",offsetX:o.x,offsetY:o.y,bold:!1,italic:!1,fontsize:12,padding:5,highlightBorder:!1,backgroundColor:T.generateColor("#5b85bf",10),backgroundTransparency:10,backgroundVertInflate:5,backgroundHorzInflate:5,backgroundRoundRect:4}},s=.5*(this._p1.x+this._p2.x),l=this._p2.y,c=new a(s,l),h=r(this._label,c),this._labelRenderer.setData(h),u=this._labelRenderer.measure(),d={x:s+h.backgroundHorzInflate+u.textBgPadding-u.width/u.textBgPadding,y:this._p1.y>this._p2.y?c.y-u.height-2*u.textBgPadding-o.y>0?l-u.height-o.y+u.textBgPadding:o.y-2*u.textBgPadding:c.y+u.height+u.textBgPadding+o.y>_.height?_.height-u.height-o.y:l+u.textBgPadding},this._labelRenderer.setPoints([new a(d.x,d.y)]),p.append(this._labelRenderer),p},r.prototype.update=function(){},r.prototype.renderer=function(){var e,t,i,n,o,r,s={},a=this.source.visible&&this.source.areLinesVisible,c=m.lockTimeAxis().value();return s.horzLinesVisible=a&&this._horzVisible,s.vertLinesVisible=a||c,e=this.pane._model.readOnly(),t=e?defaults("chartproperties.paneProperties.crossHairProperties"):null,i=this.source.selectBarMode().value()&&this.source.isOnHoveredChartWidget(),n=TradingView.isMobile.any()&&l(this.source._model.currentTool())&&!i,o=n?"#a000a0":e?t.color:this.pane._model.properties().paneProperties.crossHairProperties.color.value(),r=e?t.transparency:this.pane._model.properties().paneProperties.crossHairProperties.transparency.value(),!n&&r>0&&(o=T.generateColor(o,r)),s.color=o,s.lineWidth=e?t.width:this.pane._model.properties().paneProperties.crossHairProperties.width.value(),s.lineStyle=e?t.style:this.pane._model.properties().paneProperties.crossHairProperties.style.value(),s.drawCenter=n&&this.pane===this.source.pane,s.w=this.pane.width(),s.h=this.pane.height(),s.x=isFinite(this.source.lockedX)&&this.source.lockedX||this.source.x,s.y=this.source.y,i&&(s.x=Math.max(0,this.source.x-1),s.vertLinesVisible=!0,s.lineStyle=C.LINESTYLE_SOLID,s.mouseClickHandler=this._mouseClickHandler,s.lineWidth=2,s.color="#ff0000"),new y(s)},s.prototype.update=function(){},
s.prototype.renderer=function(){var e,t,i,n,o=this.source.visible&&this.source.areLinesVisible,r=m.lockTimeAxis().value(),s=o&&this._horzVisible,a=o||r;if(("y"!==this._axis||s)&&a)return e=9,t=11,i="y"===this._axis?this.pane.width()-e/2:this.source.lockedX+1,n="y"===this._axis?this.source.y:this.pane.height()-t/2-1,new g({x:i,y:n,width:e,height:t,bodyHeight:7})},t.CrossHair=n}).call(t,i(8))},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"CrossHairPriceAxisView",function(){return r}),n=i(1),o=i(58),r=function(e){function t(t){var i=e.call(this)||this;return i._background="#4c525e",i._source=t,i}return n.c(t,e),t.prototype._updateRendererData=function(e){var t,i,n,o;e.visible=!1,null!==(t=this._source.pane)&&(i=t.defaultPriceScale(),n=t.mainDataSource(),o=null!==n?n.firstValue():null,this._source.visible&&!i.isEmpty()&&null!=o&&(e.background=this._background,e.color=this.generateTextColor(this._background),e.coordinate=this._source.y,e.text=i.formatPrice(this._source.price,o),e.visible=!0))},t}(o.a)},function(e,t,i){"use strict";function n(e,t){r.call(this),this._header=null,this._crossHair=e,this._model=t,this._items.push(new s("Date","")),this._items.push(new s("Time","")),this._items.push(new s("Price","")),this._defaultFormatter=new a(100)}var o=i(118),r=o.DataWindowView,s=o.DataWindowItem,a=i(21).PriceFormatter,l=i(201).DateFormatter,c=i(130).TimeFormatter;inherit(n,r),n.prototype.update=function(){var e,t,i,n,o,r,s=this._model.mainSeries().isDWM();this._items[1].setVisible(!s),this._items[0].setValue("n/a"),this._items[1].setValue("n/a"),this._items[2].setValue("n/a"),this._model.timeScale().isEmpty()||(e=this._crossHair.appliedIndex(),t=this._model.timeScale().indexToUserTime(e),null===t?(this._items[0].setValue("n/a"),s||this._items[1].setValue("n/a")):(this._items[0].setValue((new l).format(t)),s||this._items[1].setValue((new c).format(t))),(i=this._crossHair.pane)&&(n=i.defaultPriceScale(),n.isEmpty()||(o=n.mainSource(),r=o?o.formatter():this._defaultFormatter,this._items[2].setValue(r.format(this._crossHair.price)))))},e.exports=n},function(e,t,i){"use strict";function n(e,t){o.call(this),this._invalidated=!0,this._crosshair=e,this._model=t,this._renderer=new r,this._rendererData={visible:!1,background:"#4c525e",color:"white",text:"",width:0}}var o=i(170).TimeAxisView,r=i(171).TimeAxisViewRenderer,s=i(172).AbbreviatedDateTimeFormatter;inherit(n,o),n.prototype.update=function(){this._invalidated=!0},n.prototype._updateImpl=function(){var e,t,i=this._rendererData;i.visible=!1,e=this._model.timeScale(),e.isEmpty()||(i.width=e.width(),i.coordinate=this._crosshair.appliedX(),(t=e.indexToUserTime(this._crosshair.appliedIndex()))&&(i.text=new s(this._model.mainSeries().isDWM()).format(t),i.visible=!0))},n.prototype.renderer=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._renderer.setData(this._rendererData),this._renderer},e.exports=n},function(e,t,i){"use strict";function n(e){this.data=e}var o=i(9).HitTestResult
;n.prototype.draw=function(e){var t,i,n,o,r,s,a,l;this.data&&(t=this.data.vertLinesVisible,i=this.data.horzLinesVisible,(t||i)&&(e.lineStyle=this.data.lineStyle,e.lineWidth=this.data.lineWidth,e.strokeStyle=this.data.color,e.fillStyle=this.data.color,n=e.lineStyle===CanvasEx.LINESTYLE_DASHED||e.lineStyle===CanvasEx.LINESTYLE_DOTTED||e.lineStyle===CanvasEx.LINESTYLE_SPARSE_DOTTED,o=this.data.lineWidth%2==0?.5:0,r=this.data.x+1+o,s=this.data.y+o,a=this.data.w,l=this.data.h,t&&r>=0&&(n?CanvasEx.drawDashedLineVertical(e,r,0,l):CanvasEx.drawSolidLine(e,r,0,r,l)),i&&s>=0&&(n?CanvasEx.drawDashedLineHorizontal(e,0,s,a):CanvasEx.drawSolidLine(e,0,s,a,s)),this.data.drawCenter&&(e.beginPath(),e.arc(r,s,3,0,2*Math.PI,!0),e.fillStyle=this.data.color,e.fill())))},n.prototype.hitTest=function(e){return this.data.mouseClickHandler?new o(o.CUSTOM,{mouseClickHandler:this.data.mouseClickHandler}):null},t.PaneRendererCrossHair=TradingView.PaneRendererCrossHair=n},function(e,t,i){"use strict";function n(e){this._data=e}n.prototype._drawShackle=function(e){var t=this._data.width-3,i=t/2,n=this._data.height-this._data.bodyHeight;e.moveTo(1.5,i),e.arc(this._data.width/2,i,i,Math.PI,2*Math.PI),n>i&&(e.moveTo(1.5,i),e.lineTo(1.5,n),e.moveTo(this._data.width-1.5,i),e.lineTo(this._data.width-1.5,n))},n.prototype.draw=function(e){var t,i,n,o;e.translate(this._data.x-this._data.width/2,this._data.y-this._data.height/2),t="rgba(153,153,153,.3)",i="rgba(153,153,153,.7)",n="#777",o="rgba(255,255,255,.7)",e.strokeStyle=t,e.lineWidth=2,e.beginPath(),this._drawShackle(e),e.stroke(),e.closePath(),e.strokeStyle=i,e.lineWidth=1,e.beginPath(),e.rect(0,this._data.height-this._data.bodyHeight+.5,this._data.width,this._data.bodyHeight),e.closePath(),e.stroke(),e.translate(0,-1),e.strokeStyle=n,e.beginPath(),this._drawShackle(e),e.stroke(),e.closePath(),e.fillStyle=o,e.beginPath(),e.rect(1,this._data.height-this._data.bodyHeight+1.5,this._data.width-2,this._data.bodyHeight-2),e.fill(),e.beginPath(),e.rect(.5,this._data.height-this._data.bodyHeight+1,this._data.width-1,this._data.bodyHeight-1),e.stroke(),e.closePath(),e.fillStyle=n,e.fillRect(this._data.width/2-.5,this._data.height-this._data.bodyHeight/2,1,2)},t.PaneRendererCrossHairLock=TradingView.PaneRendererCrossHairLock=n},function(e,t,i){"use strict";function n(e,t){o.call(this,t),this._series=e,this._series.onRestarted().subscribe(this,n.prototype.invalidate),this._series.dataEvents().symbolResolved().subscribe(this,n.prototype.invalidate),this._series.dataEvents().completed().subscribe(this,n.prototype.invalidate),this._series.onBoxSizeChanged().subscribe(this,n.prototype.invalidate)}var o=i(267),r=i(278).getTranslatedSymbolDescription,s=i(605),a=s.generateTitleForGui,l=s.generateSplitTitleForGui;inherit(n,o),n.prototype.invalidate=function(){delete this._text,this.update()},n.prototype.getSeriesPrecision=function(){var e=4;return this._series._symbolInfo&&this._series._symbolInfo.pricescale&&(e=Math.round(Math.log(this._series._symbolInfo.pricescale)/Math.log(10))),e},n.prototype.round=function(e){
var t=this.getSeriesPrecision(),i=Math.round(e*Math.pow(10,t))/Math.pow(10,t);return i||""},n.prototype.update=function(){"_text"in this||(this._bold=!1,this._size=this._props.mainSeriesProperties.statusViewStyle.fontSize.value()+"px",this._text=a(this._getTitleGenerationOptions()))},n.prototype.getSplitTitle=function(){return l(this._getTitleGenerationOptions())},n.prototype._getTitleGenerationOptions=function(){var e=this._series.symbolInfo()||{};return{description:this._props.mainSeriesProperties.statusViewStyle.showSymbolAsDescription.value()?e.name:r({pro_name:e.pro_name,description:e.description,local_description:e.local_description,language:e.language}),exchange:this._props.mainSeriesProperties.statusViewStyle.showExchange.value()?e.exchange:null,symbol:this._series.symbol(),interval:this._props.mainSeriesProperties.statusViewStyle.showInterval.value()?this._series.interval():null,style:this._series._properties.style.value(),inputs:this._series.getInputsProperties().state(),boxSize:this._series.data().boxSize,reversalAmount:this._series.data().reversalAmount,precision:this.getSeriesPrecision()}},e.exports=n},function(e,t,i){"use strict";function n(e){var t,i,n=e||{},o="QUANDL"===n.exchange,r={symbolDescription:"",interval:"",exchange:"",chartStyle:"",extended:""};switch(n.description&&o?2===n.description.split("/").length?r.symbolDescription=n.description.split("/")[1]:(t=n.description.split("'").filter(function(e){return e.length}),t.forEach(function(e){e=e&&("/"===e[0]||/\d+\/\(?/.test(e))?[e]:e.split("/").filter(function(e){return e.length}),r.symbolDescription+=e[2===e.length?1:0]})):n.description?r.symbolDescription=n.description:r.symbolDescription=n.symbol,n.interval&&(r.interval=a(n.interval)),o&&n.description&&(i=/[\w_]+\/[\w_]+/.exec(n.description),i&&i[0]?r.provider=i[0].split("/")[0]:r.provider=n.description.split("/")[0]),n.exchange&&(r.exchange=n.exchange),n.style){case l.STYLE_HEIKEN_ASHI:r.chartStyle=$.t("Heikin Ashi")}return n.extended&&(r.extended=window.t("ext",{context:"shorthand_for_extended_session"})),r}function o(e){var t=n(e),i=t.symbolDescription+(t.interval?", "+t.interval:"")+s(t);return i=i.replace(/\'/g,"")}function r(e){var t,i=n(e),o=s(i),r=i.symbolDescription.replace(/\'/g,"");return o=o.replace(/\'/g,""),t=i.interval?", "+i.interval:"",[r,t,o]}function s(e){return(e.provider?", "+e.provider:"")+(e.exchange?", "+e.exchange:"")+(e.chartStyle?", "+e.chartStyle:"")+(e.extended?", "+e.extended:"")}var a=i(123).translatedIntervalString,l=i(40);e.exports={generateSplitTitleForGui:r,generateTitleForGui:o}},function(e,t,i){"use strict";var n,o,r,s,a,l;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"ProjectionSeriesPriceAxisView",function(){return l}),n=i(1),o=i(7),i.n(o),r=i(17),s=i(279),a=i(40),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.c(t,e),t.prototype.lastPrice=function(){return this._getSource().data().lastProjectionPrice},t.prototype._updateRendererData=function(e){var t,i,n,s,l,c,h,u,d,p,_,f,m,y,g,v,S,b,w,P,T;e.visible=!1,
t=this._getData().model,t.properties().scalesProperties.showSeriesLastValue.value()&&(i=this._getSource(),n=i.priceScale(),s=t.timeScale(),l=this.lastPrice(),s.isEmpty()||n.isEmpty()||void 0===l||null!==(c=s.visibleBars())&&(h=c.firstBar(),u=c.lastBar(),d=i.data(),null!==(p=d.search(u,r.PlotRowSearchMode.NearestLeft))&&void 0!==(_=i.nearestIndex(h,r.PlotRowSearchMode.NearestRight))&&(f=Object(o.ensureNotNull)(d.valueAt(_))[TradingView.CLOSE_PLOT],m=e.background,y="",g=!1,v=i.properties(),S=v.style.value()===a.STYLE_HEIKEN_ASHI,S&&v.haStyle.showRealLastPrice.value()?(this._isCountdownEnabled()&&v.showCountdown.value()&&(y=this._countdownText()),b=i.lastValueData(TradingView.CLOSE_PLOT,!0),b.noData||b.color===e.background||(m=b.color),w=i.lastValueData(TradingView.CLOSE_PLOT,!1),b.noData||w.noData||(g=b.index===w.index)):(P=i.barColorer(),T=P.barStyle(p.index,!0),m=T.barColor,g=!0),e.background=m,e.secondLine=y,e.visible=g,e.color=this.generateTextColor(m),e.coordinate=n.priceToCoordinate(l,f),e.text=n.formatPrice(l,f))))},t}(s.SeriesPriceAxisView)},function(e,t,i){"use strict";var n,o,r,s,a,l;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"SeriesLegendView",function(){return l}),n=i(1),o=i(280),r=i(42),s=!0,a={open:window.t("O",{context:"in_legend"}),high:window.t("H",{context:"in_legend"}),low:window.t("L",{context:"in_legend"}),close:window.t("C",{context:"in_legend"}),hl2:window.t("HL2",{context:"in_legend"}),hlc3:window.t("HLC3",{context:"in_legend"}),ohlc4:window.t("OHLC4",{context:"in_legend"})},l=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n._showBarChange=i.properties().paneProperties.legendProperties.showBarChange,n._showOnlyPriceSource=i.properties().paneProperties.legendProperties.showOnlyPriceSource,n._showSeriesOHLC=i.properties().paneProperties.legendProperties.showSeriesOHLC,n._seriesStyle=t.properties().style,n._items[0].setTitle(a.open),n._items[1].setTitle(a.high),n._items[2].setTitle(a.low),n._items[3].setTitle(a.close),n._items[5].setTitle(""),n._showBarChange.subscribe(n,n.update),n._showSeriesOHLC.subscribe(n,n.update),n._items[4].setTitle(a[t.priceSource()]),n}return n.c(t,e),t.prototype.isValuesVisible=function(){return this._showSeriesOHLC.value()||this._showBarChange.value()},t.prototype.additional=function(){return null},t.prototype.destroy=function(){this._showBarChange.unsubscribeAll(this),this._showSeriesOHLC.unsubscribeAll(this)},t.prototype._updateImpl=function(){var t,i,n,o;e.prototype._updateImpl.call(this),t=s&&this._showOnlyPriceSourceValue(),i=this._showSeriesOHLC.value(),n=i&&!t,o=i&&t,this._items[0].setVisible(n),this._items[1].setVisible(n),this._items[2].setVisible(n),this._items[3].setVisible(n),this._items[4].setVisible(o),this._items[5].setVisible(this._showBarChange.value()),this._items[4].setTitle(a[this._series.priceSource()])},t.prototype._showOnlyPriceSourceValue=function(){return this._showOnlyPriceSource.value()&&Object(r.isPriceSourceStyle)(this._seriesStyle.value())},t}(o.SeriesDataWindowView)},function(e,t,i){"use strict";function n(e){
var t,i;if(0===e.length)return!1;if(-1===(t=e.findIndex(function(e){return Object(l.coordinateIsValid)(e.y)})))return!1;for(i=e.length-1;i>t&&!Object(l.coordinateIsValid)(e[i].y);)i--;return!(t>=i)}function o(e,t){var i,n,o,a,c,h=[],u=[],d=null;for(i=0;i<e.length;i++){if(n=e[i],o=e[i+1]||{},Object(l.coordinateIsValid)(n.y))n.y<=t&&h.push(n),n.y>=t&&u.push(n),d=n;else{if(null===d)continue;n=d}Object(l.coordinateIsValid)(o.y)&&((n.y>t&&o.y<t||n.y<t&&o.y>t)&&(Math.abs(n.x-o.x)<1?(a=new r.Point(n.x,t),h.push(a),u.push(a)):null!==(c=Object(s.intersectLineSegments)(n,o,new r.Point(n.x,t),new r.Point(o.x,t)))&&(a=n.add(o.subtract(n).scaled(c)),h.push(a),u.push(a))))}return{topItems:h,bottomItems:u}}var r,s,a,l,c,h,u;Object.defineProperty(t,"__esModule",{value:!0}),t.itemsRangeIsValid=n,t.splitItems=o,i.d(t,"PaneRendererBaseline",function(){return u}),r=i(6),i.n(r),s=i(129),i.n(s),a=i(30),i.n(a),l=i(27),c=i(78),h=i(9),u=function(){function e(){this._data=null}return e.prototype.setData=function(e){this._data=e},e.prototype.draw=function(e){var t,i,r,s,a,l,c,h,u,d,p,_,f,m,y;null!==this._data&&(t=this._data,i=t.items,r=t.baseLevelCoordinate,s=t.bottom,a=t.bottomFillColor1,l=t.bottomFillColor2,c=t.topFillColor1,h=t.topFillColor2,u=t.topLineColor,d=t.bottomLineColor,p=t.topLineWidth,_=t.bottomLineWidth,n(i)&&(f=o(i,r),m=f.topItems,y=f.bottomItems,e.lineCap="round",e.lineJoin="round",e.translate(.5,.5),0!==m.length&&(e.beginPath(),e.moveTo(m[0].x,r),this._makeLine(e,m,!0,0),e.closePath(),e.fillStyle=this._makeLinearGradient(e,c,h,r-s,r),e.fill(),e.beginPath(),this._makeLine(e,m,!1,0),e.lineWidth=p,e.strokeStyle=u,e.stroke()),0!==y.length&&(e.beginPath(),e.moveTo(y[0].x,r),this._makeLine(e,y,!0,1),e.closePath(),e.fillStyle=this._makeLinearGradient(e,a,l,r,r+s),e.fill(),e.beginPath(),this._makeLine(e,y,!1,1),e.lineWidth=_,e.strokeStyle=d,e.stroke())))},e.prototype.hitTest=function(e){var t,i,n,o,s,u,d,p,_,f,m;if(null===this._data)return null;for(t=this._data,i=t.items,n=t.topLineWidth,o=t.bottomLineWidth,s=Object(l.selectionTolerance)((n+o)/2),u=Object(c.lowerbound)(i,e,function(e,t){return e.x<=t.x}),d=Math.max(1,u-1),p=Math.min(i.length-1,u+1),_=d;_<=p;++_)if(f=i[_-1],m=i[_],Object(a.distanceToSegment)(new r.Point(f.x,f.y),new r.Point(m.x,m.y),new r.Point(e.x,e.y)).distance<=s)return new h.HitTestResult(h.HitTestResult.REGULAR);return null},e.prototype._makeLine=function(e,t,i,n){var o,r,s,a,c,h,u,d,p,_;if(null!==this._data&&-1!==(o=t.findIndex(function(e){return Object(l.coordinateIsValid)(e.y)})))for(r=this._data,s=r.barSpacing,a=r.baseLevelCoordinate,c=.25*s,u=t.length,d=o;d<u;d++)if(p=t[d],_=t[d+1]||{},Object(l.coordinateIsValid)(p.y)){if(0===n){if(h&&h.y>=a&&p.y>=a){e.moveTo(p.x,p.y);continue}}else if(h&&h.y<=a&&p.y<=a){e.moveTo(p.x,p.y);continue}if(h&&Object(l.coordinateIsValid)(h.y))e.lineTo(p.x,p.y),i&&!Object(l.coordinateIsValid)(_.y)&&e.lineTo(p.x,a);else if(_&&Object(l.coordinateIsValid)(_.y))i?(d!==o&&e.lineTo(p.x,a),e.lineTo(p.x,p.y)):e.moveTo(p.x,p.y);else if(i){if(0===d)continue;d!==o&&e.lineTo(p.x-c,a),
e.lineTo(p.x-c,p.y),e.lineTo(p.x+c,p.y),e.lineTo(p.x+c,a)}else e.moveTo(p.x-c,p.y),e.lineTo(p.x+c,p.y);h=p}},e.prototype._makeLinearGradient=function(e,t,i,n,o){var r=e.createLinearGradient(0,n,0,o);return r.addColorStop(0,t),r.addColorStop(1,i),r},e}()},function(e,t,i){"use strict";(function(t){var i=[{d:"E-Mini S&P 500",t:"ES"},{d:"E-Mini Nasdaq 100",t:"NQ"},{d:"Gold",t:"GC"},{d:"Silver",t:"SI"},{d:"Crude Oil WTI",t:"CL"},{d:"Natural Gas",t:"NG"},{d:"Australian Dollar",t:"6A"},{d:"Australian Dollar (Floor)",t:"AD"},{d:"Euro FX",t:"6E"},{d:"Euro FX (Floor)",t:"EC"},{d:"Corn",t:"ZC"},{d:"Corn (Floor)",t:"C"},{d:"Eurodollar",t:"GE"},{d:"Eurodollar (Floor)",t:"ED"}],n=function(){function e(e,t){var i=function(){};return i.prototype=t.prototype,e.prototype=new i,e}function n(e){return e.replace(/[\^\$\(\)\[\]\{\}\*\+\?\|\\]/g,"\\$&")}function o(){}function r(e){this.value=e}function s(){}function a(){}function l(){}function c(){}function h(){}function u(){}function d(){}function p(){}function _(e){this.value=e}function f(e){this.value=e}function m(e){this.value=e}function y(){_.apply(this,arguments)}function g(){f.apply(this,arguments)}function v(e,t){var i,n,o,s,a,l,c,h,u=[];e:for(;i=H.exec(e);){for(n=j.length;n--;)if(i[n+1]){j[n].ctor&&(o=new j[n].ctor(i[n+1]),o._offset=i.index,u.push(o));continue e}s=new m(i[0]),s._offset=i.index,u.push(s)}if(t&&t.recover)for(n=u.length;n--;)l=u[n],l instanceof f||l instanceof _?(void 0!==a&&(c=new _(""),h=u.splice(n,a-n+1,c),c.value=h.map(function(e){return e.value}).join("")),a=n):l instanceof r||(a=void 0);return u}function S(e){var i,n,o,c,h,u,d,p,y,g;if(t.enabled("charting_library_base"))return{currentState:"var"};for(i="init",n="var",o="operator",c=i,h={warnings:[],errors:[],isEmpty:!0},u=[],d=0;d<e.length;d++)if(!((p=e[d])instanceof r))if(delete h.isEmpty,p.isIncomplete&&(y={status:"incomplete",reason:"incomplete_token",offset:p._offset,token:p},p.incompleteSuggest&&(y.recover={append:p.incompleteSuggest()}),h.warnings.push(y),d!==e.length-1))y.status="error";else if(p instanceof _||p instanceof f){if(c===n){h.errors.push({status:"error",reason:"unexpected_token",offset:p._offset,token:p});continue}c=n}else if(p instanceof l){if(c!==n){h.errors.push({status:"error",reason:"unexpected_token",offset:p._offset,token:p});continue}c=o}else if(p instanceof s){if(c===n){h.errors.push({status:"error",reason:"unexpected_token",offset:p._offset,token:p});continue}u.push(p),c=i}else if(p instanceof a){if(c!==n){h.errors.push({status:"error",reason:"unexpected_token",offset:p._offset,token:p});continue}g=u.pop(),g||h.errors.push({status:"error",reason:"unbalanced_brace",offset:p._offset,token:p,recover:{prepend:new s}}),c=n}else p instanceof m&&h.errors.push({status:"error",reason:"unparsed_entity",offset:p._offset,token:p});for(h.braceBalance=u.length,c!==n&&h.warnings.push({status:"incomplete"}),g=null;u.length;)p=u.pop(),y={status:"incomplete",reason:"unbalanced_brace",offset:p._offset,token:p},c===n&&(y.recover={append:new a}),h.warnings.push(y);return h.currentState=c,
0===h.warnings.length&&delete h.warnings,0===h.errors.length&&delete h.errors,h}function b(e){var t,i=[];for(t=0;t<e.length;t++)e[t]instanceof r||i.push(e[t]);return i}function w(e){var t,i,n,o,r,c,h;for(e=b(e),t=[],i=[],o=0;o<e.length;o++)r=e[o],r instanceof l?i.length&&i[i.length-1].minPrecedence>r.precedence&&(i[i.length-1].minPrecedence=r.precedence):r instanceof s?i.push(n={minPrecedence:1/0,openBraceIndex:o}):r instanceof a&&(n=i.pop(),c=e[n.openBraceIndex-1],(h=e[o+1])instanceof l&&!(h.precedence<=n.minPrecedence)||!(!(c instanceof l)||c.precedence<n.minPrecedence||c.precedence===n.minPrecedence&&c.commutative)||(t.unshift(n.openBraceIndex),t.push(o),i.length&&i[i.length-1].minPrecedence>n.minPrecedence&&(i[i.length-1].minPrecedence=n.minPrecedence)));for(o=t.length;o--;)e.splice(t[o],1);return e}function P(e){for(var t=0;t<e.length;t++)e[t].parse&&e[t].parse();return e}function T(e){var t=x(e);return w(t?t:[new f("1"),new d,new s].concat(e).concat(new a))}function x(e){var t,i,n,o=0,c=1,h=2,u=3,p=o,_=0;for(i=0;i<e.length;i++)if(!((n=e[i])instanceof r))switch(p){case o:if(!(n instanceof f&&1==+n.value))return!1;p=c;break;case c:if(!(p===c&&n instanceof d))return!1;p=h,t=i+1;break;case h:if(n instanceof s)p=u,_=1;else if(n instanceof l)return!1;break;case u:n instanceof s?_++:n instanceof a&&--_<=0&&(p=h)}return e.slice(t)}function C(e){return new _(e).ticker()}function L(e){if("string"!=typeof e)throw new TypeError("expression must be a string");return e=v(e),e.filter(function(e){return e instanceof _}).map(function(e){return e.exchange()}).filter(function(e){return e})}function I(e){return e=L(e),1!==e.length?null:e[0]}function A(e,t){return e=L(e),e.some(function(e){return!!~t.indexOf((e||"").toUpperCase())})}function k(e){return A(e,["BATS"])}function E(e){return(e=I(e))&&-1!==e.toUpperCase().indexOf("_EOD")}function M(e){return A(e,["CHXEUR"])}function V(e){return A(e,["CHXJPY"])}function D(e){return A(e,pro.getProductsByType(pro.PRODUCT_TYPES.exchange).map(function(e){return e.exchange.toUpperCase()+"_DLY"}))}function O(e,t){return!!(e=I(e))&&e.substr(0,t.length)===t}function R(e){if("string"!=typeof e)throw new TypeError("expression must be a string");var t=w(b(v(e)));return t.forEach(function(e){e instanceof _&&e.exchange(null)}),N(t)}function B(e){if("string"!=typeof e)throw new TypeError("expression must be a string");return N(w(b(v(e))))}function N(e){return e.join("")}var F,W,H,j=[{pattern:"(",ctor:s},{pattern:")",ctor:a},{pattern:"+",ctor:c},{pattern:"-",ctor:h},{pattern:"*",ctor:u},{pattern:"/",ctor:d},{pattern:"^",ctor:p},{pattern:/\d+(?:\.\d*|(?![a-zA-Z0-9_!:\.&]))|\.\d+/,ctor:f},{pattern:/\./,ctor:g},{pattern:t.enabled("charting_library_base")?/[a-zA-Z0-9_\u0370-\u1FFF_\u2E80-\uFFFF^][a-zA-Z0-9_\u0020\u0370-\u1FFF_\u2E80-\uFFFF_!:\.&]*|'.+?'/:/[a-zA-Z0-9_\u0370-\u1FFF_\u2E80-\uFFFF][a-zA-Z0-9_\u0020\u0370-\u1FFF_\u2E80-\uFFFF_!|:\.&]*|'.+?'/,ctor:_},{pattern:/'[^']*/,ctor:y},{pattern:/[\0-\x20\s]+/,ctor:r}];return o.prototype.toString=function(){return this.value},e(r,o),e(s,o),
s.prototype.value="(",e(a,o),a.prototype.value=")",e(l,o),e(c,l),c.prototype.value="+",c.prototype.precedence=0,c.prototype.commutative=!0,e(h,l),h.prototype.value="-",h.prototype.precedence=0,h.prototype.commutative=!1,e(u,l),u.prototype.value="*",u.prototype.precedence=1,u.prototype.commutative=!0,e(d,l),d.prototype.value="/",d.prototype.precedence=1,d.prototype.commutative=!1,e(p,l),p.prototype.value="^",p.prototype.precedence=2,p.prototype.commutative=!1,F=/^'?(?:([A-Z0-9_]+):)?(.*?)'?$/i,W=/[\+\-\/\*]/,e(_,o),_.prototype.toString=function(){if(this.hasOwnProperty("_ticker")){var e=W.test(this._ticker)?"'":"";return e+(this._exchange?this._exchange+":":"")+this._ticker+e}return this.value},_.prototype.parse=function(){var e=F.exec(this.value);e[1]&&(this._exchange=e[1]),this._ticker=e[2]},_.prototype.parseAsFutures=function(){var e,t,n;for(this.hasOwnProperty("_ticker")||this.parse(),e=function(e){return i.some(function(t){return t.t===e})},t=2;t>=1;--t)if(n=this._ticker.slice(0,t),e(n)){this._root=n,this._contract=this._ticker.slice(t);break}},_.prototype.exchange=function(e){if(this.hasOwnProperty("_ticker")||this.parse(),!(arguments.length>0))return this._exchange;null===e||void 0===e?delete this._exchange:this._exchange=e+""},_.prototype.ticker=function(e){if(this.hasOwnProperty("_ticker")||this.parse(),!(arguments.length>0))return this._ticker;null===e||void 0===e?delete this._ticker:this._ticker=e+"",delete this._root,delete this._contract},_.prototype.root=function(e){if(this.hasOwnProperty("_root")||this.parseAsFutures(),!(arguments.length>0))return this._root;null===e||void 0===e?delete this._root:(this._root=e+"",this._root&&(this._ticker=this._root+(this._contract||"")))},_.prototype.contract=function(e){if(this.hasOwnProperty("_contract")||this.parseAsFutures(),!(arguments.length>0))return this._root;null===e||void 0===e?delete this._contract:(this._contract=e+"",this._root&&(this._ticker=this._root+this._contract))},e(f,o),f.prototype.toString=function(){return this.hasOwnProperty("_normalizedValue")?this._normalizedValue:this.value},f.prototype.parse=function(){this._normalizedValue=this.value.replace(/^0+|\.0*$/g,"").replace(/(\.\d*?)0+$/,"$1").replace(/^(\.|$)/,"0$1")},m.prototype.toString=function(){return this.value},e(y,_),y.prototype.isIncomplete=!0,y.prototype.incompleteSuggest=function(){if("'"!==this.value)return"'"},e(g,f),g.prototype.isIncomplete=!0,H=RegExp(j.map(function(e){return"("+("string"==typeof e.pattern?n(e.pattern):e.pattern.source)+")"}).concat(".").join("|"),"g"),{tokenize:v,validate:S,factorOutBraces:w,normalizeTokens:P,flip:T,hasBatsSymbols:k,hasEodSymbols:E,hasChxeurSymbols:M,hasChxjpySymbols:V,hasFreeDelaySymbols:D,getExchange:I,isExchange:O,SymbolToken:_,IncompleteSymbolToken:y,NumberToken:f,BinaryOperatorToken:l,OpenBraceToken:s,CloseBraceToken:a,ticker:C,shortName:R,normalize:B}}();e.exports=n}).call(t,i(5))},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"SyncModel",function(){return r}),n=i(37),i.n(n),o=0,r=function(){
function e(e,t){this._session=new n.Session,this._extrapolatedData=[],this._modelId=o++,this._builderCache=null,this._resolution=t,this._symbolInfo=e,this._valid=!!e.timezone&&!!e.session,this._session.init(e.timezone,e.session)}return e.prototype.getSymbolInfo=function(){return this._symbolInfo},e.prototype.getSession=function(){return this._session},e.prototype.getResolution=function(){return this._resolution},e.prototype.uniqueId=function(){return this._modelId},e.prototype.distance=function(e,t){var i,o,r,s,a;return this.isValid()?(i=this._extrapolatedData.length,o=0!==i?this._extrapolatedData[0]:null,r=null!==o?this._extrapolatedData[i-1]:null,1e3*e!==o&&(this._extrapolatedData=[1e3*e],o=null,r=null),(null===o||null!==r&&1e3*t>r)&&(s=Object(n.extrapolateBarsFrontToTime)(this._barBuilder(),r||1e3*e,1e3*t,2e3),this._extrapolatedData=this._extrapolatedData.concat(s),i=this._extrapolatedData.length),(r=this._extrapolatedData[i-1])<1e3*t?{success:!1}:(a=this._extrapolatedData.indexOf(1e3*t),-1===a?{success:!1}:{success:!0,result:a})):{success:!1}},e.prototype.projectTime=function(e,t){var i,o,r,s;return this.isValid()?(i=this._extrapolatedData.length,o=i>0?this._extrapolatedData[0]:null,r=null!==o?this._extrapolatedData[i-1]:null,1e3*e!==o&&(this._extrapolatedData=[1e3*e],o=null,r=null),(null===o||t>=i)&&(s=Object(n.extrapolateBarsFrontByCount)(this._barBuilder(),r||1e3*e,t-i+1),this._extrapolatedData=this._extrapolatedData.concat(s)),i<t?e:this._extrapolatedData[t]/1e3):e},e.prototype.isValid=function(){return this._valid},e.prototype._barBuilder=function(){return null===this._builderCache&&(this._builderCache=Object(n.newBarBuilder)(this._resolution,this._session,this._session)),this._builderCache},e}()},function(e,t,i){"use strict";var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"SeriesHorizontalBaseLinePaneView",function(){return s}),n=i(1),o=i(6),i.n(o),r=i(178),s=function(e){function t(t){return e.call(this,t)||this}return n.c(t,e),t.prototype._updateImpl=function(){var e,t;this._lineRendererData.visible=!1,e=this._series.priceScale().mode(),(e.percentage||e.indexedTo100)&&null!=(t=this._series.firstValue())&&(this._lineRendererData.visible=!0,this._lineRendererData.points=[new o.Point(0,this._series.priceScale().priceToCoordinate(t,t))],this._lineRendererData.width=this._model.timeScale().width(),this._lineRendererData.height=this._series.priceScale().height(),this._lineRendererData.color=this._series.properties().baseLineColor.value())},t}(r.a)},function(e,t,i){"use strict";var n,o,r,s,a;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"SeriesPriceLinePaneView",function(){return a}),n=i(1),o=i(6),i.n(o),r=i(178),s=i(85),a=function(e){function t(t){var i=e.call(this,t)||this;return i._lineRendererData.linestyle=s.LINESTYLE_DOTTED,i}return n.c(t,e),t.prototype._updateImpl=function(){if(this._lineRendererData.visible=!1,this._series.properties().showPriceLine.value()){var e=this._series.lastValueData(void 0,!0);e.noData||(this._lineRendererData.visible=!0,
this._lineRendererData.points=[new o.Point(0,e.coordinate)],this._lineRendererData.color=this._series.priceLineColor(e.color),this._lineRendererData.width=this._model.timeScale().width(),this._lineRendererData.height=this._series.priceScale().height(),this._lineRendererData.linewidth=this._series.properties().priceLineWidth.value())}},t}(r.a)},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"SeriesDataEvents",function(){return r}),n=i(8),o=i.n(n),r=function(){function e(){this._completed=new o.a,this._error=new o.a,this._symbolError=new o.a,this._symbolResolved=new o.a,this._seriesError=new o.a,this._symbolNotPermitted=new o.a,this._symbolGroupNotPermitted=new o.a,this._extendedHoursNotPermitted=new o.a,this._chartTypeNotPermitted=new o.a,this._intradaySpreadNotPermitted=new o.a,this._intradayExchangeNotPermitted=new o.a,this._customIntervalNotPermitted=new o.a,this._tickMarksRangeChanged=new o.a,this._barReceived=new o.a,this._messageReceived=new o.a}return e.prototype.completed=function(){return this._completed},e.prototype.error=function(){return this._error},e.prototype.symbolError=function(){return this._symbolError},e.prototype.symbolResolved=function(){return this._symbolResolved},e.prototype.seriesError=function(){return this._seriesError},e.prototype.symbolNotPermitted=function(){return this._symbolNotPermitted},e.prototype.symbolGroupNotPermitted=function(){return this._symbolGroupNotPermitted},e.prototype.extendedHoursNotPermitted=function(){return this._extendedHoursNotPermitted},e.prototype.chartTypeNotPermitted=function(){return this._chartTypeNotPermitted},e.prototype.intradaySpreadNotPermitted=function(){return this._intradaySpreadNotPermitted},e.prototype.intradayExchangeNotPermitted=function(){return this._intradayExchangeNotPermitted},e.prototype.customIntervalNotPermitted=function(){return this._customIntervalNotPermitted},e.prototype.tickMarksRangeChanged=function(){return this._tickMarksRangeChanged},e.prototype.barReceived=function(){return this._barReceived},e.prototype.messageReceived=function(){return this._messageReceived},e.prototype.fireCompleted=function(){this._completed.fire()},e.prototype.fireError=function(){this._error.fire()},e.prototype.fireSymbolError=function(e){this._symbolError.fire(e),this.fireError()},e.prototype.fireSymbolResolved=function(e){this._symbolResolved.fire(e)},e.prototype.fireSeriesError=function(e){this._seriesError.fire(e),this.fireError()},e.prototype.fireSymbolNotPermitted=function(e){this._symbolNotPermitted.fire(e),this.fireError()},e.prototype.fireSymbolGroupNotPermitted=function(e){this._symbolGroupNotPermitted.fire(e),this.fireError()},e.prototype.fireExtendedHoursNotPermitted=function(){this._extendedHoursNotPermitted.fire(),this.fireError()},e.prototype.fireChartTypeNotPermitted=function(e){this._chartTypeNotPermitted.fire(e),this.fireError()},e.prototype.fireIntradaySpreadNotPermitted=function(){this._intradaySpreadNotPermitted.fire(),this.fireError()},
e.prototype.fireIntradayExchangeNotPermitted=function(){this._intradayExchangeNotPermitted.fire(),this.fireError()},e.prototype.fireCustomIntervalNotPermitted=function(){this._customIntervalNotPermitted.fire(),this.fireError()},e.prototype.fireTickMarksRangeChanged=function(e){this._tickMarksRangeChanged.fire(e)},e.prototype.fireBarReceived=function(e){this._barReceived.fire(e)},e.prototype.fireMessageReceived=function(e){this._messageReceived.fire(e)},e}()},function(e,t,i){"use strict";function n(e){function t(e,t){var i=e.font;return a.hasOwnProperty(i)||(a[i]={}),a[i].hasOwnProperty(t)||(a[i][t]=e.measureText(t).width),a[i][t]}function i(){var i=n.width(),a=n.height();return{draw:function(n){var c,h,u,d,p,_,f,m,y,g=e.symbolInfo();if(g){for(n.fillStyle=o.generateColor(l.color.value(),l.transparency.value()),c=g.name,/QUANDL/.test(g.exchange)&&(h=c.split(/\//),h.length&&(c=h[h.length-1])),u={description:g.description,pro_name:g.pro_name,short_name:g.name},d=[{text:c?c+", "+r(e.interval()):"",font:"96px Verdana, Arial, sans-serif",lineHeight:117,vertOffset:0},{text:s(u)||"",font:"48px Verdana, Arial, sans-serif",lineHeight:58,vertOffset:5}],p=0,_=0;_<d.length;_++)f=d[_],f.text&&(n.font=f.font,m=t(n,f.text),f.zoom=m>i?i/m:1,p+=f.lineHeight*f.zoom);for(y=Math.max((a-p)/2,0),_=0;_<d.length;_++)f=d[_],f.text&&(n.save(),n.translate(i/2,y),n.textBaseline="top",n.textAlign="center",n.font=f.font,n.scale(f.zoom,f.zoom),n.fillText(f.text,0,f.vertOffset),n.restore(),y+=f.lineHeight*f.zoom)}}}}var n=null,a={},l=e.model().properties().symbolWatermarkProperties,c={renderer:i,update:function(){}};this.paneViews=function(e){return e.containsMainSeries()?(n=e,[c]):[]}}var o=i(29),r=i(123).translatedIntervalString,s=i(278).getTranslatedSymbolDescription;t.Watermark=n},function(e,t,i){"use strict";function n(){this.visible=!0,this.horzLinesVisible=!0,this.horzLinesColor="white",this.horzLinesStyle="",this.vertLinesVisible=!0,this.vertLinesColor="white",this.vertLinesStyle=""}function o(e,t){this.source=e,this.pane=t,this._renderer=new r}function r(){this.data=null}n.prototype.paneViews=function(e){return[new o(this,e)]},o.prototype.update=function(){},o.prototype.renderer=function(){var e={};return this.pane.defaultPriceScale().isEmpty()||this.pane.timeScale().isEmpty()?null:(e.horzLinesVisible=!0,e.vertLinesVisible=!0,e.horzLinesColor=this.pane._model.properties().paneProperties.horzGridProperties.color.value(),e.vertLinesColor=this.pane._model.properties().paneProperties.vertGridProperties.color.value(),e.horzLineStyle=this.pane._model.properties().paneProperties.horzGridProperties.style.value(),e.vertLineStyle=this.pane._model.properties().paneProperties.vertGridProperties.style.value(),e.priceMarks=this.pane.defaultPriceScale().marks(),e.timeMarks=this.pane.timeScale().marks(),e.w=this.pane.width(),e.h=this.pane.height(),this._renderer.setData(e),this._renderer)},r.prototype.setData=function(e){this.data=e},r.prototype.draw=function(e){var t;if(null!==this.data){if(e.lineWidth=1,this.data.vertLinesVisible){
for(e.strokeStyle=this.data.vertLinesColor,CanvasEx.setLineStyle(e,this.data.vertLineStyle),e.beginPath(),t=0;t<this.data.timeMarks.length;t++)e.moveTo(this.data.timeMarks[t].coord+1,0),e.lineTo(this.data.timeMarks[t].coord+1,this.data.h);e.stroke()}if(this.data.horzLinesVisible){for(e.strokeStyle=this.data.horzLinesColor,CanvasEx.setLineStyle(e,this.data.horzLineStyle),e.beginPath(),t=0;t<this.data.priceMarks.length;t++)e.moveTo(0,this.data.priceMarks[t].coord),e.lineTo(this.data.w,this.data.priceMarks[t].coord);e.stroke()}}},t.Grid=n},function(e,t,i){"use strict";function n(e,t,i){this._magnetProperty=e,this._timeScale=t}var o=i(63).Series;n.prototype.align=function(e,t,i){var n,r,s,a,l,c,h,u,d,p,_=50,f=i.defaultPriceScale(),m=e;if(!this._magnetProperty.value())return m;for(n=f.dataSources(),r=null,s=0;s<n.length;s++)if(n[s]instanceof o){r=n[s];break}if(r&&(a=r.bars(),a.contains(t)&&(l=a.valueAt(t),c=[l[TradingView.OPEN_PLOT],l[TradingView.HIGH_PLOT],l[TradingView.LOW_PLOT],l[TradingView.CLOSE_PLOT]],f=r.priceScale(),!f.isEmpty()))){for(h=[],u=r.firstValue(),s=0;s<c.length;s++)h.push({y:f.priceToCoordinate(c[s],u),price:c[s]});d=f.priceToCoordinate(e,u),h.sort(function(e,t){return Math.abs(e.y-d)-Math.abs(t.y-d)}),p=h[0],Math.abs(p.y-d)<_&&(m=p.price)}return m},e.exports=n},function(e,t,i){"use strict";(function(e){function n(){return[$.t("Jan"),$.t("Feb"),$.t("Mar"),$.t("Apr"),$.t("May"),$.t("Jun"),$.t("Jul"),$.t("Aug"),$.t("Sep"),$.t("Oct"),$.t("Nov"),$.t("Dec")]}function o(t,i){this._options=Object.assign({},P,i),this._model=t,this._scalesProperties=t.properties().scalesProperties,this.m_width=0,this._baseIndex=null,this._defaultRightOffsetProperty=new f(w),this.m_rightOffset=w,this._defaultRightOffsetProperty.listeners().subscribe(this,function(e){this.setRightOffset(e.value())}),this.m_points=new u,this._barSpacingChanged=new e,this.m_barSpacing=b,this._options.preserveBarSpacing&&(this.m_barSpacing=this._scalesProperties.barSpacing.value()||b),this.m_scrollStartPoint=null,this.m_scaleStartPoint=null,this._commonTransitionStartState=null,this.m_tickmarks=new l,this._formattedBySpan={},this._onScroll=new e,this._visibleBars=null,this._visibleBarsInvalidated=!0,this._visibleBarsChanged=new e,this._leftEdgeIndex=null}var r=i(50).clamp,s=i(214).BarsRange,a=i(618),l=i(619),c=i(18),h=i(21).numberToStringWithLeadingZero,u=i(620).TimePoints,d=i(161),p=i(4).getLogger("Chart.TimeScale"),_=i(5),f=i(13),m=i(3).saveDefaultProperties,y=null,g=50,v=_.enabled("high_density_bars")?.025:.5,S=5,b=d.DEFAULT_BAR_SPACING,w=5,P={preserveBarSpacing:!1,lockVisibleTimeRangeOnResize:!1};o.prototype.tickMarks=function(){return this.m_tickmarks},o.prototype.reset=function(){this._visibleBarsInvalidated=!0,this.m_points=new u,this.m_scrollStartPoint=null,this.m_scaleStartPoint=null,this._clearCommonTransitionsStartState(),this.m_tickmarks.reset(),this._leftEdgeIndex=null},o.prototype.restoreDefault=function(){this._visibleBarsInvalidated=!0,this.setBarSpacing(b),this.resetRightOffset()},
o.prototype.restoreRightOffsetPropertyToDefault=function(){this._defaultRightOffsetProperty.setValue(w)},o.prototype.setLeftEdgeFix=function(e){var t,i;this._leftEdgeIndex=e,(t=this.visibleBars().firstBar()-e)<0&&(i=this.m_rightOffset-t-1,this.scrollToOffsetAnimated(i,500))},o.prototype.baseIndex=function(){return this._baseIndex||0},o.prototype.rightOffset=function(){return this.m_rightOffset},o.prototype.defaultRightOffsetProperty=function(){return this._defaultRightOffsetProperty},o.prototype.rightOffsetForTimePoint=function(e){var t=this.timeToCoordinate(e);return null===t?null:this._rightOffsetForCoordinate(t)},o.prototype._rightOffsetForCoordinate=function(e){return(this.m_width+1-e)/this.m_barSpacing},o.prototype.scrollToRealtime=function(e,t){var i,n,o,r,s=this._defaultRightOffsetProperty.value();if(s<0&&(s=w),e)return i=this,n=this.m_rightOffset,o=this.maxRightOffset(),o>0&&s>o&&(s=o),r=this._model,void $({offset:n}).animate({offset:s},{duration:1e3,easing:"easeInOutQuint",complete:t,step:function(e){i._visibleBarsInvalidated=!0,i.m_rightOffset=e,i._correctOffset(),r.recalculateAllPanes(),r.invalidate(new c(c.LIGHT_UPDATE)),r.recalcVisibleRangeStudy(r.dataSources())}});this._visibleBarsInvalidated=!0,this.m_rightOffset=s,this._correctOffset(),void 0!==t&&t()},o.prototype.points=function(){return this.m_points},o.prototype.width=function(){return this.m_width},o.prototype.setWidth=function(e){var t,i;!isFinite(e)||e<=0||this.m_width!==e&&(this._visibleBarsInvalidated=!0,this._options.lockVisibleTimeRangeOnResize&&this.m_width&&(t=this.m_barSpacing*e/this.m_width,this._tryToUpdateBarSpacing(this.m_barSpacing,t)),null!==this._leftEdgeIndex&&this.visibleBars().firstBar()<=this._leftEdgeIndex&&(i=this.m_width-e,this.m_rightOffset-=Math.round(i/this.m_barSpacing)+1),this.m_width=e,this._correctOffset())},o.prototype.barSpacing=function(){return this.m_barSpacing},o.prototype.setBarSpacing=function(e){if(void 0===e)return void p.logDebug("setBarSpacing: invalid argument");this._tryToUpdateBarSpacing(this.m_barSpacing,e)&&(this._correctOffset(),this._options.preserveBarSpacing&&(m(!0),this._scalesProperties.barSpacing.setValue(this.m_barSpacing),m(!1)))},o.prototype._tryToUpdateBarSpacing=function(e,t){return e!==t&&(this._visibleBarsInvalidated=!0,this.m_barSpacing=t,this._barSpacingChanged.fire(e,t),!0)},o.prototype.barSpacingChanged=function(){return this._barSpacingChanged},o.prototype.correctBarSpacing=function(){this.isEmpty()||this.points().size()<this.width()/this.barSpacing()&&(this.setRightOffset(w),this.setBarSpacing(Math.min(this.width()/(this.points().size()+this.rightOffset()),g)))},o.prototype.visibleBars=function(){return this._visibleBarsInvalidated&&(this._visibleBarsInvalidated=!1,this._updateVisibleBars()),this._visibleBars},o.prototype._updateVisibleBars=function(){var e,t,i,n,o;if(this.isEmpty())return void(null!==this._visibleBars&&(this._visibleBars=null,this._visibleBarsChanged.fire()));e=this.baseIndex(),t=Math.ceil(this.m_width/this.m_barSpacing)-1,i=Math.round(this.m_rightOffset+e),n=i-t,
o=this._visibleBars,this._visibleBars=new s(n,i),null!==o&&this._visibleBars.equals(o)||this._visibleBarsChanged.fire()},o.prototype.isEmpty=function(){return 0===this.m_width||0===this.m_points.size()},o.prototype.indexToCoordinate=function(e,t){var i,n,o;return this.isEmpty()?0:TradingView.isInteger(e)?(i=this.baseIndex(),n=i+this.m_rightOffset-e,o=this.m_width-(n+.5)*this.m_barSpacing,t?o:Math.round(o)):0},o.prototype.barIndexesToCoordinates=function(e){var t,i,n,o,r=this.baseIndex();for(t=0;t<e.length;t++)i=e[t].time,n=r+this.m_rightOffset-i,o=this.m_width-(n+.5)*this.m_barSpacing,e[t].time=Math.round(o),e[t].exactTime=o},o.prototype.indexesToCoordinates=function(e){var t,i,n,o=this.baseIndex(),r=o+this.m_rightOffset,s=this.m_width-r*this.m_barSpacing-.5*this.m_barSpacing;for(t=0;t<e.length;t++)i=e[t].x,n=s+i*this.m_barSpacing,e[t].x=Math.round(n)},o.prototype.coordinateToIndex=function(e){var t=this._rightOffsetForCoordinate(e),i=this.baseIndex(),n=i+this.m_rightOffset-t,o=Math.round(1e6*n)/1e6;return Math.ceil(o)},o.prototype.timeToCoordinate=function(e){function t(e){return e<=0||e>=l.m_width}var i,n,o,r=this.m_points.closestIndexLeft(e),s=this.m_points.valueAt(r),a=this.indexToCoordinate(r,!0),l=this;return t(a)?null:(i=this.barSpacing(),n=function(){var e=this.baseIndex();return this.m_points.valueAt(e)-this.m_points.valueAt(e-1)}.bind(this)(),o=Math.round(a+(e-s)/n*i)+1,t(o)?null:o)},o.prototype.alignCoordinate=function(e){if(this.isEmpty())return e;var t=this.coordinateToIndex(e);return this.indexToCoordinate(t)},o.prototype.timePointToIndex=function(e){return this.m_points.indexOf(e,!0)},o.prototype.indexToTimePoint=function(e){return this.m_points.valueAt(e)},o.prototype.indexToUserTime=function(e){return this.m_tickmarks.indexToTime(e)},o.prototype.marks=function(){var e,t,i,n,o,r,s,a,l,c,h,u;if(this.isEmpty())return null;for(e=this.m_barSpacing,t=this._scalesProperties.fontSize.value()||0,i=5*(t+4),n=Math.round(i/e),o=this.visibleBars(),r=Math.max(o.firstBar(),o.firstBar()-n),s=Math.max(o.lastBar(),o.lastBar()-n),a=this.m_tickmarks.build(e,i),l=[],c=0;c<a.length;++c)h=a[c],r<=h.index&&h.index<=s&&null!==(u=this.m_tickmarks.indexToTime(h.index))&&l.push({coord:this.indexToCoordinate(h.index),label:this.formatLabel(u,h.span),span:h.span,major:h.label>=d.DAY_SPAN?1:0});return l},o.prototype.state=function(e){var t={};return t.m_barSpacing=this.barSpacing(),t.m_rightOffset=e?this.m_rightOffset:this._defaultRightOffsetProperty.value(),e&&(t.points=this.m_points.state(),t.tickmarks=this.m_tickmarks.state(),t.width=this.m_width),t},o.prototype.restoreState=function(e,t){var i,n,o;return void 0===e.m_barSpacing?void p.logDebug("restoreState: invalid state"):void 0===e.m_rightOffset?void p.logDebug("restoreState: invalid state"):(i=e.m_barSpacing,n=e.m_rightOffset<0&&!t?w:e.m_rightOffset,o=n<0?w:Math.round(n),this._defaultRightOffsetProperty.setValue(o),this.m_rightOffset=n,t&&(this.m_points.restoreState(e.points),this.m_tickmarks.restoreState(e.tickmarks),e.width&&this.m_width>0&&(i*=this.m_width/e.width)),
this._tryToUpdateBarSpacing(this.m_barSpacing,i),void this._correctOffset())},o.prototype.setBaseIndex=function(e){if("number"!=typeof e)return void p.logDebug("setBaseIndex: invalid argument");this._visibleBarsInvalidated=!0,this._baseIndex=e,this._correctOffset()},o.prototype.setRightOffset=function(e){if(void 0===e)return void p.logDebug("setRightOffset: invalid argument");this._visibleBarsInvalidated=!0,this.m_rightOffset=e,this._correctOffset()},o.prototype.resetRightOffset=function(){this.setRightOffset(this._defaultRightOffsetProperty.value())},o.prototype._correctOffset=function(){var e,t=this.maxRightOffset();this.m_rightOffset>t&&(this.m_rightOffset=t,this._visibleBarsInvalidated=!0),null!==(e=this.minRightOffset())&&this.m_rightOffset<e&&(this.m_rightOffset=e,this._visibleBarsInvalidated=!0)},o.prototype.minRightOffset=function(){var e,t=this.m_points.firstIndex(),i=this._baseIndex;return null===t||null===i?null:null!==this._leftEdgeIndex?(e=this.m_width/this.m_barSpacing,this._leftEdgeIndex-i+e-1):t-i-1+S},o.prototype.maxRightOffset=function(){return this.m_width/this.m_barSpacing-S},o.prototype.startScale=function(e){this.m_scrollStartPoint&&this.endScroll(),null===this.m_scaleStartPoint&&null===this._commonTransitionStartState&&(this.isEmpty()||(this.m_scaleStartPoint=e,this._saveCommonTransitionsStartState()))},o.prototype._saveCommonTransitionsStartState=function(){this._commonTransitionStartState={barSpacing:this.barSpacing(),rightOffset:this.rightOffset()}},o.prototype._clearCommonTransitionsStartState=function(){this._commonTransitionStartState=null},o.prototype.scaleTo=function(e){var t,i;null!==this._commonTransitionStartState&&(t=r(this.m_width-e,0,this.m_width),i=r(this.m_width-this.m_scaleStartPoint,0,this.m_width),0!==t&&0!==i&&this.setBarSpacing(this.getValidBarSpacing(this._commonTransitionStartState.barSpacing*t/i)))},o.prototype.getValidBarSpacing=function(e){return void 0===e&&(e=this.barSpacing()),e<v?v:e>g?g:e},o.prototype.isValidBarSpacing=function(e){return e>=v&&e<=g},o.prototype.endScale=function(){null!==this.m_scaleStartPoint&&(this.m_scaleStartPoint=null,this._clearCommonTransitionsStartState())},o.prototype.startScroll=function(e){null===this.m_scrollStartPoint&&null===this._commonTransitionStartState&&(this.isEmpty()||(this.m_scrollStartPoint=e,this._saveCommonTransitionsStartState()))},o.prototype.scrollTo=function(e){if(this._visibleBarsInvalidated=!0,null!==this.m_scrollStartPoint){var t=(this.m_scrollStartPoint-e)/this.barSpacing();this.m_rightOffset=this._commonTransitionStartState.rightOffset+t,this._correctOffset(),this._onScroll.fire()}},o.prototype.scrollToOffsetAnimated=function(e,t){var i,n,o,r;if(!isFinite(e))throw new RangeError("offset is required and must be finite number");if(void 0===t&&(t=400),!isFinite(t)||t<=0)throw new RangeError("animationDuration (optional) must be finite positive number");i=this,n=this.m_rightOffset,o=+new Date,r=this._model,function s(){i._visibleBarsInvalidated=!0;var a=(new Date-o)/t;if(a>=1)return i.m_rightOffset=e,
i._correctOffset(),i._visibleBarsInvalidated=!0,r.recalculateAllPanes(),void r.invalidate(new c(c.LIGHT_UPDATE));i.m_rightOffset=n+(e-n)*a,i._correctOffset(),r.recalculateAllPanes(),setTimeout(s,20)}()},o.prototype.endScroll=function(){null!==this.m_scrollStartPoint&&(this.m_scrollStartPoint=null,this._clearCommonTransitionsStartState())},o.prototype.update=function(e,t,i,n){this._visibleBarsInvalidated=!0,i.length>0&&this.m_points.merge(e,t,i),this.m_tickmarks.merge(n),this._correctOffset()},o.prototype.addTail=function(e,t,i){var n,o,r;for(this.m_tickmarks.removeTail(t),n=e.params,o=this.m_tickmarks.maxIndex+(i?0:1),r=0;r<n.marks.length;r++)n.marks[r].index=o+r;this.m_tickmarks.addTail(n.marks),this.m_points.addTail(n.changes,i),this.m_rightOffset-=n.changes.length},o.prototype.formatLabel=function(e,t){if(this._formattedBySpan[t])return this._formattedBySpan[t].format(e.valueOf());var i=this;return this._formattedBySpan[t]=new a(function(e){return i.formatLabelImpl(new Date(e),t)}),this._formattedBySpan[t].format(e)},o.prototype.formatLabelImpl=function(e,t){if(!(e&&e instanceof Date))return"incorrect time";var i=this._model.mainSeries().isDWM();return t<d.MINUTE_SPAN&&!i?h(e.getUTCHours(),2)+":"+h(e.getUTCMinutes(),2)+":"+h(e.getUTCSeconds(),2):t<d.DAY_SPAN&&!i?h(e.getUTCHours(),2)+":"+h(e.getUTCMinutes(),2):t<d.WEEK_SPAN?e.getUTCDate():t<d.MONTH_SPAN?e.getUTCDate():t<d.YEAR_SPAN?(y||(y=n()),y[e.getUTCMonth()]):e.getUTCFullYear()},o.prototype.normalizeBarIndex=function(e){var t=0,i=0,n=this.baseIndex();return e<this.m_points.firstIndex()?(t=this.m_points.valueAt(this.m_points.firstIndex()),i=e-this.m_points.firstIndex()):e>n?(t=this.m_points.valueAt(n),i=e-n):(t=this.m_points.valueAt(e),i=0),{time_t:t,offset:i}},o.prototype.denormalizeTimePoint=function(e){var t=this.m_points.indexOf(e.time_t);if(null!==t)return t+e.offset},o.prototype.zoomToBarsRange=function(e,t){if(!(t<=e)){var i=this.baseIndex();this.m_rightOffset=t-i,this.setBarSpacing(this.width()/(t-e+1)),this._visibleBarsInvalidated=!0}},o.prototype.canZoomIn=function(){return this.m_barSpacing<g},o.prototype.canZoomOut=function(){return this.m_barSpacing>v},o.prototype.minBarSpacing=function(){return v},o.prototype.maxBarSpacing=function(){return g},o.prototype.onScroll=function(){return this._onScroll},o.prototype.preserveBarSpacing=function(){return this._options.preserveBarSpacing},o.prototype.visibleBarsChanged=function(){return this._visibleBarsChanged},t.TimeScale=o}).call(t,i(8))},function(e,t,i){"use strict";function n(e,t){this._formatter=e,this._maxSize=t||50,this._actualSize=0,this._cache={},this._usageTick=1,this._oldestTick=1,this._tick2Labels={}}n.prototype.format=function(e){var t,i;return this._cache[e]?this._cache[e].string:(this._actualSize===this._maxSize&&(t=this._tick2Labels[this._oldestTick],delete this._tick2Labels[this._oldestTick],delete this._cache[t],this._oldestTick++,this._actualSize--),i=this._formatter(e),this._cache[e]={string:i,tick:this._usageTick},this._tick2Labels[this._usageTick]=e,this._actualSize++,
this._usageTick++,i)},e.exports=n},function(e,t,i){"use strict";(function(t){function i(){this._marksByIndex={},this._marksBySpan=[],this.changed=new t}i.prototype.reset=function(){this._marksByIndex={},this._marksBySpan=[],delete this.minIndex,delete this.maxIndex,delete this._cache,this.changed.fire()},i.prototype.minIndex=void 0,i.prototype.maxIndex=void 0,i.prototype.merge=function(e){var t,i,n,o,r,s=this._marksBySpan,a={};for(t=0;t<e.length;t++){if(i=e[t],n=i.index,o=i.span,r=this._marksByIndex[i.index]){if(r.index===i.index&&r.span===i.span){r.time=i.time;continue}this._removeTickmark(r)}this._marksByIndex[n]=i,this.minIndex<=n||(this.minIndex=n),this.maxIndex>=n||(this.maxIndex=n),s[o]||(s[o]=[]),s[o].push(i),a[o]=!0}for(o=s.length;o--;)s[o]&&(s[o].length||delete s[o],a[o]&&s[o].sort(this._sortByIndexAsc));delete this._cache,this.changed.fire()},i.prototype._removeTickmark=function(e){var t,i,n=e.index;this._marksByIndex[n]===e&&(delete this._marksByIndex[n],n<=this.minIndex&&this.minIndex++,n>=this.maxIndex&&this.maxIndex--,this.maxIndex<this.minIndex&&(delete this.minIndex,delete this.maxIndex),t=this._marksBySpan[e.span],-1!==(i=t.indexOf(e))&&t.splice(i,1))},i.prototype._sortByIndexAsc=function(e,t){return e.index-t.index},i.prototype.removeTail=function(e){var t,i={};this.maxIndex=0;for(t in this._marksByIndex)this._marksByIndex[t].time<e&&(i[t]=this._marksByIndex[t],this.maxIndex=Math.max(this.maxIndex,t));this._marksByIndex=i},i.prototype.addTail=function(e){for(var t=0;t<e.length;t++)e[t].index=this.maxIndex+t+1;this.merge(e)},i.prototype.indexToTime=function(e){var t=this._marksByIndex[e];return t?new Date(1e3*t.time):null},i.prototype.density=function(){var e,t=this.maxIndex-this.minIndex;if(0!==t)return e=this._marksByIndex[this.maxIndex].time-this._marksByIndex[this.minIndex].time,1e3*e/t},i.prototype.estimateLeft=function(e){var t,i=this.density();if(i)return t=1e3*this._marksByIndex[this.minIndex].time-e,t/i},i.prototype.nearestIndex=function(e){for(var t,i=this.minIndex,n=this.maxIndex;n-i>2;){if(1e3*this._marksByIndex[i].time===e)return i;if(1e3*this._marksByIndex[n].time===e)return n;t=Math.round((i+n)/2),1e3*this._marksByIndex[t].time>e?n=t:i=t}return i},i.prototype.build=function(e,t){var i,n,o,r,s,a,l,c,h,u,d,p,_,f,m=Math.ceil(t/e);if(this._maxbar===m&&this._cache)return this._cache;for(this._maxbar=m,i=[],n=this._marksBySpan.length;n--;)if(this._marksBySpan[n]){for(o=i,i=[],r=o.length,s=0,a=this._marksBySpan[n],l=a.length,c=1/0,h=-1/0,u=0;u<l;u++){for(d=a[u],p=d.index;s<r;){if(_=o[s],!((f=_.index)<p)){c=f;break}s++,i.push(_),h=f,c=1/0}c-p>=m&&p-h>=m&&(i.push(d),h=p)}for(;s<r;s++)i.push(o[s])}return this._cache=i,this._cache},i.prototype.state=function(){var e,t=[];for(e=this._marksBySpan.length;e--;)this._marksBySpan[e]&&(t=t.concat(this._marksBySpan[e]));return t=t.map(function(e){return[e.span,e.time,e.index]}),{marks:t,version:2}},i.prototype.restoreState=function(e){if(this._marksByIndex={},this._marksBySpan=[],delete this.maxIndex,delete this.minIndex,
e&&e.marks&&e.marks.length)if(2===e.version){var t=e.marks.map(function(e){return{span:e[0],time:e[1],index:e[2]}});this.merge(t)}else this.merge(e.marks)},e.exports=i}).call(t,i(8))},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"TimePoints",function(){return r}),n=i(4),o=Object(n.getLogger)("Chart.TimePoints"),r=function(){function e(){this._zoffset=0,this._items=[]}return e.prototype.clear=function(){this._zoffset=0,this._items=[]},e.prototype.size=function(){return this._items.length},e.prototype.firstIndex=function(){return this._offsetToIndex(0)},e.prototype.lastIndex=function(){return this._offsetToIndex(this._items.length-1)},e.prototype.merge=function(e,t,i){var n,r,s,a,l,c,h,u;if(0===i.length)return o.logError("merge: 'values' does not contain any time points"),[];if(t>this._zoffset&&e+t>0)return o.logError("merge: when the first time point index is updated, we should fill the time points starting from the first one"),[];if(0===this._items.length)return this._items=i,this._zoffset=t,[{change:"rebuild",index:this._validOffsetToIndex(0)}];if((n=e+this._zoffset)<0){if(r=Math.abs(n),i.length<r)return o.logError("merge: 'values' does not contain enough time points to fill in the new items. 'index': "+e+", previous 'zoffset': "+this._zoffset+", new 'zoffset': "+t+", 'values.length': "+i.length),[];for(this._items=Array(r).concat(this._items),this._zoffset=t,s=0;s<i.length;++s)this._items[e+s+t]=i[s];return[{change:"rebuild",index:this._validOffsetToIndex(0)}]}for(a=[],l=n;l<this._items.length&&l-n<i.length;++l)this._items[l]=i[l-n],a.push({change:"update",index:this._validOffsetToIndex(l),value:i[l-n]});if((c=n+i.length)>this._items.length)for(r=c-this._items.length,h=l;h<l+r;++h)u=this._items.length,this._items.push(i[h-n]),a.push({change:"append",index:this._validOffsetToIndex(u),value:i[h-n]});return this._zoffset=t,a},e.prototype.addTail=function(e,t){for(var i=t?1:0;i<e.length;i++)this._items.push(e[i])},e.prototype.remove=function(e){var t,i,n,o=this._indexToOffset(e);if(null===o)return[];for(t=this._items.splice(o),i=[],n=0;n<t.length;n++)i.push({change:"remove",index:e+n,value:t[n]});return i},e.prototype.valueAt=function(e){var t=this._indexToOffset(e);return null!==t?this._items[t]:null},e.prototype.indexOf=function(e,t){if(this._items.length<1)return null;if(e>this._items[this._items.length-1])return t?this._validOffsetToIndex(this._items.length-1):null;for(var i=0;i<this._items.length;++i){if(e===this._items[i])return this._validOffsetToIndex(i);if(e<this._items[i])return t?this._validOffsetToIndex(i):null}return null},e.prototype.state=function(){return{items:this._items,zoffset:this._zoffset}},e.prototype.restoreState=function(e){null!==e&&(this._items=e.items,this._zoffset=e.zoffset)},e.prototype.roughTime=function(e,t){var i,n,o,r,s,a,l,c,h,u,d,p;return void 0===t&&(t=null),null!==(i=this.valueAt(e))?i:(n=this._items,!n.length||n.length<2?null:(o=0,r=n.length-1,s=this._validOffsetToIndex(o),a=this._validOffsetToIndex(r),l=n[o],c=n[r],h=(c-l)/(a-s),
e<s?(u=s-e,d=u*h,l-d):(p=500,e>a?(u=e-a)<p&&null!=t?t(c,u):(d=u*h,c+d):null)))},e.prototype.roughIndex=function(e,t){var i,n,o,r,s,a,l,c,h,u,d,p;return void 0===t&&(t=null),i=this._items,!i.length||i.length<2?null:(n=0,o=i.length-1,r=this._validOffsetToIndex(n),s=this._validOffsetToIndex(o),a=i[n],l=i[o],e>=a&&e<=l?this.closestIndexLeft(e):(c=(l-a)/(s-r),e<a?(h=a-e,u=Math.round(h/c),r-u):(d=500,e>l?(h=e-l,u=Math.trunc(h/c),u<d&&null!==t&&(p=t(l,e),p.success&&(u=p.result)),s+u):null)))},e.prototype.closestIndexLeft=function(e){var t,i,n,o,r,s,a=this._items;if(!a.length)return null;if(Number.isNaN(e))return null;if(t=a.length-1,i=a[t],e>=i)return this._validOffsetToIndex(t);if(n=0,o=a[n],e<o)return null;if(e===o)return this._validOffsetToIndex(n);for(;t>n+1;)if(r=n+t>>1,(s=a[r])>e)t=r;else{if(!(s<e))return s===e?this._validOffsetToIndex(r):null;n=r}return this._validOffsetToIndex(n)},e.prototype._validOffsetToIndex=function(e){return e-this._zoffset},e.prototype._offsetToIndex=function(e){return 0<=e&&e<this.size()?this._validOffsetToIndex(e):null},e.prototype._indexToOffset=function(e){var t=e+this._zoffset;return 0<=t&&t<this.size()?t:null},e}()},function(e,t,i){"use strict";function n(e,t){this.tooltips={},this.tooltipFactory=e,this.source=t}function o(e,t){this.renderer=e,this._tooltip=t,this.visible=!1}n.prototype.findOrCreateTooltip=function(e){var t=this.tooltips[e.id];return null==t&&(e.hovered||e.pinned)&&(t=this._createTooltip(),this.tooltips[e.id]=t),t},n.prototype.showPlate=function(e,t){var i=this.findOrCreateTooltip(e);null!=i&&(i._drawPlate(e,t),i.plateData=e)},n.prototype.draw=function(e,t){this.hoveredId=null;for(var i=0;i<e.length;i++)e[i].hovered&&(this.hoveredId=e[i].id);e.forEach(function(e){this.showPlate(e,t)}.bind(this))},n.prototype.endDraw=function(){var e,t,i=this;for(e in this.tooltips)this.tooltips.hasOwnProperty(e)&&(t=this.tooltips[e],t.toggleVisibility(),i.hoveredId&&t.plateData.id!==i.hoveredId&&!t.plateData.pinned&&(t.remove(),delete this.tooltips[e]))},n.prototype.removeAll=function(){var e,t;for(e in this.tooltips)this.tooltips.hasOwnProperty(e)&&(t=this.tooltips[e],t.remove());this.tooltips={}},n.prototype.removeTooltip=function(e){delete this.tooltips[e]},n.prototype._createTooltip=function(){return new o(this,this.tooltipFactory())},o.prototype._drawPlate=function(e,t){var i=this;this.visible=!0,this._tooltip.setSource(this.renderer.source),this._tooltip.showPlate(e,t),e.hovered||e.pinned||this._tooltip.hide(function(){i.renderer.removeTooltip(e.id)})},o.prototype.remove=function(){this._tooltip._removeLayout()},o.prototype.toggleVisibility=function(){this._tooltip._toggleLayout(this.visible),this.visible=!1},t.TooltipRenderer=n},function(e,t,i){"use strict";function n(e){var t,i;if(e&&e.__esModule)return e;if(t={},null!=e)for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t,i){var n,o=2*J,r=document.createElement("canvas")
;return r.width=t*o,r.height=i*o,r.style.width=t+"px",r.style.height=i+"px",n=r.getContext("2d"),n.setTransform(o,0,0,o,0,0),n.drawImage(e,0,0,t,i),r}function s(e,t){return function(){i.e(11).then(function(){X=i(811),e.call(t)}.bind(null,i)).catch(i.oe)}}function a(e){return!x||e>L}function l(e){return!T||e>C}var c,h,u,d,p,_,f,m,y,g,v,S,b,w,P,T,x,C,L,I,A,k,E,M,V,D,O,R,B,N,F,W,H,j,z,U,q,Y,G,K,Z,J,X,Q,ee;Object.defineProperty(t,"__esModule",{value:!0}),t.Branding=void 0,c=function(){function e(e,t){var i,n,o=[],r=!0,s=!1,a=void 0;try{for(i=e[Symbol.iterator]();!(r=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);r=!0);}catch(e){s=!0,a=e}finally{try{!r&&i.return&&i.return()}finally{if(s)throw a}}return o}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),h=function(){function e(e,t){var i,n;for(i=0;i<t.length;i++)n=t[i],n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),u=i(6),d=i(60),p=i(5),_=n(p),f=i(9),m=i(184),y=i(29),g=i(194),v=i(46),S=i(24),b=i(257).debounce,w=i(623),P=!1,T=_.enabled("adaptive_logo"),x=_.enabled("small_no_display"),P=_.enabled("38914"),C=500,L=480,I="TradingView",A="Ch{0}ar{1}t{2}by{3}{4}".format("",""," "," ",I),k="po{0}wer{1}ed{2}by{3}{4}".format("",""," "," ",I),E="by{3}{4}".format("",""," "," ",I),M=P?E:k,V="site_branding",D="widget_branding",O="widget_referral_branding",R="widget_custom_branding",B="widget_custom_no_powered_branding",N="fundamental_branding",F="fundamental_custom_branding",W="fundamental_custom_no_powered_branding",H="library_branding",j="library_custom_branding",z="library_custom_no_powered_branding",U=.2,q=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,Y=q&&navigator.userAgent.toLowerCase().indexOf("windows")>-1,G=navigator.userAgent.toLowerCase().indexOf("chrome")>-1&&-1===navigator.userAgent.toLowerCase().indexOf("edge"),K=function(){var e,t=window.navigator.userAgent,i=t.indexOf("MSIE ");return i>0?parseInt(t.substring(i+5,t.indexOf(".",i)),10):t.indexOf("Trident/")>0&&(e=t.indexOf("rv:"),parseInt(t.substring(e+3,t.indexOf(".",e)),10))}(),Z=window.urlParams||{},window.initData,J=window.hidpiCanvasRatio||1,X=null,Q=function(){function e(t){var i=t.layout,n=void 0===i?V:i,r=t.symbol,a=void 0===r?"":r,l=t.model,c=t.onReadyCallback;o(this,e),this._model=l,this._image=null,this._imageReady=!1,this._needDisplayImage=!1,this._imageWidth=22,this._imageHeight=13,this._layout=n,this._symbol=a,this.showAnimatedBranding=_.enabled("show_animated_logo"),this.show=!0,this.width=100,this.height=14,this._bottomShift=0,this._brandCircleSize=32,this._animatedWidth=this._brandCircleSize,this._animatedOpacity=0,this.width=this.showAnimatedBranding?this._brandCircleSize:100,this.height=14,this._fillColor=m.color.brandNew,this._colorOldBlue=m.color.brandDown,this._colorOldGray=m.color.black30,this._strokeColor=m.color.black255,
this._brandCircleShadowColor=m.color.black0,this._strokeWidth=4,this._fontSize=this.showAnimatedBranding?11:14,this._font='px "Trebuchet MS", Tahoma, Arial, sans-serif',this._txt="TradingView",this._onReadyCallback=c,this._upscaleRatio=G?1:2,this._verticalTextShift=q?this.showAnimatedBranding?2:4:0,this._strokeCanv=null,this._fillCanv=null,K&&(this._init=s(this._init,this)),this._init()}return h(e,[{key:"_init",value:function(){this._checkLayout(),this.show&&(this._updateStrokeColor(),this.showAnimatedBranding?(this._loadImage(w,"tvLogo"),this._createFillText()):this._loadImage(w,"tvLogo"),this._model.properties().paneProperties.background.subscribe(this,this._updateStrokeColor),this._model.onChartThemeLoaded().subscribe(this,this._updateStrokeColor))}},{key:"_updateStrokeColor",value:function(){var e=(0,y.getLuminance)(this._model.properties().paneProperties.background.value());this._strokeCanv=null,this._fillCanv=null,e>U?(this._brandCircleColor=m.color.black255,this._animatedColorBg=m.color.black255,this._brandCircleShadowOpacity=.09,this._strokeOpacity=.8):(this._brandCircleColor=m.color.black27,this._animatedColorBg=m.color.black27,this._brandCircleShadowOpacity=.09,this._strokeOpacity=.1)}},{key:"_loadImage",value:function(e,t){var i,n=this;this._needDisplayImage&&(this._image=new Image,this.showAnimatedBranding&&(this._imageWhite=new Image),K?(this._image.src=X.fallbackImages[t+"Blue"],this.showAnimatedBranding&&(this._imageWhite.src=X.fallbackImages[t+"White"])):(i=e.replace(/fill="#[\da-f]{6}"/i,'fill="#FFFFFF"'),this._image.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(e),this.showAnimatedBranding&&(this._imageWhite.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(i))),this._image.addEventListener("load",function(){Y&&(n._image=r(n._image,n._imageWidth,n._imageHeight)),n._imageReady=!0,"function"==typeof n._onReadyCallback&&n._onReadyCallback()}))}},{key:"_checkLayout",value:function(){switch(this._layout){case D:case O:case R:case N:case F:case j:case H:this.show=!0;break;case V:case B:case W:case z:this.show=!1}switch(this._layout){case H:this._needDisplayImage=!0,this._txt=$.t(A);break;case j:this._txt=$.t(M)}}},{key:"_drawTextStroke",value:function(e){var t,i;this._strokeCanv||(this._strokeCanv=document.createElement("canvas"),t=this._strokeCanv.getContext("2d"),i=Math.round(this._strokeWidth*this._upscaleRatio),t.font=this._fontSize*this._upscaleRatio+this._font,this._textWidth=t.measureText(this._txt).width,this._strokeCanv.width=(this._textWidth+2*i)*J,this._strokeCanv.height=(this._fontSize+2*i)*this._upscaleRatio*J,this._strokeCanv.width%2==0&&(this._strokeCanv.width+=1,this._strokeCanv.height+=1),t.textBaseline="top",t.textAlign="start",t.font=this._fontSize*this._upscaleRatio+this._font,t.strokeStyle=this._strokeColor,t.lineWidth=this._strokeWidth*this._upscaleRatio*J,t.lineJoin="round",t.strokeText(this._txt,i,this._verticalTextShift)),e.save(),e.globalAlpha=this._strokeOpacity,
e.drawImage(this._strokeCanv,0,0,this._strokeCanv.width,this._strokeCanv.height,0,0,this._strokeCanv.width/this._upscaleRatio/J,this._strokeCanv.height/this._upscaleRatio/J),e.restore()}},{key:"_drawTextFill",value:function(e){this._createFillText(),e.save(),e.drawImage(this._fillCanv,0,0,this._fillCanv.width,this._fillCanv.height,0,0,this._fillCanv.width/this._upscaleRatio/J,this._fillCanv.height/this._upscaleRatio/J),e.restore()}},{key:"_createFillText",value:function(){var e,t;null===this._fillCanv&&(this._fillCanv=document.createElement("canvas"),e=this._fillCanv.getContext("2d"),t=Math.round(this._strokeWidth*this._upscaleRatio),e.font=this._fontSize*this._upscaleRatio+this._font,void 0===this._textWidth&&(this._textWidth=Math.round(e.measureText(this._txt).width)),this._setSizeFillTextCanvas(t),e.textBaseline="top",e.textAlign="start",e.font=this._fontSize*this._upscaleRatio+this._font,e.fillStyle=this._fillColor,e.fillText(this._txt,t,this._verticalTextShift))}},{key:"_updateFillTextWithColor",value:function(e){var t=Math.round(this._strokeWidth*this._upscaleRatio),i=this._fillCanv.getContext("2d");this._setSizeFillTextCanvas(t),i.clearRect(0,0,this._fillCanv.width,this._fillCanv.height),i.textBaseline="top",i.textAlign="start",i.font=this._fontSize*this._upscaleRatio+this._font,i.fillStyle=e,i.fillText(this._txt,t,this._verticalTextShift)}},{key:"_setSizeFillTextCanvas",value:function(e){this._fillCanv.width=(this._textWidth+2*e)*J,this._fillCanv.height=(this._fontSize+2*e)*this._upscaleRatio*J,this._fillCanv.width%2==0&&(this._fillCanv.width+=1,this._fillCanv.height+=1)}},{key:"_drawFillTextCropWidth",value:function(e,t,i){this._fillCanv?this._updateFillTextWithColor(i):this._createFillText(),e.save(),e.drawImage(this._fillCanv,0,0,t*this._upscaleRatio*J,this._fillCanv.height,0,0,t,this._fillCanv.height/this._upscaleRatio/J),e.restore()}},{key:"_drawBgCircle",value:function(e){e.save(),e.beginPath(),e.fillStyle=this._brandCircleShadowColor,e.globalAlpha=this._brandCircleShadowOpacity,e.arc(this._imageWidth/2,this._imageHeight/2,this._brandCircleSize/2+1,0,2*Math.PI),e.fill(),e.closePath(),e.restore(),e.save(),e.beginPath(),e.fillStyle=this._brandCircleColor,e.arc(this._imageWidth/2,this._imageHeight/2,this._brandCircleSize/2,0,2*Math.PI,!1),e.fill(),e.closePath(),e.restore()}},{key:"_drawFillRectWithRoundedCorner",value:function(e,t,i,n,o,r,s){e.save(),(0,v.drawRoundRect)(e,t-1,i-1,n+2,o+2,r),e.globalAlpha=this._brandCircleShadowOpacity,e.fillStyle=this._brandCircleShadowColor,e.fill(),e.closePath(),e.restore(),e.save(),(0,v.drawRoundRect)(e,t,i,n,o,r),e.fillStyle=s,e.fill(),e.closePath(),e.restore()}},{key:"_drawImageWithColor",value:function(e){e.save(),e.globalAlpha=this._animatedOpacity,e.drawImage(this._imageWhite,0,-.5,this._imageWidth,this._imageHeight),e.restore(),e.save(),e.globalAlpha=1-this._animatedOpacity,e.drawImage(this._image,0,-.5,this._imageWidth,this._imageHeight),e.restore()}},{key:"bottomShift",value:function(){return this._bottomShift}},{key:"minimizedAnimationWidth",value:function(){
return this._brandCircleSize}},{key:"maximizedAnimationWidth",value:function(){return this._fillCanv.width/this._upscaleRatio/J+this._brandCircleSize-3}},{key:"animatedDrawStep",value:function(e,t){var i,n,o,r,s,a,l,h,u,d,p,_,f,m,y,g;this._animatedWidth=t,i=this._animatedWidth<this._brandCircleSize+20?0:this._animatedWidth/this.maximizedAnimationWidth(),n=(0,S.parseRgb)(this._brandCircleColor),o=c(n,3),r=o[0],s=o[1],a=o[2],l=(0,S.parseRgb)(this._fillColor),h=c(l,3),u=h[0],d=h[1],p=h[2],_=(0,S.parseRgb)(this._strokeColor),f=c(_,3),m=f[0],y=f[1],g=f[2],this._animatedColorBg=(0,S.rgbaToString)((0,S.blendRgba)([r,s,a,(0,S.normalizeAlphaComponent)(1)],[u,d,p,(0,S.normalizeAlphaComponent)(i)])),this._animatedColorText=(0,S.rgbaToString)((0,S.blendRgba)([u,d,p,(0,S.normalizeAlphaComponent)(1)],[m,y,g,(0,S.normalizeAlphaComponent)(i)])),this._animatedOpacity=i}},{key:"draw",value:function(e,t){var i,n,o,r,s,c,h,u,d,p;this.showAnimatedBranding?this._needDisplayImage&&this._imageReady&&(e.save(),i=(this._brandCircleSize-this._imageWidth)/2,n=(this._brandCircleSize-this._imageHeight)/2,e.translate(-i,-n),this._drawFillRectWithRoundedCorner(e,0,0,this._animatedWidth,this._brandCircleSize,this._brandCircleSize/2,this._animatedColorBg),e.translate(i,n),this._drawImageWithColor(e),o=12+(G?-.5:0),r=this._imageWidth+o,this._animatedWidth>r&&(e.translate(this._imageWidth/2+o,.5),this._drawFillTextCropWidth(e,this._animatedWidth-r,this._animatedColorText)),e.restore(),this.width=this._animatedWidth,this.height=this._brandCircleSize,this._bottomShift=this._brandCircleSize-this._imageHeight):this._layout===R||this._layout===F?(s='12px "Trebuchet MS", Tahoma, Arial, sans-serif',e.font=s,c=e.measureText(this._txt).width,this.width=c+e.measureText("TradingView").width,e.save(),e.globalAlpha=.7,e.fillStyle=this._colorOldGray,e.fillText(this._txt,0,12),e.fillStyle=this._colorOldBlue,e.fillText("TradingView",c,12),e.restore()):a(t)&&(this._needDisplayImage&&this._imageReady?(e.save(),h=(this._brandCircleSize-this._imageWidth)/2,e.translate(h,0),this._drawBgCircle(e),e.drawImage(this._image,0,-.5,this._imageWidth,this._imageHeight),u=12+(G?-.5:0),e.translate(this._imageWidth+u,-.5),d=l(t),d&&(this._drawTextStroke(e),this._drawTextFill(e)),e.restore(),this.width=this._imageWidth+h,this.width+=d?u+this._strokeCanv.width/this._upscaleRatio/J:h,this.height=this._brandCircleSize,this._bottomShift=this._brandCircleSize-this._imageHeight):(e.save(),e.translate(G?-.5:0,-.5),p=l(t),p&&(this._drawTextStroke(e),this._drawTextFill(e)),e.restore(),p&&(this.width=this._strokeCanv.width/this._upscaleRatio/J)))}}]),e}(),ee=function(){function e(t){var i=t.layout,n=void 0===i?V:i,r=t.src,a=t.onReadyCallback;o(this,e),this._img=new Image,this._ready=!1,this.show=!1,this.width=0,this.height=0,this._layout=n,this._src=r,this._onReadyCallback=a,K&&(this._init=s(this._init,this)),this._init()}return h(e,[{key:"_init",value:function(){var e,t,i=this;this._checkLayout(),this.show&&(e=this._src.match(/(\w+)\.svg/),K&&e&&2===e.length?(t=e[1],
this._img.src=X.fallbackImages[t],this._img.addEventListener("load",function(){var e=X.logoSizes;t in e?(i.width=e[t].width,i.height=e[t].height):(i.width=135,i.height=25),i._ready=!0,"function"==typeof i._onReadyCallback&&i._onReadyCallback()})):(this._img.src=this._src,this._img.addEventListener("load",function(){i.width=Math.round(i._img.width),i.height=Math.round(i._img.height),Y&&(i._img=r(i._img,i.width,i.height)),i._ready=!0,"function"==typeof i._onReadyCallback&&i._onReadyCallback()})))}},{key:"_checkLayout",value:function(){switch(this._layout){case R:case B:case F:case W:case j:case z:this.show=!0;break;case V:case D:case O:case N:case H:this.show=!1}}},{key:"draw",value:function(e){this._ready&&e.drawImage(this._img,0,0,this.width,this.height)}}]),e}(),t.Branding=function(){function e(t){var i,n=this;o(this,e),this._model=t,this._mainSeries=this._model.mainSeries(),this._canvasWidth=0,this._paneHeight=0,this._left=13,this._bottom=24,this._layout=V,this._needToShow=!0,this._customLogoSrc="",this._customLogoLink="",this._checkLayout(),this._layout!==R&&this._layout!==F||(this._left=8,this._bottom=5),i=function(){n._needToShow?n._layout===V?n._showBranding=window.innerWidth>=768:n._showBranding=!0:n._showBranding=!1},this._resizeHandlerDelayed=b(i,200),i(),window.addEventListener("resize",this._resizeHandlerDelayed),this._model.isSnapshot()?this._init():this._mainSeries.dataEvents().symbolResolved().subscribe(this,this._init),this._cubicBezier=new m.CubicBezier(.4,.01,.22,1)}return h(e,[{key:"destroy",value:function(){window.removeEventListener("resize",this._resizeHandlerDelayed)}},{key:"_init",value:function(){var e=this,t=this._mainSeries.symbolInfo()||{};this._powBy=new Q({layout:this._layout,symbol:t.name,model:this._model,onReadyCallback:function(){return e._model.fullUpdate()}}),this._custom=new ee({layout:this._layout,src:this._customLogoSrc,onReadyCallback:function(){return e._model.fullUpdate()}}),this._openAnimation=null,this._closeAnimation=null}},{key:"_checkLayout",value:function(){if(_.enabled("widget"));else if(_.enabled("charting_library")||_.enabled("amp_terminal")||_.enabled("cqg_terminal")||_.enabled("trading_terminal")){var e=JSON.parse(Z.logo)||{};e.image?(this._customLogoSrc=e.image,this._customLogoLink=e.link,this._needToShow=_.enabled("widget_logo"),_.enabled("link_to_tradingview")?this._layout=j:this._layout=z):(this._layout=H,this._needToShow=_.enabled("widget_logo"))}else this._layout=V}},{key:"_startOpenAnimation",value:function(){null===this._openAnimation&&(null!==this._closeAnimation&&(this._closeAnimation.stop(),this._closeAnimation=null),this._openAnimation=(0,g.doAnimate)({from:this._currentStateForAnimation(),to:this._openedStateForAnimation(),duration:200,easing:this._cubicBezier.easingFunc,onStep:this._animatedDrawStep.bind(this)}))}},{key:"_startCloseAnimation",value:function(){null===this._closeAnimation&&(null!==this._openAnimation&&(this._openAnimation.stop(),this._openAnimation=null),this._closeAnimation=(0,g.doAnimate)({from:this._currentStateForAnimation(),
to:this._closedStateForAnimation(),duration:200,easing:this._cubicBezier.easingFunc,onStep:this._animatedDrawStep.bind(this)}))}},{key:"_currentStateForAnimation",value:function(){return this._powBy.width}},{key:"_closedStateForAnimation",value:function(){return this._powBy.minimizedAnimationWidth()}},{key:"_openedStateForAnimation",value:function(){return this._powBy.maximizedAnimationWidth()}},{key:"_animatedDrawStep",value:function(e,t){this._powBy.animatedDrawStep(e,t),this._model.lightUpdate()}},{key:"updateAllViews",value:function(){}},{key:"priceScale",value:function(){}},{key:"priceAxisViews",value:function(){}},{key:"onClickOutside",value:function(){}},{key:"hasContextMenu",value:function(){return!1}},{key:"hitTest",value:function(e){var t=this;return!this._showBranding||_.enabled("logo_without_link")?null:this._powBy&&this._layout!==V&&this._layout!==B&&this._layout!==W&&(0,d.pointInRectangle)(e,new u.Point(this._left,this._paneHeight-this._bottom+this._powBy.bottomShift()/2-Math.max(this._powBy.height,void 0!==this._custom?this._custom.height:0)),new u.Point(this._left+Math.max(this._powBy.width,void 0!==this._custom?this._custom.width:0),this._paneHeight-this._bottom+this._powBy.bottomShift()/2))?new f.HitTestResult(f.HitTestResult.CUSTOM,{mouseUpHandler:function(){window.open(t.tvUrl(),"_blank").opener=null},mouseEnterHandler:function(){t._startOpenAnimation()},mouseLeaveHandler:function(){t._startCloseAnimation()}}):void 0}},{key:"tvUrl",value:function(){var e,t="https://www.tradingview.com/";if(this._customLogoLink)return this._customLogoLink;if(this._layout===H||this._layout===j){switch(e=void 0,!0){case _.enabled("charting_library"):e="library";break;case _.enabled("trading_terminal"):case _.enabled("amp_terminal"):case _.enabled("cqg_terminal"):e="trading-terminal"}return t+="/"===t[t.length-1]?"?":"&",t+="utm_source="+window.location.origin+"&utm_medium=library"+(e?"&utm_campaign="+e:"")}return t}},{key:"draw",value:function(e){if(this._showBranding){var t=0;this._powBy&&this._powBy.show&&(t=this._powBy.height-this._powBy.bottomShift(),e.save(),e.translate(this._left,this._paneHeight-this._bottom-t),this._powBy.draw(e,this._canvasWidth),e.restore()),this._custom&&this._custom.show&&(e.save(),e.translate(this._left,this._paneHeight-this._bottom-t-this._custom.height),this._custom.draw(e),e.restore())}}},{key:"renderer",value:function(e,t){return this._paneHeight=this._pane.height(),this._canvasWidth=t,{draw:this.draw.bind(this),hitTest:this.hitTest.bind(this)}}},{key:"paneViews",value:function(e){var t=_.enabled("move_logo_to_main_pane");return t&&e.isMainPane()||!t&&e.isLast()||e.isMaximized()?(this._pane=e,[{renderer:this.renderer.bind(this)}]):[]}}]),e}()},function(e,t){
e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 13" width="22" height="13"><path fill="#37A6EF" fill-rule="nonzero" d="M19.354 4.932c.379.55.611 1.207.642 1.918A3.007 3.007 0 0 1 22 9.686a3.003 3.003 0 0 1-3 3.006H4a3.983 3.983 0 0 1-2.814-1.16l6.363-5.048a1.657 1.657 0 0 0 1.495.037l3.034 2.66a1.672 1.672 0 0 0 1.589 2.175 1.668 1.668 0 0 0 1.552-2.28l4.135-4.144zm-.942-.945L14.276 8.13a1.66 1.66 0 0 0-1.32.044l-3.034-2.66A1.672 1.672 0 0 0 8.333 3.34a1.668 1.668 0 0 0-1.611 2.097l-6.316 5.01A3.999 3.999 0 0 1 0 8.683a4.004 4.004 0 0 1 4.041-4.008A5.338 5.338 0 0 1 9.333 0a5.337 5.337 0 0 1 5.124 3.857 3.644 3.644 0 0 1 1.876-.517c.772 0 1.488.239 2.079.647z"/></svg>'},function(e,t,i){"use strict";(function(e){function n(e,t,i,n){this._prices=[],this._canvas=$("<canvas>"),this._cache=this._canvas.get(0).getContext("2d"),this.reset({font:e,fontSize:t,backColors:i,colors:n}),this._priceAxisFontSize=11}function o(e,t){this._model=e,this._source=t,this._pivots=[],this._textCache={}}function r(e,t){this._source=e,this._model=e._model,this._prices=[],this._invidated=!0,this._cache=t}function s(e,t,i,n){var o,r,s;for(p.call(this,e,t,i,n),o=["P","S1/R1","S2/R2","S3/R3","S4/R4","S5/R5"],r=this.properties().levelsStyle.visibility,s=0;s<o.length;s++)r[o[s]].listeners().subscribe(this,TradingView.Study.prototype.processHibernate)}var a=i(6).Point,l=i(24),c=l.parseRgb,h=l.rgbToBlackWhiteString,u=i(119),d=i(117).StudyDataWindowView,p=i(180).NonSeriesStudy,_=i(625).StandardPivotPointsPriceAxisView,f=i(185).TrendLineRenderer,m=i(100),y=i(312),g=i(9).HitTestResult,v=i(69).CompositeRenderer,S=i(17).PlotRowSearchMode,b=i(2).propertyPages,w=i(104).LineEnd;n.prototype.destroy=function(){this._canvas.remove()},n.prototype.reset=function(e){this._prices=[],this._params=e,this._cache.setFont(e.fontSize+"px "+e.font);var t=this;this._labelWidth=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5","/"].reduce(function(e,i){var n=t._cache.measureText(i).width;return Math.max(n,e)},0)},n.prototype.rowHeight=function(){return this._priceAxisFontSize+4},n.prototype._labelRectByIndex=function(e){return{left:0,top:Math.round(this._topByIndex(e)),width:Math.round(this._labelWidth+4),height:this._params.fontSize+8}},n.prototype.params=function(){return this._params},n.prototype._centerByIndex=function(e){return Math.round((e+.5)*(this._params.fontSize+8))},n.prototype._topByIndex=function(e){return Math.round(e*(this._params.fontSize+8))},n.prototype.setPrices=function(e){var t,i,n,o,r,s,a=8,l=!1,c=function(e,t){return void 0===e&&void 0===t||e.formatted===t.formatted};if(e.length!==this._prices.length)l=!0;else for(t=0;t<this._prices.length;t++)if(!c(this._prices[t],e[t])){l=!0;break}if(l){for(i=this,i._cache.save(),i._cache.font=this._priceAxisFontSize+"px Arial",i._cache.restore(),n=this._labelWidth+6,o=window.hidpiCanvasRatio||1,n*=o,this._canvas.prop("width",n),r=Math.max(e.length,22)*(this._params.fontSize+a),r*=o,this._canvas.prop("height",r),this._canvas.css("width",n).css("height",r),this._prices=e,
this._cache.clearRect(0,0,n,r),this._cache.save(),this._cache.translate(.5,.5),this._cache.font=this._params.fontSize+"px "+this._params.font,this._cache.textBaseline="middle",t=0;t<this._prices.length;t++)this._prices[t]&&(s=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5"][t],this._cache.fillStyle=this._params.backColors[t],this._cache.fillText(s,0,this._centerByIndex(t)),this._cache.fillText("/",0,this._centerByIndex(t+11)));this._prices=e,this._cache.restore()}},o.prototype.setCache=function(e){this._cache=e},o.prototype.priceAxisViews=function(e,t){return this._priceAxisViews},o.prototype.mergeLabel=function(e,t,i){var n=""+t;void 0===e[n]?(e[n]={},e[n].text=i,e[n].ids=[this.complete(i)]):(e[n].text+="/"+i,e[n].ids.push(this.complete(i)))},o.prototype.complete=function(e){return"P"===e?e:"S"+e[1]+"/R"+e[1]},o.prototype.update=function(){this._invalidated=!0},o.prototype._updateImpl=function(){var e,t,i,n,o,r,s,a,l,c,h,u,d,p,_,f,m,y;if(this._source.pricesView().prices(),this._pivots=[],this._source.customData()&&this._source.customData().pivots&&this._source.properties().visible.value()&&(e=this._source.customData().pivots,t=this._source._indexes,i=this._model.timeScale(),(n=this._source.priceScale())&&!n.isEmpty()&&!i.isEmpty()&&e&&(o=i.visibleBars(),r=o.firstBar(),s=o.lastBar(),this._source.ownerSource())))for(a=this._source.ownerSource().firstValue(),l=0;l<e.length;l++)if(e[l]&&(c=t[e[l].startIndex],!((h=t[e[l].endIndex])<r||c>s))){u={},d=this._source.properties().levelsStyle.visibility,d.P.value()&&this.mergeLabel(u,e[l].p,"P"),d["S1/R1"].value()&&(this.mergeLabel(u,e[l].s1,"S1"),this.mergeLabel(u,e[l].r1,"R1")),d["S2/R2"].value()&&(this.mergeLabel(u,e[l].s2,"S2"),this.mergeLabel(u,e[l].r2,"R2")),d["S3/R3"].value()&&(this.mergeLabel(u,e[l].s3,"S3"),this.mergeLabel(u,e[l].r3,"R3")),d["S4/R4"].value()&&(this.mergeLabel(u,e[l].s4,"S4"),this.mergeLabel(u,e[l].r4,"R4")),d["S5/R5"].value()&&(this.mergeLabel(u,e[l].s5,"S5"),this.mergeLabel(u,e[l].r5,"R5")),p=i.indexToCoordinate(c),_=i.indexToCoordinate(h);for(f in u)m=parseFloat(f),y=n.priceToCoordinate(m,a),this._pivots.push({x1:p,x2:_,y:y,label:u[f].text,labelIds:u[f].ids})}},o.prototype.renderer=function(){var e,t,i,n,o,r,s,l,c,h,u,d,p,_,m,S,b;for(this._invalidated&&(this._updateImpl(),this._invalidated=!1),e=new v,t=this._source.properties().levelsStyle.colors,i=this._source.properties().levelsStyle.widths,n=0;n<this._pivots.length;n++)if(o=this._pivots[n],r=new a(o.x1,o.y),s=new a(o.x2,o.y),l={points:[r,s],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:t[o.labelIds[0]].value(),linewidth:i[o.labelIds[0]].value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:w.Normal,rightend:w.Normal},c=new f,c.setData(l),c.setHitTest(new g(g.REGULAR)),e.append(c),this._source.properties().levelsStyle.showLabels.value())for(h=o.label.split("/"),u=0,d=0;d<h.length;d++)p=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5"].indexOf(h[d]),d>0&&(_=this._cache._labelRectByIndex(p+11),m={left:r.x-_.width+u,
top:Math.round(r.y-_.height/2),width:_.width,height:_.height},u+=_.width/2,S=this._cache._canvas.get(0),b=new y(S,_,m),e.append(b)),_=this._cache._labelRectByIndex(p),m={left:r.x-_.width+u,top:Math.round(r.y-_.height/2),width:_.width,height:_.height},u+=_.width,S=this._cache._canvas.get(0),b=new y(S,_,m),e.append(b);return e},r.prototype._updateImpl=function(){var e,t,i,n,o,r,s,a,l,c,h,u,d,p,_,f,m,y,g,v;if(!this._model.timeScale().isEmpty()&&!this._source.priceScale().isEmpty()&&null!==(e=this._model.timeScale().visibleBars())&&this._source.customData()&&this._source.customData().pivots&&(t=this._model.mainSeries(),i=this._source.priceScale(),null!==(n=t.bars().search(e.lastBar(),S.NearestLeft)))){for(o=n.index,r=this._source.customData().pivots,s=this._source._indexes,a=this._source.properties(),l=this._source.firstValue(),c=0;c<r.length;c++)if(r[c]&&(h=s[r[c].startIndex],u=s[r[c].endIndex],d=a.inputs.showHistoricalPivots.value(),u>=o&&h<=o||!d))for(p=["p","s1","r1","s2","r2","s3","r3","s4","r4","s5","r5"],this._prices=[],_=0;_<p.length;_++)f=p[_],void 0!==(m=r[c][f])&&(y=i.priceToCoordinate(m,l),g={P:"P",S1:"S1/R1",S2:"S2/R2",S3:"S3/R3",S4:"S4/R4",S5:"S5/R5",R1:"S1/R1",R2:"S2/R2",R3:"S3/R3",R4:"S4/R4",R5:"S5/R5"},v=a.levelsStyle.colors[g[f.toUpperCase()]].value(),this._prices.push({formatted:i.formatPrice(m,l),price:m,coordinate:y,color:v}));this._cache.setPrices(this._prices)}},r.prototype.update=function(){this._invidated=!0},r.prototype.prices=function(){return this._invidated&&(this._updateImpl(),this._invidated=!1),this._prices},inherit(s,p),s.prototype.lastValueData=function(e,t,i){var n=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5"].indexOf(e.toUpperCase()),o={noData:!0},r=this._pricesView.prices()[n];return null!==r&&void 0!==r?r:o},s.prototype.lastPriceLabelFixedCoordinate=function(e){var t=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5"].indexOf(e.toUpperCase());return this._priceAxisViews[t]._fixedCoordinate},s.prototype.priceLabelText=function(e){return this._metaInfo.shortDescription+":"+e.toUpperCase()},s.prototype.pricesView=function(){return this._pricesView},s.prototype._getActualCacheParams=function(){var e={};return e.font=this.properties().font.value(),e.fontSize=this.properties().fontsize.value(),e.backColors=[this.properties().levelsStyle.colors.P.value(),this.properties().levelsStyle.colors["S1/R1"].value(),this.properties().levelsStyle.colors["S1/R1"].value(),this.properties().levelsStyle.colors["S2/R2"].value(),this.properties().levelsStyle.colors["S2/R2"].value(),this.properties().levelsStyle.colors["S3/R3"].value(),this.properties().levelsStyle.colors["S3/R3"].value(),this.properties().levelsStyle.colors["S4/R4"].value(),this.properties().levelsStyle.colors["S4/R4"].value(),this.properties().levelsStyle.colors["S5/R5"].value(),this.properties().levelsStyle.colors["S5/R5"].value()],e.colors=e.backColors.map(function(e){return"black"===h(c(e),150)?"white":"black"}),e},s.prototype.updateAllViews=function(){p.prototype.updateAllViews.call(this),this._pricesView.update()},
s.prototype.createViews=function(){var e,t,i,s,a,l=this._getActualCacheParams();for(this._cache&&this._cache.destroy(),this._cache=new n(l.font,l.fontSize,l.backColors,l.colors),this._priceAxisViews=[],e=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5"],this._paneViews.length=0,t=new o(this._model,this),t.setCache(this._cache),this._paneViews.push(t),i=this.properties().levelsStyle.visibility,s=0;s<e.length;s++)this._priceAxisViews.push(new _(this,{name:e[s],cache:this._cache})),a="P"===e[s].toUpperCase()?"P":"S"+e[s][1]+"/R"+e[s][1],i[a]&&i[a].value()&&this._paneViews.push(new m(this._model,this,e[s],"priceLabelText","showStudyPlotLabels"));this._dataWindowView||(this._dataWindowView=new d(this,this._model)),this._statusView||(this._statusView=new u(this,this._model.properties())),this._legendView=null,this._pricesView=new r(this,this._cache)},s.prototype._postProcessGraphics=function(){},s.prototype.isVisible=function(){var e,t,i;if(!this.properties().visible.value())return!1;for(e=["P","S1/R1","S2/R2","S3/R3","S4/R4","S5/R5"],t=this.properties().levelsStyle.visibility,i=0;i<e.length;i++)if(t[e[i]].value())return!0;return!1},s.prototype.stop=function(){TradingView.Study.prototype.stop.call(this),this._cache&&(this._cache.destroy(),this._cache=null)},s.prototype.priceRange=function(t,i){var n,o,r,s,a,l,c,h;if(!this.customData()||!this.customData().pivots||!this._indexes)return null;if(!this.priceScale())return null;for(n=this.customData().pivots,o=this._indexes,r=null,s=0;s<n.length;s++)if(n[s]&&(a=o[n[s].startIndex],!(o[n[s].endIndex]<t||a>i)))for(l=[],c=this._properties.levelsStyle.visibility,c.P.value()&&l.push(n[s].p),c["S1/R1"].value()&&l.push(n[s].s1,n[s].r1),c["S2/R2"].value()&&l.push(n[s].s2,n[s].r2),c["S3/R3"].value()&&l.push(n[s].s3,n[s].r3),c["S4/R4"].value()&&l.push(n[s].s4,n[s].r4),c["S5/R5"].value()&&l.push(n[s].s5,n[s].r5),h=0;h<l.length;h++)l[h]&&(null===r?r=new e(l[h],l[h]):r.apply(l[h],l[h]));return this.priceScale().isLog()&&r?new e(this.priceScale().priceToLogical(r.minValue()),this.priceScale().priceToLogical(r.maxValue())):r},s.prototype.getStylesPropertyPage=function(){return b.StudyPivotPointsStandardStylesPropertyPage},t.study_PivotPointsStandard=s}).call(t,i(48).PriceRange)},function(e,t,i){"use strict";var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"StandardPivotPointsPriceAxisView",function(){return s}),n=i(1),o=i(58),r=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5"],s=function(e){function t(t,i){var n,o=e.call(this)||this;return o._source=t,o._data=i,n=i.name,o._completeName="P"===n.toUpperCase()?"P":"S"+n[1]+"/R"+n[1],o}return n.c(t,e),t.prototype._updateRendererData=function(e){var t,i,n,o,s,a,l,c,h,u;e.visible=!1,t=this._source.properties(),t.visible.value()&&(i=this._completeName,n=t.levelsStyle.visibility,n[i]&&n[i].value()&&(o=this._source.model(),s=o.timeScale(),a=this._source.priceScale(),s.isEmpty()||null===s.visibleBars()||null!==a&&a.isEmpty()||(l=this._source.customData())&&l.pivots&&(c=this._source.pricesView().prices(),
h=r.indexOf(this._data.name.toUpperCase()),(u=c[h])&&(e.background=u.color,e.color=this.generateTextColor(u.color),e.coordinate=u.coordinate,e.floatCoordinate=u.floatCoordinate,e.text=u.formatted,e.visible=!0))))},t}(o.a)},function(e,t,i){"use strict";function n(e,t){this._source=e,this._model=t,this._points=[new s(0,0)],this._lineRenderer=new P}function o(e){return null==e[TradingView.OPEN_PLOT]}function r(e,t,i,n){this._waterlineView=null,this._symbolLabelView=new T(e,this,void 0,"symbol","showSymbolLabels"),l.call(this,e,t,i,n),this.m_data=new M(E(),o),this._formatter=null,this._paneView=null;var r=this;this.properties().minTick.listeners().subscribe(null,function(){r._createFormatter(),r.updateAllViews(),r._model.invalidate(new x(x.FULL_UPDATE))}),this.properties().style.listeners().subscribe(this,this._updateBarFunction),this.properties().lineStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this.properties().areaStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this.properties().baselineStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this._updateBarFunction()}var s=i(6).Point,a=i(63).Series,l=i(34).Study,c=i(17).PlotRowSearchMode,h=i(627).OverlayPriceAxisView,u=i(282),d=u.SeriesAreaPaneView,p=u.SeriesLinePaneView,_=u.SeriesHollowCandlesPaneView,f=u.SeriesCandlesPaneView,m=u.SeriesBarsPaneView,y=u.SeriesBaselinePaneView,g=i(283).SeriesWaterlinePaneView,v=i(119),S=i(286).OverlayDataWindowView,b=i(628).OverlayLegendView,w=i(166).SeriesBarColorer,P=i(110).HorizontalLineRenderer,T=i(100),x=i(18),C=i(21).PriceFormatter,L=i(2).propertyPages,I=i(5),A=i(48).PriceRange,k=i(72).barFunction,E=i(72).seriesPlotFunctionMap,M=i(17).PlotList,V=!I.enabled("hide_study_overlay_legend_item"),D=I.enabled("uppercase_instrument_names"),O=i(4).getLogger("Chart.StudyOverlay");n.prototype.update=function(){if(this._visible=!1,this._source.properties().showPriceLine.value()){var e=this._source.lastValueData(void 0,!0);e.noData||(this._visible=!0,this._points=[new s(0,e.coordinate)],this._color=e.color)}},n.prototype.renderer=function(){var e={};return e.width=this._model.timeScale().width(),e.height=this._source.priceScale().height(),e.points=this._points,e.color=this._color,e.linewidth=1,e.linestyle=CanvasEx.LINESTYLE_DOTTED,e.visible=this._visible,this._lineRenderer.setData(e),this._lineRenderer},inherit(r,l),r.prototype.createPlotLabels=function(e){},r.prototype._showLastValueOnPriceScale=function(){return this._model.properties().scalesProperties.showSeriesLastValue.value()},r.prototype.symbol=function(){var e,t=this.properties().inputs.symbol.value(),i=this._resolvedSymbols?this._resolvedSymbols[t]:null;return e=i?i.name:t,D?e.toUpperCase():e},r.prototype.lastValueData=function(e,t,i){var n,o,r,s,l,h,u,d,p,_,f,m,y,g={noData:!0};if(this._model.timeScale().isEmpty()||null==this.priceScale()||this.priceScale().isEmpty()||this.data().isEmpty())return g;if(null===(n=this._model.timeScale().visibleBars()))return g;if(!this.properties().visible.value())return g
;if(null==(o=this.nearestIndex(n.lastBar(),c.NearestLeft)))return g;if(r=this._lastNonEmptyPlotRow(TradingView.CLOSE_PLOT),s=null!==r&&n.contains(r.index),l=null!==r?r.value:null,h=t||s?l:this.data().valueAt(o),u=this._barFunction(h),!h||!isNumber(u))return g;if(d={noData:!1},i&&(d.price=u),!(p=this.firstValue()))return g;switch(d.text=this.priceScale().formatPrice(u,p),d.floatCoordinate=this.priceScale().priceToCoordinate(u,p,!0),d.coordinate=Math.round(d.floatCoordinate),d.item=h,_=this.properties(),_.style.value()){case a.STYLE_BARS:d.color=h[TradingView.OPEN_PLOT]<=h[TradingView.CLOSE_PLOT]?_.barStyle.upColor.value():_.barStyle.downColor.value();break;case a.STYLE_CANDLES:case a.STYLE_HOLLOW_CANDLES:d.color=h[TradingView.OPEN_PLOT]<=h[TradingView.CLOSE_PLOT]?_.candleStyle.upColor.value():_.candleStyle.downColor.value();break;case a.STYLE_LINE:d.color=_.lineStyle.color.value();break;case a.STYLE_AREA:d.color=_.areaStyle.color1.value();break;case a.STYLE_BASELINE:f=_.baselineStyle,m=this.priceScale(),y=Math.round(m.height()*(Math.abs(100-f.baseLevelPercentage.value())/100)),d.color=d.coordinate<y?_.baselineStyle.topLineColor.value():_.baselineStyle.bottomLineColor.value()}return d},r.prototype.firstValue=function(){var e,t,i=this._model.timeScale().visibleBars();return null===i?null:(e=i.firstBar(),0===this.data().size()?null:(t=this.data().search(e,c.NearestRight,!0),null!==t?this._barFunction(t.value):null))},r.prototype.barFunction=function(){return this._barFunction},r.prototype._updateBarFunction=function(){var e=this.priceSource()||"close";this._barFunction=k(e)},r.prototype.priceSource=function(){switch(this._properties.style.value()){case a.STYLE_LINE:return this._properties.lineStyle.priceSource.value();case a.STYLE_AREA:return this._properties.areaStyle.priceSource.value();case a.STYLE_BASELINE:return this._properties.baselineStyle.priceSource.value()}return null},r.prototype.priceRange=function(e,t){var i,n,o;return TradingView.isInteger(e)?TradingView.isInteger(t)?0===this.m_data.size()?null:(i=this.priceSource(),n=null!==i?this.m_data.minMaxOnRangeCached(e,t,[{name:i,offset:0}]):this.m_data.minMaxOnRangeCached(e,t,[{name:"low",offset:0},{name:"high",offset:0}]),o=null!==n?new A(n.min,n.max):null,this._postProcessPriceRange(o)):void O.logDebug("priceRange: incorrect endBar"):void O.logDebug("priceRange: incorrect startBar")},r.prototype.createViews=function(){this._priceAxisViews=[],this._priceAxisViewsBase=[new h(this)],this._paneViews=[];var e=null;switch(this._properties.style.value()){case a.STYLE_BARS:e=new m(this,this._model);break;case a.STYLE_CANDLES:e=new f(this,this._model);break;case a.STYLE_HOLLOW_CANDLES:e=new _(this,this._model);break;case a.STYLE_LINE:e=new p(this,this._model);break;case a.STYLE_AREA:e=new d(this,this._model);break;case a.STYLE_BASELINE:e=new y(this,this._model),this._waterlineView=new g(this)}e&&this._paneViews.push(e),null!==this._waterlineView&&this._paneViews.push(this._waterlineView),this._paneViews.push(new n(this,this._model)),
this._paneViews.push(this._symbolLabelView),this._dataWindowView||(this._dataWindowView=new S(this,this._model)),this._legendView||(this._legendView=new b(this,this._model)),this._statusView||(this._statusView=new v(this,this._model.properties())),this._priceAxisViews=[].concat(this._priceAxisViewsBase,this._hlinesPriceAsisViews,this._horizlinesPriceAsisViews)},r.prototype.barColorer=function(){return new w(this)},r.prototype.start=function(e){this._formatter=null,l.prototype.start.apply(this,arguments),this.priceScale()&&this.priceScale().updateFormatter()},r.prototype._createFormatter=function(){var e,t,i,n,o,r,s;"default"===this.properties().minTick.value()?(e=this.properties().inputs.symbol.value(),t=this._resolvedSymbols[e],this._formatter=new C(t?t.pricescale:100,t?t.minmov:1,!!t&&t.fractional)):(i=this.properties().minTick.value(),n=isNumber(i)?["100","1","false"]:i.split(","),o=parseInt(n[0]),r=parseInt(n[1]),s="true"===n[2],this._formatter=new C(o,r,s)),this.priceScale()&&this.priceScale().updateFormatter()},r.prototype.formatter=function(){return this._formatter||this._createFormatter(),this._formatter},r.prototype._tryChangeInputs=function(){l.prototype._tryChangeInputs.call(this),this.m_formatter=null,this.priceScale().updateFormatter()},r.prototype.title=function(){var e,t=this.properties().inputs.symbol.value(),i=this._resolvedSymbols[t];return i?(e=i.name,i.exchange&&0!==i.exchange.length&&(e+=", "+i.exchange)):e=t,D?e.toUpperCase():e},r.prototype.bars=function(){return this.m_data},r.prototype.open=function(e){return this.bars().valueAt(e)[TradingView.OPEN_PLOT]},r.prototype.high=function(e){return this.bars().valueAt(e)[TradingView.HIGH_PLOT]},r.prototype.low=function(e){return this.bars().valueAt(e)[TradingView.LOW_PLOT]},r.prototype.close=function(e){return this.bars().valueAt(e)[TradingView.CLOSE_PLOT]},r.prototype.hl2=function(e){return(this.high(e)+this.low(e))/2},r.prototype.hlc3=function(e){return(this.high(e)+this.low(e)+this.close(e))/3},r.prototype.ohlc4=function(e){return(this.open(e)+this.high(e)+this.low(e)+this.close(e))/4},r.prototype.symbolInfo=function(){if(!this._resolvedSymbols)return null;var e=this._properties.inputs.symbol.value();return e?this._resolvedSymbols[e]:null},r.prototype.lastPriceLabelFixedCoordinate=function(){return this._priceAxisViews[0]._fixedCoordinate},r.prototype.tags=function(){var e=[],t=this.symbolInfo();return t?e.push(t.name):this._properties.inputs.symbol.value()&&e.push(this._properties.inputs.symbol.value()),e},r.prototype.statusView=function(){return V?l.prototype.statusView.call(this):null},r.prototype.getStylesPropertyPage=function(){return L.StudyOverlayStylesPropertyPage},t.study_Overlay=r},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"OverlayPriceAxisView",function(){return r}),n=i(1),o=i(58),r=function(e){function t(t){var i=e.call(this)||this;return i._source=t,i}return n.c(t,e),t.prototype._updateRendererData=function(e){e.visible=!1;var t=this._source.lastValueData("close",!1)
;t.noData||(e.background=t.color,e.color=this.generateTextColor(t.color),e.coordinate=t.coordinate,e.floatCoordinate=t.floatCoordinate,e.text=t.text,e.visible=!0)},t}(o.a)},function(e,t,i){"use strict";var n,o,r,s,a;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"OverlayLegendView",function(){return a}),n=i(1),o=i(286),r=i(42),s=!0,a=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n._additional=null,n._showBarChange=i.properties().paneProperties.legendProperties.showBarChange,n._showOnlyPriceSource=i.properties().paneProperties.legendProperties.showOnlyPriceSource,n._showSeriesOHLC=i.properties().paneProperties.legendProperties.showSeriesOHLC,n._seriesStyle=t.properties().style,n._studyOverlay=t,n._showBarChange.subscribe(n,n.update),n._showSeriesOHLC.subscribe(n,n.update),n}return n.c(t,e),t.prototype.isValuesVisible=function(){return this._showSeriesOHLC.value()||this._showBarChange.value()},t.prototype.additional=function(){return this._additional},t.prototype.destroy=function(){this._showBarChange.unsubscribeAll(this),this._showSeriesOHLC.unsubscribeAll(this)},t.prototype._updateImpl=function(){var t,i,n,o;e.prototype._updateImpl.call(this),t=s&&this._showOnlyPriceSourceValue(),i=this._showSeriesOHLC.value(),n=i&&!t,o=i&&t,this._items[0].setVisible(n),this._items[1].setVisible(n),this._items[2].setVisible(n),this._items[3].setVisible(n),this._items[5].setVisible(this._showBarChange.value()),this._items[4].setVisible(o)},t.prototype._showOnlyPriceSourceValue=function(){return this._showOnlyPriceSource.value()&&Object(r.isPriceSourceStyle)(this._seriesStyle.value())},t}(o.OverlayDataWindowView)},function(e,t,i){"use strict";function n(e,t,i,n){this._symbolLabelView=new a(e,this,"compare","symbol","showSymbolLabels"),o.call(this,e,t,i,n);var r=this;this._properties.minTick.listeners().subscribe(null,function(){r._createFormatter()}),this.properties().minTick.listeners().subscribe(null,function(){r._model.invalidate(new l(l.FULL_UPDATE))}),this._properties.merge({skipHistogramBaseOnAutoScale:!0})}var o=i(34).Study,r=i(630).CompareLegendView,s=i(287).CompareDataWindowView,a=i(100),l=i(18),c=i(21).PriceFormatter,h=i(2).propertyPages,u=i(5),d=!u.enabled("hide_study_compare_legend_item"),p=u.enabled("uppercase_instrument_names");inherit(n,o),n.prototype.createPlotLabels=function(e){},n.prototype._showLastValueOnPriceScale=function(){return this._model.properties().scalesProperties.showSeriesLastValue.value()},n.prototype.createViews=function(){this._legendView||(this._legendView=new r(this,this._model)),this._dataWindowView||(this._dataWindowView=new s(this,this._model)),o.prototype.createViews.call(this),this._paneViews.push(this._symbolLabelView)},n.prototype._createFormatter=function(){var e,t,i,n,o,r=this.properties().inputs.symbol.value(),s=this._resolvedSymbols?this._resolvedSymbols[r]:null;"default"===this.properties().minTick.value()?this._formatter=new c(s?s.pricescale:100,s?s.minmov:1,!!s&&s.fractional):(e=this.properties().minTick.value(),t=isNumber(e)?["100","1","false"]:e.split(","),
i=parseInt(t[0]),n=parseInt(t[1]),o="true"===t[2],this._formatter=new c(i,n,o)),this.priceScale()&&this.priceScale().updateFormatter()},n.prototype.symbol=function(){var e,t=this.properties().inputs.symbol.value(),i=this._resolvedSymbols?this._resolvedSymbols[t]:null;return e=i?i.name:t,p?e.toUpperCase():e},n.prototype.title=function(e){var t,i=this.properties().inputs.symbol.value(),n=this._resolvedSymbols?this._resolvedSymbols[i]:null;return n?(t=n.name,n.exchange&&0!==n.exchange.length&&(t+=", "+n.exchange)):t=i,p?t.toUpperCase():t},n.prototype.symbolInfo=function(){if(!this._resolvedSymbols)return null;var e=this._properties.inputs.symbol.value();return e?this._resolvedSymbols[e]:null},n.prototype.lastPriceLabelFixedCoordinate=function(){return this._priceAxisViews[0]._fixedCoordinate},n.prototype.tags=function(){var e=this.symbol();return e?[e]:[]},n.prototype.statusView=function(){return d?o.prototype.statusView.call(this):null},n.prototype.getInputsPropertyPage=function(){return h.StudyCompareInputsPropertyPage},n.prototype.guiPlotName=function(e){return this.properties().inputs.symbol.value()},t.study_Compare=n},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"CompareLegendView",function(){return r}),n=i(1),o=i(287),r=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n._additional=null,n._showStudyValues=i.properties().paneProperties.legendProperties.showStudyValues,n._showStudyValues.subscribe(n,n.update),n}return n.c(t,e),t.prototype.isValuesVisible=function(){return this._showStudyValues.value()},t.prototype.destroy=function(){this._showStudyValues.unsubscribeAll(this)},t.prototype.additional=function(){return this._additional},t.prototype._updateImpl=function(){e.prototype._updateImpl.call(this)},t}(o.CompareDataWindowView)},function(e,t,i){"use strict";function n(e,t,i,n){s.call(this,e,t,i,n),this._underlyingData=new a(l(n))}var o=i(7).assert,r=i(12).clone,s=i(34).Study,a=i(17).PlotList,l=i(269).studyPlotFunctionMap;inherit(n,s),n.prototype.clearData=function(){s.prototype.clearData.call(this),this._underlyingData.clear()},n.prototype._mergeData=function(e){var t,i;this._invalidateLastNonEmptyPlotRowCache(),t=this._underlyingData.firstIndex(),this._underlyingData.merge(e),t!==this._underlyingData.firstIndex()&&(this.m_data=new a(l(this._metaInfo))),i=this.m_data.lastIndex(),this._underlyingData.range(i,this._underlyingData.lastIndex()).each(function(e,t){return this.m_data.add(e,r(t)),!1}.bind(this)),this._plotsForStrategyProcessing().forEach(function(e){this._createStrategy(e.strategy,e.strategyIndex,e.targetIndex,i).rebuildData(this.m_data)},this)},n.prototype._plotsForStrategyProcessing=function(){var e=["dataoffset"],t=[];return this._metaInfo.plots.forEach(function(i,n){var r,s;e.indexOf(i.type)>-1&&(r=null,this._metaInfo.plots.forEach(function(e,t){e.id===i.target&&(r=t)}),o(r>=0,"target plot not found for strategy plot "+i.id),s={strategy:i.type,strategyIndex:n,targetIndex:r},t.push(s))},this),t},
n.prototype._createStrategy=function(e,t,i,o){return new n["Strategy_"+e](t,i,o)},n.Strategy_dataoffset=function(e,t,i){this._strategyPlotIndex=e,this._targetPlotIndex=t,this._startIndex=i},n.Strategy_dataoffset.prototype.rebuildData=function(e){var t=this._targetPlotIndex+1,i=this._strategyPlotIndex+1,n=null,o=null;e.range(this._startIndex||e.firstIndex(),e.lastIndex()).each(function(r,s){var a,l,c,h=s[t],u=s[i]?Math.round(s[i]):null;return s[t]=null,s[i]=null,!(!u||u>0)&&(a=r+u,l={pointIndex:a,value:h},o?o.pointIndex!==l.pointIndex&&(a>=0&&(e.valueAt(a)[t]=h),c=!1,n&&(c=n.value<=o.value&&o.value<=h||n.value>=o.value&&o.value>=h),c?o.pointIndex>=0&&(e.valueAt(o.pointIndex)[t]=null):n=o,o=l):o=l,!1)})},t.study_ScriptWithDataOffset=n},function(e,t,i){"use strict";function n(){return null===c&&(c=new l.Session,c.init("Etc/UTC","24x7")),c}function o(e,t){return e.timezone===t.timezone&&e.session===t.session}var r,s,a,l,c,h;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"TimeSynchronizer",function(){return h}),r=i(15),s=i(35),a=i.n(s),l=i(37),i.n(l),c=null,h=function(){function e(e,t){this._sourceTargetBarBuilder=null,this._cache=new Map,this._source=e,this._target=t,this._isResolutionTheSame=r.Interval.isEqual(e.getResolution(),t.getResolution()),this._isSessionTheSame=o(e.getSymbolInfo(),t.getSymbolInfo()),this._shouldCorrectTradingDay=r.Interval.isDWM(e.getResolution())&&!this._isSessionTheSame}return e.prototype.sourceTimeToTargetTime=function(e){var t,i,n,o,r,s;return this._isSessionTheSame&&this._isResolutionTheSame?e:this._source.isValid()&&this._target.isValid()?(t=this._cache.get(e),void 0===t&&(i=1e3*e,this._shouldCorrectTradingDay&&(n=a.a.utc_to_cal(this._source.getSession().timezone,i),n=this._source.getSession().spec.correctTradingDay(n,this._source.getSession().timezone),o=new Date(n),a.a.set_hms(o,0,0,0,0,this._source.getSession().timezone),i=o.valueOf()),r=this._sourceTargetBuilder(),r.moveTo(i),s=r.indexOfBar(i),t=r.startOfBar(Math.max(0,s))/1e3,this._cache.set(e,t)),t):e},e.prototype._sourceTargetBuilder=function(){if(null===this._sourceTargetBarBuilder){var e=this._isSessionTheSame?this._target.getSession():n();this._sourceTargetBarBuilder=Object(l.newBarBuilder)(this._target.getResolution(),this._target.getSession(),e)}return this._sourceTargetBarBuilder},e}()},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"MainSeriesScaleRatioProperty",function(){return r}),n=i(8),o=i.n(n),r=function(){function e(e){this._changed=new o.a,this._model=e}return e.prototype.getStepChangeValue=function(){return.1},e.prototype.getMinValue=function(){return 1e-7},e.prototype.getMaxValue=function(){return 9999},e.prototype.value=function(){return this._model.mainSeriesScaleRatio()},e.prototype.setValue=function(e,t){(e!==this.value()||t)&&(this._model.setMainSeriesScaleRatio(e),this._onChanged())},e.prototype.state=function(){return null},e.prototype.clone=function(){return new e(this._model)},e.prototype.listeners=function(){return this._changed},
e.prototype.subscribe=function(e,t){this._changed.subscribe(e,t)},e.prototype.unsubscribe=function(e,t){this._changed.unsubscribe(e,t)},e.prototype.unsubscribeAll=function(e){this._changed.unsubscribeAll(e)},e.prototype._onChanged=function(){this._changed.fire(this)},e}()},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"MainSeriesPriceScaleNameProperty",function(){return r}),n=i(8),o=i.n(n),r=function(){function e(e){var t=this;this._changed=new o.a,this._defaultValues=["left","right","none"],this._model=e,this._model.mainSeriesPriceScaleNameChanged().subscribe(null,function(){return t._onChanged()})}return e.prototype.getValues=function(e){var t,i=[],n=this._defaultValues.length-1;for(t=0;t<=n;t++)(t!==n||e)&&i.push(this._defaultValues[t]);return i},e.prototype.value=function(){return this._model.mainSeriesPriceScaleName()},e.prototype.setValue=function(e,t){var i=this.value();(e!==i||t)&&this._model.setMainSeriesPriceScaleName(i,e)},e.prototype.state=function(){return null},e.prototype.clone=function(){return new e(this._model)},e.prototype.listeners=function(){return this._changed},e.prototype.subscribe=function(e,t){this._changed.subscribe(e,t)},e.prototype.unsubscribe=function(e,t){this._changed.unsubscribe(e,t)},e.prototype.unsubscribeAll=function(e){this._changed.unsubscribeAll(e)},e.prototype._onChanged=function(){this._changed.fire(this)},e}()},function(e,t,i){"use strict";function n(e){"LineToolGannComplex"!==e.type||void 0!==e.version&&1!==e.version||(e.type="LineToolGannFixed")}Object.defineProperty(t,"__esModule",{value:!0}),t.migrateState=n},function(e,t){},function(e,t,i){"use strict";function n(e){return null==e._parentMenu?null:o(e._parentMenu)}function o(e){return null==e._parentMenuItem?e:n(e._parentMenuItem)}function r(e,t){this.action=e,this._parentMenu=t}function s(e,t){this.action=e,this._parentMenu=t}var a,l,c;i(208),a=i(289),l=i(290),c=i(38).IS_RTL,r.prototype._createIconTag=function(){var e=this._iconTagAttributes();return this.jqIcon=l.create(a.ICON_CELL_TAG,e),this.jqIcon.addClass("context-menu"),this.jqIcon},r.prototype._createDeleteButton=function(){var e,t,i;if(!this.action.deleteButton)return null;e=this,t=this.action.deleteButton.action,i=l.create("span",{class:"context-menu-delete-button"}),t&&i.click(function(){return t.call(e),!1}),this.jqSubmenu.addClass("delete-spacer"),this.jqSubmenu.append(i)},r.prototype._createTextTag=function(){var e=this._textTagAttributes();return this.jqText=l.create(a.TEXT_CELL_TAG,e),this.jqIcon.addClass("context-menu"),this.jqText},r.prototype._createRightTag=function(){var e=this._rightTagAttributes();return this.jqRight=l.create(a.RIGHT_CELL_TAG,e),this.jqIcon.addClass("context-menu"),this.jqRight},r.prototype._createSubmenuTag=function(){var e=this._submenuTagAttributes();return this.jqSubmenu=l.create(a.SUBMENU_CELL_TAG,e),this.jqIcon.addClass("context-menu"),this.jqSubmenu},r.prototype._iconTagAttributes=function(){var e={},t=[];return this.action&&(this.action.icon?(t.push("icon"),
t.push(this.action.icon.replace(/\./,"_"))):this.action.checkable?(t.push("icon"),this.action.checked?(t.push("checked-icon"),e.html=i(195)):t.push("unchecked-icon")):t.push("spacer")),e.class=t.join(" "),e},r.prototype._textTagAttributes=function(){return{class:"text",html:this.action?this.action.text:""}},r.prototype.highlight=function(e){e?(this.jqRow.addClass("context-menu-hover"),this.jqIcon.addClass("context-menu-hover")):(this.jqRow.removeClass("context-menu-hover"),this.jqIcon.removeClass("context-menu-hover")),this.action&&this.action.hasSubActions()&&(e?this.jqSubmenu.addClass("expanded"):this.jqSubmenu.removeClass("expanded"))},r.prototype._rightTagAttributes=function(){var e={},t=["right"];return this.action&&this.action.shortcut&&(t.push("shortcut"),e.class=t.join(" "),e.html=this.action.shortcut),e},r.prototype._submenuTagAttributes=function(){var e={};return this.action&&this.action.hasSubActions()?e.class="submenu-arrow":e.class="context-menu spacer",e},r.prototype.render=function(){var e,t;return this._createRow(),e=this._createIconTag(),this.jqRow.append(c?this._createSubmenuTag():e),this.jqRow.append(this._createTextTag()),this.jqRow.append(this._createRightTag()),this.jqRow.append(c?e:this._createSubmenuTag()),this._createDeleteButton(),this.appendCallback(),t=this,this.jqRow.mouseenter(function(e){t.showSubmenu(e),t.highlight(!0),t._parentMenu&&t._parentMenu._parentMenuItem&&t._parentMenu._parentMenuItem.highlight(!0)}),this.jqRow.mouseleave(function(){t.highlight(!1)}),this.jqRow},r.prototype._createRow=function(){var e,t,i=this._rowTagAttributes();this.jqRow=l.create(a.ITEM_ROW_TAG,i),this.jqRow.addClass("context-menu"),e=this,this.action&&!this.action.hasSubActions()&&(t=function(e){e.destroy(),e._parentMenuItem&&t(e._parentMenuItem._parentMenu)},this.jqRow.click(function(i){t(e._parentMenu)}))},r.prototype.showSubmenu=function(e){var t,n;this._parentMenu.closeOtherSubmenus(this),this.action&&!this.action.hasSubActions()||(this._menu||(t=i(89),n={},this._menu=t.createMenu(this.action.subActions,n,this)),e.pageX=this._parentMenu.jqMenu.width()-2,e.pageY=this.jqSubmenu.offset().top-this._parentMenu.jqMenu.offset().top-1,this._menu.show(e,this._parentMenu.jqMenu))},r.prototype._rowTagAttributes=function(){var e=[];return this.action&&(!1===this.action.enabled&&e.push("disabled"),!1===this.action.visible&&e.push("hidden"),this.action.font&&e.push("font_"+this.action.font),this.action.hasSubActions()&&e.push("has_submenu"),this.action.htmlclass&&e.push(this.action.htmlclass)),{class:e.join(" ")}},r.prototype.appendCallback=function(){var e=this;this.jqRow.click(function(t){e.action.enabled&&e.action.executeCallback(t)})},r.prototype.getTopLevelMenu=function(){return n(this)},s.prototype.render=function(e){this._createRow();var t=this;return this.action.deferred.then(function(n){var o,r,s,a=i(288);for(o in n)r=n[o],s=t._parentMenu.addItem(r),a.renderItem(e,s)}).always(function(){t.jqRow.hide()}),this.jqRow},s.prototype._createIconTag=function(){var e=this._iconTagAttributes()
;return this.jqIcon=l.create(a.ICON_CELL_TAG,e),this.jqIcon.addClass("context-menu"),this.jqIcon},s.prototype._createRow=function(){var e=this._rowTagAttributes();this.jqRow=l.create(a.ITEM_ROW_TAG,e),this.jqRow.append(this._createIconTag()),this.jqRow.addClass("context-menu")},s.prototype._rowTagAttributes=function(){var e=[];return this.action&&e.push("spinner"),{class:e.join(" ")}},s.prototype.highlight=function(e){},s.prototype._iconTagAttributes=function(){var e={},t=[];return t.push("spacer"),e.class=t.join(" "),e.colspan="10",e},t.Item=r,t.ItemPlaceholder=s},function(e,t,i){"use strict";function n(e){var t,i;return e.getClientRects().length?(t=e.getBoundingClientRect(),"fixed"===getComputedStyle(e).position?{top:t.top,left:t.left}:(i=e.ownerDocument.defaultView,{top:t.top+i.pageYOffset,left:t.left+i.pageXOffset})):{top:0,left:0}}function o(e,t){var i,o,a,l,c,h,u=getComputedStyle(e),d=u.position;"static"===d&&(e.style.position="relative"),i=n(e),o=u.top,a=u.left,l=0,c=0,"absolute"!==d&&"fixed"!==d||"auto"!==o&&"auto"!==a?(o&&(l=parseFloat(o)),a&&(c=parseFloat(a))):(h=r(e),l=h.top,c=h.left),Object(s.isNumber)(t.top)&&(e.style.top=t.top-i.top+l+"px"),Object(s.isNumber)(t.left)&&(e.style.left=t.left-i.left+c+"px")}function r(e){var t=e.ownerDocument,i=e.offsetParent||t.documentElement,o=n(e),r=n(i);return{top:o.top-r.top,left:o.left-r.left}}var s;Object.defineProperty(t,"__esModule",{value:!0}),t.getOffset=n,t.setOffset=o,t.getPosition=r,s=i(84),i.n(s)},function(e,t,i){"use strict";(function(t){function n(e,t,i,n){this.reset(e,t,i,n)}var o=i(79).makeFont,r=i(116),s=t.enabled("charting_library_debug_mode");n.prototype.maxCount=200,n.prototype.reset=function(e,t,i,n){this._textWidthCache=new r(this.maxCount),this._fontSize=e,this._color=n,this._font=o(e,t,i),this._keys=[],this._hash={}},n.prototype.paintTo=function(e,t,i,n,o){var r=this.getLabelImage(e,t);"left"!==o&&(i-=r.textWidth),n-=Math.floor(r.height/2),e.drawImage(r.canvas,i,n)},n.prototype.getLabelImage=function(e,t){var i,n,o,r,a;return Object.prototype.hasOwnProperty.call(this._hash,t)?i=this._hash[t]:(this._keys.length>=this.maxCount&&(n=this._keys.shift(),delete this._hash[n]),i={text:t,textWidth:0,width:0,height:0,canvas:document.createElement("canvas")},o=Math.ceil(this._fontSize/4.5),r=Math.round(this._fontSize/10),a=Math.ceil(this._textWidthCache.measureText(e,t)),i.textWidth=Math.round(Math.max(1,a)),i.width=Math.round(a+2*o),i.height=this._fontSize+2*o,0!==a?(this._keys.push(i.text),this._hash[i.text]=i):s&&console.log('Canvas 2d context measureText return zero width for "'+t+'" text'),i.canvas.width=i.width,i.canvas.height=i.height,e=i.canvas.getContext("2d"),e.font=this._font,e.fillStyle=this._color,e.fillText(t,0,i.height-o-r)),i},e.exports=n}).call(t,i(5))},function(e,t,i){"use strict";function n(e,t,i){return void 0===i&&(i="promise rejected by time-out"),new Promise(function(n,o){var r=setTimeout(function(){return o(i)},t);e.then(function(e){clearTimeout(r),n(e)}),e.catch(function(e){clearTimeout(r),o(e)})})}
Object.defineProperty(t,"__esModule",{value:!0}),t.makeTimeLimited=n},function(e,t,i){"use strict";function n(e,t,i){this.chart=e,this.paneA=e.paneWidgets()[t],this.paneB=e.paneWidgets()[i],this.jqRow=$(document.createElement("tr")),this.jqRow.height(n.HEIGHT),this.jqCell=$(document.createElement("td")),this.jqCell.appendTo(this.jqRow),this.jqCell.addClass("pane-separator"),this.jqCell.attr("colspan","3"),this.jqCell.css("background",this.chart.properties().scalesProperties.lineColor.value()),this.jqCell.click(function(){}),this.handle=$('<div class="handle">').appendTo(this.jqCell),this._mouseEventHandler=new r(this.handle,this,!0)}var o,r;i(642),o=i(50).clamp,r=i(111).MouseEventHandler,n.prototype.destroy=function(){this._mouseEventHandler.destroy(),this.jqRow.remove()},n.HEIGHT=1,n.prototype.hide=function(){this.jqRow.addClass("js-hidden")},n.prototype.show=function(){this.jqRow.removeClass("js-hidden")},n.prototype.mouseDownEvent=function(e){(0===e.button||Modernizr.touch)&&(this.startY=e.pageY,this.deltaY=0,this.totalHeight=this.paneA.size.h+this.paneB.size.h,this.totalStretch=this.paneA.stretchFactor()+this.paneB.stretchFactor(),this.prevStretchA=this.paneA.stretchFactor(),this.minPaneHeight=30,this.maxPaneHeight=this.totalHeight-this.minPaneHeight,this.pixelStretchFactor=this.totalStretch/this.totalHeight)},n.prototype.pressedMouseMoveEvent=function(e){var t,i,n,r;(0===e.button||Modernizr.touch)&&(e.preventDefault(),this.deltaY=e.pageY-this.startY,t=this.paneA.size.h,i=o(t+this.deltaY,this.minPaneHeight,this.maxPaneHeight),n=i*this.pixelStretchFactor,r=this.totalStretch-n,this.paneA.setStretchFactor(n),this.paneB.setStretchFactor(r),this.chart._adjustSize(),this.paneA.size.h!==t&&(this.startY=e.pageY),this.chart.paint())},n.prototype.mouseUpEvent=function(e){(0===e.button||Modernizr.touch)&&(this.chart._model.addPaneStretchFactorUndoCommand(this.paneA._state,this.paneB._state,this.prevStretchA,this.paneA.stretchFactor()),this.startY=0,this.deltaY=0,this.totalHeight=0,this.totalStretch=0,this.minPaneHeight=0,this.maxPaneHeight=0,this.pixelStretchFactor=0)},n.prototype.update=function(){this.jqCell.css("background",this.chart.properties().scalesProperties.lineColor.value())},n.prototype.paint=function(){},n.prototype.image=function(){var e={},t=n.HEIGHT,i=this.paneA.lhsPriceAxisWidget.size.w,o=this.paneA.size.w,r=this.paneA.rhsPriceAxisWidget.size.w,s=$('<canvas width="'+i+'" height="'+t+'">')[0],a=s.getContext("2d");return a.fillStyle=this.chart.properties().scalesProperties.lineColor.value(),a.fillRect(0,0,i,t),e.leftAxis={content:s.toDataURL(),contentWidth:i,contentHeight:t},s=$('<canvas width="'+o+'" height="'+t+'">')[0],a=s.getContext("2d"),a.fillStyle=this.chart.properties().scalesProperties.lineColor.value(),a.fillRect(0,0,o,t),e.content=s.toDataURL(),e.contentWidth=o,e.contentHeight=t,s=$('<canvas width="'+r+'" height="'+t+'">')[0],a=s.getContext("2d"),a.fillStyle=this.chart.properties().scalesProperties.lineColor.value(),a.fillRect(0,0,r,t),e.rightAxis={content:s.toDataURL(),contentWidth:r,
contentHeight:t},e},e.exports=n},function(e,t){},function(e,t,i){"use strict";function n(e,t,n,r,s,a,l,c,h){var u=i(644).ChartUndoModel,d=new u(e,t,n,r,s,a,l,c,h);return d.model().invalidate(new o(o.FULL_UPDATE)),d}var o=i(18),r=i(26);TradingView.MAMetaInfo=function(){return new r({id:"MASimple",inputs:[{id:"length",type:"integer",defval:10},{id:"source",type:"text",defval:"close"}],plots:[{id:"MovAvg",type:"line"}],properties:[{id:"is_price_study",type:"bool",value:"true"}],palettes:{}})},TradingView.VolumeMetaInfo=function(){var e={id:"Volume",inputs:[],plots:[{id:"Volume",type:"histogram"},{id:"Color",type:"colorer",palette:"volumePalette",target:"Volume"}],properties:[{id:"is_price_study",type:"bool",value:"false"}],palettes:{volumePalette:{colors:{0:{color:"#007F0E",width:1,style:CanvasEx.LINESTYLE_SOLID,name:"Up Volume"},1:{color:"#872323",width:1,style:CanvasEx.LINESTYLE_SOLID,name:"Down Volume"}}}}};return new r(e)},TradingView.DMMetaInfo=function(){return new r({id:"DM",inputs:[{id:"ADX smoothing",max:50,min:1,type:"integer",defval:14},{id:"DI Length",max:500,min:1,type:"integer",defval:14}],plots:[{id:"ADX",type:"line"},{id:"DI_P",type:"line"},{id:"DI_N",type:"line"}],properties:[{id:"is_price_study",type:"bool",value:"false"}],palettes:{}})},TradingView.RSIMetaInfo=function(){return new r({id:"RSI",inputs:[{id:"length",type:"integer",defval:14}],plots:[{id:"RelativeStrengthIndex",type:"line"}],properties:[{id:"is_price_study",type:"bool",value:"false"}],palettes:{}})},e.exports=n},function(e,t,i){"use strict";(function(e){function n(t,i,n,o,r,s,a,l,c){this._chartWidget=s,this.m_model=new z(t,i,n,o,r,this,l,c),this.m_zoomStack=new oe,this.undoHistory=a,this._onRearrangePanes=new e,this._onSimpleZoomIn=new e,this._onSimpleZoomOut=new e,this._currentCustomMoveSource=null,this._currentLineMoveCommand=null,this.beginUndoMacro=a.beginUndoMacro.bind(a),this.endUndoMacro=a.endUndoMacro.bind(a),this.createUndoCheckpoint=a.createUndoCheckpoint.bind(a),this.undoToCheckpoint=a.undoToCheckpoint.bind(a)}function o(e,t,i,n){re.call(this,i),this._targetObj=e,this._newValue=t,this._model=n}function r(e,t,i,n){re.call(this,i),this._priceScale=t,this._newMode=e,this._model=n}function s(e,t,i,n){re.call(this,i),this._property=e,this._newValue=t,this._model=n,this._priceScale=this._model.mainSeries().priceScale()}function a(e,t,i,n){re.call(this,"scale price",!1),this.m_model=e,this.m_pane=t,this.m_priceScale=i,this.m_state=n,this.m_newPriceScaleState=null}function l(e,t,i){re.call(this,i,!1),this.setCustomFlag("doesnt_affect_save",!0),this.m_model=e,this.m_state=t,this.m_newTimeScaleState=null}function c(e,t,i,n){this._model=e,this._series=t,this._oldSymbol=t.symbol(),this._oldInterval=t.interval(),this._symbol=i,this._interval=n}function h(e,t,i,n,o){re.call(this,"Insert "+t.id),this._model=e,this._studyMetaInfo=t,this._props=i,this._isOverlay=n,this._parentSource=o,this._oldShowLeftScale=e.isLeftPriceScaleVisible(),this._oldShowRightScale=e.isRightPriceScaleVisible()}function u(e,t){re.call(this,"Remove Source"),
this._model=e,this._sourceId=t.id()}function d(e,t){re.call(this,"Remove Drawing(s)"),this._model=e,this._linetools=t,this._statesByPaneIndexes={}}function p(e,t,i,n){this._model=e,this._oldPane=this._model.paneForSource(t),re.call(this,this._oldPane===i?"Change Price Scale":"Move Source"),this._sourceId=t.id(),this._oldPaneIndex=e.panes().indexOf(this._oldPane),this._oldScaleName=this._oldPane.priceScaleName(t.priceScale()),this._oldShowLeftScale=e.isLeftPriceScaleVisible(),this._oldShowRightScale=e.isRightPriceScaleVisible(),this._pane=i,this._paneIndex=e.panes().indexOf(i),this._pane?this._scaleName=this._pane.priceScaleName(n):this._paneIndex=e.panes().length}function _(e,t,i){this._model=e,this._sourceId=t.id(),this._oldShowLeftScale=e.isLeftPriceScaleVisible(),this._oldShowRightScale=e.isRightPriceScaleVisible(),re.call(this,i)}function f(e,t){_.call(this,e,t,"Merge Up"),this._mergeRedoFn=this._model.mergeSourceUp,this._mergeUndoFn=this._model.unmergeSourceDown}function m(e,t){_.call(this,e,t,"Merge Down"),this._mergeRedoFn=this._model.mergeSourceDown,this._mergeUndoFn=this._model.unmergeSourceUp}function y(e,t){_.call(this,e,t,"Unmerge Up"),this._mergeRedoFn=this._model.unmergeSourceUp,this._mergeUndoFn=this._model.mergeSourceDown}function g(e,t){_.call(this,e,t,"Unmerge Down"),this._mergeRedoFn=this._model.unmergeSourceDown,this._mergeUndoFn=this._model.mergeSourceUp}function v(e,t,i){re.call(this,"Create line "+i,!1),this._model=e,this._paneIndex=e.panes().indexOf(t),this._lineTool=i}function S(e,t,i,n){re.call(this,"Move Drawing",!1),this._model=e,this._sourceId=t.id(),this._origPoint=i instanceof F?i.clone():TradingView.clone(i),this._pointIndex=n}function b(e,t,i){re.call(this,"Change %1 Z order (%2)".format(t.title(),i>0?"Forward":"Backward")),this._model=e,this._sourceId=t.id(),this._shift=i}function w(e,t){re.call(this,"Send "+t.title()+" to back"),this._model=e,this._sourceId=t.id()}function P(e,t){re.call(this,"Bring "+t.title()+" to front"),this._model=e,this._sourceId=t.id()}function T(e,t,i){re.call(this,"Remove pane"),this._model=e,this._index=t,this._pane=this._model.panes()[t],this._chart=i}function x(e,t,i,n){re.call(this,"Rearrange panes"),this._model=e,this._index=t,this._direction=i,this._chart=n}function C(e,t,i,n,o,r){re.call(this,"Zoom"),this._model=e,this._startBar=t,this._endBar=i,this._startPrice=n,this._endPrice=o,this._pane=r}function L(e,t,i){re.call(this,"Zoom"),this._baseCmd=e,this._zoomStack=t,this._inOut=i}function I(e,t,i,n,o){re.call(this,"",!1),this._model=e,this._paneA=t,this._paneB=i,this._prevStretchA=n,this._currStretchA=o}function A(e,t){re.call(this,"Restore Defaults"),this._model=e,this._defaultProperty=t,this._state=t.state(t._exclusions),this._chartWidget=e._undoModel._chartWidget}function k(e,t){re.call(this,"Apply Chart Theme"),this._model=e,this._newChartProps=TradingView.factoryDefaults("chartproperties"),this._newSeriesProps=TradingView.factoryDefaults("chartproperties.mainSeriesProperties"),["candleStyle","hollowCandleStyle","haStyle"].forEach(function(e){
t.mainSourceProperties[e].wickUpColor=t.mainSourceProperties[e].wickUpColor||t.mainSourceProperties[e].wickColor,t.mainSourceProperties[e].wickDownColor=t.mainSourceProperties[e].wickDownColor||t.mainSourceProperties[e].wickColor}),t.chartProperties.paneProperties.vertGridProperties=t.chartProperties.paneProperties.vertGridProperties||t.chartProperties.paneProperties.gridProperties,t.chartProperties.paneProperties.horzGridProperties=t.chartProperties.paneProperties.horzGridProperties||t.chartProperties.paneProperties.gridProperties,t.chartProperties.paneProperties.legendProperties=this._model.properties().state().paneProperties.legendProperties,this._newChartProps=$.extend(!0,{},this._newChartProps,t.chartProperties),delete this._newChartProps.scalesProperties.showLeftScale,delete this._newChartProps.scalesProperties.showRightScale,delete this._newChartProps.scalesProperties.scaleSeriesOnly,delete this._newChartProps.scalesProperties.showSeriesLastValue,delete this._newChartProps.scalesProperties.showStudyLastValue,delete this._newChartProps.scalesProperties.showSymbolLabels,delete this._newChartProps.scalesProperties.showStudyPlotLabels,e.timeScale().preserveBarSpacing()&&delete this._newChartProps.scalesProperties.barSpacing,this._newSeriesProps=$.extend(!0,{},this._newSeriesProps,t.mainSourceProperties),this._newChartProps.symbolWatermarkProperties||(this._newChartProps.symbolWatermarkProperties=defaults("chartproperties.symbolWatermarkProperties"),this._newChartProps.symbolWatermarkProperties.color=this._newChartProps.scalesProperties.textColor),this._oldChartProps=e.properties().state(),delete this._oldChartProps.paneProperties.topMargin,delete this._oldChartProps.paneProperties.bottomMargin,this._oldSeriesProps=e.properties().state().mainSeriesProperties}function E(e,t,i,n){var o;n=n||"",o=n+" Study template",re.call(this,o),this._model=e,this._oldProps=t,this._newProps=i,this._oldShowLeftScale=e.model().isLeftPriceScaleVisible(),this._oldShowRightScale=e.model().isRightPriceScaleVisible(),this._newSourcesPriceScalesNames=[]}function M(e,t,i,n,o){re.call(this,e),this._property=t,this._value=i,this._forceSetProperty=o,this._prevValue=t.value(),this._cw=n}function V(e,t){var i,n,o,r,s=t.priceScale(),a=[],l=t.firstValue();for(i=0;i<e.length;i++)n={offset:e[i].offset,time_t:e[i].time_t},o=e[i].price,r=s.priceToCoordinate(o,l),r-=40,o=s.coordinateToPrice(r,l),n.price=o,a.push(n);return a}function D(e,t,i){re.call(this,"clone "+t.title()),this._model=e,this._originalSource=t,this._withoutShift=i}function O(e,t){re.call(this,"Stop Sincing Drawing"),this._model=e,this._sourceId=t.id(),this._linkKey=t.linkKey}function R(e,t,i){re.call(this,"Paste Drawing"),this._model=e,this._clipboardData=t,this._paneIndex=this._model.panes().indexOf(i||this._model.paneForSource(this._model.mainSeries()))}function B(e,t){re.call(this,"Paste Indicator"),this._model=e,this._clipboardData=t}function N(e,t){re.call(this,"Move",!1),this._origPoint=e.clone(),this._point=null,this._handler=t}
var F=i(6).Point,W=i(73).createLineTool,H=i(0).LineDataSource,j=i(5),z=i(120),U=i(32),q=i(18),Y=i(194).doAnimate,G=i(301),K=i(3),Z=K.saveDefaultProperties,J=i(182),X=i(63).Series,Q=i(34),ee=Q.Study,te=i(124),ie=i(33),ne=i(292).showTooManyStudiesNotice,oe=i(293).UndoStack,re=i(43).UndoCommand,se=i(645).SaveLineToolStateUndoCommand,ae=i(646).ApplyLineToolTemplateUndoCommand,le=i(647).SetChartStyleCommand,ce=i(648).SetResolutionUndoCommand,he=i(42).preparePriceAxisProperties,ue=i(294).RestoreFactoryDefaultsUndoCommand,de=i(294).RestoreUserDefaultsUndoCommand,pe=i(42).getChartStyleByResolution,_e=i(4).getLogger("Chart.ChartUndoModel");inherit(n,G),n.prototype.version=function(){return this.m_model._version},n.prototype.onData=function(e){switch(e.method){case"timescale_update":var t=e.params;this.m_model.updateTimeScale(t.index,t.zoffset,t.changes,t.index_diff,t.marks,t.clear)}},n.prototype.paneForSource=function(e){return this.m_model.paneForSource(e)},n.prototype.createPane=function(e){return this.m_model.createPane(e)},n.prototype.dumpViews=function(){return this.m_model.dumpViews()},n.prototype.readOnly=function(){return this.m_model.readOnly()},n.prototype.restart=function(){this.m_model.restart()},n.prototype.disconnect=function(){this.m_model.disconnect()},n.prototype.studiesMetaData=function(){return this.m_model.studiesMetaData()},n.prototype.studyVersioning=function(){return this.m_model.studyVersioning()},n.prototype.chartModel=function(){return this.m_model},n.prototype.pushUndoCommand=function(e){this.undoHistory.pushUndoCommand(e)},n.prototype.startScalePrice=function(e,t,i){this.pushUndoCommand(new a(this.m_model,e,t,t.state())),this.chartModel().startScalePrice(e,t,i)},n.prototype.scalePriceTo=function(e,t,i){this.chartModel().scalePriceTo(e,t,i)},n.prototype.endScalePrice=function(e,t){this.chartModel().endScalePrice(e,t)},n.prototype.startScrollPrice=function(e,t,i){t.isAutoScale()||(this._initialPriceScrollState=t.state(),this._initialPriceScrollPos=i,this.chartModel().startScrollPrice(e,t,i))},n.prototype.scrollPriceTo=function(e,t,i){t.isAutoScale()||(this._initialPriceScrollPos&&Math.abs(this._initialPriceScrollPos-i)>20&&(this.pushUndoCommand(new a(this.m_model,e,t,this._initialPriceScrollState)),delete this._initialPriceScrollState,delete this._initialPriceScrollPos),this.chartModel().scrollPriceTo(e,t,i))},n.prototype.endScrollPrice=function(e,t){t.isAutoScale()||(delete this._initialPriceScrollState,delete this._initialPriceScrollPos,this.chartModel().endScrollPrice(e,t))},n.prototype.setPriceAutoScale=function(e,t,i){this.pushUndoCommand(new a(this.m_model,e,t,t.state())),this.chartModel().setPriceAutoScale(e,t,i)},n.prototype.resetPriceScale=function(e,t){this.pushUndoCommand(new a(this.m_model,e,t,t.state())),this.chartModel().resetPriceScale(e,t)},n.prototype.startScaleTime=function(e){this.pushUndoCommand(new l(this.m_model,this.m_model.timeScale().state(),"scale time")),this.chartModel().startScaleTime(e)},n.prototype.scaleTimeTo=function(e){this.chartModel().scaleTimeTo(e)},
n.prototype.endScaleTime=function(){this.chartModel().endScaleTime()},n.prototype.startScrollTime=function(e){this._initialTimeScrollState=this.m_model.timeScale().state(),this._initialTimeScrollPos=e,this.chartModel().startScrollTime(e)},n.prototype.scrollTimeTo=function(e){this._initialTimeScrollPos&&Math.abs(e-this._initialTimeScrollPos)>20&&(this.pushUndoCommand(new l(this.m_model,this._initialTimeScrollState,"scroll time")),delete this._initialTimeScrollPos,delete this._initialTimeScrollState),this.chartModel().scrollTimeTo(e)},n.prototype.gotoTime=function(e,t){var i,n,o=this.timeScale().visibleBars();if(null===o)return $.Deferred().reject().promise();i=o.firstBar(),n=this.m_model.timeScale().state(),this.chartModel().gotoTime(e,t),i!==this.timeScale().visibleBars().firstBar()&&this.pushUndoCommand(new l(this.m_model,n,"scroll time"))},n.prototype.endScrollTime=function(){this.chartModel().endScrollTime(),delete this._initialTimeScrollPos,delete this._initialTimeScrollState},n.prototype.resetTimeScale=function(){this.pushUndoCommand(new l(this.m_model,this.m_model.timeScale().state())),this.chartModel().resetTimeScale()},n.prototype.canZoomIn=function(){return this.chartModel().canZoomIn()},n.prototype.canZoomOut=function(){return this.chartModel().canZoomOut()},n.prototype.setWidth=function(e){this.m_model.setWidth(e)},n.prototype.setPaneHeight=function(e,t){this.m_model.setPaneHeight(e,t)},n.prototype.gridSource=function(){return this.m_model.gridSource()},n.prototype.watermarkSource=function(){return this.m_model.watermarkSource()},n.prototype.brandingSource=function(){return this.m_model.brandingSource()},n.prototype.addAlertsSource=function(e){return this.m_model.addAlertsSource(e)},n.prototype.alertsSources=function(){return this.m_model.alertsSources()},n.prototype.publishedChartsTimelineSource=function(){return this.m_model.publishedChartsTimelineSource()},n.prototype.barsMarksSources=function(){return this.m_model.barsMarksSources()},n.prototype.crossHairSource=function(){return this.m_model.crossHairSource()},n.prototype.model=function(){return this.m_model},n.prototype.chartWidget=function(){return this._chartWidget},n.prototype.mainSeries=function(){return this.m_model.m_mainSeries},n.prototype.mainSeriesScaleRatioProperty=function(){return this.m_model.mainSeriesScaleRatioProperty()},n.prototype.mainSeriesPriceScaleNameProperty=function(){return this.m_model.mainSeriesPriceScaleNameProperty()},n.prototype.panes=function(){return this.m_model.m_panes},n.prototype.timeScale=function(){return this.m_model.timeScale()},n.prototype.setSelectedSource=function(e,t){this.m_model.setSelectedSource(e,t)},n.prototype.setHoveredSource=function(e,t){this.m_model.setHoveredSource(e,t)},n.prototype.selectedSource=function(){return this.m_model.selectedSource()},n.prototype.onSelectedSourceChanged=function(){return this.m_model.onSelectedSourceChanged()},n.prototype.hoveredSource=function(){return this.m_model.hoveredSource()},n.prototype.activeStrategySource=function(){return this.m_model.activeStrategySource()},
n.prototype.invalidate=function(e){this.m_model.invalidate(e)},n.prototype.setCurrentPosition=function(e,t,i,n){this.m_model.setCurrentPosition(e,t,i,n)},n.prototype.setAndSaveCurrentPosition=function(e,t,i,n){this.m_model.setAndSaveCurrentPosition(e,t,i,n)},n.prototype.modifySeries=function(e,t,i){var n=new c(this.m_model,e,t,i);this.pushUndoCommand(n)},n.prototype.canCreateStudy=function(e){return this.model().chartApi().chartApi().isCanCreateStudy(e)},n.prototype.checkIfFeatureAvailable=function(e,t){var i=this.canCreateStudy(),n=t&&t instanceof ee;return!this.readOnly()&&n&&(i=this.canCreateStudy(!0)),!!i||void(n||ne())},n.prototype._insertStudy=function(e,t,i,n){var o=new h(this.m_model,e,t,i,n);return this.pushUndoCommand(o),o.insertedStudy()},n.prototype.insertStudyWithoutCheck=function(){return this._insertStudy.apply(this,arguments)},n.prototype.insertStudy=function(e,t,i,n){if(this.checkIfFeatureAvailable(e,n))return this._insertStudy(e,t,i,n)},n.prototype.setProperty=function(e,t,i){if(e&&e.value()!==t){var n=new o(e,t,i,this.m_model);this.pushUndoCommand(n),this.emitEvent("setProperty")}},n.prototype.setPriceScaleMode=function(e,t,i){var n,o,s=Object.keys(e),a=t.mode(),l=!1;for(n=0;n<s.length;n++)if(a[s[n]]!==e[s[n]]){l=!0;break}l&&(o=new r(e,t,i,this.m_model),this.pushUndoCommand(o))},n.prototype.setChartStyleProperty=function(e,t,i){if(e.value()!==t){var n=new le(e,t,this.mainSeries(),i,this.m_model,this._chartWidget);this.pushUndoCommand(n),this.emitEvent("setChartStyleProperty")}},n.prototype.setScaleRatioProperty=function(e,t,i){if(e.value()!==t){var n=new s(e,t,i,this.m_model);this.pushUndoCommand(n)}},n.prototype.setScreenChartProperty=function(e,t,i,n,o){if(o||e.value()!==t){var r=new M(n,e,t,i,o);this.pushUndoCommand(r)}},n.prototype.setResolutionProperty=function(e,t,i,n){if(e.value()!==t){var o=new ce(e,t,i,n);this.pushUndoCommand(o)}},n.prototype._getSourcesTree=function(e){var t,i=[],n=this.m_model.children(e);for(t=0;t<n.length;t++)i=i.concat(this._getSourcesTree(n[t]));return i.push(e),i},n.prototype.removeSource=function(e,t){var i,n,o;if(e.isUserDeletable()){if(i=this._getSourcesTree(e),this.lineBeingCreated()===e)this.cancelCreatingLine();else{for(this.beginUndoMacro("Remove source"),n=0;n<i.length;++n)o=new u(this.m_model,i[n]),this.pushUndoCommand(o);this.endUndoMacro()}t||(1===i.length?this.emitEvent("removeSource",[i[0]]):this.emitEvent("removeSources",[i]))}},n.prototype.removeSelectedSource=function(){var e,t=this.m_model.selectedSource();t&&t.isUserDeletable()&&(this.setSelectedSource(null),e=new u(this.m_model,t),this.pushUndoCommand(e),this.emitEvent("removeSource",[t]))},n.prototype.removeLineTools=function(e){var t,i,n=this.lineBeingCreated();n&&-1!==(t=e.indexOf(n))&&(this.cancelCreatingLine(),e.splice(t,1)),i=new d(this.m_model,e),this.pushUndoCommand(i),this.emitEvent("removeSources",[e])},n.prototype.move=function(e,t,i){var n=new p(this.m_model,e,t,i);this.pushUndoCommand(n),this.emitEvent("moveSource",[e])},n.prototype.mergeSourceUp=function(e){
var t=new f(this.m_model,e);this.pushUndoCommand(t),this.emitEvent("mergeSourceUp",[e])},n.prototype.mergeSourceDown=function(e){var t=new m(this.m_model,e);this.pushUndoCommand(t),this.emitEvent("mergeSourceDown",[e])},n.prototype.unmergeSourceUp=function(e){var t=new y(this.m_model,e);this.pushUndoCommand(t),this.emitEvent("unmergeSourceUp",[e])},n.prototype.unmergeSourceDown=function(e){var t=new g(this.m_model,e);this.pushUndoCommand(t),this.emitEvent("unmergeSourceDown",[e])},n.prototype.createLineTool=function(e,t,i,n,o){var r,s;return"LineToolRegressionTrend"!==i||this.canCreateStudy()?(this._createLineCommand=new v(this.m_model,e,i),r=this._createLineCommand.startCreatingLine(t,n,o),s=this._createLineCommand.line(),r&&(this.pushUndoCommand(this._createLineCommand),delete this._createLineCommand),s):void ne()},n.prototype.lineBeingCreated=function(){return this.m_model.lineBeingCreated()},n.prototype.paneBeingCreatedLineOn=function(){return this.m_model.paneBeingCreatedLineOn()},n.prototype.coninueCreatingLine=function(e,t,i){var n=this._createLineCommand.continueCreatingLine(e,t,i);return n&&(this.pushUndoCommand(this._createLineCommand),delete this._createLineCommand),n},n.prototype.finishLineTool=function(e){this.m_model.finishLineTool(e)},n.prototype.cancelCreatingLine=function(){this.m_model.cancelCreatingLine()},n.prototype.lineCancelled=function(){return this.m_model.lineCancelled()},n.prototype.startChangingLinetool=function(e,t,i,n){this._currentLineChangeCommand=new se(this.m_model,e,"Change "+i+"point",!1),this.m_model.startChangingLinetool(e,t,i,n)},n.prototype.lineBeingEdited=function(){return this.m_model.lineBeingEdited()},n.prototype.changeLinePoint=function(e,t){this.m_model.changeLinePoint(e,t)},n.prototype.endChangingLinetool=function(e){this.m_model.endChangingLinetool(e),this.pushUndoCommand(this._currentLineChangeCommand),this._currentLineChangeCommand=null},n.prototype.startMovingSource=function(e,t,i){e.doesMovingAffectsUndo()&&(this._currentLineMoveCommand=new S(this.m_model,e,t,i)),this.m_model.startMovingSource(e,t,i)},n.prototype.sourceBeingMoved=function(){return this.m_model.sourceBeingMoved()},n.prototype.moveSource=function(e){null!==this._currentLineMoveCommand&&this._currentLineMoveCommand.setPoint(e),this.m_model.moveSource(e)},n.prototype.endMovingSource=function(e){this.m_model.endMovingSource(e),null!==this._currentLineMoveCommand&&this._currentLineMoveCommand._point&&(this.pushUndoCommand(this._currentLineMoveCommand),this._currentLineChangeCommand=null),this._currentLineMoveCommand=null},n.prototype.dataSources=function(){return this.m_model.dataSources()},n.prototype.orderedDataSources=function(e){return this.m_model.orderedDataSources(e)},n.prototype.dataSourceForId=function(e){return this.m_model.dataSourceForId(e)},n.prototype.state=function(e,t){return this.m_model.state(e,t)},n.prototype.asyncState=function(e){return this.m_model.asyncState(e)},n.prototype.restoreState=function(e,t){return this.m_model.restoreState(e,t)},n.prototype.calculateDefaultTags=function(){
return this.m_model.calculateDefaultTags()},n.prototype.onTagsChanged=function(){return this.m_model.onTagsChanged()},n.prototype.changeZOrder=function(e,t){var i=new b(this.m_model,e,t);this.pushUndoCommand(i),this.emitEvent("changeZOrder",[e,t])},n.prototype.sendToBack=function(e){var t=new w(this.m_model,e);this.pushUndoCommand(t),this.emitEvent("changeZOrder",[e])},n.prototype.bringToFront=function(e){var t=new P(this.m_model,e);this.pushUndoCommand(t),this.emitEvent("changeZOrder",[e])},n.prototype.removeAllStudies=function(){var e,t,i;for(this.beginUndoMacro("remove all studies"),e=this.m_model.dataSources(),t=0;t<e.length;t++)i=e[t],(TradingView.isInherited(i.constructor,ee)&&!i.isChildStudy()&&i.removeByRemoveAllStudies()||TradingView.isInherited(i.constructor,te))&&this.removeSource(i);this.endUndoMacro()},n.prototype.removeAllDrawingTools=function(e){var t,i,n;for(this.beginUndoMacro("remove all drawing tools"),this.lineBeingCreated()&&this.cancelCreatingLine(),t=this.m_model.dataSources(),i=0;i<t.length;i++)n=t[i],TradingView.isInherited(n.constructor,H)&&n.isActualSymbol()&&n.isUserDeletable()&&(e&&e!==n._constructor||this.removeSource(n));this.endUndoMacro()},n.prototype.unlinkLine=function(e){var t=new O(this.m_model,e);this.pushUndoCommand(t)},n.prototype.copyToOtherCharts=function(e){this.m_model.copyToOtherCharts(e)},n.prototype.moveLeft=function(){var e,t;try{this.beginUndoMacro("Move Left")}catch(e){return}e=this.m_model.timeScale().width(),t=this,Y({to:e/5,onStep:function(e){t.startScrollTime(e),t.scrollTimeTo(0),t.endScrollTime()},onComplete:function(){t.endUndoMacro()}})},n.prototype.moveRight=function(){var e,t;try{this.beginUndoMacro("Move Right")}catch(e){return}e=this.m_model.timeScale().width(),t=this,Y({to:e/5,onStep:function(e){t.startScrollTime(0),t.scrollTimeTo(e),t.endScrollTime()},onComplete:function(){t.endUndoMacro()}})},n.prototype.scrollChart=function(e){j.enabled("chart_scroll")&&(this.startScrollTime(0),this.scrollTimeTo(e),this.endScrollTime())},n.prototype.scrollChartByBar=function(e){if(j.enabled("chart_scroll")){var t=e*this.m_model.timeScale().barSpacing();this.startScrollTime(0),this.scrollTimeTo(t),this.endScrollTime()}},n.prototype.zoomIn=function(e,t){var i,n,o=this.m_model.timeScale().width(),r=this;if(t=t||1,this.canZoomIn())if(e)i=t*o/10,n=i*((e+1)/2),this.startScaleTime(i),this.scaleTimeTo(0),this.endScaleTime(),this.startScrollTime(0),this.scrollTimeTo(i-n),this.endScrollTime(),this._onSimpleZoomIn.fire();else{try{this.beginUndoMacro("Zoom In")}catch(e){return}Y({to:o/5,onStep:function(e){r.startScaleTime(e),r.scaleTimeTo(0),r.endScaleTime()},onComplete:function(){r.endUndoMacro(),r._onSimpleZoomIn.fire()}})}},n.prototype.zoomOut=function(e,t){var i=this.m_model.timeScale().width(),n=this;if(t=t||1,this.canZoomOut())if(e)this.startScaleTime(0),this.scaleTimeTo(t*i/10),this.endScaleTime(),this.startScrollTime(t*(i/20-i/20*e)),this.scrollTimeTo(0),this.endScrollTime(),this._onSimpleZoomOut.fire();else{try{this.beginUndoMacro("Zoom Out")}catch(e){return}Y({to:i/5,
onStep:function(e){n.startScaleTime(0),n.scaleTimeTo(e),n.endScaleTime()},onComplete:function(){n.endUndoMacro(),n._onSimpleZoomOut.fire()}})}},n.prototype.resetScales=function(){var e,t;for(this.beginUndoMacro("Reset scales"),this.resetTimeScale(),e=0;e<this.panes().length;e++)t=this.panes()[e],this.resetPriceScale(t,t.leftPriceScale()),this.resetPriceScale(t,t.rightPriceScale());this.endUndoMacro(),this.m_model.recalculateAllPanes()},n.prototype.zoomToViewport=function(e,t,i,n,o){var r=new C(this.m_model,e,t,i,n,o),s=new L(r,this.m_zoomStack,!0);this.pushUndoCommand(s)},n.prototype.zoomFromViewport=function(){var e=new L(this.m_zoomStack.head(),this.m_zoomStack,!1);this.pushUndoCommand(e)},n.prototype.zoomStack=function(){return this.m_zoomStack},n.prototype.addPaneStretchFactorUndoCommand=function(e,t,i,n){var o=new I(this.m_model,e,t,i,n);this.pushUndoCommand(o)},n.prototype.restoreFactoryDefaults=function(e){var t=new ue(this.m_model,e);this.pushUndoCommand(t)},n.prototype.restoreDefaults=function(e){var t=new de(this.m_model,e);this.pushUndoCommand(t)},n.prototype.chartLoadTheme=function(e,t){var i=new k(e,t);this.pushUndoCommand(i)},n.prototype.applyLineToolTemplate=function(e,t,i){this.beginUndoMacro(i),this.saveLineToolState(e,i);var n=new ae(e,t,i);this.pushUndoCommand(n),this.saveLineToolState(e,i),this.endUndoMacro(),this.model().updateSource(e)},n.prototype.restoreLineToolFactoryDefaults=function(e,t){this.beginUndoMacro(t),this.saveLineToolState(e,t),e.restoreFactoryDefaults(),this.saveLineToolState(e,t),this.endUndoMacro()},n.prototype.studyLoadTemplate=function(e,t,i,n){var o=new E(e,t,i,n);this.pushUndoCommand(o)},n.prototype.onRearrangePanes=function(){return this._onRearrangePanes},n.prototype.onSimpleZoomIn=function(){return this._onSimpleZoomIn},n.prototype.onSimpleZoomOut=function(){return this._onSimpleZoomOut},n.prototype.loadRange=function(e){e.res!==this.m_model.mainSeries().properties().interval.value()?(this.m_model.mainSeries().setDefaultTimeframe(e.val),this.setProperty(this.m_model.mainSeries().properties().interval,e.res,"Change date range")):this.m_model.mainSeries().loadDataTo(e.val)},n.prototype.cloneLineTool=function(e,t){var i=new D(this.m_model,e,t);return this.pushUndoCommand(i),this.emitEvent("cloneLineTool"),i.clonedLineToolId()},n.prototype.alertsList=function(){return this.m_model.alertsList()},n.prototype.alertsListChanged=function(){return this.m_model.alertsListChanged()},n.prototype.insertStudyStub=function(e){return this.m_model.insertStudyStub(e)},n.prototype.removeStudyStub=function(e){return this.m_model.removeStudyStub(e)},n.prototype.isJustClonedChart=function(){return this._chartWidget.isJustClonedChart()},n.prototype.copySourceToClip=function(e){if(e&&!e.properties().blockCopying){var t={};if(e instanceof H)t.type="drawing",t.geometry=e.geometry();else{if(!(e instanceof ee))return!1;t.type="study"}return t.source=e.state&&e.state(),(delete t.source.alertId,delete t.source.linkKey,t.source)?(t.title=e.title&&e.title(),t.modelId=this.m_model._id,J.set(t),!0):!1}},
n.prototype.cutSourceToClip=function(e){if(!this.copySourceToClip(e))return!1;this.removeSource(e)},n.prototype.pasteLineTool=function(e,t){var i=new R(this.m_model,t,e);this.pushUndoCommand(i)},n.prototype.pasteStudy=function(e){var t=new B(this.m_model,e);this.pushUndoCommand(t)},n.prototype.pasteSourceFromClip=function(e,t){var i=J.get();if(!i)return!1;"drawing"===i.type&&this.pasteLineTool(e,i),"study"===i.type&&this.checkIfFeatureAvailable(i.state)&&this.pasteStudy(i)},n.prototype.trackTime=function(){return this._chartWidget.trackTime()},n.prototype.isInReplay=function(){return this.m_model.isInReplay()},n.prototype.switchToReplay=function(e){},n.prototype.switchToRealtime=function(){},n.prototype.startCustomMoving=function(e,t,i){this._currentCustomMoveCommand=new N(t,i),this._currentCustomMoveSource=e},n.prototype.customMoveBeingProcessed=function(){return null!==this._currentCustomMoveSource},n.prototype.processCustomMove=function(e){this._currentCustomMoveCommand.setPoint(e)},n.prototype.endCustomMoving=function(){null!==this._currentCustomMoveCommand.point()&&(this.pushUndoCommand(this._currentCustomMoveCommand),this._currentCustomMoveCommand=null,this._currentCustomMoveSource=null)},n.prototype.saveLineToolState=function(e,t){this.pushUndoCommand(new se(this.m_model,e,t))},inherit(o,re),o.prototype.redo=function(){this._oldValue=this._targetObj.value(),Z(!0),this._targetObj.setValue(this._newValue),Z(!1),this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new q(q.LIGHT_UPDATE)))},o.prototype.undo=function(){Z(!0),this._targetObj.setValue(this._oldValue),Z(!1),this._oldValue=null,this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new q(q.LIGHT_UPDATE)))},inherit(r,re),r.prototype.redo=function(){this._oldMode=this._priceScale.mode(),Z(!0),this._priceScale.setMode(this._newMode),Z(!1),this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new q(q.LIGHT_UPDATE)))},r.prototype.undo=function(){Z(!0),this._priceScale.setMode(this._oldMode),Z(!1),this._oldMode=null,this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new q(q.LIGHT_UPDATE)))},inherit(s,re),s.prototype.redo=function(){this._oldValue=this._property.value(),this._oldMode=this._priceScale.mode(),Z(!0),this._priceScale.setMode({autoScale:!1,percentage:!1,log:!1}),this._property.setValue(this._newValue),Z(!1),this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new q(q.LIGHT_UPDATE)))},s.prototype.undo=function(){Z(!0),this._property.setValue(this._oldValue),this._priceScale.setMode(this._oldMode),Z(!1),this._oldMode=null,this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new q(q.LIGHT_UPDATE)))},inherit(a,re),a.prototype.undo=function(){if(null!==this.m_newPriceScaleState)return void _e.logDebug("PriceScaleChangeUndoCommand.undo: Command is already undone");this.m_newPriceScaleState=this.m_priceScale.state(),this.m_model.restorePriceScaleState(this.m_pane,this.m_priceScale,this.m_state)},a.prototype.redo=function(){
if(null===this.m_newPriceScaleState)return void _e.logDebug("PriceScaleChangeUndoCommand.redo: Command is not undone");this.m_model.restorePriceScaleState(this.m_pane,this.m_priceScale,this.m_newPriceScaleState),this.m_newPriceScaleState=null},inherit(l,re),l.prototype.undo=function(){if(null!==this.m_newTimeScaleState)return void _e.logDebug("TimeScaleChangeUndoCommand.undo: Command is already undone");this.m_newTimeScaleState=this.m_model.timeScale().state(),this.m_model.restoreTimeScaleState(this.m_state)},l.prototype.redo=function(){if(null===this.m_newTimeScaleState)return void _e.logDebug("TimeScaleChangeUndoCommand.redo: Command is not undone");this.m_model.restoreTimeScaleState(this.m_newTimeScaleState),this.m_newTimeScaleState=null},inherit(c,re),c.prototype.redo=function(){this._model.modifySeries(this._series,this._symbol,this._interval)},c.prototype.undo=function(){this._model.modifySeries(this._series,this._oldSymbol,this._oldInterval)},inherit(h,re),h.prototype.redo=function(){var e,t,i=null;return this._studyState?(i=this._model.restoreSource(this._restorePane,this._paneIndex,this._paneState,this._studyState,this._priceScaleName),this._studyId!==i.id()&&_e.logError("Study was restored improperly - study ids does not match"),delete this._studyState):(i=this._model.insertStudy(this._studyMetaInfo,this._props,this._isOverlay,this._parentSource),this._studyId=i.id()),e=this._model.paneForSource(i),t=e.priceScaleName(i.priceScale()),this._model.setPriceScaleVisibility(t,!0),i},h.prototype.insertedStudy=function(){return this._model.dataSourceForId(this._studyId)},h.prototype.undo=function(){var e,t=this.insertedStudy();this._studyState=t.state(),e=this._model.paneForSource(t),this._paneIndex=this._model.panes().indexOf(e),this._paneState=e.state(),this._restorePane=this._model.removeSource(t),this._model.setLeftPriceScaleVisible(this._oldShowLeftScale),this._model.setRightPriceScaleVisible(this._oldShowRightScale)},inherit(u,re),u.prototype.redo=function(){var e,t=this._model.dataSourceForId(this._sourceId);this._sourceState=t.state(),e=this._model.paneForSource(t),this._paneIndex=this._model.panes().indexOf(e),this._priceScaleName=e.priceScaleName(t.priceScale()),this._paneState=e.state(),this._restorePane=this._model.removeSource(t)},u.prototype.undo=function(){var e=this._model.restoreSource(this._restorePane,this._paneIndex,this._paneState,this._sourceState,this._priceScaleName);this._sourceId!==e.id()&&_e.logError("Source was restored improperly - source ids does not match")},inherit(d,re),d.prototype.redo=function(){var e,t,i;for(e=0;e<this._linetools.length;e++)t=this._model.paneForSource(this._linetools[e]),i=this._model.panes().indexOf(t),this._statesByPaneIndexes[i]=this._statesByPaneIndexes[i]||[],this._statesByPaneIndexes[i].push({state:this._linetools[e].state(),owner:this._linetools[e].ownerSource().id()}),t.removeDataSource(this._linetools[e]);delete this._linetools},d.prototype.undo=function(){var e,t,i,n,o,r,s;this._linetools=[]
;for(e in this._statesByPaneIndexes)for(t=this._model.panes()[e],i=this._statesByPaneIndexes[e],n=0;n<i.length;n++)o=i[n],r=this._model.dataSourceForId(o.owner),s=t._restoreLineTool(o.state),s.setOwnerSource(r),s.updateAllViews(),this._linetools.push(s);this._model.invalidate(new q(q.LIGHT_UPDATE))},inherit(p,re),p.prototype.redo=function(){var e,t;-1===this._model.panes().indexOf(this._pane)&&(this._pane=this._model.createPane(this._paneIndex)),e=this._model.dataSourceForId(this._sourceId),this._model.move(e,this._pane,this._pane.priceScaleByName(this._scaleName)),t=this._pane.priceScaleName(e.priceScale()),this._model.setPriceScaleVisibility(t,!0)},p.prototype.undo=function(){-1===this._model.panes().indexOf(this._oldPane)&&(this._oldPane=this._model.createPane(this._oldPaneIndex)),this._model.move(this._model.dataSourceForId(this._sourceId),this._oldPane,this._oldPane.priceScaleByName(this._oldScaleName)),this._model.setLeftPriceScaleVisible(this._oldShowLeftScale),this._model.setRightPriceScaleVisible(this._oldShowRightScale)},inherit(_,re),_.prototype.redo=function(){var e,t,i=this._model.dataSourceForId(this._sourceId);this._mergeRedoFn.call(this._model,i),e=this._model.paneForSource(i),t=e.priceScaleName(i.priceScale()),this._model.setPriceScaleVisibility(t,!0)},_.prototype.undo=function(){var e=this._model.dataSourceForId(this._sourceId);this._mergeUndoFn.call(this._model,e),this._model.setLeftPriceScaleVisible(this._oldShowLeftScale),this._model.setRightPriceScaleVisible(this._oldShowRightScale)},inherit(f,_),inherit(m,_),inherit(y,_),inherit(g,_),inherit(v,re),v.prototype.startCreatingLine=function(e,t,i){var n,o;return this._points=[{point:e}],n=this._model.panes()[this._paneIndex],o=this._model.createLineTool(n,e,this._lineTool,t,i),this._lineId=o.id(),!this._model.lineBeingCreated()},v.prototype.continueCreatingLine=function(e,t,i){return this._points||_e.logError("continueCreatingLine is called before startCreatingLine"),this._points.push({point:e,envState:t}),this._model.coninueCreatingLine(e,t,i)},v.prototype.line=function(){return this._lineId?this._model.dataSourceForId(this._lineId):null},v.prototype.undo=function(){var e=this.line();e&&(this._lineState=e.state(),this._model.removeSource(e),delete this._lineId)},v.prototype.redo=function(){this._lineState||_e.logError("This command was never undone - nothing to redo");var e=this._model.restoreSource(!1,this._paneIndex,null,this._lineState,null);this._lineId=e.id(),delete this._lineState},inherit(S,re),S.prototype.setPoint=function(e){this._point=e instanceof F?e.clone():TradingView.clone(e)},S.prototype.undo=function(){var e=this._model.dataSourceForId(this._sourceId);this._model.startMovingSource(e,this._point,this._pointIndex),this._model.moveSource(this._origPoint),this._model.endMovingSource()},S.prototype.redo=function(){var e=this._model.dataSourceForId(this._sourceId);this._model.startMovingSource(e,this._origPoint,this._pointIndex),this._model.moveSource(this._point),this._model.endMovingSource()},inherit(b,re),b.prototype.undo=function(){
var e=this._model.dataSourceForId(this._sourceId);this._model.changeZOrder(e,-this._shift)},b.prototype.redo=function(){var e=this._model.dataSourceForId(this._sourceId);this._model.changeZOrder(e,this._shift)};inherit(w,re),w.prototype.undo=function(){var e=this._model.dataSourceForId(this._sourceId);this._model.bringToFront(e)},w.prototype.redo=function(){var e=this._model.dataSourceForId(this._sourceId);this._model.sendToBack(e)},inherit(P,re),P.prototype.undo=function(){var e=this._model.dataSourceForId(this._sourceId);this._model.sendToBack(e)},P.prototype.redo=function(){var e=this._model.dataSourceForId(this._sourceId);this._model.bringToFront(e)},n.prototype.removePane=function(e,t){var i=new T(this,t,e);this.pushUndoCommand(i)},inherit(T,re),T.prototype.redo=function(){this._model.panes().splice(this._index,1),this._chart._updateGui()},T.prototype.undo=function(){this._model.panes().splice(this._index,0,this._pane),this._chart._updateGui()},n.prototype.rearrangePanes=function(e,t,i){var n=new x(this,t,i,e);this.pushUndoCommand(n),this._onRearrangePanes.fire()},inherit(x,re),x.prototype.redo=function(){var e=this._model.panes()[this._index];"up"===this._direction&&this._index>0&&(this._model.panes().splice(this._index,1),this._model.panes().splice(this._index-1,0,e)),"down"===this._direction&&this._index<this._model.panes().length-1&&(this._model.panes().splice(this._index,1),this._model.panes().splice(this._index+1,0,e)),this._model.invalidate(new q(q.FULL_UPDATE))},x.prototype.undo=function(){var e;"up"===this._direction&&(e=this._model.panes()[this._index-1],this._model.panes().splice(this._index-1,1),this._model.panes().splice(this._index,0,e)),"down"===this._direction&&(e=this._model.panes()[this._index+1],this._model.panes().splice(this._index+1,1),this._model.panes().splice(this._index,0,e)),this._model.invalidate(new q(q.FULL_UPDATE))},inherit(C,re),C.prototype.redo=function(){this._timeScaleState=this._model.timeScale().state(),this._priceScaleState=this._pane.defaultPriceScale().state(),this._model.zoomToViewport(this._startBar,this._endBar,this._startPrice,this._endPrice,this._pane)},C.prototype.undo=function(){this._model.timeScale().restoreState(this._timeScaleState),this._pane.defaultPriceScale().restoreState(this._priceScaleState),this._model.recalculateAllPanes(),this._model.invalidate(new q(q.LIGHT_UPDATE))},inherit(L,re),L.prototype.undo=function(){if(this._inOut){if(this._baseCmd!==this._zoomStack.head())return void _e.logDebug("zoom stack inconsistency");this._baseCmd.undo(),this._zoomStack.pop()}else this._baseCmd.redo(),this._zoomStack.push(this._baseCmd)},L.prototype.redo=function(){if(this._inOut)this._baseCmd.redo(),this._zoomStack.push(this._baseCmd);else{if(this._baseCmd!==this._zoomStack.head())return void _e.logDebug("zoom stack inconsistency");this._baseCmd.undo(),this._zoomStack.pop()}},inherit(I,re),I.prototype.redo=function(){var e=this._paneA._stretchFactor+this._paneB._stretchFactor;this._paneA._stretchFactor=this._currStretchA,
this._paneB._stretchFactor=e-this._currStretchA,this._model.invalidate(new q(q.FULL_UPDATE))},I.prototype.undo=function(){var e=this._paneA._stretchFactor+this._paneB._stretchFactor;this._paneA._stretchFactor=this._prevStretchA,this._paneB._stretchFactor=e-this._prevStretchA,this._model.invalidate(new q(q.FULL_UPDATE))},inherit(A,re),A.prototype.redo=function(){this._model.restoreFactoryDefaults(this._defaultProperty)},A.prototype.undo=function(){this._defaultProperty.merge(this._state),this._defaultProperty.listeners().fire(this._defaultProperty),this._model.mainSeries().onChartStyleChanged()},inherit(k,re),k.prototype._merge=function(e,t){var i=this._model;Z(!0),e&&(i.properties().paneProperties.mergeAndFire(e.paneProperties),i.properties().scalesProperties.mergeAndFire(e.scalesProperties),i.properties().symbolWatermarkProperties.mergeAndFire(e.symbolWatermarkProperties)),i.mainSeries().priceScale().setMode({autoScale:t.priceAxisProperties.autoScale,percentage:t.priceAxisProperties.percentage,log:t.priceAxisProperties.log,lockScale:t.priceAxisProperties.lockScale}),i.mainSeries().setChartStyleWithIntervalIfNeeded(t.style),delete t.style,delete t.interval,i.mainSeries().properties().mergeAndFire(t),i.mainSeries().properties().saveDefaults(),i.mainSeries().createPaneView(),i.mainSeries().invalidateBarStylesCache(),i._version=t.version,i.recalculateAllPanes(),i.invalidate(new q(q.FULL_UPDATE)),i.properties().saveDefaults(),Z(!1)},k.prototype.undo=function(){this._merge(this._oldChartProps,this._oldSeriesProps),this._model.mainSeries().onChartStyleChanged(),this._model.updateScales(),this._model.chartThemeLoaded()},k.prototype.redo=function(){this._merge(this._newChartProps,this._newSeriesProps),this._model.mainSeries().onChartStyleChanged(),this._model.updateScales(),this._model.chartThemeLoaded()},inherit(E,re),E.prototype._merge=function(e){var t,i,n,o,r,s,a,l,c,h,u,d,p,_=this._model.model(),f=_.mainSeries();for(f.priceScale().properties().lockScale.setValue(!1),e.interval&&(t=pe(e.interval,f.properties().style.value()),f.setChartStyleWithIntervalIfNeeded(t,e.interval)),i=[],n=_.panes(),o=n.length;o--;)for(r=n[o],s=r.containsMainSeries(),a=r.dataSources(),l=a.length;l--;)c=a[l],(!s||c instanceof ee)&&(c.isRemovedByStudyTemplates()||i.push(c),_.removeSource(c));for(h=e.panes,function(e,t){return e.dataSources().some(function(e){return e.alert&&e.alert().id===t.alert.id})},o=0;o<h.length;o++){for(u=!1,d=h[o],l=0;l<d.sources.length;l++)c=d.sources[l],"MainSeries"===c.type&&(delete c.state,u=!0),-1!==d.leftAxisSources.indexOf(c.id)&&-1===this._newSourcesPriceScalesNames.indexOf("left")&&this._newSourcesPriceScalesNames.push("left"),-1!==d.rightAxisSources.indexOf(c.id)&&-1===this._newSourcesPriceScalesNames.indexOf("right")&&this._newSourcesPriceScalesNames.push("right");if(r=null,r=u?n[o]:_.createPane(o),r.restoreState(h[o],!1,e.version),u)for(p=0;p<i.length;p++)i[p].restore&&i[p].restore()}f.priceScale().setMode({autoScale:!0}),_._version=e.version,_.startNotStartedStudies(),_.recalculateAllPanes(),
_.invalidate(new q(q.FULL_UPDATE))},E.prototype.redo=function(){var e,t,i;for(this._merge(this._newProps),e=this._model.model(),e.mainSeries().onChartStyleChanged(),t=this._model.model().mainSeries().properties(),he(t),e._recalcVisibleRangeStudy(e.dataSources(),!0),i=0;i<this._newSourcesPriceScalesNames.length;i++)e.setPriceScaleVisibility(this._newSourcesPriceScalesNames[i],!0)},E.prototype.undo=function(){this._merge(this._oldProps),this._model.model().mainSeries().onChartStyleChanged(),this._model.model().setLeftPriceScaleVisible(this._oldShowLeftScale),this._model.model().setRightPriceScaleVisible(this._oldShowRightScale)},inherit(M,re),M.prototype.redo=function(){this._cw.screen.show(),this._property.setValue(this._value,this._forceSetProperty)},M.prototype.undo=function(){this._cw.screen.show(),this._property.setValue(this._prevValue,this._forceSetProperty)},inherit(D,re),D.prototype.redo=function(){var e,t,i,n,o,r,s,a,l,c,h;if(this._lineState)r=this._model.restoreSource(!1,this._paneIndex,null,this._lineState,null);else{for(e=this._originalSource,t=e.priceScale(),i=this._model.paneForSource(e),n=TradingView.className(e.constructor),o=e.properties().clone(),r=W(n,this._model,o,null,e.ownerSource()),r.setOwnerSource(e.ownerSource()),r.properties().visible._value=!0,r._fixedPoints=r._fixedPoints.concat(e._fixedPoints),s=0;s<r._fixedPoints.length;s++)r._fixedPoints[s]=r._fixedPoints[s].add(new F(20,20));a=e._timePoint,l=this._withoutShift?TradingView.clone(a):V(a,e.ownerSource()),c=e._points,h=c,r.restorePoints(l,h),r.cloneData&&r.cloneData(e),i.addDataSource(r,t),this._model.updateSource(r),r.checkAlert&&r.checkAlert(),this._paneIndex=this._model.panes().indexOf(i),U.drawOnAllCharts().value()&&this._model.copyToOtherCharts(r),this._lineState=r.state()}},D.prototype.undo=function(){this._lineState||_e.logError("This command was never executed - nothing to undo");var e=this._model.dataSourceForId(this._lineState.id);this._model.removeSource(e)},D.prototype.clonedLineToolId=function(){return this._lineState.id},inherit(O,re),O.prototype.redo=function(){delete this._model.dataSourceForId(this._sourceId).linkKey},O.prototype.undo=function(){this._model.dataSourceForId(this._sourceId).linkKey=this._linkKey},inherit(R,re),R.prototype.redo=function(){var e,t,i,n,o,r,s,a,l,c,h=this._model.panes()[this._paneIndex],u=h.dataSourceForId(this._clipboardData.source.ownerSource)||h.mainDataSource();this._sourceState||(e=!0,t=this._clipboardData.source.state.symbol,i=h.mainDataSource(),n=i.symbol?i.symbol():"",o=t===n,o&&(u instanceof X&&(e=!1),u instanceof ee&&(e=!u.metaInfo().is_price_study)),r=TradingView.clone(this._clipboardData.source),delete r.state.symbol,e?(s=this._model,a=function(e){var t=e.x*s.timeScale().width(),i=e.y*u.priceScale().height();return new F(t,i)},l=u.firstValue(),r.points=this._clipboardData.geometry.map(function(e){var t=a(e),i=s.timeScale().coordinateToIndex(t.x),n=s.timeScale().normalizeBarIndex(i);return n.price=u.priceScale().coordinateToPrice(t.y,l),n
})):this._model._id===this._clipboardData.modelId&&u.id()===this._clipboardData.source.ownerSource&&(r.points=V(this._clipboardData.source.points,u)),r.id=ie.guid(),this._sourceState=r),c=h._restoreLineTool(this._sourceState,null,!1),c.calcIsActualSymbol(),c.setOwnerSource(u),c.setPriceScale(u.priceScale()),u.priceScale().addDataSource(c),c.createServerPoints(),this._model.invalidate(new q(q.LIGHT_UPDATE,!0))},R.prototype.undo=function(){var e,t;this._sourceState||_e.logError("This command was never executed - nothing to undo"),e=this._model.panes()[this._paneIndex],t=e.dataSourceForId(this._sourceState.id),this._model.removeSource(t)},inherit(B,re),B.prototype.redo=function(){var e,t,i,n;this._sourceState||(e=TradingView.clone(this._clipboardData.source),e.id=ie.guid(),this._sourceState=e),t=null,i=null,this._sourceState.metaInfo.is_price_study?(t=this._model.paneForSource(this._model.mainSeries()),i=this._model.mainSeries().priceScale()):(t=this._model.createPane(),i=t.defaultPriceScale()),n=t._restoreStudy(this._sourceState),n.start(),n.setPriceScale(i),t.move(n,i)},B.prototype.undo=function(){this._sourceState||_e.logError("This command was never executed - nothing to undo");var e=this._model.dataSourceForId(this._sourceState.id);this._model.removeSource(e)},inherit(N,re),N.prototype.setPoint=function(e){this._point=e.clone(),this._handler(e)},N.prototype.point=function(){return this._point},N.prototype.undo=function(){this._handler(this._origPoint)},N.prototype.redo=function(){this._handler(this._point)},t.ChartUndoModel=n}).call(t,i(8))},function(e,t,i){"use strict";var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"SaveLineToolStateUndoCommand",function(){return s}),n=i(1),o=i(7),i.n(o),r=i(43),s=function(e){function t(t,i,n,o){void 0===o&&(o=!0);var r=e.call(this,n,o)||this;return r._model=t,r._savedState=i.state(!0),r}return n.c(t,e),t.prototype.redo=function(){this._toggleState()},t.prototype.undo=function(){this._toggleState()},t.prototype._getSource=function(){return Object(o.ensureNotNull)(this._model.dataSourceForId(this._savedState.id))},t.prototype._toggleState=function(){var e=this._getSource(),t=this._savedState;this._savedState=e.state(!0),this._model.restoreLineToolState(e,t)},t}(r.UndoCommand)},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"ApplyLineToolTemplateUndoCommand",function(){return r}),n=i(1),o=i(43),r=function(e){function t(t,i,n){var o=e.call(this,n)||this;return o._source=t,o._newState=i,o._oldState=t.properties().state(),o}return n.c(t,e),t.prototype.redo=function(){this._source.applyTemplate(this._newState)},t.prototype.undo=function(){this._source.applyTemplate(this._oldState)},t}(o.UndoCommand)},function(e,t,i){"use strict";var n,o,r,s,a,l,c,h,u;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"SetChartStyleCommand",function(){return u}),n=i(1),o=i(43),r=i(3),i.n(r),s=i(42),a=i(62),l=i(18),c=i.n(l),h=i(61),u=function(e){function t(t,i,n,o,r,s){var a=e.call(this,o)||this;return a._prevPriceAxisProps={},
a._property=t,a._mainSeries=n,a._value=i,a._model=r,a._chartWidget=s,a}return n.c(t,e),t.prototype.redo=function(){var e,t,i,n=this._mainSeries,o=n.properties();o.style===this._property&&n.isNeedRestart(this._value)&&this._chartWidget.screen.show(),this._prevResolution=o.interval.value(),this._prevValue=this._property.value(),this._storePriceAxisProps(),Object(r.saveDefaultProperties)(!0),e=o.interval.value(),t=this._model.defaultResolutions(),i=Object(h.getResolutionByChartStyle)(this._value,e,t),a.linking.interval.setValue(i),n.setChartStyleWithIntervalIfNeeded(this._value,i),Object(s.setLastUsedStyle)(this._value),Object(s.preparePriceAxisProperties)(o),Object(r.saveDefaultProperties)(!1),this._invalidateModel()},t.prototype.undo=function(){var e=this._mainSeries;e.properties().style===this._property&&e.isNeedRestart(this._value)&&this._chartWidget.screen.show(),Object(r.saveDefaultProperties)(!0),e.setChartStyleWithIntervalIfNeeded(this._prevValue,this._prevResolution),this._restorePriceAxisProps(),a.linking.interval.setValue(this._prevResolution),Object(r.saveDefaultProperties)(!1),this._invalidateModel()},t.prototype._storePriceAxisProps=function(){var e=this._mainSeries.priceScale();this._prevPriceAxisProps=e.mode()},t.prototype._restorePriceAxisProps=function(){this._mainSeries.priceScale().setMode(this._prevPriceAxisProps)},t.prototype._invalidateModel=function(){this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new c.a(c.a.LIGHT_UPDATE)))},t}(o.UndoCommand)},function(e,t,i){"use strict";var n,o,r,s,a,l;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"SetResolutionUndoCommand",function(){return l}),n=i(1),o=i(43),r=i(15),s=i(42),a=i(40),l=function(e){function t(t,i,n,o){var r=e.call(this,o)||this;return r._property=t,r._value=i,r._prevValue=t.value(),r._chartWidget=n,r}return n.c(t,e),t.prototype.redo=function(){this._chartWidget.screen.show(),this._property.setValue(this._value),this._handleResolution(this._value)},t.prototype.undo=function(){this._chartWidget.screen.show(),this._property.setValue(this._prevValue),this._handleResolution(this._prevValue)},t.prototype._handleResolution=function(e){var t=this._chartWidget.model().mainSeries().properties(),i=t.style.value(),n=Object(s.isRangeStyle)(i),o=r.Interval.isRange(e);!n&&o?t.style.setValue(a.STYLE_RANGE):n&&!o&&t.style.setValue(Object(s.getLastUsedStyle)())},t}(o.UndoCommand)},function(e,t,i){"use strict";(function(e){function n(e,t){this._options=Object.assign({},b,t),this.chart=e,this._properties=e.properties().scalesProperties,this.contextMenu=null,this.jqRow=$(document.createElement("tr")),this.jqLhsTimeAxisStub=$(document.createElement("td")),this.jqLhsTimeAxisStub.addClass("chart-markup-table"),this.jqLhsTimeAxisStub.appendTo(this.jqRow),this.jqLhsStub=$("<div>"),this.jqLhsStub.css("width","100%"),this.jqLhsStub.css("height","100%"),this.jqLhsStub.css("position","relative"),this.jqLhsStub.css("overflow","hidden"),this.jqLhsStub.appendTo(this.jqLhsTimeAxisStub),this.lhsCanvas=f(this.jqLhsStub,new m(16,16)),
$(this.lhsCanvas).css("position","absolute"),$(this.lhsCanvas).css("z-order","2"),$(this.lhsCanvas).css("left",0),$(this.lhsCanvas).css("top",0),this.lhsCtx=this.lhsCanvas.getContext("2d"),this.jqCell=$(document.createElement("td")),this.jqCell.appendTo(this.jqRow),this.jqCell.addClass("chart-markup-table"),this.jqCell.addClass("time-axis"),this.jqCell.height(25),this._dv=$("<div>"),this._dv.css("width","100%"),this._dv.css("height","100%"),this._dv.css("position","relative"),this._dv.css("overflow","hidden"),this._dv.appendTo(this.jqCell),this.canvas=f(this._dv,new m(16,16)),$(this.canvas).css("position","absolute"),$(this.canvas).css("z-order","2"),$(this.canvas).css("left",0),$(this.canvas).css("top",0),this.ctx=this.canvas.getContext("2d"),this.top_canvas=f(this._dv,new m(16,16)),$(this.top_canvas).css("position","absolute"),$(this.top_canvas).css("z-order","1"),$(this.top_canvas).css("left",0),$(this.top_canvas).css("top",0),this.top_ctx=this.top_canvas.getContext("2d"),this.jqRhsTimeAxisStub=$(document.createElement("td")),this.jqRhsTimeAxisStub.addClass("chart-markup-table"),this.jqRhsTimeAxisStub.appendTo(this.jqRow),this.jqRhsStub=$("<div>"),this.jqRhsStub.css("width","100%"),this.jqRhsStub.css("height","100%"),this.jqRhsStub.css("position","relative"),this.jqRhsStub.css("overflow","hidden"),this.jqRhsStub.appendTo(this.jqRhsTimeAxisStub),this.rhsCanvas=f(this.jqRhsStub,new m(16,16)),$(this.rhsCanvas).css("position","absolute"),$(this.rhsCanvas).css("z-order","2"),$(this.rhsCanvas).css("left",0),$(this.rhsCanvas).css("top",0),this.rhsCtx=this.rhsCanvas.getContext("2d"),this.restoreDefaultCursor(),this.update(),this._minVisibleSpan=S.MINUTE_SPAN,this._mouseEventHandler=new y(this.jqCell,this,!0),this.updatePriceScalesVisibility()}var o,r,s,a,l,c,h,u,d,p,_,f,m,y,g,v,S,b;i(650),o=i(125).PriceAxisWidget,r=i(0).LineDataSource,s=i(116),a=i(41),l=a.ActionSeparator,c=i(89),h=i(18),u=i(82),d=u.resizeCanvas,p=u.hardResizeCanvas,_=u.clearRect,f=u.addCanvasTo,m=u.Size,y=i(111).MouseEventHandler,g=i(39).trackEvent,v=i(79).makeFont,S=i(161),b={contextMenuEnabled:!0,timezoneMenuEnabled:!0},n.prototype.destroy=function(){this._mouseEventHandler.destroy()},n.prototype._BORDER_SIZE=1,n.prototype._OFFSET_SIZE=1,n.prototype._TICK_LENGTH=3,n.prototype.backgroundColor=function(){return this.chart.properties().paneProperties.background.value()},n.prototype.lineColor=function(){return this._properties.lineColor.value()},n.prototype.textColor=function(){return this._properties.textColor.value()},n.prototype.fontSize=function(){return this._properties.fontSize.value()},n.prototype.baseFont=function(){return v(this.fontSize(),"Arial","")},n.prototype.baseBoldFont=function(){return v(this.fontSize(),"Arial","bold")},n.prototype.rendererOptions=function(){var e,t;return this._rendererOptions||(this._rendererOptions={borderSize:this._BORDER_SIZE,offsetSize:this._OFFSET_SIZE,tickLength:this._TICK_LENGTH,fontSize:NaN,font:"",widthCache:new s}),e=this._rendererOptions,e.fontSize!==this.fontSize()&&(t=this.fontSize(),e.fontSize=t,
e.font=this.baseFont(),e.font=v(this.fontSize(),"'Trebuchet MS', Tahoma, Arial, sans-serif",""),e.paddingTop=Math.ceil(t/2.5),e.paddingBottom=e.paddingTop,e.paddingHorizontal=Math.ceil(t/2),e.baselineOffset=Math.round(this.fontSize()/5),e.widthCache.reset()),this._rendererOptions},n.prototype.updatePriceScalesVisibility=function(){var e=this.chart.properties().scalesProperties;e.showLeftScale.value()?this.jqLhsTimeAxisStub.css("display","table-cell"):this.jqLhsTimeAxisStub.css("display","none"),e.showRightScale.value()?this.jqRhsTimeAxisStub.css("display","table-cell"):this.jqRhsTimeAxisStub.css("display","none")},n.prototype.mouseDownEvent=function(t){if(this._mousedown||!e.enabled("chart_zoom"))return!0;this._mousedown=!0;var i=this.chart.model();i.timeScale().isEmpty()||(this.setCursor("ew-resize"),i.startScaleTime(t.localX))},n.prototype.mouseDownOutsideEvent=function(e){var t=this.chart.model();!t.timeScale().isEmpty()&&this._mousedown&&(this._mousedown=!1,t.endScaleTime(),this.restoreDefaultCursor())},n.prototype.pressedMouseMoveEvent=function(e){var t,i,n=this.chart.model();n.timeScale().isEmpty()||(t=!1,i=(new Date).valueOf(),this._lastScrollScaleTime&&i-this._lastScrollScaleTime<100&&(t=!0),t||(n.scaleTimeTo(e.localX),this._lastScrollScaleTime=i))},n.prototype.mouseUpEvent=function(e){this._mousedown=!1;var t=this.chart.model();t.timeScale().isEmpty()||(t.endScaleTime(),this.restoreDefaultCursor())},n.prototype.contextMenuEvent=function(e,t){this._options.contextMenuEnabled&&this._createContextMenu().show(e)},n.prototype._createContextMenu=function(){return c.createMenu(this.getContextMenuActions(),{statName:"TimeScaleContextMenu"})},n.prototype.getContextMenuActions=function(){var t,i,n=this.chart;return n.model().mainSeries().createSessStudy(),n.updateActions(),t=n.actions(),i=e.enabled("charting_library_base")?[t.timeScaleReset,new l,t.applyTimeZone,t.sessionBreaks]:[t.timeScaleReset,new l,t.applyTimeZone,t.sessionBreaks,t.extendedHours],this._options.timezoneMenuEnabled||i.splice(2,1),e.enabled("show_chart_property_page")&&e.enabled("chart_property_page_timezone_sessions")&&t.tmzProperties&&i.push(new l,t.tmzProperties),i},n.prototype.mouseClickEvent=function(e){},n.prototype.mouseDoubleClickEvent=function(e){g("GUI","Double click time scale"),this.chart.model().resetTimeScale()},n.prototype.optimalHeight=function(){var e=this.rendererOptions();return Math.ceil(e.offsetSize+e.borderSize+e.tickLength+e.fontSize+e.paddingTop+e.paddingBottom)},n.prototype.setSize=function(e,t,i){this.size&&this.size.equals(e)||(this.lhsStubSize=t,d(this.lhsCanvas,t),this.jqLhsTimeAxisStub.width(t.w),this.jqLhsTimeAxisStub.height(t.h),this.rhsStubSize=i,d(this.rhsCanvas,i),this.jqRhsTimeAxisStub.width(i.w),this.jqRhsTimeAxisStub.height(i.h),this.size=e,d(this.canvas,e),d(this.top_canvas,e),this.lhsCanvas.getContext("2d"),this.rhsCanvas.getContext("2d"),this.canvas.getContext("2d"),this.top_canvas.getContext("2d"),this.jqCell.width(e.w),this.jqCell.height(e.h))},n.prototype._spanIndex=function(e){
for(var t=[S.MINUTE_SPAN,S.HOUR_SPAN,S.DAY_SPAN,S.MONTH_SPAN,S.YEAR_SPAN],i=t.length-1;i>0;){if(t[i]<=e)return i;i--}return i},n.prototype._spanOffset=function(e,t){if(t<e)throw Error("actual span cuold not be less then base");return this._spanIndex(t)-this._spanIndex(e)},n.prototype.update=function(){var e,t;this.chart.model()&&(e=this.chart.model().timeScale().marks())&&(t=this,this._minVisibleSpan=S.YEAR_SPAN,$.each(e,function(){t._minVisibleSpan=Math.min(this.span,t._minVisibleSpan)}))},n.prototype._hightlightBackground=function(e,t){var i,n,o,r,s=this.chart.model(),a=s.timeScale(),l=t[0].index,c=t[0].index;for(i=1;i<t.length;i++)l=Math.min(l,t[i].index),c=Math.max(c,t[i].index);n=a.indexToCoordinate(l),o=a.indexToCoordinate(c),r="rgba(109, 158, 235, 0.3)",_(e,n,1,o-n,this.size.h-1,r)},n.prototype.drawBackground=function(e){var t,i,n,o,s;if(_(e,0,0,this.size.w,this.size.h,this.backgroundColor()),t=this.chart.model()){if(i=t.timeScale(),(n=t.model().selectedSource())&&n instanceof r&&!i.isEmpty()){if(o=n.axisPoints(),0===o.length)return;this._hightlightBackground(e,o)}s=t.model().crossHairSource(),s.startMeasurePoint()&&this._hightlightBackground(e,s.measurePoints())}},n.prototype.drawBorder=function(e){e.save(),e.fillStyle=this.lineColor(),e.fillRect(-.5,.5,this.size.w+.5,this._BORDER_SIZE),e.restore()},n.prototype.drawStubs=function(){var e,t=this._BORDER_SIZE,i=2*this._BORDER_SIZE,n=this.lhsCtx;_(n,0,0,this.lhsStubSize.w,this.lhsStubSize.h,this.backgroundColor()),n.fillStyle=this.lineColor(),n.fillRect(this.lhsStubSize.w-i-.5,.5,i,t),n.fillRect(this.lhsStubSize.w-i-.5,-.5,t,t),e=this.rhsCtx,_(e,0,0,this.rhsStubSize.w,this.rhsStubSize.h,this.backgroundColor()),e.fillStyle=this.lineColor(),e.fillRect(-.5,.5,i,t),e.fillRect(.5,-.5,t,t)},n.prototype.drawTickMarks=function(e){var t,i,n,o,r,s,a,l,c,h,u,d=this.chart.model().timeScale().marks();if(d&&0!==d.length){for(t=d.reduce(function(e,t){return e.span>t.span?e:t},d[0]).span,t>30&&t<40&&(t=30),e.save(),e.strokeStyle=this.lineColor(),i=this.rendererOptions(),n=i.borderSize+i.tickLength+i.paddingTop+i.fontSize-i.baselineOffset,e.textAlign="center",e.translate(.5,.5),e.fillStyle=this.lineColor(),e.beginPath(),o=d.length;o--;)e.rect(d[o].coord,i.borderSize,1,i.tickLength);for(e.fill(),e.fillStyle=this.textColor(),r={},s=this.baseFont(),a=this.baseBoldFont(),o=0;o<d.length;o++)l=d[o].span>=t?a:s,c=r[l]||[],c.push(d[o]),r[l]=c;for(h in r)for(e.setFont(h),u=r[h],o=0;o<u.length;o++)e.fillText(u[o].label,u[o].coord,n);e.restore()}},n.prototype.drawBackLabels=function(e){var t,i,n,o,r,s,a,l;for(e.save(),t=this.chart.model().dataSources(),i=this.chart.model(),n=i.sourceBeingMoved()||i.lineBeingEdited()||i.lineBeingCreated(),o=this.rendererOptions(),r=0;r<t.length;r++)if((s=t[r])!==this.chart.model().crossHairSource()&&s!==n&&s.timeAxisViews&&(a=s.timeAxisViews()))for(l=0;l<a.length;l++)a[l].renderer().draw(e,o);e.restore()},n.prototype.drawCrossHairLabel=function(e){var t,i,n,o,r;if(this.top_ctx.clearRect(-.5,-.5,this.size.w,this.size.h),t=this.chart.model(),
i=t.sourceBeingMoved()||t.lineBeingEdited()||t.lineBeingCreated(),n=this.rendererOptions(),i){if(e.save(),i.timeAxisViews&&(o=i.timeAxisViews()))for(r=0;r<o.length;r++)o[r].renderer().draw(e,n);return void e.restore()}if(e.save(),o=this.chart.model().crossHairSource().timeAxisView())for(r=0;r<o.length;r++)o[r].renderer().draw(e,n);e.restore()},o.prototype.hardResetCanvas=function(){this.size&&(p(this.canvas,this.size),p(this.top_canvas,this.size))},n.prototype.paint=function(e){if(0!==e)if(e===h.UPDATE_CURSOR_ONLY)this.drawCrossHairLabel(this.top_ctx);else{var t=this.ctx;this.drawBackground(t),this.drawBorder(t),this.drawStubs(),this.chart.model()&&(this.drawTickMarks(t),this.drawBackLabels(t),this.drawCrossHairLabel(this.top_ctx))}},n.prototype.setStubVisible=function(e,t){var i=o.isLeft(e)?this.jqLhsTimeAxisStub:this.jqRhsTimeAxisStub;t?i.css("display","table-cell"):i.css("display","none")},n.prototype.restoreDefaultCursor=function(){this.setCursor("")},n.prototype.setCursor=function(e){var t="";"grabbing"!==e&&"ew-resize"!==e||(t="time-axis--cursor-"+e),this._currentCursorClassName!==t&&(this._currentCursorClassName&&this.jqCell.removeClass(this._currentCursorClassName),t&&this.jqCell.addClass(t),this._currentCursorClassName=t,this.jqCell.css("cursor"))},n.prototype.image=function(){var e={};return e.content=this.canvas.toDataURL(),e.contentWidth=this.size.w,e.contentHeight=this.size.h,e.lhsStub={},e.lhsStub.content=this.lhsCanvas.toDataURL(),e.lhsStub.contentWidth=this.lhsStubSize.w,e.lhsStub.contentHeight=this.lhsStubSize.h,e.rhsStub={},e.rhsStub.content=this.rhsCanvas.toDataURL(),e.rhsStub.contentWidth=this.rhsStubSize.w,e.rhsStub.contentHeight=this.rhsStubSize.h,e},t.TimeAxisWidget=n}).call(t,i(5))},function(e,t){},function(e,t,i){"use strict";function n(e,t){i.e(13).then(function(n){i(359).showSymbolInfoDialog(e,t)}.bind(null,i)).catch(i.oe)}Object.defineProperty(t,"__esModule",{value:!0}),t.showSymbolInfoDialog=n},function(e,t,i){"use strict";var n,o,r,s,a,l,c,h,u,d,p,_;Object.defineProperty(t,"__esModule",{value:!0}),n=i(1),o=i(8),r=i.n(o),s=i(7),a=i(16),l=i.n(a),c=i(33),h=i(4),u=Object(h.getLogger)("ChartApi.AbstractSession"),d="",p=function(){function e(e,t,i){this._isConnected=new l.a(!1),this._state=0,this._isConnectForbidden=!1,this._sessionId=d,this._sessionIdChanged=new r.a,this._chartApi=e,this._sessionPrefix=t,this._shouldReconnectAfterCriticalError=i}return e.prototype.destroy=function(){this._logNormal("Destroying session"),this._isConnected.unsubscribe(),this.disconnect(),this._sessionIdChanged.destroy(),delete this._chartApi,this._logNormal("Session has been destroyed")},e.prototype.isConnected=function(){return this._isConnected},e.prototype.sessionId=function(){return this._sessionId},e.prototype.onSessionIdChanged=function(){return this._sessionIdChanged},e.prototype.connect=function(){0===this._state&&(Object(s.assert)(!this._isConnectForbidden,"Cannot call connect because it is forbidden at this moment"),this._setSessionId(this._sessionPrefix+"_"+Object(c.randomHash)()),
this._logNormal("Connecting session - wait until transport stay connected"),this._state=1,this._chartApi.createSession(this._sessionId,this))},e.prototype.disconnect=function(){var e=this;0!==this._state&&(Object(s.assert)(this._sessionId!==d,"sessionId must not be invalid"),this._logNormal("Disconnecting session..."),this._forbidConnectWhile(function(){e._chartApi.connected()&&e._sendRemoveSession(),e._processDestroyingOnServer()}))},e.prototype.onMessage=function(e){var t,i;switch(e.method){case"connected":return void this._onChartApiConnected();case"disconnected":return void this._onChartApiDisconnected();case"critical_error":return t=e.params[0]+"",i=e.params[1]+"",void this._onCriticalError(t,i)}this._onMessage(e)},e.prototype._getChartApi=function(){return this._chartApi},e.prototype._generateLogMessage=function(e){return"["+this._sessionId+"] "+e},e.prototype._onCriticalError=function(e,t){var i=this;this._logError("Critical error. Reason="+e+", info="+t+"."),this._forbidConnectWhile(function(){i._processDestroyingOnServer()}),this._shouldReconnectAfterCriticalError?(this._logNormal("Reconnecting after critical error..."),this.connect()):this._logNormal("Reconnecting after critical error skipped")},e.prototype._onChartApiConnected=function(){Object(s.assert)(1===this._state,"Session is not registered"),this._logNormal("Transport is connected. Creating session on the server"),this._sendCreateSession(),this._state=2,this._isConnected.setValue(!0)},e.prototype._onChartApiDisconnected=function(){var e=this;this._logNormal("Transport is disconnected. Reconnecting..."),this._forbidConnectWhile(function(){e._processDestroyingOnServer()}),this.connect()},e.prototype._setSessionId=function(e){var t=this._sessionId;this._logNormal("Changing sessionId: old="+t+", new="+e),this._sessionId=e,this._sessionIdChanged.fire(e,t)},e.prototype._logNormal=function(e){u.logNormal(this._generateLogMessage(e))},e.prototype._logError=function(e){u.logError(this._generateLogMessage(e))},e.prototype._processDestroyingOnServer=function(){this._state=0,this._isConnected.setValue(!1),this._chartApi.removeSession(this._sessionId),this._setSessionId(d)},e.prototype._forbidConnectWhile=function(e){this._isConnectForbidden=!0,e(),this._isConnectForbidden=!1},e}(),i.d(t,"ChartSession",function(){return _}),Object(h.getLogger)("ChartSession"),_=function(e){function t(t,i){void 0===i&&(i=!1);var n=e.call(this,t,"cs",!1)||this;return n._sessionDisabled=!1,n._handler=null,n._criticalError=new r.a,n._disableStatistics=i,n}return n.c(t,e),t.prototype.destroy=function(){this._criticalError.destroy(),this._handler=null,e.prototype.destroy.call(this)},t.prototype.serverTimeOffset=function(){return this._getChartApi().serverTimeOffset()},t.prototype.switchTimezone=function(e){return this._getChartApi().switchTimezone(this.sessionId(),e)},t.prototype.resolveSymbol=function(e,t,i){return this._getChartApi().resolveSymbol(this.sessionId(),e,t,i)},t.prototype.requestFirstBarTime=function(e,t,i){
return this._getChartApi().requestFirstBarTime(this.sessionId(),e,t,i)},t.prototype.createSeries=function(e,t,i,n,o,r){return this._getChartApi().createSeries(this.sessionId(),e,t,i,n,o,r)},t.prototype.modifySeries=function(e,t,i,n,o){return this._getChartApi().modifySeries(this.sessionId(),e,t,i,n,o)},t.prototype.removeSeries=function(e,t){return!!this.isConnected().value()&&this._getChartApi().removeSeries(this.sessionId(),e,t)},t.prototype.requestMoreData=function(e,t,i){return this._getChartApi().requestMoreData(this.sessionId(),e,t,i)},t.prototype.requestMoreTickmarks=function(e,t,i){return this._getChartApi().requestMoreTickmarks(this.sessionId(),e,t,i)},t.prototype.requestMetadata=function(e,t){var i=this,n=function(){return i._getChartApi().requestMetadata(i.sessionId(),e,t)};n()},t.prototype.isCanCreateStudy=function(e){return this._getChartApi().isCanCreateStudy(e)},t.prototype.createStudy=function(e,t,i,n,o,r,s){return this._getChartApi().createStudy(this.sessionId(),e,t,i,n,o,r,s)},t.prototype.rebindStudy=function(e,t,i,n,o,r,s){return this._getChartApi().rebindStudy(this.sessionId(),e,t,i,n,o,r,s)},t.prototype.modifyStudy=function(e,t,i,n){return this._getChartApi().modifyStudy(this.sessionId(),e,t,i,n)},t.prototype.removeStudy=function(e,t,i){return this._getChartApi().removeStudy(this.sessionId(),e,t,i)},t.prototype.createPointset=function(e,t,i,n,o,r){return this._getChartApi().createPointset(this.sessionId(),e,t,i,n,o,r)},t.prototype.modifyPointset=function(e,t,i,n){return this._getChartApi().modifyPointset(this.sessionId(),e,t,i,n)},t.prototype.removePointset=function(e){return this._getChartApi().removePointset(this.sessionId(),e)},t.prototype.setVisibleTimeRange=function(e,t,i,n){this._getChartApi().setVisibleTimeRange(e,this.sessionId(),t,i,n)},t.prototype.criticalError=function(){return this._criticalError},t.prototype.connect=function(t){void 0===t&&(t=null),null!==t&&(this._handler=t),e.prototype.connect.call(this)},t.prototype.setHandler=function(e){this._handler=e},t.prototype.connected=function(){return this.isConnected().value()&&!this._sessionDisabled},t.prototype.disable=function(){this._sessionDisabled=!0},t.prototype.chartApi=function(){return this._getChartApi()},t.prototype._sendCreateSession=function(){var e=this;Object.keys(this).forEach(function(t){/^(s|st|symbol_)\d+$/.test(t)&&delete e[t]}),this._getChartApi().chartCreateSession(this.sessionId(),this._disableStatistics)},t.prototype._sendRemoveSession=function(){this._getChartApi().chartDeleteSession(this.sessionId())},t.prototype._onMessage=function(e){this._handler&&this._handler(e)},t.prototype._onCriticalError=function(t,i){this._criticalError.fire(t,i),e.prototype._onCriticalError.call(this,t,i)},t}(p)},function(e,t,i){"use strict";var n,o,r,s,a,l,c;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"MarketStatusIndicator",function(){return c}),n=i(1),i(11),o=i(654),i.n(o),r=i(295),s={invalid:"tv-market-status--invalid",market:"tv-market-status--market",out_of_session:"tv-market-status--out-of-session",
post_market:"tv-market-status--post-market",pre_market:"tv-market-status--pre-market",loading:"tv-market-status--loading",holiday:"tv-market-status--holiday",replay:"tv-market-status--replay"},a={invalid:$.t("Invalid Symbol"),market:$.t("Market Open"),out_of_session:$.t("Market Closed"),post_market:$.t("Post Market"),pre_market:$.t("Pre Market"),loading:$.t("Loading"),holiday:$.t("Holiday"),replay:""},l={classMap:s,classSuffix:"",data:{},extraTitle:"",labelMap:a,short:!1,showTooltip:!0,tooltipType:"custom"},c=function(e){function t(t){var i=e.call(this,t)||this;return i._quoteSessionPrefix="market-status-indicator",i._componentClass="tv-market-status",i._extraTitle="",i._init(t),i}return n.c(t,e),t.prototype.setStatus=function(e,t){var i={values:{current_session:e}};this.update(i,t)},t.prototype.getTooltipText=function(){var t=e.prototype.getTooltipText.call(this);return""===t?t:(""!==this._extraTitle&&(t=t+", "+this._extraTitle),t)},t.prototype.setExtraTitle=function(e){this._extraTitle=e},t.prototype.reset=function(){this._clearClasses(),this._labelEl.textContent="",this._extraTitle="",this._el.setAttribute("title",""),this._value=""},t.prototype.enableShortMode=function(t){void 0===t&&(t=!0),void 0!==this._labelEl&&this._labelEl.classList.add("i-hidden"),e.prototype.enableShortMode.call(this)},t.prototype.disableShortMode=function(){void 0!==this._labelEl&&this._labelEl.classList.remove("i-hidden"),e.prototype.disableShortMode.call(this)},t.prototype._renderLabel=function(){this._labelEl.textContent=this.getLabel()},t.prototype._getValueFromData=function(e){return void 0!==e.values&&void 0!==e.values.current_session?e.values.current_session:this.getValue()},t.prototype._render=function(){this._renderLabelElement(),this._renderDotElement(),e.prototype._render.call(this)},t.prototype._init=function(t){var i=Object.assign({},l,t);e.prototype._init.call(this,i),this.setExtraTitle(i.extraTitle),this._render()},t.prototype._renderLabelElement=function(){void 0===this._labelEl&&(this._labelEl=document.createElement("span"),this._labelEl.classList.add(this._componentClass+"__label"),this._labelEl.classList.add(this._componentClass+"__label"+this._classSuffix),this._el.appendChild(this._labelEl))},t.prototype._renderDotElement=function(){void 0===this._dotEl&&(this._dotEl=document.createElement("span"),this._dotEl.classList.add(this._componentClass+"__dot"),this._dotEl.classList.add(this._componentClass+"__dot"+this._classSuffix),this._el.appendChild(this._dotEl))},t}(r.a)},function(e,t){},function(e,t,i){"use strict";var n,o,r,s,a,l,c,h,u,d;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"DataModeIndicator",function(){return d}),n=i(1),i(11),i(86),o=i(656),i.n(o),r=i(295),s={connecting:"tv-data-mode--connecting",delayed:"tv-data-mode--delayed",delayed_streaming:"tv-data-mode--delayed",endofday:"tv-data-mode--endofday",forbidden:"tv-data-mode--forbidden",realtime:"tv-data-mode--realtime",snapshot:"tv-data-mode--snapshot",loading:"tv-data-mode--loading",replay:"tv-data-mode--replay"},a={connecting:$.t("Connecting"),
delayed:$.t("Delayed"),delayed_streaming:$.t("Delayed"),endofday:$.t("End of Day"),forbidden:$.t("Instrument is not allowed"),realtime:$.t("Real-time"),snapshot:$.t("Snapshot"),loading:"",replay:$.t("Replay Mode")},l={connecting:$.t("C",{context:"data_mode_connecting_letter"}),delayed:$.t("D",{context:"data_mode_delayed_letter"}),delayed_streaming:$.t("D",{context:"data_mode_delayed_streaming_letter"}),endofday:$.t("E",{context:"data_mode_end_of_day_letter"}),forbidden:$.t("F",{context:"data_mode_forbidden_letter"}),realtime:$.t("R",{context:"data_mode_realtime_letter"}),snapshot:$.t("S",{context:"data_mode_snapshot_letter"}),loading:"",replay:$.t("R",{context:"data_mode_replay_letter"})},c=600,h={streaming:"realtime"},u={classMap:s,classSuffix:"",data:{values:{update_mode:"connecting"}},labelMap:a,modeInterval:c,short:!1,shortLabelMap:l,showTooltip:!0,tooltipType:"custom"},d=function(e){function t(t){var i=e.call(this,t)||this;return i._quoteSessionPrefix="data-mode-indicator",i._componentClass="tv-data-mode",i._init(t),i}return n.c(t,e),t.prototype.getLabel=function(){return!0===this._shortMode?this._shortLabelMap[this._value]||"":e.prototype.getLabel.call(this)},t.prototype.setMode=function(e,t){this.update({values:{update_mode:e,update_mode_seconds:t}})},t.prototype.hide=function(){this._el.classList.add("i-hidden")},t.prototype.show=function(){this._el.classList.remove("i-hidden")},t.prototype.getTooltipText=function(){var e="",t=this.getValue();if(""===t)return e;switch(t){case"delayed":e=$.t("Quotes are delayed by {0} min and updated every 30 seconds");break;case"delayed_streaming":e=$.t("Quotes are delayed by {0} min");break;default:e=this._labelMap[t]||e}return["delayed","delayed_streaming"].includes(t)&&(e=e.format(Math.round(this._modeInterval/60))),e},t.prototype._init=function(t){void 0===t&&(t={});var i=Object.assign({},u,t);this._modeInterval=i.modeInterval||c,this._shortLabelMap=i.shortLabelMap||l,e.prototype._init.call(this,i),this._render()},t.prototype._getValueFromData=function(e){var t;return t=void 0!==e.values&&void 0!==e.values.update_mode?e.values.update_mode:this.getValue(),h[t]||t},t.prototype._updateValue=function(t,i){void 0!==t.values&&void 0!==t.values.update_mode_seconds&&(this._modeInterval=t.values.update_mode_seconds),e.prototype._updateValue.call(this,t,i)},t}(r.a)},function(e,t){},function(e,t,i){"use strict";var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"StudyMetaInfoRepository",function(){return s}),i(11),n=i(26),o=i.n(n),r=i(4),Object(r.getLogger)("Chart.Studies.StudyMetaInfoRepository",{color:"#606"}),s=function(){function e(e){this._nextRequestNumber=1,this._rawStudiesMetaInfo=[],this._metaInfoReceived=!1,this._onRawMetaReceivedDfd=null,this._tvScriptsRequestDfd=null,this._isReady=!1,this._metaInfoQueryQueue=[],this._studiesMetaInfo=[],this._studiesMigrations=[],this._studyScriptingPkgVers=null,this._gateway=e}return e.prototype.getStudyScriptingPkgVers=function(){return this._studyScriptingPkgVers},e.prototype.requestMetaInfo=function(){var e=this
;return this._requestStarted(),new Promise(function(t){e._gateway.requestMetadata(e._makeNextRequestId(),function(i){var n=i.params[1].metainfo.slice();e._processLibraryMetaInfo(n),e._requestFinished(),t()})})},e.prototype.requestAlertsMetaInfo=function(){throw Error("not supported")},e.prototype.findById=function(e){if(this._isReady){var t=this._findStudyMetaInfo(e);if(!t)throw new ReferenceError("unexpected study id:"+e);return Promise.resolve(t)}return this._enqueueMetaInfoQuery(e)},e.prototype.isReady=function(){return this._isReady},e.prototype.getInternalMetaInfoArray=function(){return this._studiesMetaInfo},e.prototype.getMigrations=function(){return this._studiesMigrations},e.prototype._processMigrations=function(e){throw Error("not implemented")},e.prototype._addPineMetaInfo=function(e){throw Error("not implemented")},e.prototype._processSiteMetaInfo=function(e,t){throw Error("not implemented")},e.prototype._processLibraryMetaInfo=function(t){for(var i=0;i<t.length;++i)o.a.addOrReplaceStudyMetaInfo(this._studiesMetaInfo,e._applyLocalizationToMetadata(t[i]));this._studiesMetaInfo=this._studiesMetaInfo.sort(function(e,t){var i=e.description_localized||e.description,n=t.description_localized||t.description;return i>n?1:i<n?-1:0}),o.a.overrideDefaults(this._studiesMetaInfo)},e.prototype._requestStarted=function(){this._isReady=!1,this._studiesMetaInfo=[],this._studiesMigrations=[],this._studyScriptingPkgVers=null,this._tvScriptsRequestDfd=null,this._rawStudiesMetaInfo=[],this._metaInfoReceived=!1},e.prototype._requestFinished=function(){this._isReady=!0,this._processPendingMetaInfoQueries()},e.prototype._enqueueMetaInfoQuery=function(e){var t=this;return new Promise(function(i){t._metaInfoQueryQueue.push({studyId:e,resolver:i})})},e.prototype._processPendingMetaInfoQueries=function(){for(var e,t;this._metaInfoQueryQueue.length;){if(e=this._metaInfoQueryQueue.shift(),null===(t=this._findStudyMetaInfo(e.studyId)))throw new ReferenceError("unexpected study id:"+e.studyId);e.resolver(t)}},e.prototype._findStudyMetaInfo=function(e){for(var t=0;t<this._studiesMetaInfo.length;t+=1)if(this._studiesMetaInfo[t].id===e)return this._studiesMetaInfo[t];return null},e.prototype._makeNextRequestId=function(){return"metadata_"+this._nextRequestNumber++},e._applyLocalizationToMetadata=function(e){return e.description_localized=window.t(e.description,{context:"study"}),e},e}()},function(e,t,i){"use strict";function n(){}function o(e){r(e),s(e)}var r,s;Object.defineProperty(t,"__esModule",{value:!0}),t.addPerfMark=o,r=console.timeStamp?console.timeStamp.bind(console):n,s=window.performance&&performance.mark?performance.mark.bind(performance):n},function(e,t,i){"use strict";function n(){function e(){return b}function t(e){return g&&i(),g=new r.UndoMacroCommand(e)}function i(){if(g){var e=g;g=null,e.isEmpty()||a(e)}}function n(){if(v.isEmpty())return!1;var e=v.pop();return!!e&&(e.undo(),S.push(e),d.logNormal("UNDO: "+e.text()),b.fire(y()),!0)}function s(){if(S.isEmpty())return!1;var e=S.pop();return!!e&&(e.redo(),v.push(e),
d.logNormal("REDO: "+e.text()),b.fire(y()),!0)}function a(e){var t,i,n;g?g.addCommand(e):(S.clear(),t=v.head(),i=t&&t.text(),v.push(e),""!==(n=e.text())&&n!==i&&d.logNormal("DO: "+n)),e.executeOnPush()&&e.redo(),g||b.fire(y())}function c(){return{lastActualCommand:v.isEmpty()?null:v.head()}}function h(e){for(;!v.isEmpty()&&e.lastActualCommand!==v.head();)v.pop().undo();S.clear(),b.fire(y())}function p(){return v}function _(){return S}function f(){v.clear(),S.clear(),b.fire(y())}function m(e,t,i){if(e.value()!==t){var n=new l(e,t,i);a(n),n.redo()}}function y(){var e=v.head(),t=S.head();return{enableUndo:!v.isEmpty(),undoText:void 0===e?void 0:e.text(),enableRedo:!S.isEmpty(),redoText:void 0===t?void 0:t.text()}}var g=null,v=new o.UndoStack,S=new o.UndoStack,b=new u.a;return{beginUndoMacro:t,clearStack:f,createUndoCheckpoint:c,endUndoMacro:i,pushUndoCommand:a,redo:s,redoStack:_,setWatchedValue:m,undo:n,undoStack:p,undoToCheckpoint:h,state:y,onChange:e}}var o,r,s,a,l,c,h,u,d;Object.defineProperty(t,"__esModule",{value:!0}),o=i(293),r=i(258),s=i(1),a=i(43),l=function(e){function t(t,i,n){var o=e.call(this,n)||this;return o._wv=t,o._newValue=i,o._oldValue=t.value(),o}return s.c(t,e),t.prototype.redo=function(){this._wv.setValue(this._newValue)},t.prototype.undo=function(){this._wv.setValue(this._oldValue)},t}(a.UndoCommand),c=i(4),h=i(8),u=i.n(h),t.createUndoHistory=n,d=Object(c.getLogger)("Common.UndoHistory")},function(e,t,i){"use strict";function n(e,t,n){void 0===t&&(t={}),i.e(4).then(function(o){i(137).getImageOfChart(e,t,n)}.bind(null,i)).catch(i.oe)}function o(e,t,n){void 0===t&&(t={}),i.e(4).then(function(o){i(137).getImageOfChartSilently(e,t,n)}.bind(null,i)).catch(i.oe)}Object.defineProperty(t,"__esModule",{value:!0}),t.getImageOfChart=n,t.getImageOfChartSilently=o},function(e,t,i){"use strict";var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"SetChartLayoutCommand",function(){return s}),n=i(1),o=i(43),r=i(109),s=function(e){function t(t,i){var n=this,o="Change Chart Layout to "+r.layouts[i].title;return n=e.call(this,o)||this,n._chartWidgetCollection=t,n._newLayoutType=i,n._oldLayoutType=t.layout.value(),n}return n.c(t,e),t.prototype.redo=function(){this._chartWidgetCollection.layout.setValue(this._newLayoutType)},t.prototype.undo=function(){this._chartWidgetCollection.layout.setValue(this._oldLayoutType)},t}(o.UndoCommand)},function(e,t,i){"use strict";function n(e){return new Promise(function(t,i){e.subscribe(null,t,!0)})}Object.defineProperty(t,"__esModule",{value:!0}),t.delegateToPromise=n},function(e,t,i){"use strict";function n(e){r.call(this,e);var t=this;a.hideMarksOnBars().subscribe(this,function(){t._properties.visible.setValue(!a.hideMarksOnBars().value())})}function o(e){s.call(this)}var r=i(88).BarsMarksContainer,s=i(179).BarMarkTooltip,a=i(32);inherit(n,r),n.prototype._initialize=function(e){this._properties.visible.setValue(!0)},n.prototype.userEditEnabled=function(){return!1},n.prototype._constructor="UserDefinedBarsMarks",n.prototype._plateViewData=function(e){var t={
text:e.text};return"object"==typeof e.color&&(t.theme="user_defined_theme",t.overridedTheme={},t.overridedTheme.border=e.color.border,t.overridedTheme.background=e.color.background),t},n.prototype.onClicked=function(){var e=this._model.lastHittestData().id;this._marks[e].onClicked()},n.prototype.clearMarks=function(){r.prototype.clearMarks.call(this),this.onNeedRepaint.fire()},n.prototype._getData=function(e){var t,i,n,o=this._model.mainSeries().symbolInfo();o&&(t=this.roundRange(this._rangeDifference(e)),i=this,n=this._model.mainSeries().properties().interval.value(),ChartApiInstance.getMarks(o,t.start,t.end,function(t){t.forEach(function(e){i._marks[e.id]=e},i),i._loadedRange=i._rangeUnion(e,i._loadedRange),i.onNeedRepaint.fire()},n))},n.prototype._createTooltip=function(){return new o},n.prototype.updatePlateData=function(e,t){return t.barWidth=this.barWidth(),t.text=e.text,t.tooltipMargin=-1*Math.max(e.minSize/2,.4*this.barWidth()),t},n.prototype.hasContextMenu=function(){return!1},inherit(o,s),o.prototype._createLayout=function(){this._layout=$('<div class="bar-mark-tooltip"></div>'),this._layout_text=$('<div class="text"></div>').appendTo(this._layout)},o.prototype._updatePlate=function(e){this._currentId=e.id,this._layout.css("border-color",e.theme.border),this._layout.css("margin-top",e.tooltipMargin+"px"),this._layout_text.html(e.text),this._layout.append(this._layout_text)},e.exports=n},function(e,t,i){"use strict";function n(e){a.call(this,e);var t=this;l.hideMarksOnBars().subscribe(this,function(){t._properties.visible.setValue(!l.hideMarksOnBars().value())}),this._paneView=new o(this)}function o(e,t){this.source=e,this._rendererFactory=t,this.stylesCache={},this.templatesCache={},this._lollipops={},this._createLollipops()}var r=i(6).Point,s=i(665).ESDPaneView,a=i(88).BarsMarksContainer,l=i(32),c=i(31),h=i(296).Tooltip;inherit(n,a),n.prototype._initialize=function(e){this._properties.visible.setValue(!0)},n.prototype.userEditEnabled=function(){return!1},n.prototype._constructor="UserDefinedTimescaleMarks",n.prototype._plateViewData=function(e){return{text:e.text}},n.prototype.onClicked=function(){var e=this._model.lastHittestData().id;c.emit("onTimescaleMarkClick",e)},n.prototype.clearMarks=function(){a.prototype.clearMarks.call(this),this._paneView.clearCaches(),this.onNeedRepaint.fire()},n.prototype._getData=function(e){var t,i,n,o=this._model.mainSeries().symbolInfo();o&&(t=this.roundRange(this._rangeDifference(e)),i=this,n=this._model.mainSeries().properties().interval.value(),ChartApiInstance.getTimescaleMarks(o,t.start,t.end,function(t){t.forEach(function(e){i._marks[e.id]=e},i),i._loadedRange=i._rangeUnion(e,i._loadedRange),i.onNeedRepaint.fire()},n))},n.prototype.updatePlateData=function(e,t){return t.barWidth=this.barWidth(),t.text=e.text,t.tooltipMargin=-1*Math.max(e.minSize/2,.4*this.barWidth()),t},n.prototype.hasContextMenu=function(){return!1},n.prototype.paneViews=function(e){return this._properties.visible.value()?[this._paneView]:[]},n.prototype.onClickOutside=function(e){
this._paneView.onClickOutside(e)},inherit(o,s),o.prototype._createLollipops=function(){var e=this.source._model.timeScale(),t=s.prototype._getY.call(this.source),i=this.source._model.lastHittestData(),n=this;$.each(this.source._marks,function(o,s){var a=s.id;n._lollipops[a]={id:a,basePoint:new r(e.indexToCoordinate(e.timePointToIndex(s.tickmark))+1,t),hovered:i&&i.id===a||a===n.getLastClickedLollipopId(),barY:null,label:s.label,color:s.color,items:s.tooltip,tooltip:n._lollipops.hasOwnProperty(a)?n._lollipops[a].tooltip:new h,visible:!0}})},o.prototype.clearCaches=function(){this._lollipops={}},o.prototype.update=function(){this._createLollipops()},o.prototype.renderer=function(){return this.update(),s.prototype.renderer.call(this)},o.prototype._generateTemplateStyle=function(e,t,i){var n,o,r=e+t+i;return r in this.stylesCache||(n={strokeStyle:t,lineWidth:1,fillStyle:"white",barLine:{lineStyle:CanvasEx.LINESTYLE_DASHED},lollipop:{width:32,height:96,circleHeight:16,radius:12,lineWidth:1.5,fillStyle:"white",strokeStyle:"#E2745B",text:{label:i,strokeStyle:t,font:"normal 12px Verdana, Arial, sans-serif"}}},o={strokeStyle:t,lollipop:{fillStyle:t,fillCircle:!0,text:{strokeStyle:"white"}}},this.stylesCache[r]="default"===e?n:$.extend(!0,{},n,o)),this.stylesCache[r]},o.prototype.getTemplate=function(e,t){var i=e+t.color+t.label;return i in this.templatesCache||(this.templatesCache[i]=this.createTemplate(this._generateTemplateStyle(e,t.color,t.label))),this.templatesCache[i]},o.prototype.getStyle=function(e,t){return this._generateTemplateStyle(e,t.color,t.label)},o.prototype.createText=function(e,t){"string"==typeof e.items?t.addTextLine(e.items):Array.isArray(e.items)&&e.items.forEach(function(e){t.addTextLine(e)})},o.prototype.hasTooltip=function(e){return!!e.tooltip&&e.tooltip.length},e.exports=n},function(e,t,i){"use strict";function n(e,t){this._lastClickedId=null,this._model=e,this._study=t,this._metaInfo=t.metaInfo(),this._lollipops={},this._textCache={},this.templatesCache={},this._invalidated=!0,this.templatesCache.hovered=this.createTemplate(this.hoveredStyle),this.templatesCache.default=this.createTemplate(this.defaultStyle),e.properties().paneProperties.background.subscribe(this,this.onPaneBgChange)}function o(e){this.data=e}function r(e){this.data=e,this._hittest=new c(c.CUSTOM,e)}function s(e,t){this._data=e,this._paneView=t,this.textRenderer=new s.TextRenderer(e.style.lollipop.importance)}var a=i(6).Point,l=i(60).pointInCircle,c=i(9).HitTestResult,h=i(69).CompositeRenderer,u=i(296).Tooltip;i(70).PercentageFormatter,i(667).roundToFirstValuable;n.prototype.onPaneBgChange=function(){this.defaultStyle.lollipop.fillStyle=this._model.properties().paneProperties.background.value(),this._stylesCache=null,Object.keys(this.templatesCache).forEach(function(e){0===e.indexOf("default")&&(this.templatesCache[e]=null)},this)},n.prototype.onClickOutside=function(){this._lastClickedId=null},n.prototype.closeTooltips=function(){var e,t;for(e in this._lollipops)this._lollipops.hasOwnProperty(e)&&(t=this._lollipops[e],
t.visible&&(t.tooltip.isOpened()&&t.tooltip.hide(),t.visible=!1))},n.prototype.getLastClickedLollipopId=function(){return this._lastClickedId},n.prototype._setStackStudies=function(){this._stackStudies=[]},n.prototype._getY=function(){var e,t,i=0,n=this._model.panes();for(e=n.length;e--;)t=n[e],t.containsMainSeries()&&(i+=t.height());return i},n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){var e,t,i,n,o,r,s,a,l,c,h,u;this._setStackStudies(),e=this,t=this._study.data(),i=this._model.timeScale(),n=i.visibleBars(),o=this._model.mainSeries().bars(),r=this._study.priceScale(),s=this._model.mainSeries(),a=s.firstBar(),r&&!r.isEmpty()&&!i.isEmpty()&&a&&t&&(this.closeTooltips(),l=this._getY(),c=n.firstBar(),h=n.lastBar(),u=t.range(c,h),u.each(function(t,n){var s,a=0;for(s=0;s<e._stackStudies.length;++s)e._stackStudies[s].data().contains(t)&&++a;t>c&&t<h&&e.addLollipop(l,o,i,r,t,n,a)}),this.afterUpdate(l,o,i,r))},n.prototype.addLollipop=function(e,t,i,n,o,r,s){var l,c,h,d,p,_,f,m,y=r[0],g=this._model.mainSeries().symbolInfo();g&&(l=g.name,c=null,h=this._study.metaInfo().id+"_"+y+"_"+l,d=this._model.lastHittestData(),p=d&&d.id===h,p&&null!==(_=t.valueAt(o))&&(f=_[TradingView.LOW_PLOT],m=this._model.mainSeries().firstValue(),c=n.priceToCoordinate(f,m)),this._lollipops[h]=$.extend({id:h,visible:!0,basePoint:new a(i.indexToCoordinate(o)+1,e),hovered:p||h===this.getLastClickedLollipopId(),barY:c,stack:s,tooltip:this._lollipops.hasOwnProperty(h)?this._lollipops[h].tooltip:new u},this.extraData(r)))},n.prototype.afterUpdate=function(e,t,i){},n.prototype.extraData=function(e){throw Error("Not Implemented")},n.prototype.createText=function(e,t){throw Error("Not Implemented")},n.prototype.showBarLine=function(){return!0},n.prototype.getStyle=function(e,t){var i,n=e;return t.stack&&(n+="_stack:"+t.stack),"hovered"===n?this.hoveredStyle:"default"===n?this.defaultStyle:(this._stylesCache||(this._stylesCache={}),this._stylesCache[n]||(i=TradingView.clone("hovered"===e?this.hoveredStyle:this.defaultStyle),t.stack&&(i.lollipop.incHeight=24*t.stack),this._stylesCache[n]=i),this._stylesCache[n])},n.prototype.hasTooltip=function(e){return!0},n.prototype.renderer=function(){var e,t,i,n,l,c,u,d,p;this._invalidated&&(this.updateImpl(),this._invalidated=!1),e=new h;for(t in this._lollipops)this._lollipops.hasOwnProperty(t)&&(i=this._lollipops[t],n=15,l=this.getStyle(i.hovered?"hovered":"default",i),i.visible&&(c=$.extend({tooltipPoint:new a(i.basePoint.x,i.basePoint.y-l.lollipop.circleHeight-n-(l.lollipop.incHeight||0)),style:l,createText:this.createText.bind(this)},i),u=this.getTemplate(i.hovered?"hovered":"default",i),d={circlePoint:new a(i.basePoint.x,i.basePoint.y-l.lollipop.circleHeight-(l.lollipop.incHeight||0)),style:l,template:u,basePoint:i.basePoint,id:i.id,mouseClickHandler:this._lollipopMouseClickHandler.bind(this,i.id)},e.append(new r(d)),i.hovered&&this.hasTooltip(i)&&i.barY&&this.showBarLine()&&(p={style:{lineStyle:l.barLine.lineStyle,strokeStyle:l.strokeStyle,lineWidth:l.lineWidth},
startPoint:new a(i.basePoint.x,i.basePoint.y-l.lollipop.circleHeight),endPoint:new a(i.basePoint.x,i.barY)},e.append(new o(p))),e.append(new s(c,this))));return e},n.prototype.getTemplate=function(e,t){var i=e;return t.stack&&(i+="_stack:"+t.stack),this.templatesCache[i]||(this.templatesCache[i]=this.createTemplate(this.getStyle(e,t))),this.templatesCache[i]},n.prototype.createTemplate=function(e){var t=document.createElement("canvas"),i=t.getContext("2d"),n=new a(e.lollipop.width/2,e.lollipop.height-e.lollipop.circleHeight-(e.lollipop.incHeight||0));return this.drawCircle(i,e,n),this.drawLabel(i,e,n),t},n.prototype.drawCircle=function(e,t,i){e.strokeStyle=t.strokeStyle,e.fillStyle=t.lollipop.fillStyle,e.lineWidth=t.lollipop.lineWidth,CanvasEx.setLineStyle(e,CanvasEx.LINESTYLE_SOLID),e.beginPath(),e.arc(i.x,i.y,t.lollipop.radius,0,2*Math.PI,!1),e.closePath(),e.stroke(),t.lollipop.fillCircle&&e.fill()},n.prototype.drawLabel=function(e,t,i){e.textAlign="center",e.textBaseline="middle",e.fillStyle=t.lollipop.text.strokeStyle,e.font=t.lollipop.text.font,e.fillText(t.lollipop.text.label,i.x,i.y)},n.prototype._lollipopMouseClickHandler=function(e){this._lastClickedId=this._lastClickedId===e?null:e},o.prototype.draw=function(e){e.strokeStyle=this.data.style.strokeStyle,e.lineWidth=this.data.style.lineWidth,CanvasEx.setLineStyle(e,this.data.style.lineStyle),CanvasEx.drawLine(e,this.data.startPoint.x,this.data.startPoint.y,this.data.endPoint.x,this.data.endPoint.y)},o.prototype.hitTest=function(e){return null},r.prototype.hitTest=function(e){return l(e,this.data.circlePoint,this.data.style.lollipop.radius)?this._hittest:null},r.prototype.draw=function(e){var t=this.data.template;e.drawImage(t,this.data.basePoint.x-(.5+this.data.style.lollipop.width/2<<0)+.5,this.data.basePoint.y-this.data.style.lollipop.height+.5)},s.prototype.draw=function(e){this._data.createText(this._data,this.textRenderer),this._paneView.getLastClickedLollipopId()===this._data.id?this._data.tooltip.show({items:[this.textRenderer],x:this._data.basePoint.x,y:this._data.basePoint.y-this._data.style.lollipop.circleHeight-10-2*this._data.style.lollipop.radius*(this._data.stack?this._data.stack:0),wrapElement:e.canvas.parentNode,leftBorderColor:this._data.color}):this._data.tooltip.hide()},s.prototype.hitTest=function(e){return null},s.TextRenderer=function(e){this.lines=[],this.fontHeight=12,this.font=this.fontHeight+"px Arial, sans-serif",this.lineSpacing=8,this.fillStyle="black",e&&(this.importance=e)},s.TextRenderer.prototype.draw=function(e,t){var i,n,o=t.y;for(i=0;i<this.lines.length;i++)n=this.lines[i],e.font=this.font,n.options.fontWeight&&(e.font=n.options.fontWeight+" "+this.font),e.fillStyle=this.fillStyle,n.renderer(e,n.line,{x:t.x,y:o}),o+=this.lineSpacing+this.fontHeight},s.TextRenderer.prototype.measure=function(){return this.lines.length*(this.fontHeight+this.lineSpacing)-this.lineSpacing},s.TextRenderer.prototype.basicRenderer=function(e,t,i){e.fillText(t,i.x,i.y)},s.TextRenderer.prototype.addMulticolorTextLine=function(e,t){
this.addTextLine(e,t,this.multicolorRenderer)},s.TextRenderer.prototype.addTextLine=function(e,t,i){i||(i=this.basicRenderer),t||(t={}),this.lines.push({line:e,renderer:i,options:t})},s.TextRenderer.prototype.multicolorRenderer=function(e,t,i){var n,o,r=i.x;for(n=0;n<t.length;++n)o=t[n],e.fillStyle=o.color,e.fillText(o.text,r,i.y),r+=e.measureText(o.text).width},t.ESDPaneView=n},function(e,t){},function(e,t,i){"use strict";function n(e){var t,i=""+e,n=i.split(".")[1],o=2;return n&&(t=n.match(/^([0]+)/))&&(o=t[1].length+1),parseFloat(i).toFixed(o)}Object.defineProperty(t,"__esModule",{value:!0}),t.roundToFirstValuable=n},function(e,t,i){"use strict";var n=i(72).TimePointIndexSearchMode,o=i(37),r=i(25),s=i(670),a=i(297),l=i(268),c=l.ChartApiInterface,h=l.HandlerInfo,u=i(12).requireFullInterfaceImplementation,d=i(4).getLogger("Chart.ChartApiLocal");TradingView.STUDY_COUNT_LIMIT=210,JSServer.ChartApi=function(e){this._notificationHandlers={},this._sessions={},this.studyCounter=0,this._connected=!1,this._enabled=!1,this._studyEngine=new s(e),this._callbacks={},this._symbolIdCache={},this._seriesIdCache={},this._recentSeriesId={},this._enableLogging=!1,this._enabledMoreBarsRequest=!0,this._serverTimeOffset=0;var t=this;this._studyEngine.on("configuration_received",function(){t._fireEvent("configuration_received")}),this._studyEngine.on("realtime_tick",function(e){var i={time:e.value[0]/1e3,open:e.value[1],high:e.value[2],low:e.value[3],close:e.value[4],volume:e.value[5]};t._fireEvent("realtime_tick",i,!0)}),this._setVisibleRangeTimeout=null},JSServer.ChartApi.prototype._makeSymbolKey=function(e,t){if(!e||!t)throw Error("incorrect identifiers");return e+"_"+t},JSServer.ChartApi.prototype._makeSeriesKey=function(e,t){if(!e||!t)throw Error("incorrect identifiers");return e+"_"+t},JSServer.ChartApi.prototype.destroy=function(){this._studyEngine.destroy(),this._studyEngine=null},JSServer.ChartApi.prototype.purgeCache=function(e){this._symbolIdCache={},this._studyEngine.purgeCache(),this._studyEngine.purgeRangeExtensionData(),this._studyEngine.purgeDataCache()},JSServer.ChartApi.prototype.setAdditionalBarsRequestEnabled=function(e){this._enabledMoreBarsRequest=e},JSServer.ChartApi.prototype.defaultWatchlistSymbols=function(){return this._watchlistSettings.default_symbols},JSServer.ChartApi.prototype.defaultResolutions=function(){return this._studyEngine.supportedResolutions()||["1","3","5","15","30","45","60","120","180","240","D","W","M"]},JSServer.ChartApi.prototype.supportedSymbolsTypes=function(){return this._studyEngine.supportedSymbolsTypes()},JSServer.ChartApi.prototype.supportedExchangesList=function(){return this._studyEngine.supportedExchangesList()},JSServer.ChartApi.prototype.futuresRegex=function(){return this._studyEngine.futuresRegex()},JSServer.ChartApi.prototype.start=function(){this._enabled=!0,this._fireEvent("start_enabled")},JSServer.ChartApi.prototype._logMessage=function(e){this._enableLogging&&console.log(e)},JSServer.ChartApi.prototype.unsubscribe=function(e,t){var i=this._callbacks[e]
;i&&i.splice(i.indexOf(t),1)},JSServer.ChartApi.prototype.on=function(e,t){return this._callbacks.hasOwnProperty(e)||(this._callbacks[e]=[]),this._callbacks[e].push(t),this},JSServer.ChartApi.prototype._fireEvent=function(e,t,i){var n,o;if(this._callbacks.hasOwnProperty(e))for(n=this._callbacks[e].slice(0),i||(this._callbacks[e]=[]),o=0;o<n.length;++o)n[o](t)},JSServer.ChartApi.prototype.chartCreateSession=function(e,t){},JSServer.ChartApi.prototype.chartDeleteSession=function(e){},JSServer.ChartApi.prototype.createSession=function(e,t){TradingView.ChartapiMessagerInstances[e]=new a(this,e),this._sessions[e]=t,this._notificationHandlers[e]={},this.connected()&&t.onMessage({method:"connected",params:[]})},JSServer.ChartApi.prototype.removeSession=function(e){delete this._sessions[e],delete this._notificationHandlers[e],this._studyEngine.stopSources(e)},JSServer.ChartApi.prototype.connected=function(){return this._connected},JSServer.ChartApi.prototype.connect=function(){if(!this._enabled){var e=this;return void this.on("start_enabled",function(){e.connect()})}this.connected()||(this._connected=!0,this.sessionid="dummy session id",this._notifySessions({method:"connected",params:[]}))},JSServer.ChartApi.prototype.disconnect=function(){this._connected=!1,this._notifySessions({method:"disconnected",params:[]})},JSServer.ChartApi.prototype.switchTimezone=function(e,t){if(TradingView.ChartapiMessagerInstances[e].timezone()!==t&&(TradingView.ChartapiMessagerInstances[e].setTimezone(t),this._recentSeriesId[e])){var i=this;this._doWhenSeriesSymbolIdIsReady(e,this._recentSeriesId[e],function(t){var n=i._seriesIdCache[i._makeSeriesKey(e,i._recentSeriesId[e])].resolution;i._studyEngine.recreateSources(t.name,n,e,!0),i._doWhenSeriesDataReceived(e,function(){var n=i._seriesIdCache[i._makeSeriesKey(e,i._recentSeriesId[e])].resolution,o=TradingView.ChartapiMessagerInstances[e].lastBarTime(i._recentSeriesId[e]);o&&i._studyEngine.rebuildExtrapolatedData(e,t.name,n,t.info,1e3*o)})})}},JSServer.ChartApi.prototype.receiveLocalResponse=function(e){this._logMessage("< "+e.method),this._dispathNotification(e),this._fireEvent("message_"+e.method,void 0,!0)},JSServer.ChartApi.prototype.getMarks=function(e,t,i,n,o){this._studyEngine.getMarks(e,t,i,n,o)},JSServer.ChartApi.prototype.getTimescaleMarks=function(e,t,i,n,o){this._studyEngine.getTimescaleMarks(e,t,i,n,o)},JSServer.ChartApi.prototype.resolveSymbol=function(e,t,i,n,o){function r(t,n){Object.keys(s._seriesIdCache).some(function(e){return s._seriesIdCache[e].symbolId===t})&&TradingView.ChartapiMessagerInstances[e].onSeriesClearData(0,""),TradingView.ChartapiMessagerInstances[e].onSymbolError(t,n),s._symbolIdCache[s._makeSymbolKey(e,t)]={name:i,status:"invalid_symbol"},s._fireEvent("resolve_fail",{session:e,symbolId:t},!0),s._fireEvent(s._makeSymbolKey(e,t)+"_resolve_fail")}this._notificationHandlers[e][t]=new h(n,t),this._symbolIdCache[this._makeSymbolKey(e,t)]=null;var s=this;this._studyEngine.resolveSymbol(i,function(n){if(n.errmsg)return void r(t,n.errmsg)
;s._symbolIdCache[s._makeSymbolKey(e,t)]={name:i,info:n,status:"ok"},s._fireEvent("symbol_resolved",{symbolInfo:n,symbolId:t,session:e},!0),s._fireEvent(s._makeSymbolKey(e,t)+"_resolved",n),TradingView.ChartapiMessagerInstances[e].onSymbolResolved(t,n)},function(e){r(t,e)})},JSServer.ChartApi.prototype._doWhenSymbolIdIsReady=function(e,t,i){function n(){return{name:r._symbolIdCache[r._makeSymbolKey(e,t)].name,info:r._symbolIdCache[r._makeSymbolKey(e,t)].info}}function o(){s&&(i(n()),s=!1,r.unsubscribe(r._makeSymbolKey(e,t)+"_resolved",o),r.unsubscribe(r._makeSymbolKey(e,t)+"_resolve_fail",o))}var r=this,s=!0;this._symbolIdCache[this._makeSymbolKey(e,t)]?o():(this.on(this._makeSymbolKey(e,t)+"_resolved",o),this.on(this._makeSymbolKey(e,t)+"_resolve_fail",o))},JSServer.ChartApi.prototype._doWhenSeriesDataReceived=function(e,t){TradingView.ChartapiMessagerInstances[e].seriesCompleted.subscribe(null,t,!0)},JSServer.ChartApi.prototype._doWhenSeriesSymbolIdIsReady=function(e,t,i,n){function o(){var t=c._symbolIdCache[c._makeSymbolKey(e,h)];return{name:t.name,info:t.info}}function r(){i(o())}function s(){c.unsubscribe("symbol_resolved",l),c.unsubscribe("resolve_fail",a)}function a(t){t.symbolId===h&&t.session===e&&(s(),n&&n())}function l(t){t.symbolId===h&&t.session===e&&(s(),r())}var c=this,h=this._seriesIdCache[e+"_"+t].symbolId;this._symbolIdCache[this._makeSymbolKey(e,h)]?r():(this.on("symbol_resolved",l),this.on("resolve_fail",a))},JSServer.ChartApi.prototype.createSeries=function(e,t,i,n,o,s,a){i=i||"";var l=this;this._notificationHandlers[e][t]=new h(function(s){if("series_completed"===s.method){var c=r.Symbol.parsePeriod(o);c.range&&l._applyRange(e,n,t,i,c.range)}a(s)},t),this._recentSeriesId[e]=t,TradingView.ChartapiMessagerInstances[e].setResolution(r.Symbol.parsePeriod(o).pureResolution),this._seriesIdCache[e+"_"+t]={symbolId:n,resolution:o,turnaround:i},this._studyEngine.updateSeriesTurnaround(e,t,i),this._doWhenSeriesSymbolIdIsReady(e,t,function(n){l._studyEngine.seriesTurnaround(e,t)===i&&l._studyEngine.createSeries(n.name,o,e,t,i)})},JSServer.ChartApi.prototype.removeSeries=function(e,t,i){this._notificationHandlers[e][t]=new h(i,t),this._studyEngine.removeSeries(e,t)},JSServer.ChartApi.prototype.setVisibleTimeRange=function(e,t,i,o,r){function s(){var s,a;u=e.data(),s=[u.plotValueToTimePointIndex(i,TradingView.TIME_PLOT,n.FromLeft),u.plotValueToTimePointIndex(o,TradingView.TIME_PLOT,n.FromRight)],s[1]<s[0]||(u.valueAt(s[1])[0]<o&&e.syncModel()&&(a=e.syncModel().distance(u.valueAt(s[1])[0],o),a.success&&(s[1]+=a.result)),TradingView.ChartapiMessagerInstances[t].onSeriesTimeframeUpdate(p,_,s[0],s[1],!0),e.requestMoreData(),r&&r())}function a(e,t){e===p&&t===_&&(c.unsubscribe(null,a),h.unsubscribe(null,l),s())}function l(e,t){e===p&&t===_&&c.unsubscribe(null,a)}var c,h,u=e.data(),d=!!u.plotValueToTimePointIndex(i,TradingView.TIME_PLOT,n.FromLeft),p=this._recentSeriesId[t],_=this._seriesIdCache[t+"_"+p].turnaround;if(d)return void s();c=TradingView.ChartapiMessagerInstances[t].seriesCompleted,
h=TradingView.ChartapiMessagerInstances[t].seriesError,null!==this._setVisibleRangeTimeout&&clearTimeout(this._setVisibleRangeTimeout),this._setVisibleRangeTimeout=setTimeout(function(){this._setVisibleRangeTimeout=null,c.subscribe(null,a,!0),h.subscribe(null,l,!0),this._studyEngine.ensureExtendedTo(p,t,i)}.bind(this),0)},JSServer.ChartApi.prototype._exactBarsCountOfTimeFrame=function(e,t){var i,n=chartWidget.model().mainSeries().bars(),r=chartWidget.model().mainSeries().symbolInfo().session,s=n._valueAt(n.size()-1)[0],a=o.alignPeriodsBack(r,e.resolution,e.interval,1,1e3*s),l=n.size();for(a/=1e3,i=0,i=0;i<l&&!(n._valueAt(i)[0]>a);++i);return l-i},JSServer.ChartApi.prototype._applyRange=function(e,t,i,n,o){var r,s,a,l=chartWidget.model().mainSeries().bars().size();0!==l&&(r=this._exactBarsCountOfTimeFrame(o,this._symbolIdCache[this._makeSymbolKey(e,t)].info),s=Math.max(0,l-1-r),a=Math.max(s,l-1),TradingView.ChartapiMessagerInstances[e].onSeriesTimeframeUpdate(i,n,s,a))},JSServer.ChartApi.prototype.modifySeries=function(e,t,i,n,o,s,a){var l,c;i=i||"",l=this._seriesIdCache[e+"_"+t]?this._seriesIdCache[e+"_"+t].resolution:void 0,TradingView.ChartapiMessagerInstances[e].setResolution(r.Symbol.parsePeriod(o).pureResolution),c=this,this._notificationHandlers[e][t]=new h(function(a){var h,u;"series_completed"===a.method&&(h=r.Symbol.parsePeriod(l),u=r.Symbol.parsePeriod(o),u.range&&h.range!==u.range&&c._applyRange(e,n,t,i,u.range)),s(a)},t),this._recentSeriesId[e]=t,this._studyEngine.updateSeriesTurnaround(e,t,i),a&&(this._seriesIdCache[this._makeSeriesKey(e,a)]=null),this._seriesIdCache[this._makeSymbolKey(e,t)]={symbolId:n,resolution:o,turnaround:i},this._doWhenSeriesSymbolIdIsReady(e,t,function(t){c._studyEngine.purgeRangeExtensionData(e),c._studyEngine.recreateSources(t.name,o,e,!0)})},JSServer.ChartApi.prototype.requestMoreData=function(e,t,i,n){if(this._enabledMoreBarsRequest){var o=this;setTimeout(function(){o._notificationHandlers[e][t]=new h(n,t),o._studyEngine.extendSeriesRange(t,e,i)})}},JSServer.ChartApi.prototype.setStudiesAccessController=function(e){this.studiesAccessController=e},JSServer.ChartApi.prototype.setWatchlistSettings=function(e){this._watchlistSettings=e},JSServer.ChartApi.prototype.allStudiesMetadata=function(){return this._studyEngine.studiesMetadata()},JSServer.ChartApi.prototype.requestMetadata=function(e,t,i){this._notificationHandlers[e][t]=new h(i,t);var n=this.studiesAccessController.getEnabledTools();TradingView.ChartapiMessagerInstances[e].onRequestMetadata(t,n)},JSServer.ChartApi.prototype.isCanCreateStudy=function(){return this.studyCounter<TradingView.STUDY_COUNT_LIMIT},JSServer.ChartApi.prototype.createStudy=function(e,t,i,n,o,r,s){var a,l,c;if(!this.isCanCreateStudy())throw Error("Exceeded the limit of studies");a=this,i=i||"",this._notificationHandlers[e][t]=new h(s,t),l=this._seriesIdCache[this._makeSeriesKey(e,n)].symbolId,c=this._seriesIdCache[this._makeSeriesKey(e,n)].resolution,this._doWhenSymbolIdIsReady(e,l,function(n){a._studyEngine.createStudy(n.name,c,e,t,i,o,r),
a.studyCounter++})},JSServer.ChartApi.prototype.rebindStudy=function(e,t,i,n,o,r,s,a){throw Error("Not implemented")},JSServer.ChartApi.prototype.removeStudy=function(e,t){this._notificationHandlers[e][t]=null,this._studyEngine.removeStudy(e,t),this.studyCounter--},JSServer.ChartApi.prototype.modifyStudy=function(e,t,i,n,o){var r=this;setTimeout(function(){i=i||"",r._notificationHandlers[e][t]=new h(o,t),r._studyEngine.recomputeStudy(t,n,e,i)},0)},JSServer.ChartApi.prototype.createPointset=function(e,t,i,n,o,r,s){i=i||"",this._notificationHandlers[e][t]=new h(s,t);var a=this;this._doWhenSymbolIdIsReady(e,n,function(i){a._studyEngine.createPointset(e,t,i.info.full_name,i.info,o,r)})},JSServer.ChartApi.prototype.modifyPointset=function(e,t,i,n,o){throw Error("This call is not implemented")},JSServer.ChartApi.prototype.removePointset=function(e,t,i){this._notificationHandlers[e][t]=null,this._studyEngine.removePointset(t)},JSServer.ChartApi.prototype.requestMoreTickmarks=function(e,t,i,n){this._notificationHandlers[e][t]=new h(n,t);var o=this;this._doWhenSeriesSymbolIdIsReady(e,t,function(n){var r=o._seriesIdCache[o._makeSeriesKey(e,t)].resolution;o._studyEngine.onMoreTickmarksRequested(e,n.name,n.info,r,i)})},JSServer.ChartApi.prototype.requestFirstBarTime=function(e,t,i,n){this._notificationHandlers[e][t]=new h(n,t)},JSServer.ChartApi.prototype._invokeHandler=function(e,t){e&&e(t)},JSServer.ChartApi.prototype._sendRequest=function(e,t){throw Error("This method is not implemented")},JSServer.ChartApi.prototype._onMessage=function(e){throw Error("This method is not implemented")},JSServer.ChartApi.prototype._convertTimescaleResponse=function(e){var t,i=e.marks;for(t=0;t<i.length;++t)i[t]={span:i[t][0],time:i[t][1],index:i[t][2]};return e},JSServer.ChartApi.prototype._dispathNotification=function(e){var t,i,n,o,r,s,a,l,c,h,u=e.params.shift();if(this._notificationHandlers[u])switch(e.method){case"timescale_update":t=e.params[0],i=e.params[1],n=this._convertTimescaleResponse(i),n.clear=0===i.changes.length&&0===i.marks.length,this._sessions[u].onMessage({method:"timescale_update",params:n});for(o in t)r={},r.customId=o,r.plots=t[o].series,t[o].ns&&(r.nonseries=t[o].ns),r.turnaround=t[o].turnaround,s={method:"data_update",params:r},this._invokeNotificationHandler(u,o,s);break;case"tickmark_update":n=this._convertTimescaleResponse(e.params[0]),n.changes=[],this._sessions[u].onMessage({method:"timescale_update",params:n});break;case"data_update":for(o in e.params[0]){a=e.params[0][o],r={},r.customId=o,r.plots=a.series?a.series:a.plots,r.turnaround=a.turnaround,"s"in a&&"ns"in a&&(r.plots=a.s,r.nonseries=a.ns);for(l=0;l<r.plots.length;l++)for(c in r.plots[l].value)1e100===r.plots[l].value[c]&&(r.plots[l].value[c]=void 0);s={method:"data_update",params:r},this._invokeNotificationHandler(u,o,s)}break;case"index_update":for(o in e.params[0])s={method:"index_update",params:e.params[0][o]},this._invokeNotificationHandler(u,o,s);break;case"critical_error":
d.logNormal(new Date+" critical_error session:"+this.sessionid+" reason:"+e.params[0]),this._sessions[u].onMessage({method:"critical_error",params:e.params});break;case"quote_symbol_data":case"quote_list_fields":case"depth_symbol_error":case"depth_symbol_success":case"dd":case"dpu":case"depth_bar_last_value":this._sessions[u].onMessage({method:e.method,params:e.params});break;default:h=e.params[0],this._invokeNotificationHandler(u,h,e)}},JSServer.ChartApi.prototype._invokeNotificationHandler=function(e,t,i){if(void 0!==t){var n=this._notificationHandlers[e][t];void 0!==n&&n&&this._invokeHandler(n.handler,i),"series_deleted"!==i.method&&"study_deleted"!==i.method||delete this._notificationHandlers[e][t]}},JSServer.ChartApi.prototype.searchSymbols=function(e,t,i,n,o,r,s,a,l,c){0===e.length&&0===t.length&&0===i.length&&c([]),this._studyEngine.searchSymbols(e,t,i,c)},JSServer.ChartApi.prototype._notifySessions=function(e){var t,i;for(t in this._sessions){if(!this._sessions.hasOwnProperty(t))return;i=this._sessions[t],"function"==typeof i.onMessage&&i.onMessage(e)}},JSServer.ChartApi.prototype.unpack=function(e){throw Error("This method is not implemented")},JSServer.ChartApi.prototype.quoteCreateSession=function(e){return this._studyEngine.quoteCreateSession(e)},JSServer.ChartApi.prototype.quoteDeleteSession=function(e){return this._studyEngine.quoteDeleteSession(e)},JSServer.ChartApi.prototype.quoteSetFields=function(e,t){return this._studyEngine.quoteSetFields(e,t)},JSServer.ChartApi.prototype.quoteAddSymbols=function(e,t){return-1!==t.indexOf(void 0)&&(console.warn("Got undefined in quoteAddSymbols"),t=t.filter(function(e){return!!e})),this._studyEngine.quoteAddSymbols(e,t)},JSServer.ChartApi.prototype.quoteRemoveSymbols=function(e,t){return this._studyEngine.quoteRemoveSymbols(e,t)},JSServer.ChartApi.prototype.quoteFastSymbols=function(e,t){return this._studyEngine.quoteFastSymbols(e,t)},JSServer.ChartApi.prototype.quoteHibernateAll=function(e){return this._studyEngine.quoteHibernateAll(e)},JSServer.ChartApi.prototype.depthCreateSession=function(e){return this._studyEngine.depthCreateSession(e)},JSServer.ChartApi.prototype.depthDeleteSession=function(e){return this._studyEngine.depthDeleteSession(e)},JSServer.ChartApi.prototype.depthSetSymbol=function(e,t){return this._studyEngine.depthSetSymbol(e,t)},JSServer.ChartApi.prototype.depthClearSymbol=function(e){},JSServer.ChartApi.prototype.depthSetScale=function(e,t){},JSServer.ChartApi.prototype.createStudiesAccessController=function(e,t,i){return new this.StudiesAccessController(this._studyEngine,e&&JSON.parse(e)||{type:"black",tools:[]})},JSServer.ChartApi.prototype.StudiesAccessController=function(e,t){this._studyEngine=e,this._studiesAccess=t},JSServer.ChartApi.prototype.StudiesAccessController.prototype._findTool=function(e){var t,i,n=null;for(t=0;t<this._studiesAccess.tools.length;++t)if(i=this._studiesAccess.tools[t],i.name===e||i===e){n=i;break}return n},JSServer.ChartApi.prototype.StudiesAccessController.prototype.getEnabledTools=function(){
return this._studyEngine.studiesMetadata().filter(function(e){var t=this._findTool(e.description);return"black"===this._studiesAccess.type?!t||t.grayed:!!t},this)},JSServer.ChartApi.prototype.StudiesAccessController.prototype.isToolGrayed=function(e){var t=this._findTool(e);return t&&t.grayed},JSServer.ChartApi.prototype.serverTimeOffset=function(){return this._studyEngine.serverTimeOffset()},JSServer.ChartApi.prototype.alignTimePoint=function(e,t,i){return this._studyEngine.alignTimePoint(e,t,i)},JSServer.ChartApi.prototype.disconnectCount=function(){return 0},u(JSServer.ChartApi,"JSServer.ChartApi",c,"ChartApiInterface"),e.exports=JSServer.ChartApi},function(e,t,i){"use strict";var n,o;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"StudyError",function(){return o}),n=i(1),o=function(e){function t(t){var i=e.call(this,t)||this;return i.studyError=!0,i}return n.c(t,e),t}(Error)},function(e,t,i){"use strict";(function(t,n){function o(e){var t=e.findIndex(function(e){return e.index!==_});return 0===t?e:e.slice(t)}function r(e,i){var n=t.get_timezone(i.timezone),o=new b.Session;return o.init(n,i.session),y.Symbol.newBarBuilder(e,o,o)}function s(e){function t(e){console.warn("SymbolInfo validation: "+e)}var i,o;if(e.has_empty_bars&&n.enabled("disable_resolution_rebuild")&&t('both has_empty_bars field and featureset "disable_resolution_rebuild" are enabled and may cause data issues (see #3329)'),(void 0===e.minmov||e.minmov<=0)&&t("minmov must be positive"),(void 0===e.pricescale||e.pricescale<=0)&&t("pricescale must be positive"),void 0!==e.name&&0!==e.name.length||t("name must be non-empty string"),void 0!==e.session&&0!==e.session.length||t("session must be non-empty string"),void 0===e.timezone||0===e.timezone.length?t("timezone must be non-empty string"):"exchange"!==e.timezone&&p(e.timezone)||"UTC"!==e.timezone&&t('unsupported timezone "{0}"'.format(e.timezone)),void 0!==e.intraday_multipliers)if(i=e.intraday_multipliers,Array.isArray(i))for(o=0;o<i.length;++o)"string"!=typeof i[o]&&t('intraday_multipliers[{0}] = "{1}" must be string (now: {2})'.format(o+1,i[o],typeof i[o]));else t("intraday_multipliers must be array");(e.supported_resolutions||[]).filter(function(e){return!w.isValid(e)}).forEach(function(e){t("supported_resolutions field contains invalid value: "+e)})}function a(e){var t,i;if(e.base_name||(e.base_name=[e.name]),e.legs||(e.legs=[e.name]),e.exchange||(e.exchange=e["exchange-listed"]),e.full_name||(e.full_name=e.symbol||(e.exchange?e.exchange+":"+e.name:e.name)),e.pro_name||(e.pro_name=e.full_name),e.data_status||(e.data_status="streaming"),e.ticker||(e.ticker=e.symbol||e.name),!e.session&&e["session-regular"]&&(e.session=e["session-regular"]),!e.minmov&&e.minmovement&&(e.minmov=e.minmovement),e.supported_resolutions)for(t=0;t<e.supported_resolutions.length;t++)i=w.parse(e.supported_resolutions[t]),i.isValid()&&(e.supported_resolutions[t]=i.value())}function l(e,t){
null!=e.graphicsCmds&&null!=e.graphicsCmds.create&&null!=e.graphicsCmds.create.vertlines&&e.graphicsCmds.create.vertlines.forEach(function(e){e.data.forEach(t)})}function c(e,t){var i,n,o=e.length,r=t.length,s=0;for(i=0;i<o;++i){for(n=e[i];s<r&&t[s].value[0]<n;)++s;s>=r?e[i]=t[r-1].index:e[i]=t[s].index}}function h(e,t){var i,n;null!==t&&0!==t.length&&(i={},T(e,function(e){x(e)&&Object.keys(e).forEach(function(t){t.endsWith("__t")&&(i[e[t]]=!0)})},{visitInstances:!0}),n=Object.keys(i).map(Number).sort(function(e,t){return e-t}),n.forEach(function(e,t){i[e]=t}),Object.assign(e,T(e,function(e){return x(e)&&Object.keys(e).forEach(function(t){t.endsWith("__t")&&(e[t.slice(0,-3)]=i[e[t]])}),e},{visitInstances:!0})),c(n,t),e.indexes=n)}function u(e,t){var i,n;null!==t&&0!==t.length&&(i={},l(e.data,function(e){i[e.time]=!0}),n=Object.keys(i).map(Number).sort(function(e,t){return e-t}),n.forEach(function(e,t){i[e]=t}),l(e.data,function(e){e.index=i[e.time]}),c(n,t),e.indexes=n)}var d,p,_,f,m=i(671),y=i(25),g=i(672),v=i(674),S=i(675),b=i(37),w=i(15).Interval,P=i(31),T=i(676).visitObject,x=i(12).isObject;i(183),i(297),d=i(677).DatafeedRequestsCachedProcessor,p=i(200).timezoneIsAvailable,_=-5e6,f=function(e){function t(e,t,i){return function(n){var o,a;n&&n.count()&&(o=r(t,e),a=1e3*s.getCurrentUTCTime(),o.moveTo(a),o.indexOfBar(a)>=0&&n.setLastBarClosed(!1)),i(n)}}function i(e,i,n,o,r){return s._cachedDatafeed.subscribe(e,i,n,t(e,i,o),r)}function n(e){return s._cachedDatafeed.unsubscribe(e)}function o(e,t,i){s.resolveSymbol(e,t,i)}var s=this;this._studiesCache={},this._sessionsLastDataCache={},this._metainfoCache=[],this._barsCoefficientsCache={},this._extrapolationManager=v,this._externalDatafeed=e,this._datafeedConfiguration=null,this._marketStatusWatchers={},this._resolveRequests={},this._callbacks={},this._serverTimeOffset=0,s._logMessage("Datafeed settings received: {0}".format(JSON.stringify(window.configurationData))),s._datafeedConfiguration=s._adoptConfigurationData(window.configurationData),s._fireEvent("configuration_received"),s._externalDatafeed.getServerTime&&s._externalDatafeed.getServerTime(function(e){s._serverTimeOffset=e-(new Date).valueOf()/1e3}),this._pointsetsManager=S,this._rangeExtensionData={},this._quotesInfo=[],this._depthInfo=[],this._fullNameSymbolInfoMap={},this._endOfData={},this._computeStudyCounter=0,this._cachedDatafeed=new d(e,f.createDWMAligner),this._extendedRange=function(e){return s._rangeExtensionData[e]&&s._rangeExtensionData[e].summary},this._extendedRangeForStudy=function(e){var t=s._rangeExtensionData[e];return t?t.summary+t.realtimeBarsCount:0},this._extendedTime=function(e){return s._rangeExtensionData[e]&&s._rangeExtensionData[e].time},g.setupFeed({resolve:o,subscribe:i,unsubscribe:n,calculateHistoryDepth:this._externalDatafeed.calculateHistoryDepth?this._externalDatafeed.calculateHistoryDepth.bind(this._externalDatafeed):void 0})},f.createDWMAligner=function(e,i,n){var o=t.get_timezone(i),r=new b.Session;return r.init(o,n),b.createDWMAligner(e,r)},
f.prototype._barsCoefficients=function(e,t){if(0!==e.indexOf("="))return{};var i=e+t;return this._barsCoefficientsCache[i]||(this._barsCoefficientsCache[i]={}),this._barsCoefficientsCache[i]},f.prototype.destroy=function(){this._cachedDatafeed.destroy(),this._externalDatafeed=null},f.prototype.purgeCache=function(){this._endOfData={},this._resolveRequests={}},f.prototype.purgeDataCache=function(){this._cachedDatafeed.purgeCache()},f.prototype._logMessage=function(e){n.enabled("charting_library_debug_mode")&&console.log(e)},f.prototype._extendRange=function(e,t){this._rangeExtensionData[e]||(this._rangeExtensionData[e]={}),void 0===this._rangeExtensionData[e].summary&&(this._rangeExtensionData[e].summary=0),this._rangeExtensionData[e].summary+=t},f.prototype.on=function(e,t){return this._callbacks.hasOwnProperty(e)||(this._callbacks[e]=[]),this._callbacks[e].push(t),this},f.prototype._fireEvent=function(e,t,i){var n,o;if(this._callbacks.hasOwnProperty(e)){for(n=this._callbacks[e],o=0;o<n.length;++o)n[o](t);i||(this._callbacks[e]=[])}},f.prototype._adoptConfigurationData=function(e){var t,i,n,o=TradingView.merge({},e),r=o.supported_resolutions;if(!r||0===r.length)return o.supported_resolutions=void 0,o;for(t=[],i=0;i<r.length;i++){if(n=r[i],-1!==t.indexOf(n))throw Error("Duplicating resolution `"+n+"`");t.push(n)}return o.supported_resolutions=t,o},f.prototype.supportedResolutions=function(){return this._datafeedConfiguration.supported_resolutions},f.prototype.supportedSymbolsTypes=function(){return this._datafeedConfiguration.symbols_types||[]},f.prototype.supportedExchangesList=function(){return this._datafeedConfiguration.exchanges||[]},f.prototype.futuresRegex=function(){return this._datafeedConfiguration.futures_regex||/$a/},f.prototype._findStudyObject=function(e){var t=e.split("@")[0],i=JSServer.studyLibrary.filter(function(i){return i.metainfo.id===e||i.metainfo.shortDescription===t});if(0===i.length)throw Error("Study `"+e+"` not found");return i[0]},f.prototype.getMarks=function(e,t,i,n,o){var r,s={red:6,green:5,blue:4,yellow:3};this._externalDatafeed.getMarks&&this._datafeedConfiguration.supports_marks&&(this._logMessage("Requesting bars marks: symbol {0}, resolution {1}, range [{2} ... {3}]".format(e.full_name,o,new Date(1e3*t).toUTCString(),new Date(1e3*i).toUTCString())),r=this,this._externalDatafeed.getMarks(e,t,i,function(t){var i,a,l=t.map(function(e){return e.time=parseInt(e.time),e});r._logMessage("Received bars marks: symbol {0}, resolution {1}, marks {2}".format(e.full_name,o,JSON.stringify(l))),i=f.createDWMAligner(o,e.timezone,e.session),a=l.map(function(e){return e.tickmark=null!==i?i.tradingDayToSessionStart(1e3*e.time)/1e3:e.time,e.direction=s[e.color],e.onClicked=function(){P.emit("onMarkClick",e.id)},e.label=!!e.label&&e.label[0],e}),n(a)},o))},f.prototype.getTimescaleMarks=function(e,t,i,n,o){if(this._externalDatafeed.getTimescaleMarks&&this._datafeedConfiguration.supports_timescale_marks){
this._logMessage("Requesting timescale marks: symbol {0}, resolution {1}, range [{2} ... {3}]".format(e.full_name,o,new Date(1e3*t).toUTCString(),new Date(1e3*i).toUTCString()));var r=this;this._externalDatafeed.getTimescaleMarks(e,t,i,function(t){var i,s;r._logMessage("Received timescale marks: symbol {0}, resolution {1}, marks {2}".format(e.full_name,o,JSON.stringify(t))),i=f.createDWMAligner(o,e.timezone,e.session),s=t.map(function(e){return e.tickmark=null!==i?i.tradingDayToSessionStart(1e3*e.time)/1e3:e.time,e}),n(s)},o)}},f.prototype._computeStudy=function(e,t,i,n,o,r,s,a,l,c,h,u){function d(e){var t,i;return e<a()?_:0===(t=g.length)?0:(i=g[t-1].index,i===_?0:i+1)}function p(e,t,i){var n,o,r,s,a=e.time,l="number"==typeof t?[t]:t;for(n=0;n<l.length;++n)o=l[n],o&&"object"==typeof o&&(v["plot_"+n]=o.offset,o=o.value,S++),"number"==typeof o&&isNaN(o)&&(o=void 0),l[n]=o;r=g.length-1,s=r<0||a>g[r].value[0],s?g.push({index:d(a),value:[a].concat(l)}):g[r].value=[a].concat(l),f||c([g[g.length-1]],s,g.length,v,i)}var f=!0,m=this._computeStudyCounter++,g=[],v={},S=0,b=!1,w=!1,P=this,T=function(a){var c;if(y.Symbol.parsePeriod(n).isIntraday&&!a.has_intraday)return void h("Unsupported resolution. Did you forget to set has_intraday to true?");try{if(c=new y.StudyEngine({tickerid:i,symbolInfo:a,period:n,body:t,sessionId:e,onErrorCallback:h,rangeExtension:s,input:function(e){return r[e]},out:function(e,t){p(e,t,a)},nonseriesOut:function(e,t){w=!0,u(t,a)},setNoMoreData:function(){b=!0},recalc:function(e,i){f=!1,g.endOfData=b,w&&!(g.length>0)||t.error&&null!==t.error()||l(g,S>0?v:void 0,a,i)}}),!P._studiesCache[e]||!P._studiesCache[e][o])throw Error("This should never happen");P._studiesCache[e][o].engine=c}catch(e){if(!e.studyError)throw e;h(e.message)}},x=function(e){h(e)},C=function(){return P._studiesCache[e]&&P._studiesCache[e][o]&&P._studiesCache[e][o].activeResolve===m};P._studiesCache[e][o].activeResolve=m,this.resolveSymbol(i,function(){C()&&T.apply(P,arguments)},function(){C()&&x.apply(P,arguments)})},f.prototype._createStudy=function(e,t,i,n,r,s,a){function l(e){var t,i,o;if(Array.isArray(e))return e;for(t=[],i=p._studiesCache[n][r].metainfo.inputs,o=0;o<i.length;o++)t[o]=e[i[o].id];return t}function c(i,a,l){i=o(i),TradingView.ChartapiMessagerInstances[n].onDataUpdate(r,s,p._convertBarsTimeToUnix(i),a,l,p._extendedRange(e,t)),TradingView.ChartapiMessagerInstances[n].onStudyCompleted(r,s)}var d,p=this;a=l(a),TradingView.ChartapiMessagerInstances[n].onStudyLoading(r,s),d=null,p._computeStudy(n,i,e,t,r,a,{getRangeExtensionCount:p._extendedRangeForStudy.bind(this,n),getRangeExtensionTime:p._extendedTime.bind(this,n)},function(){if(null===d){var e=p._sessionsLastDataCache[n][0];if(void 0===e)return 1/0;d=e.value[0]}return d},function(e,t,i){c(e,t?{data:{offsets:t}}:null,i)},function(i,a,l,c,h){i=o(i);var u=c?{data:{offsets:c}}:null;TradingView.ChartapiMessagerInstances[n].onDataUpdate(r,s,p._convertBarsTimeToUnix(i),u,h,p._extendedRange(e,t))},function(e){TradingView.ChartapiMessagerInstances[n].onStudyError(r,s,e)
},function(e,t){var i;switch(e.type){case"projection":this._updateProjectionData(n,r,s,e);break;case"study_graphics":i={data:e.data,indexes:[]},u(i,p._sessionsLastDataCache[n]),c([],i,t);break;case"non_series_data":i={data:e.data,indexes:[]},h(i,p._sessionsLastDataCache[n]),c([],i,t);break;default:console.warn("unsupported non-series data type for study "+e.type)}}.bind(this))},f.prototype.stopSources=function(e){var t,i;for(t in this._studiesCache[e])(i=this._studiesCache[e][t])&&(i.engine&&i.engine.stop(),i.activeResolve=-1);g.unsubscribeUnused()},f.prototype.recreateSources=function(e,t,i,n){var o,r;this.stopSources(i);for(o in this._studiesCache[i])(r=this._studiesCache[i][o])&&(r.symbol=e,r.resolution=t,"series"===r.type&&this.createSeries(e,t,i,o,r.turnaround,n));for(o in this._studiesCache[i])(r=this._studiesCache[i][o])&&"study"===r.type&&this._createStudy(e,t,r.studyObject,i,o,r.turnaround,r.inputs)},f.prototype.removeStudy=function(e,t){this._studiesCache[e]&&this._studiesCache[e][t]&&this._studiesCache[e][t].engine&&(this._studiesCache[e][t].engine.stop(),g.unsubscribeUnused()),this._studiesCache[e][t]=null},f.prototype.removeSeries=function(e,t){this.removeStudy(e,t)},f.prototype.recomputeStudy=function(e,t,i,n){var o=this._studiesCache[i][e];if(!o)throw Error("This should never happen");o.inputs=t,o.turnaround=n,o.engine&&o.engine.stop(),this._createStudy(o.symbol,o.resolution,o.studyObject,i,e,n,t)},f.prototype._convertBarsTimeToUnix=function(e){var t,i,n=[];for(t=0;t<e.length;++t)i={index:e[t].index,value:[].concat(e[t].value)},i.value[0]/=1e3,n.push(i);return n.endOfData=e.endOfData,n},f.prototype.createStudy=function(e,t,i,n,o,r,s){var a=this._findStudyObject(r),l=new a.constructor;this._studiesCache[i]=this._studiesCache[i]||{},this._studiesCache[i][n]={studyObject:l,symbol:e,resolution:t,guid:n,type:"study",inputs:s,metainfo:a.metainfo,turnaround:o},this._createStudy(e,t,l,i,n,o,s)},f.prototype.purgeRangeExtensionData=function(e){e?this._rangeExtensionData[e]={summary:0,realtimeBarsCount:0}:this._rangeExtensionData={}},f.prototype.ensureExtendedTo=function(e,t,i){var n,o=this._studiesCache[t][e];if(!o)throw Error("This should never happen");this.purgeRangeExtensionData(t),this._rangeExtensionData[t]||(this._rangeExtensionData[t]={}),this._rangeExtensionData[t].time=i,n=this,setTimeout(function(){n.recreateSources(o.symbol,o.resolution,t,!0)},0)},f.prototype.extendSeriesRange=function(e,t,i){var n,o,r,s,a=this._studiesCache[t][e];if(!a)throw Error("This should never happen");if(this._isEndOfData(t,e,a.turnaround))return n=a.engine.runner.host.symbolInfo.data_status,void setTimeout(function(){TradingView.ChartapiMessagerInstances[t].onSeriesCompleted(e,a.turnaround,n)},0);i+=10,o=this._barsCoefficients(a.symbol,a.resolution),r=o.barsCoefficient||1,this._extendRange(t,i*r),o.barsCoefficient||(o.expectedBarsCount=this._extendedRange(t)),s=this,setTimeout(function(){s.recreateSources(a.symbol,a.resolution,t,!0)},0)},f.prototype._updateProjectionData=function(e,t,i,n){
var o=n.barsetSize?this._convertBarsTimeToUnix([{index:n.barsetSize-1,exTime:n.lastBar?n.lastBar[0]/1e3:0,value:n.lastBar}]):null;TradingView.ChartapiMessagerInstances[e].onProjectionUpdate(t,i,n,o)},f.prototype.updateSeriesTurnaround=function(e,t,i){this._studiesCache[e]||(this._studiesCache[e]={}),this._studiesCache[e][t]||(this._studiesCache[e][t]={}),this._studiesCache[e][t].type="series",this._studiesCache[e][t].turnaround=i},f.prototype.seriesTurnaround=function(e,t){return this._studiesCache[e]&&this._studiesCache[e][t]&&this._studiesCache[e][t].turnaround},f.prototype.createSeries=function(e,t,i,o,r,s){function a(e,n,o){l._extrapolationManager.storage(i,e.full_name,t).setLastBarTime(n,o)}var l,c=e,h=new y.OHLCV;this._studiesCache[i]=this._studiesCache[i]||{},this._sessionsLastDataCache[i]=null,this._studiesCache[i][o]={symbol:e,resolution:t,studyObject:h,guid:o,type:"series",turnaround:r},TradingView.ChartapiMessagerInstances[i].onSeriesLoading(o,r),l=this,this._computeStudy(i,h,c,t,o,[],{getRangeExtensionCount:l._extendedRange.bind(this,i),getRangeExtensionTime:l._extendedTime.bind(this,i)},function(){return-1/0},function(n,c,h,u){var d,p,_,f,m,y;if(!l._studiesCache[i][o])throw Error("This should never happen");if(l._sessionsLastDataCache[i]=n,d=l._convertBarsTimeToUnix(n),p=d.length>0?1e3*d[0].value[0]:void 0,u.nextTime&&(!p||u.nextTime<p/1e3))return void l.ensureExtendedTo(o,i,u.nextTime);0!==d.length&&(_=l._barsCoefficients(e,t),_.expectedBarsCount&&_.barsCount&&(_.barsCoefficient=Math.min(Math.max(_.barsCoefficient||1,parseInt(_.expectedBarsCount/(d.length-_.barsCount)+.5)),100)),_.barsCount=d.length,f=d[d.length-1],a(h,d.length-1,1e3*f.value[0]),l.rebuildExtrapolatedData(i,e.name,t,h,1e3*f.value[0]),s&&TradingView.ChartapiMessagerInstances[i].onSeriesClearData(o,r),TradingView.ChartapiMessagerInstances[i].onTimescaleUpdate(o,r,d,h,0),m=l._extrapolationManager.storage(i,h.full_name,t),Promise.resolve().then(function(){l._pointsetsManager.broadcastPointsetsUpdates(h.full_name,t,n,m,h,function(e,t){TradingView.ChartapiMessagerInstances[i].onPointsetDataUpdate(e,r,t,h)})})),y=0===d.length||u&&u.endOfData,y&&(l._logMessage("Series has no more data on server: {0}".format(h.full_name)),l._setEndOfData(i,o,r),0===d.length&&TradingView.ChartapiMessagerInstances[i].onSeriesClearData(o,r)),TradingView.ChartapiMessagerInstances[i].onSeriesCompleted(o,r,h.data_status)},function(e,n,s,c,h){var u,d=l._convertBarsTimeToUnix(e),p=d[d.length-1];if(n){if(l._rangeExtensionData[i]||l.purgeRangeExtensionData(i),l._rangeExtensionData[i].realtimeBarsCount+=1,!l._studiesCache[i][o])throw Error("This should never happen");u=s-1,l._logMessage("New bar arrived: symbol {0}, bar {1}".format(h.full_name,JSON.stringify(p))),TradingView.ChartapiMessagerInstances[i].onTimescaleUpdate(o,r,[p],h,u),a(h,u,1e3*p.value[0]),l.rebuildExtrapolatedData(i,h.full_name,t,h,1e3*p.value[0])}else l._logMessage("Last bar update: symbol {0}, bar {1}".format(h.full_name,JSON.stringify(p))),
TradingView.ChartapiMessagerInstances[i].onDataUpdate(o,r,d,null,h);l._fireEvent("realtime_tick",e[e.length-1],!0)},function(e){l._logMessage("Series error: {0}".format(e)),TradingView.ChartapiMessagerInstances[i].onSeriesError(o,e),n.enabled("clear_bars_on_series_error")&&TradingView.ChartapiMessagerInstances[i].onSeriesClearData(o,r)},function(e,n){var s,c,h,u,d,p,_,f;if("projection"!==e.type)throw Error("unexpected non-series data type for series "+e.type);if(s=e.projectionTime/1e3,c=-1,(e.data||[]).forEach(function(e){c=Math.max(c,e[0]||0)}),c=Math.min(c,100),h=e.barsetSize,s&&c>=0&&h&&e.lastBar){for(u=[],d=0;d<=c;d++)u.push(s+.001*d);p=e.lastBar.slice(0),p[0]=p[0]/1e3,TradingView.ChartapiMessagerInstances[i].onTimescaleUpdate(o,r,[{index:h-1,value:p}],n,h-1,u),_=h+c,f=1e3*Math.trunc(u[c]),a(n,_,f),l.rebuildExtrapolatedData(i,n.full_name,t,n,f)}l._updateProjectionData(i,o,r,e)})},f.prototype.onMoreTickmarksRequested=function(e,t,i,n,o){this._extrapolationManager.storage(e,i.full_name,n).onTickmarksNeeded(i,o)},f.prototype.removePointset=function(e){this._pointsetsManager.removePointset(e)},f.prototype.rebuildExtrapolatedData=function(e,t,i,n,o){this._extrapolationManager.storage(e,n.full_name,i).rebuild(o,n)},f.prototype.createPointset=function(e,t,i,n,o,r){var s=this._extrapolationManager.storage(e,n.full_name,o);this._pointsetsManager.createPointset(t,i,o,r,s,n)},f.prototype.studiesMetadata=function(){return 0===this._metainfoCache.length&&(this._metainfoCache=JSServer.studyLibrary.map(function(e){return e.metainfo})),this._metainfoCache},f.prototype.searchSymbols=function(e,t,i,n){function o(e){r._logMessage("Symbol search response: {0}".format(JSON.stringify(e))),n(e)}this._logMessage("Symbol search requested: search string `{0}`, exchange: `{1}`, type `{2}`".format(e,t,i));var r=this;this._externalDatafeed.searchSymbols(e,t,i,o)},f.prototype.resolveSymbol=function(e,t,i){var n,o=g.parseSymbol(e).symbol;this._resolveRequests[o]?n=this._resolveRequests[o]:(n=this.resolveSymbolInternal(o),this._resolveRequests[o]=n),n.done(t).fail(i)},f.prototype.resolveSymbolInternal=function(e){var t,i=this,n=$.Deferred();return this._logMessage("Symbol resolve requested: `{0}` ".format(e)),t=!0,this._externalDatafeed.resolveSymbol(e,function(o){t&&console.warn("`resolveSymbol` should return result asynchronously. Use `setTimeout` with 0 interval to execute the callback function."),i._logMessage("Symbol resolved: `{0}`, SymbolInfo in server response {1}".format(e,JSON.stringify(o))),a(o),s(o),i._logMessage("Symbol info after post-processing: `{0}`, SymbolInfo {1}".format(e,JSON.stringify(o))),i._fullNameSymbolInfoMap[o.full_name]=o,n.resolve(o)},function(t){i._logMessage("Symbol resolve failed: `{0}`, reason: `{1}`".format(e,t)),n.reject(t)}),t=!1,n.promise()},f.prototype._createMarketStatusWatchers=function(e,t){void 0===this._marketStatusWatchers[e]&&(this._marketStatusWatchers[e]={});var i=this;t.forEach(function(t){void 0===i._marketStatusWatchers[e][t]&&(i._marketStatusWatchers[e][t]=new m(i,e,t))})},
f.prototype._removeMarketStatusWatchers=function(e){var t=this;Object.keys(this._marketStatusWatchers[e]||{}).forEach(function(i){t._marketStatusWatchers[e][i].stop()}),this._marketStatusWatchers[e]={}},f.prototype._stopQuotesSubscription=function(e){this._quotesInfo[e].listenerGUID&&(this._externalDatafeed.unsubscribeQuotes(this._quotesInfo[e].listenerGUID),this._quotesInfo[e].listenerGUID=void 0),this._removeMarketStatusWatchers(e)},f.prototype._startQuotesSubscription=function(e){function t(t,i){var n=r._marketStatusWatchers[e][t.n];t.symbolname=t.n,t.status=t.s,t.values=t.v,t.values.change=t.v.ch,t.values.last_price=t.v.lp,t.values.change_percent=t.v.chp,t.values.current_session=t.v.cs||n&&n.marketStatus(),t.values.pricescale=i.pricescale,t.values.minmov=i.minmov,t.values.minmove2=i.minmove2||0,t.values.fractional=i.fractional||!1,n&&t.v.cs&&n.stop(),TradingView.ChartapiMessagerInstances[e].onQuotesData([e].concat([t]))}function i(e){e.forEach(function(e){void 0!==o[e.n]?null!==o[e.n]&&t(e,o[e.n]):r.resolveSymbol(e.n,function(i){o[e.n]=i,t(e,i)},function(){o[e.n]=null})})}var o={},r=this,s=this._quotesInfo[e].symbols;0!==s.length&&(this._externalDatafeed.getQuotes&&!n.enabled("charting_library")?this._externalDatafeed.getQuotes(s,function(t){r._quotesInfo[e]&&(i(t),r._quotesInfo[e].listenerGUID=e,r._externalDatafeed.subscribeQuotes(s,r._quotesInfo[e].fastSymbols,i,r._quotesInfo[e].listenerGUID))},function(e){}):!this._externalDatafeed.getQuotes&&n.enabled("trading_terminal")&&setTimeout(function(){i(s.map(function(e){return{n:e,s:"ok",v:{}}}))}),this._createMarketStatusWatchers(e,s))},f.prototype._restartQuotesSubscription=function(e){this._stopQuotesSubscription(e),this._startQuotesSubscription(e)},f.prototype.quoteCreateSession=function(e){this._quotesInfo[e]={symbols:[],fastSymbols:[],listenerGUID:void 0}},f.prototype.quoteDeleteSession=function(e){this._stopQuotesSubscription(e),this._quotesInfo[e]=null},f.prototype.quoteSetFields=function(e,t){},f.prototype.quoteAddSymbols=function(e,t){this._quotesInfo[e].symbols=this._filteredSymbols(this._quotesInfo[e].symbols.concat(t)),this._restartQuotesSubscription(e)},f.prototype.quoteRemoveSymbols=function(e,t){this._quotesInfo[e].symbols=this._quotesInfo[e].symbols.filter(function(e){return t.indexOf(e)<0}),this._restartQuotesSubscription(e)},f.prototype.quoteFastSymbols=function(e,t){this._quotesInfo[e].fastSymbols=this._filteredSymbols(t),this._restartQuotesSubscription(e)},f.prototype.quoteHibernateAll=function(e){},f.prototype._stopDepthSubscription=function(e){this._depthInfo[e].listenerGUID&&(this._externalDatafeed.unsubscribeDepth(this._depthInfo[e].listenerGUID),this._depthInfo[e].listenerGUID=void 0)},f.prototype._startDepthSubscription=function(e){function t(e){return e.map(function(e){return{p:e.price,v:e.volume}})}function i(e){var i={};return i.s=r,i.bids=t(e.bids),i.asks=t(e.asks),i}function n(t){
t.snapshot?TradingView.ChartapiMessagerInstances[e].onDepthData([e].concat([i(t)])):TradingView.ChartapiMessagerInstances[e].onDepthUpdate([e].concat([i(t)]))}var o=this,r=this._depthInfo[e].symbol;r&&this._fullNameSymbolInfoMap[r]&&this._externalDatafeed.subscribeDepth&&(o._depthInfo[e].listenerGUID=this._externalDatafeed.subscribeDepth(r,function(t){o._depthInfo[e]&&n(t)}))},f.prototype._restartDepthSubscription=function(e){this._stopDepthSubscription(e),this._startDepthSubscription(e)},f.prototype.depthCreateSession=function(e){this._depthInfo[e]={symbol:null,listenerGUID:void 0}},f.prototype.depthDeleteSession=function(e){this._depthInfo[e].symbol=null,this._stopDepthSubscription(e),delete this._depthInfo[e]},f.prototype.depthSetSymbol=function(e,t){this._depthInfo[e].symbol=t,this._restartDepthSubscription(e)},f.prototype._filteredSymbols=function(e){var t=[];return e.forEach(function(e){e instanceof Object||t.indexOf(e)<0&&t.push(e)}),t},f.prototype._isEndOfData=function(e,t,i){var n=e+"!"+t+"@"+i;return!!this._endOfData[n]},f.prototype._setEndOfData=function(e,t,i){var n=e+"!"+t+"@"+i;this._endOfData[n]=!0},f.prototype.alignTimePoint=function(e,t,i){return n.enabled("disable_resolution_rebuild")?e:r(t,i).alignTimeIfPossible(1e3*e)/1e3},f.prototype.serverTimeOffset=function(){return this._serverTimeOffset},f.prototype.getCurrentUTCTime=function(){return(new Date).valueOf()/1e3+this._serverTimeOffset},e.exports=f}).call(t,i(35),i(5))},function(e,t,i){"use strict";(function(t){var n=i(37),o={},r=function(e,i,r){function s(){var e={};e.symbolname=_,e.status="ok",e.values={},e.values.current_session=d,o[_]=d,TradingView.ChartapiMessagerInstances[f].onQuotesData([f].concat([e]))}function a(e,i,o){var r=t.get_timezone(i);c=(new n.Session).init(r,e),h=o,m=setInterval(l,6e4),l(),s()}function l(){var e,t;if(c){if(h)return void(d="out_of_session");e=n.isTradingNow(new Date,c),t=e?"market":"out_of_session",t!==d&&(d=t,s())}}var c,h,u={},d=o[r]||"out_of_session",p=!1,_=r,f=i,m=null;return e.resolveSymbol(r,function(e){p||a(e.session,e.timezone,e.expired)},function(){}),u.stop=function(){p=!0,m&&clearInterval(m)},u.marketStatus=function(){return d},u};e.exports=r}).call(t,i(35))},function(e,t,i){"use strict";(function(t){var n=i(673).HeikenAshi,o=i(15).Interval,r=function(){function e(e){this.host=e,this.cache={}}function r(e){var t=e.indexOf(",");return-1===t?e:e.slice(0,t)}function s(e,t,i,n,o,r,s){return o+e+t+i+(a(n)?"_":"")+r+"_"+s}function a(e){return e.has_empty_bars||e.force_session_rebuild}function l(e){if(0!==e.indexOf("="))return{symbol:e};var t;try{t=JSON.parse(e.slice(1))}catch(t){return{symbol:e}}return t.type&&(0===t.type.indexOf("BarSetHeikenAshi@tv-basicstudies-")?t.builder=new n:console.error("unknown builder type: "+t.type)),"string"!=typeof t.symbol&&(t.session=t.symbol.session||t.session,t.symbol=t.symbol.symbol),t}function c(t){e.instance=new e(t),p.setupFeed(e.instance)}var h,u,d,p=i(25),_=i(37),f=p.Symbol,m=p.StudyEngine,y=p.BarBuilder,g=p.BarSet;return e.prototype.getCache=function(e){
return this.cache[e]},e.prototype.putCache=function(e,t){this.cache[e]=t},e.prototype.subscribe=function(e,t,i,n,o,r,a,l,c,h){var u=s(e,t,i,a,l,n,h),d=this.getCache(u);return d||(d=this.createItem(e,t,i,a,c,l,n,h),this.putCache(u,d)),d.listeners.addListener(o,r),{key:u,listener:o}},e.prototype.unsubscribe=function(e){var t=this.getCache(e.key);t&&t.listeners.removeListener(e.listener)},e.prototype.removeUnused=function(){var e,t,i,n,o,r=[];for(e in this.cache)this.cache[e]&&(t=this.cache[e],0===t.listeners.listenersCount()&&r.push(e));if(0!==r.length){for(i=0;i<r.length;i++)n=r[i],o=this.cache[n],this.cache[n]=null,o.stop();this.removeUnused()}},e.prototype.rebuildFrom=function(e,t,i){var n,o,r,s,a=f.parsePeriod(e),l=f.parsePeriod(t);if(""!==a.resolution&&!a.isSeconds){if(i.has_weekly_and_monthly)return a.resolution;if(void 0===i.has_daily||i.has_daily)return"D";""!==l.resolution&&(l.resolution="",l.interval=i.intraday_multipliers?i.intraday_multipliers[0]:1)}if(a.isIntraday&&void 0!==i.has_intraday&&!i.has_intraday)return"";if(a.isSeconds&&!i.has_seconds)return"";if(n=""!==a.resolution?l.interval:""===l.resolution?Math.min(a.interval,l.interval):a.interval,(o=a.isIntraday?i.intraday_multipliers:i.seconds_multipliers)&&-1===o.indexOf(n)){for(r=o.length-1;r>=0;r--)if(s=+o[r],n%s==0)return s+(a.isSeconds?"S":"");return""}return n+(a.isSeconds?"S":"")},e.prototype.createItem=function(e,t,i,n,s,c,p,_){var f,m,g,v,S,b,w,P=new d,T=l(e);return T.builder?new u(P,T.symbol,t,i,T.builder,n,s,c):(f=r(t),m=this.rebuildFrom(f,r(i),n),g=a(n),!o.isEqual(f,m)||g?(v=n.has_empty_bars,S=$.extend({},n),g&&(S.has_empty_bars=!1,S.force_session_rebuild=!1),void 0!==_&&(b=o.parse(f).inMilliseconds()/o.parse(m).inMilliseconds(),_*=Math.ceil(b)),new u(P,T.symbol,t,m,new y(t,v),S,s,c,p,_)):(w=T.session&&"extended"!==T.session,new h(P,T.symbol,t,i,w,this.host,n,s,p,_)))},h=function(e,t,i,n,o,s,a,l,c,h){this.listeners=e,this.host=s;var u=this;this.host.resolve(t,function(e){o&&e.regular_session&&(e.session=e.regular_session);var s=u.calculateFromTo(e,c||n||i,t,l,h);u.subs=u.host.subscribe(e,r(i),s,function(e){u.listeners.fire(e)},function(e){u.listeners.onError(e)})},function(e){u.listeners.onError(e)})},h.prototype._createDWMAligner=function(e,i){var n=t.get_timezone(i.timezone),o=new _.Session;return o.init(n,i.session),f.newBarBuilder(e,o,o)},h.prototype.stop=function(){this.subs&&this.host.unsubscribe(this.subs)},h.prototype.calculateFromTo=function(e,i,n,o,r){var s,a,l,c,h,u,d,p,m=f.parsePeriod(i),y=(new Date).valueOf(),g=e.expired?t.cal_to_utc(t.get_timezone(e.timezone),new Date(1e3*e.expiration_date))||y:y;return""===m.resolution?(a=m.interval,l="D"):"S"===m.resolution?(a=10*m.interval,l=""):(c="D"===m.resolution?1:"W"===m.resolution?5:30,a=12*c*m.interval,l="M"),m.range?(a=m.range.interval,l=m.range.resolution):this.host.calculateHistoryDepth&&(h=this.host.calculateHistoryDepth(i,l,a))&&(a=h.intervalBack||a,l=void 0===h.resolutionBack?l:h.resolutionBack),u=e.sessionString||e.session,s=_.alignPeriodsBack(u,l,a,1,g),
o&&o.getRangeExtensionTime&&(d=o.getRangeExtensionTime())&&(s=Math.min(1e3*d,s)),p=Math.ceil(1.5*r),o&&o.getRangeExtensionCount&&(p+=o.getRangeExtensionCount()),p>0&&(s=_.alignPeriodsBack(u,m.resolution,m.interval,p,s)),{from:s,to:g+6e4}},u=function(e,t,i,n,o,r,s,a,l,c){if(this.listeners=e,this.isRecalculated=!1,""===n)return console.error("unsupported resolution for rebuild: "+i),void this.listeners.onError("unsupported resolution for rebuild: "+i);this.symbolInfo=r;var h=this;this.engine=new m({tickerid:t,period:n,periodBase:i,body:o,sessionId:a,symbolInfo:r,rangeExtension:s,periodForInitialRange:l,additionalBarsCount:c,recalc:function(e,t){h._recalc(t)},out:function(e,t){h._out(e,t)},nonseriesOut:function(e,t){h._nonseriesOut(e,t)},setNoMoreData:function(){h.barset&&(h.barset.endOfData=!0)},onErrorCallback:function(e){h.listeners.onError(e)}})},u.prototype.stop=function(){this.engine?this.engine.stop():console.error("Internal library error 0x1")},u.prototype._recalc=function(e){this.isRecalculated&&console.error("recalc called twice!"),this.barset||(this.barset=new g(this.symbolInfo)),e&&(this.barset.nextTime=e.nextTime,this.barset.endOfData=e.endOfData),this.listeners.fire(this.barset),this.isRecalculated=!0},u.prototype._nonseriesOut=function(e,t){var i=Object.assign({},t);i.nonseries=!0,i.data=t.bars,delete i.bars,i.barsetSize=this.barset?this.barset.count():0,i.lastBar=this.barset?this.barset.bar(this.barset.count()-1):null,this.listeners.fire(i,!0)},u.prototype._out=function(e,t){var i,n,o,r,s,a,l,c=t[0];if(!isNaN(c)){if(i={time:c,open:t[1],high:t[2],low:t[3],close:t[4],volume:t[5],updatetime:t[6]},n=t[7],this.barset||(this.barset=new g(e.info)),(o=t[8])instanceof Array)for(r=0;r<o.length;r++)s=t[9],a=o[r],l={time:a,open:s,high:s,low:s,close:s,volume:0,updatetime:a},this.barset.add(l,!0),this.isRecalculated&&this.listeners.fire(this.barset);this.barset.add(i,n),this.barset.isBarClosed=n,this.isRecalculated&&this.listeners.fire(this.barset)}},d=function(){this.listeners=[]},d.prototype.listenersCount=function(){return this.listeners.reduce(function(e,t){return e+(t?1:0)},0)},d.prototype.addListener=function(e,t){this.listeners.push({dataListener:e,onErrorCallback:t}),this.barset&&e(this.barset),this.errorMsg&&t(this.errorMsg)},d.prototype.removeListener=function(e){var t,i=this.listeners.filter(function(t){return t.dataListener===e});0!==i.length&&(t=this.listeners.indexOf(i[0]),delete this.listeners[t])},d.prototype.onError=function(e){var t,i,n,o;for(this.errorMsg=e||"unspecified error",t=this.listeners,i=t.length,n=0;n<i;n++)(o=t[n])&&o.onErrorCallback&&o.onErrorCallback(e)},d.prototype.fire=function(e,t){var i,n,o,r;for(t||(this.barset=e),i=this.listeners,n=i.length,o=0;o<n;o++)(r=i[o])&&r.dataListener(e)},{setupFeed:c,parseSymbol:l,unsubscribeUnused:function(){e.instance.removeUnused()}}}();e.exports=r}).call(t,i(35))},function(e,t,i){"use strict";var n,o;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"HeikenAshi",function(){return o}),n=i(25),i.n(n),o=function(){function e(){}
return e.prototype.main=function(e){var t,i,o,r,s=e.new_var(n.Std.open(e)),a=e.new_var(n.Std.close(e)),l=s.get(1),c=a.get(1),h=n.Std.ohlc4(e),u=n.Std.na(s.get(1))?(n.Std.open(e)+n.Std.close(e))/2:(l+c)/2;return s.set(u),a.set(h),t=n.Std.max(n.Std.high(e),n.Std.max(u,h)),i=n.Std.min(n.Std.low(e),n.Std.min(u,h)),o=n.Std.volume(e),r=e.symbol,[r.time,u,t,i,h,o,r.updatetime,r.isBarClosed]},e}()},function(e,t,i){"use strict";var n=function(){function e(e,t,i){return e+","+t+","+i}function t(t,i,n){delete o[e(t,i,n)]}function n(t,i,n){function s(e){return"undefined"!=typeof TradingView&&TradingView.ChartapiMessagerInstances?o[e]=new a(TradingView.ChartapiMessagerInstances[t],l.pureResolution):o[e]=new a(null,l.pureResolution),o[e]}var l=r.Symbol.parsePeriod(n),c=e(t,i,l.pureResolution);return o[c]?o[c]:s(c)}var o={},r=i(25),s=i(37),a=function(e,t,i){this._chartApiMessager=e,this._lastRealBarTime=null,this._lastRealBarIndex=null,this._resolution=t,this._extrapolatedBarsCache=[],this._onReadyCallbacks=[],this._requestedAmountOfBars=0,this._maxDepth=i||100};return a.prototype.ready=function(){return null!==this._lastRealBarIndex},a.prototype.rebuild=function(e,t){this._lastRealBarTime=e;var i=Math.max(this._extrapolatedBarsCache.length,this._requestedAmountOfBars);this._extrapolatedBarsCache=[],this.ensureExtrapolatedToBar(t,i)},a.prototype.historyExtrapolator=function(){return void 0===this._historyExtrapolator&&(this._historyExtrapolator=new a(null,this._resolution,Math.max(this._maxDepth,1500))),this._historyExtrapolator},a.prototype.getPointTimeUTC=function(e,t,i){var n,o;return 0===t?e:!this.ready()||e<this._lastRealBarTime/1e3?(this.historyExtrapolator().setLastBarTime(0,1e3*e),this.historyExtrapolator().getPointTimeUTC(e,t,i)):(n=0===this._extrapolatedBarsCache.length||e===this._lastRealBarTime/1e3,o=n?-1:this.indexOfBar(e,i)-this._lastRealBarIndex-1,this.ensureExtrapolatedToBar(i,o+t+1),this._extrapolatedBarsCache[o+t])},a.prototype.findDistanceInBars=function(e,t,i){return e===t?0:(this.historyExtrapolator().setLastBarTime(0,1e3*e),this.historyExtrapolator().indexOfBar(t,i))},a.prototype.indexOfBar=function(e,t){this._ensureExtrapolatedToTime(t,1e3*e);var i=s.lower_bound(this._extrapolatedBarsCache,e,function(e,t){return e>t?1:e<t?-1:0});return-1===i?i:this._lastRealBarIndex+i+1},a.prototype._extrapolateData=function(e,t){var i,n,o;if(!this._lastRealBarTime)throw Error("No real bars known, so cannot extrapolate anything");if(!(i=t(this._lastRealBarTime))||0===i.length)return void(null!==this._lastRealBarIndex&&null!==this._chartApiMessager&&this._chartApiMessager.onTickmarksUpdated(this._lastRealBarIndex+1,this._extrapolatedBarsCache,e,this._resolution));for(n=0;n<i.length;++n)i[n]=i[n]/1e3;for(i[0]===this._lastRealBarTime/1e3&&(i=i.slice(1)),this._extrapolatedBarsCache=i,o=i.slice(0),o.sort(),n=0;n<o.length-1;++n)o[n]===o[n+1]&&console.error("Duplicating extrapolated bars: duplicated "+new Date(1e3*o[n]))
;null!==this._lastRealBarIndex&&null!==this._chartApiMessager&&this._chartApiMessager.onTickmarksUpdated(this._lastRealBarIndex+1,i,e,this._resolution)},a.prototype.onTickmarksNeeded=function(e,t){if(this.ready())this.ensureExtrapolatedToBar(e,t);else{var i=this;this._onReadyCallbacks.push(function(){i.ensureExtrapolatedToBar(e,t)})}},a.prototype.ensureExtrapolatedToBar=function(e,t){var i=this;return this._requestedAmountOfBars=t,this._extrapolateData(e,function(n){return i._extrapolatedBarsCache.length>=t||!i._shouldExtrapolateMore()?null:s.extrapolateBarsFrontByCount(i.newBarBuilder(e),n,t)})},a.prototype._ensureExtrapolatedToTime=function(e,t){var i=this;return this._extrapolateData(e,function(n){var o,r;return n>=t||!i._shouldExtrapolateMore()?null:(o=2e3,r=s.extrapolateBarsFrontToTime(i.newBarBuilder(e),n,t,o),r[r.length-1]<t&&console.warn("Extrapolation error: not enough data created"),r)})},a.prototype.newBarBuilder=function(e){var t=r.Symbol.newSession(e.timezone,e.session);return r.Symbol.newBarBuilder(this._resolution,t)},a.prototype._shouldExtrapolateMore=function(){return this._extrapolatedBarsCache.length<this._maxDepth},a.prototype.setLastBarTime=function(e,t){(null===this._lastRealBarIndex||this._lastRealBarIndex===e&&this._lastRealBarTime!==t)&&(this._extrapolatedBarsCache=[]),this._extrapolatedBarsCache&&this._extrapolatedBarsCache.length&&this._lastRealBarIndex!==e&&(this._lastRealBarIndex>e?this._extrapolatedBarsCache=[]:this._lastRealBarTime!==t&&this._extrapolatedBarsCache.shift(e-this._lastRealBarIndex)),this._lastRealBarIndex=e,this._lastRealBarTime=t;for(var i=0;i<this._onReadyCallbacks.length;++i)this._onReadyCallbacks[i]();this._onReadyCallbacks=[]},{remove:t,storage:n}}();e.exports=n},function(e,t,i){"use strict";(function(t){var n=i(37),o=i(15).Interval,r=function(){function e(e,t){return e}function r(e,t){var i=m.get_timezone(e.timezone),o=new n.Session;return o.init(i,e.session),f.Symbol.newBarBuilder(t,o,o)}function s(t,i,n,o,r,s){var a,l,c,h,u=e(i,n);for(p.hasOwnProperty(u)||(p[u]=[]),a=[],l=0;l<o.length;++l)o[l][1]<0&&(o[l][1]=0),0!==o[l][1]?(c=r.getPointTimeUTC(o[l][0],o[l][1],s),a.push(c)):o[l][0]&&a.push(o[l][0]);h={guid:t,points:a},p[u].push(h)}function a(e){var t,i,n;for(t in p)for(i=p[t],n=0;n<i.length;++n)if(i[n].guid===e)return void i.splice(n,1)}function l(e,t,i,n,o){var r,s,a,l=[];for(r=0;r<e.points.length;++r){if(null==(s=e.points[r]))return null;if(null===(a=h(t,s,i,n,o)))return null;l.push({index:r,value:[a,s]})}return l}function c(t,i,n,o,r,s){var a,c,h,u,d=e(t,i);if(p.hasOwnProperty(d))for(a=p[d].length,c=0;c<a;++c)h=p[d][c],null!==(u=l(h,n,o,r,i))&&s(h.guid,u)}function h(e,t,i,o,s){var a,l;return 1e3*(t=r(o,s).alignTimeIfPossible(1e3*t)/1e3)<e[0].value[0]?-d(o,s,t,e[0].value[0]/1e3,i):(a=n.lower_bound(e,1e3*t,function(e,t){return e.value[0]>t?1:e.value[0]<t?-1:0}))>=0&&t<e[e.length-1].value[0]?(e[a].value[0]/1e3!==t&&0!==a&&a--,e[a].index):(l=i.indexOfBar(t,o),-1===l?null:l)}function u(e,t,i,n,o){function r(e,t){
var i=new Date(1e3*e),n=new Date(1e3*t),o=12*(n.getFullYear()-i.getFullYear());return o-=i.getMonth()+1,o+=n.getMonth(),o<=0?0:o}var s,a,l,c,h,u,d,p,_,f,y,g,v,S,b;if(t.isMonths())s=r(n,o)/t.multiplier();else if(t.isWeeks())a=Math.ceil((o-n)/604800),s=Math.ceil(a/t.multiplier());else{if(l=m.utc_to_cal(i.timezone,+new Date(1e3*n)),c=m.utc_to_cal(i.timezone,+new Date(1e3*o)),(h=(o-n)/86400)>4*(7-i.spec.weekEndsCount()))d=h/7,u=d*(7-i.spec.weekEndsCount());else{for(p=0,_={},f=l;f.valueOf()<=c.valueOf();f=m.add_days_considering_dst(i.timezone,f,1))y=m.get_day_of_week(f),void 0===_[y]&&(_[y]=i.spec.isWeekEnd(y)),_[y]&&p++;u=h-p}if(t.isDays())s=Math.ceil(u/t.multiplier());else{if(g=t.isHours()?60*t.multiplier()*60:t.isSeconds()?t.multiplier():60*t.multiplier(),h<1&&(v=i.spec.findSessionEntry(m.get_day_of_week(l),m.get_minutes_from_midnight(l)),S=i.spec.findSessionEntry(m.get_day_of_week(c),m.get_minutes_from_midnight(c)),v===S))return Math.ceil((o-n)/g);y=i.spec.entries()[0].dayOfWeek(),b=60*i.spec.entries().reduce(function(e,t){return e+(t.dayOfWeek()===y?t.length():0)},0),s=Math.ceil(u*b/g)}}return s}function d(e,t,i,s,a){var l,c,h=new o(t),d=m.get_timezone(e.timezone),p=new n.Session;return p.init(d,e.session),l=r(e,t),i=l.alignTimeIfPossible(1e3*i)/1e3,s=l.alignTimeIfPossible(1e3*s)/1e3,i>=s?0:(c=u(e,h,p,i,s),c>=1e3?c:a.findDistanceInBars(i,s,e))}var p={},_="undefined"!=typeof window?window:t,f=i(25),m=_.PineJsCalendar?_.PineJsCalendar:i(35);return{createPointset:s,removePointset:a,broadcastPointsetsUpdates:c,tests:{approxBarsInterval:u,indexOfTime:h}}}();e.exports=r}).call(t,i(99))},function(e,t,i){"use strict";function n(e,t,i){return Object(a.isArray)(e)?o(e,t,i):Object(a.isObject)(e)&&(Object(a.isHashObject)(e)||i&&i.visitInstances)?r(e,t,i):e}function o(e,t,i){return e.map(function(e){var o=n(e,t,i),r=t(o);return void 0!==r?r:o})}function r(e,t,i){var o={};return Object.keys(e).forEach(function(r){var s=n(e[r],t,i),a=t(s);o[r]=void 0!==a?a:s}),o}function s(e,t,i){var o=n(e,t,i),r=t(o);return void 0!==r?r:o}var a;Object.defineProperty(t,"__esModule",{value:!0}),t.visitObject=s,a=i(12),i.n(a)},function(e,t,i){"use strict";function n(e,t){return e.ticker+"_"+t}function o(e){return new Date(e).toISOString()}var r,s,a,l,c,h;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"DatafeedRequestsCachedProcessor",function(){return h}),r=i(15),s=i(78),a=i(25),i.n(a),l=i(5),i.n(l),i(86),c=function(){function e(e,t,i,n){this._cache={bars:[]},this._nextSubscriptionId=0,this._pendingSubscribers=[],this._subscribers=[],this._requesting=!1,this._leftDate=null,this._gaps=[],this._needPurgeCache=!1,this._realtimeOn=!1,this._endOfData=!1,this._resetCacheTimeout=null,this._errorMessage=null,this._datafeed=e,this._symbolInfo=t,this._resolution=i,this._dwmAligner=n}return e.prototype.destroy=function(){0!==this._subscribers.length&&console.warn("Destroying with not-empty state"),this._clearResetCacheTimeout(),this._unsubscribeRealtime(),this._purgeCache(),delete this._datafeed},e.prototype.addSubscription=function(e,t,i){
var n=this,o=this._getNextSubscriptionId(),r=Math.floor(e.from/1e3),s=Math.floor(e.to/1e3);return this._pendingSubscribers.push({key:o,range:{from:r,to:s},onHistoryCallback:t,onErrorCallback:i}),this._clearResetCacheTimeout(),setTimeout(function(){return n._processPendingSubscribers()},0),o},e.prototype.removeSubscription=function(e){var t,i=this,n=this._pendingSubscribers.find(function(t){return t.key===e});return n?void this._pendingSubscribers.splice(this._pendingSubscribers.indexOf(n),1):(t=this._subscribers.find(function(t){return t.key===e}))?(this._subscribers.splice(this._subscribers.indexOf(t),1),void(this._subscribers.length||(this._symbolInfo.expired||this._symbolInfo.expiration_date?this._unsubscribeRealtime():this._resetCacheTimeout=setTimeout(function(){i._purgeCacheDelayed(),i._unsubscribeRealtime()})))):void console.warn("Unknown subscription symbol={0}, resolution={1}, key={2}".format(this._symbolInfo.name,this._resolution,e))},e.prototype._purgeCacheDelayed=function(){this._logMessage("Reset cache"),this._needPurgeCache=!0,this._clearResetCacheTimeout()},e.prototype._logMessage=function(e,t){(l.enabled("charting_library_debug_mode")||t)&&console.log("FEED [{0}|{1}]: {2}".format(this._symbolInfo.name,this._resolution,e))},e.prototype._clearResetCacheTimeout=function(){null!==this._resetCacheTimeout&&(clearTimeout(this._resetCacheTimeout),this._resetCacheTimeout=null)},e.prototype._purgeCache=function(){this._cache={bars:[]},this._gaps=[],this._errorMessage=null,this._needPurgeCache=!1,this._leftDate=null,this._endOfData=!1},e.prototype._processPendingSubscribers=function(){var e,t,i,n,s,a,l=this,c=this._pendingSubscribers;if(c.length){if(this._requesting)return void this._logMessage("Processing is skipped due active request");if(this._logMessage("Processing pending subscribers, count="+c.length),this._needPurgeCache&&this._purgeCache(),this._errorMessage)return e=this._errorMessage,this._logMessage("Return error: "+e),this._pendingSubscribers=[],void c.forEach(function(t){t.onErrorCallback(e)});if(t=c.reduce(function(e,t){return Math.min(t.range.from,e)},1/0),this._logMessage('Leftmost requested "from" is '+o(1e3*t)),(!this._leftDate||t<this._leftDate)&&(i=new r.Interval(this._resolution),n=(i.inMilliseconds(Date.now())||0)/1e3,s=!this._leftDate,a=!s&&!!this._cache.bars.length&&this._cache.bars[0].time/1e3-t<n,(s||!a)&&!this._endOfData))return void this._ensureRequestedTo(t);this._pendingSubscribers=[],c.forEach(function(e){var t=l._moveSubscriberToRealtime(e);l._returnHistoryDataToSubscriber(e,t)}),this._subscribeRealtimeIfNeeded()}},e.prototype._moveSubscriberToRealtime=function(e){var t={key:e.key,onHistoryCallback:e.onHistoryCallback,barset:null};return this._subscribers.push(t),t},e.prototype._subscribeRealtimeIfNeeded=function(){!this._subscribers.length||this._realtimeOn||this._symbolInfo.expired||this._symbolInfo.expiration_date||this._subscribeRealtime()},e.prototype._subscribeRealtime=function(){var e,t,i=this;this._symbolInfo.expired||this._realtimeOn||(e=function(e){
i._dwmAligner&&(e.time=i._dwmAligner.tradingDayToSessionStart(e.time)),i._putToCacheNewBar(e),i._subscribers.forEach(function(t){var i=t.barset;if(null===i)throw Error("subscirber.barset is null");i.add(e),t.onHistoryCallback(i)})},t=function(){i._unsubscribeRealtime();var e=i._leftDate;i._purgeCache(),e&&i._ensureRequestedTo(e)},this._realtimeOn=!0,this._datafeed.subscribeBars(this._symbolInfo,this._resolution,e,n(this._symbolInfo,this._resolution),t),this._logMessage("Subscribed to realtime"))},e.prototype._unsubscribeRealtime=function(){!this._symbolInfo.expired&&this._realtimeOn&&(this._datafeed.unsubscribeBars(n(this._symbolInfo,this._resolution)),this._logMessage("Unsubscribed from realtime"),this._realtimeOn=!1)},e.prototype._returnHistoryDataToSubscriber=function(e,t){var i,n,r=e.range,s=l.enabled("cl_feed_return_all_data")?this._createBarset(this._leftDate||r.from):this._createBarset(r.from);s.count()>0?this._logMessage("Bars to return for request {0}: total {1} bars in [{2} ... {3}] ".format(e.key,s.count(),o(s.bars[0].time),o(s.bars[s.count()-1].time))):this._logMessage("Request {0}. Nothing to return.".format(e.key)),t.barset=s,i=this._inGapNextTime(r.from),i?(this._logMessage("Request {0} is in gap, nextTime = {1}".format(e.key,o(1e3*i))),s.nextTime=i):0===s.count()&&(n=this._cache.bars.length&&this._cache.bars[this._cache.bars.length-1].time/1e3)&&r.from>n&&(this._logMessage("Request {0} is in gap, nextTime = {1}".format(e.key,o(1e3*n))),s.nextTime=n||void 0),this._endOfData&&null!==this._leftDate&&e.range.from<=this._leftDate&&(s.endOfData=!0),e.onHistoryCallback(s)},e.prototype._createBarset=function(e){var t=Object(s.lowerbound)(this._cache.bars,1e3*e,function(e,t){return e.time<t});return new a.BarSet(this._symbolInfo,this._cache.bars.slice(t))},e.prototype._ensureRequestedTo=function(t){var i,n,r,s=this;if(this._leftDate&&this._leftDate<t)return void this._processPendingSubscribers();i=!this._leftDate,this._requesting=!0,n=t,r=this._leftDate?this._leftDate-1:this._symbolInfo.expiration_date||Math.floor(e._now()/1e3),this._leftDate=t,this._logMessage("Requesting data: [{0} ... {1}] ".format(o(1e3*n),o(1e3*r))),this._datafeed.getBars(this._symbolInfo,this._resolution,n,r,function(e,t){s._requesting=!1,s._processBars(e,t)},function(e){s._requesting=!1,s._errorMessage=e||null,s._processPendingSubscribers()},i)},e.prototype._processBars=function(e,t){this._checkBars(e),this._alignBarsTime(e),e.length>0?this._processFullBarset(e,t):this._processEmptyBarset(t),this._processPendingSubscribers()},e.prototype._processEmptyBarset=function(t){this._logMessage("Receiving bars: barset is empty"),t&&t.nextTime?(this._logMessage("Next time received: `{0}`".format(o(1e3*t.nextTime))),this._addGap(t.nextTime),this._leftDate=Math.min(this._leftDate||e._now()/1e3,t.nextTime+1)):t&&t.noData?(this._logMessage("EOD received"),this._endOfData=!0,this._cache.bars.length&&(this._leftDate=this._cache.bars[0].time/1e3)):this._logMessage("nextTime or noData should present in metainfo when empty barset is returned")},
e.prototype._processFullBarset=function(e,t){var i=e[0].time,n=e[e.length-1].time;this._logMessage("Receiving bars: total {0} bars in [{1} ... {2}] ".format(e.length,o(i),o(n))),null!==this._leftDate&&i<1e3*this._leftDate&&!l.enabled("cl_feed_return_all_data")&&this._logMessage("Returned more data than needed"),this._putToCache(e)?null!==this._leftDate&&this._cache.bars.length&&this._leftDate>this._cache.bars[0].time/1e3&&(this._leftDate=this._cache.bars[0].time/1e3):this._logMessage("Incremental update failed. Starting full update. Returned data should be in the requested range.",!0),t&&t.nextTime?console.warn("nextTime should be set when there is no data in the requested period only"):t&&t.noData&&console.warn("noData should be set when there is no data in the requested period and earlier only")},e.prototype._addGap=function(t){var i;this._gaps.find(function(e){return e.from===t})||(i=(this._cache.bars.length?this._cache.bars[0].time:e._now())/1e3,this._gaps.push({from:t,to:i}))},e.prototype._inGapNextTime=function(e){var t=this._gaps.find(function(t){return t.from<e&&t.to>e});return t?t.from:null},e.prototype._getNextSubscriptionId=function(){return this._nextSubscriptionId++},e.prototype._checkBars=function(e,t){var i,n;if(void 0===t&&(t=!1),l.enabled("charting_library_debug_mode"))for(i=1;i<e.length;i++)e[i].time<=e[i-1].time&&(n="Wrong bars time: time {0} of bar {1} should be more than time {2} of bar {3}".format(e[i].time,i,e[i-1].time,i-1),t&&this._dwmAligner&&(n+="\nCheck that you provide DWM bars without time part, i.e. 00:00 GMT"),console.error(n))},e.prototype._putToCache=function(e){if(0===e.length)return!0;if(this._cache.bars.length===e.length&&this._cache.bars[0].time===e[0].time&&this._cache.bars[this._cache.bars.length-1].time===e[e.length-1].time)return this._logMessage("Time range of received data is the same as cached one. Skip the update."),!0;if(0!==this._cache.bars.length&&e[e.length-1].time===this._cache.bars[0].time&&this._cache.bars.splice(0,1),0!==this._cache.bars.length&&e[e.length-1].time>=this._cache.bars[0].time){var t=this._cache.bars[this._cache.bars.length-1].time===e[e.length-1].time;if(this._cache.bars=[],!t)return this._leftDate=null,!1;this._logMessage("Received history up to now instead of incremental update. Return exactly what is requested.")}return this._cache.bars=e.concat(this._cache.bars),this._checkBars(this._cache.bars,!0),!0},e.prototype._putToCacheNewBar=function(e){var t=this._cache.bars.length,i=e.time,n=0===t?NaN:this._cache.bars[t-1].time;0===t||n<i?this._cache.bars.push(e):n===i?this._cache.bars[t-1]=e:console.error("putToCacheNewBar: time violation, previous bar time: "+o(n)+" should be less or equal to new time: "+o(i))},e.prototype._alignBarsTime=function(e){if(this._dwmAligner)for(var t=0;t<e.length;t++)e[t].time=this._dwmAligner.tradingDayToSessionStart(e[t].time)},e._now=function(){return Date.now()+6e4},e}(),h=function(){function e(e,t){this._threads={},this._datafeed=e,this._dwmAlignerCreator=t}return e.prototype.destroy=function(){
this._forEachThread(function(e,t){return t.destroy()}),this._threads={},delete this._datafeed},e.prototype.purgeCache=function(){this._forEachThread(function(e,t){return t.destroy()}),this._threads={}},e.prototype.subscribe=function(e,t,i,o,r){var s,a=n(e,t);return this._threads[a]||(this._threads[a]=this._createThread(e,t)),s=this._threads[a].addSubscription(i,o,r),a+'"'+s},e.prototype.unsubscribe=function(e){var t,i,n=e.split('"');if(2!==n.length)return void console.warn("Wrong guid format");t=n[0],i=parseInt(n[1]),this._threads.hasOwnProperty(t)?this._threads[t].removeSubscription(i):console.warn("Data thread doesnt exist: "+e)},e.prototype._createThread=function(e,t){return new c(this._datafeed,e,t,this._dwmAlignerCreator(t,e.timezone,e.session))},e.prototype._forEachThread=function(e){var t=this;Object.keys(this._threads).forEach(function(i){return e(i,t._threads[i])})},e}()},function(e,t,i){"use strict";(function(t,n){function o(e,i,n,o){this._chartWidgetCollection=e,this._chartApiInstance=i,this._saveChartService=n,this._loadChartService=o,this._proxyWatchListChangedDelegate=null,this._lockDrawingsWatchedValue=null,this._hideDrawingsWatchedValue=null,this._activeChangedChangedDelegate=new t,this._chartWidgetCollection.activeChartWidget.subscribe(function(){this._activeChangedChangedDelegate.fire()}.bind(this)),this._chartWidgets=new WeakMap}var r=i(62).linking,s=i(679),a=i(109).layouts,l=i(31),c=i(89),h=i(32),u=i(61),d=i(67),p=i(4),_=i(209).createNoticeDialog,f=i(83).createConfirmDialog,m=i(298),y=i(685).ThemesApi;o.prototype.subscribe=function(e,t){l.subscribe(e,t)},o.prototype.unsubscribe=function(e,t){l.unsubscribe(e,t)},o.prototype.onContextMenu=function(e){l.subscribe("onContextMenu",function(t){t.callback(e(t.unixtime,t.price))})},o.prototype.onGrayedObjectClicked=function(e){l.subscribe("onGrayedObjectClicked",e)},o.prototype.activeChart=function(){return this._getChartWidgetApi(this._chartWidgetCollection.activeChartWidget.value())},o.prototype._getChartWidgetApi=function(e){var t=this._chartWidgets.get(e);return void 0===t&&(t=new s(e),this._chartWidgets.set(e,t)),t},o.prototype.onActiveChartChanged=function(){return this._activeChangedChangedDelegate},o.prototype.changeSymbol=function(e,t,i){r.interval.setValue(t),r.symbol.setValue(e),i&&this.activeChart().onDataLoaded().subscribe(null,i,!0)},o.prototype.setLayout=function(e){this._chartWidgetCollection.layout.setValue(e)},o.prototype.layout=function(){return this._chartWidgetCollection.layout.value()},o.prototype.layoutName=function(){return this._chartWidgetCollection.metaInfo.name.value()},o.prototype.chartsCount=function(){return a[this.layout()].count},o.prototype.chart=function(e){if(void 0===e&&(e=0),e<0||e>=this.chartsCount())throw Error("Incorrect index: "+e);return this._getChartWidgetApi(this._chartWidgetCollection.getAll()[e])},o.prototype.getSymbolInterval=function(e){var t={symbol:r.symbol.value(),interval:r.interval.value()};return e&&e(t),t},o.prototype.saveChart=function(e){var t=this
;this._saveChartService.whenReadyToSave(function(){var i=t._saveChartService.saveToJSON();return e&&e(JSON.parse(i.content))})},o.prototype.loadChart=function(e){this._chartApiInstance.purgeCache(),this._chartApiInstance._studyEngine.stopSources(),this._chartWidgetCollection.loadContent(e.json),this._chartWidgetCollection.purgeUnusedWidgets(),e.extendedData&&(this._chartWidgetCollection.metaInfo.id.setValue(e.extendedData.uid),this._chartWidgetCollection.metaInfo.uid.setValue(e.extendedData.uid),this._chartWidgetCollection.metaInfo.name.setValue(e.extendedData.name)),r.symbol.setValue(this.activeChart().symbol()),l.emit("chart_loaded")},o.prototype.getStudiesList=function(){return this._chartApiInstance.allStudiesMetadata().filter(function(e){return!e.is_hidden_study}).map(function(e){return e.name||e.description})},o.prototype.getSavedCharts=function(e){d.getCharts(e)},o.prototype.loadChartFromServer=function(e){d.loadChart(e)},o.prototype.saveChartToServer=function(e,t,i,n){this._saveChartService.saveChartSilently(e,i,t,n)},o.prototype.removeChartFromServer=function(e,t){d.removeChart(e,t)},o.prototype.getIntervals=function(){var e=[],t=u.getCustomResolutions();return null!==this._chartApiInstance&&(e=this._chartApiInstance.defaultResolutions()),u.mergeResolutions(e,t)},o.prototype.closePopupsAndDialogs=function(){var e,t,n=document.querySelectorAll("._tv-dialog-title-close");for(e=0;e<n.length;e++)n[e].click();t=i.c[690],t&&t.exports.closeAllDialogs(),c.hideAll()},o.prototype.selectLineTool=function(e){m.supportedLineTools[e]&&(e=m.supportedLineTools[e].name,h.tool.value()!==e&&h.tool.setValue(e))},o.prototype.selectedLineTool=function(){var e,t=Object.keys(m.supportedLineTools),i=h.tool.value();for(e=0;e<t.length;++e)if(m.supportedLineTools[t[e]].name===i)return t[e];return""},o.prototype.lockAllDrawingTools=function(){return null===this._lockDrawingsWatchedValue&&(this._lockDrawingsWatchedValue=new n(h.lockDrawings().value()),this._lockDrawingsWatchedValue.subscribe(function(e){h.lockDrawings().setValue(e)}),h.lockDrawings().subscribe(this,function(){this._lockDrawingsWatchedValue.setValue(h.lockDrawings().value())})),this._lockDrawingsWatchedValue},o.prototype.hideAllDrawingTools=function(){return null===this._hideDrawingsWatchedValue&&(this._hideDrawingsWatchedValue=new n(h.hideAllDrawings().value()),this._hideDrawingsWatchedValue.subscribe(function(e){h.hideAllDrawings().setValue(e)}),h.hideAllDrawings().subscribe(this,function(){this._hideDrawingsWatchedValue.setValue(h.hideAllDrawings().value())})),this._hideDrawingsWatchedValue},o.prototype.mainSeriesPriceFormatter=function(){return this._chartWidgetCollection.activeChartWidget.value().model().mainSeries().priceScale().formatter()},o.prototype.showNoticeDialog=function(e){function t(){i&&(i(),i=null)}e=e||{};var i=e.callback;_({title:e.title,content:e.body||""}).then(function(e){e.on("action:ok",t),e.on("afterClose",t),e.open()})},o.prototype.showConfirmDialog=function(e){function t(e){i&&(i(e),i=null)}if(e=e||{},
!e.callback)throw Error("callback must be exist");var i=e.callback;f({title:e.title,content:e.body||""}).then(function(e){e.on("action:yes",t.bind(null,!0)),e.on("action:no",t.bind(null,!1)),e.on("afterClose",t.bind(null,!1)),e.open()})},o.prototype.logs=function(){return{getLogHistory:p.getLogHistory,enable:p.loggingOn,disable:p.loggingOff}},o.prototype.showLoadChartDialog=function(){var e=this._loadChartService;e&&e.showLoadDialog()},o.prototype.showSaveAsChartDialog=function(){var e=this._saveChartService;e&&window.runOrSignIn(function(){e.saveChartAs()})},o.prototype.themes=function(){return new y({chartWidgetCollection:this._chartWidgetCollection})},o.prototype.undoRedoState=function(){return this._chartWidgetCollection.undoHistory.state()},o.prototype.takeScreenshot=function(){this._chartWidgetCollection.takeScreenshot()},e.exports=o}).call(t,i(8),i(16))},function(e,t,i){"use strict";(function(t){function n(e){var t,i,n=Object.keys(y),o=n.length;for(t=0;t<o;++t)if(i=n[t],y[i].name===e)return i;return null}function o(e){return"LineToolRiskRewardLong"===e||"LineToolRiskRewardShort"===e}var r=i(7).ensureNotNull,s=i(680),a=i(162).applyOverridesToStudy,l=i(26),c=i(681).LineDataSourceApi,h=i(682).StudyApi,u=i(683).PaneApi,d=i(3).DefaultProperty,p=i(335).availableIcons,_=i(37),f=i(15).Interval,m=i(35),y=i(298).supportedLineTools,g=i(292).showTooManyStudiesNotice,v=i(12).isNumber,S=i(684).onSeriesCompletedOrErrorReceived,b=function(e){this._chartWidget=e,this._panes=new WeakMap,this._studies=new WeakMap,this._lineDataSources=new WeakMap};b.prototype._getPaneApi=function(e){var t=this._panes.get(e);return void 0===t&&(t=new u(e),this._panes.set(e,t)),t},b.prototype._getStudyApi=function(e){var t=this._studies.get(e);return void 0===t&&(t=new h(e,this._chartWidget.model().model()),this._studies.set(e,t)),t},b.prototype._getLineDataSourceApi=function(e){var t=this._lineDataSources.get(e);return void 0===t&&(t=new c(e,this._chartWidget.model().model(),{apiPointsToDataSource:this._convertUserPointsToDataSource.bind(this),dataSourcePointsToPriced:function(e){var t=this._chartWidget.model().mainSeries().syncModel(),i=this._chartWidget.model().timeScale();return e.map(function(e){var n=i.normalizeBarIndex(e.index);return{price:e.price,time:t.projectTime(n.time_t,n.offset)}})}.bind(this)}),this._lineDataSources.set(e,t)),t},b.prototype._makeSubscriptionFromDelegate=function(e){var t=$.extend({},e);return delete t.fire,t},b.prototype.executeActionById=function(e){this._chartWidget.executeActionById(e)},b.prototype.getCheckableActionState=function(e){return this._chartWidget.getCheckableActionState(e)},b.prototype.refreshMarks=function(){this._chartWidget.refreshMarks()},b.prototype.clearMarks=function(){this._chartWidget.clearMarks()},b.prototype.symbol=function(){return this._chartWidget.getSymbol()},b.prototype.symbolExt=function(){var e=this._chartWidget.model().mainSeries().symbolInfo();return e?{symbol:e.name,full_name:e.full_name,exchange:e.exchange,description:e.description,type:e.type}:null},
b.prototype.resolution=function(){return this._chartWidget.model().mainSeries().properties().interval.value()},b.prototype.setSymbol=function(e,i){function n(e){e||i()}if(e!==this.symbol()||t.enabled("same_data_requery")){var o=this._chartWidget.model().mainSeries().dataEvents();return i&&S(o,n),this._chartWidget.setSymbol(e)}},b.prototype.resetData=function(){this._chartWidget.model().mainSeries().rerequestData()},b.prototype.setResolution=function(e,t){function i(e){e||t()}if((e=e.toUpperCase())!==this.resolution()){var n=this._chartWidget.model().mainSeries().dataEvents();return t&&S(n,i),this._chartWidget.setResolution(e)}},b.prototype.setEntityVisibility=function(e,t){var i,n;console.warn("`setEntityVisibility` is deprecated. Use shape/study API instead"),(i=this._chartWidget.model().model().dataSourceForId(e))&&(n=i.properties())&&n.visible&&n.visible.setValue(t)},b.prototype.getAllStudies=function(){return this._chartWidget.model().model().allStudies().map(function(e){return{id:e.id(),name:e._metaInfo.description}})},b.prototype.getAllShapes=function(){return this._chartWidget.model().model().allLineTools().map(function(e){return{id:e.id(),name:n(e.toolname)}}).filter(function(e){return null!==e.name})},b.prototype.removeAllShapes=function(){this._chartWidget.removeAllDrawingTools()},b.prototype.removeAllStudies=function(){this._chartWidget.removeAllStudies()},b.prototype.removeEntity=function(e){var t=this._chartWidget.model().chartModel().dataSourceForId(e);if(!t)return void console.warn("Can't find a source with id: "+e);this._chartWidget.model().chartModel().removeSource(t,!0)},b.prototype.createStudyTemplate=function(e){return this._chartWidget.model().model().studyTemplate(e.saveInterval)},b.prototype.applyStudyTemplate=function(e){this._chartWidget.model().model().restoreStudyTemplate(e,""+1e3*Math.random())},b.prototype.setVisibleRange=function(e,i){var n,o,r,s;if(void 0===e||!e.from||!e.to||isNaN(e.from)||isNaN(e.to))return void console.warn("Wrong time range: "+JSON.stringify(e)+'. Expected an object with "from" and "to" numeric values.');n=this._chartWidget.model().model(),o=n.mainSeries(),r=[parseInt(e.from),parseInt(e.to)],s=f.isDWM(o.interval())&&!t.enabled("disable_resolution_rebuild")?this._alignPoints(r):r,e.from=s[0],e.to=s[1],this._chartWidget.setVisibleTimeRange(e.from,e.to,i)},b.prototype.getVisibleRange=function(){var e,t,i,n,o,r,s={from:0,to:0},a=this._chartWidget.model().timeScale(),l=a.visibleBars();return null===l?s:(e=this._chartWidget.model().mainSeries(),null===(t=e.syncModel())?s:null===e.data().last()?s:(i=e.data().last(),n=l.lastBar()-i.index,o=n<=0,r=o?a.indexToTimePoint(l.lastBar()):t.projectTime(i.value[TradingView.TIME_PLOT],n),s.from=+a.indexToTimePoint(Math.max(0,l.firstBar()))||0,s.to=+r||0,s))},b.prototype.getVisiblePriceRange=function(){return this._chartWidget.model().mainSeries()?this._chartWidget.model().mainSeries().priceScale().priceRangeInPrice():null},b.prototype._createTradingPrimitive=function(e,t){function i(){
var e=TradingView.CLOSE_PLOT,t=r(n._chartWidget.model().mainSeries().bars().last());return{index:t.index,price:t.value[e]}}var n=this,o=this._chartWidget.model().model(),s=o.paneForSource(o.mainSeries());return(t?o:this._chartWidget.model()).createLineTool(s,i(),e)._adapter},b.prototype.createOrderLine=function(e){var e=e||{};return this._createTradingPrimitive("LineToolOrder",e.disableUndo)},b.prototype.createPositionLine=function(e){var e=e||{};return this._createTradingPrimitive("LineToolPosition",e.disableUndo)},b.prototype.createExecutionShape=function(e){var e=e||{};return this._createTradingPrimitive("LineToolExecution",e.disableUndo)},b.prototype.createShape=function(e,t){return this.createMultipointShape([e],t)},b.prototype._alignPoints=function(e){var t,i,n=this._chartWidget.model().model(),o=n.mainSeries(),r=o.symbolInfo(),s=m.get_timezone(r.timezone);return n.timeScale().isEmpty()?e:(t=(new _.Session).init(s,r.session),i=_.createDWMAligner(o.interval(),t),null===i?e:e.map(function(e){return e?(i.moveTo(1e3*e),i.startOfBar(0)/1e3):e}))},b.prototype._convertUserPointsToDataSource=function(e){function i(e,t,i){var n,o,r,s=h.closestIndexLeft(e)||0,a={index:s},l=h.valueAt(s);return e>l&&(n=c.syncModel().distance(l,e),n.success&&(a.index=a.index+n.result)),v(t)?a.price=t:(o=["open","high","low","close"],r=i?o.indexOf(i)+1:1,r<=0&&(r=1),a.price=u.valueAt(s)[r]),a}var n,o,r,s,a,l=this._chartWidget.model().model(),c=l.mainSeries(),h=l.timeScale().points(),u=c.data();if(l.timeScale().isEmpty())return null;for(n=e.map(function(e){return e.time}),o=f.isDWM(c.interval())&&!t.enabled("disable_resolution_rebuild")?this._alignPoints(n):n,r=[],s=0;s<e.length;s++)a=e[s],r.push(i(o[s],a.price,a.channel));return r},b.prototype.createMultipointShape=function(e,t,i){var n,r,s,a,l,c,h,u=t.disableUndo?this._chartWidget.model().model():this._chartWidget.model(),_=this._chartWidget.model().model(),f=_.mainSeries();if(!_.timeScale().isEmpty()){if(n=_.paneForSource(f),r=this._convertUserPointsToDataSource(e),s=y[t.shape]||y.flag,s.onlySelectable)throw Error('Cannot create "'+t.shape+'" shape');if("LineToolPolyline"===s.name)r[0].price===r[r.length-1].price&&r[0].index===r[r.length-1].index||r.push(r[0]);else if("LineToolIcon"===s.name){if(t.icon=t.icon||t.overrides&&t.overrides.icon,!t.hasOwnProperty("icon"))throw Error("icon must be specified in options");if(-1===p.indexOf(t.icon))throw Error("icon value must be valid");t.overrides=t.overrides||{},t.overrides.icon=t.icon}if(a=new d(s.name.toLowerCase()),t.overrides)for(l in t.overrides)a[l]?a[l].setValue(t.overrides[l]):o(s.name)&&-1!==["profitLevel","stopLevel"].indexOf(l)&&a.addProperty(l,t.overrides[l]);if(s.supportsText&&t.text&&a.text.setValue(t.text),c=u.createLineTool(n,r[0],s.name,a),c.pointsCount()!==r.length&&-1!==c.pointsCount())throw Error("Wrong points count for "+t.shape+". Required "+c.pointsCount());for(h=1;h<r.length&&this._chartWidget.model().lineBeingCreated();h++)u.coninueCreatingLine(r[h],{},h<r.length-1);return t.lock&&c.setUserEditEnabled(!1),
t.disableSelection&&(c.customization.disableSelection=!0),t.disableSave&&(c.customization.disableSave=!0),t.hasOwnProperty("showInObjectsTree")&&(c.customization.showInObjectsTree=t.showInObjectsTree),t.zOrder&&("top"===t.zOrder?u.bringToFront(c):"bottom"===t.zOrder&&u.sendToBack(c)),c.id()}},b.prototype.getShapeById=function(e){var t=this._chartWidget.model().model().getLineToolById(e);if(null===t)throw Error("There is no such shape");return this._getLineDataSourceApi(t)},b.prototype.createStudy=function(e,t,i,n,o,c,h){var u,d,p,_,f,m;return h=h||{},h.checkLimit&&!this._chartWidget.model().canCreateStudy()?(g(),null):(e=e.toLowerCase(),u=this._chartWidget.model().chartModel(),d=l.findStudyMetaInfoByDescription(u.studiesMetaData(),e),d=$.extend({},d),delete d.state,d?(p={},n&&(p.inputs=s.getStudyRecordFromArray([e].concat(n),this._chartWidget).inputs),_=u.insertStudy(d,p,t,null,h.priceScale),c&&a(_,c),f=r(u.paneForSource(_)),m=f.priceScaleName(_.priceScale()),u.setPriceScaleVisibility(m,!0),i&&_.setUserEditEnabled(!1),o&&o(_.id()),_.id()):(console.warn("Study `"+e+"` not found."),null))},b.prototype.getStudyById=function(e){var t=this._chartWidget.model().model().getStudyById(e);if(null===t)throw Error("There is no such study");return this._getStudyApi(t)},b.prototype.chartType=function(){return this._chartWidget.model().mainSeries().properties().style.value()},b.prototype.setChartType=function(e){this._chartWidget.model().mainSeries().properties().style.setValue(e)},b.prototype.priceFormatter=function(){return this._chartWidget.model().mainSeries().priceScale().formatter()},b.prototype.onDataLoaded=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().dataEvents().completed())},b.prototype.onSymbolChanged=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().dataEvents().symbolResolved())},b.prototype.onIntervalChanged=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().onIntervalChanged())},b.prototype.onVisibleRangeChanged=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().timeScale().visibleBarsChanged())},b.prototype.dataReady=function(e){var t=!this._chartWidget.model()||!this._chartWidget.model().mainSeries()||this._chartWidget.model().mainSeries().data().isEmpty();return e&&(t?this.onDataLoaded().subscribe(null,e,!0):e()),!t},b.prototype.crossHairMoved=function(e){this._makeSubscriptionFromDelegate(this._chartWidget.model().chartModel().crossHairMoved()).subscribe(null,e)},b.prototype.setTimezone=function(e){this._chartWidget.setTimezone(e)},b.prototype.getPanes=function(){return this._chartWidget.model().chartModel().panes().map(function(e){return this._getPaneApi(e)},this)},b.prototype.exportData=function(e){var t=this._chartWidget;return new Promise(function(n){i.e(26).then(function(o){var r=i(821).exportData;n(r(t.model().chartModel(),e))}.bind(null,i)).catch(i.oe)})},b.prototype.canZoomOut=function(){return!this._chartWidget.model().zoomStack().isEmpty()},
b.prototype.zoomOut=function(){this.canZoomOut()&&this._chartWidget.model().zoomFromViewport()},e.exports=b}).call(t,i(5))},function(e,t,i){"use strict";var n=function(){function e(e){return e.is_price_study}function t(e,t){var i,n=t.slice(0).toLowerCase();if(e){for(i=0;i<e.length;++i)if(e[i].description.toLowerCase()===n||e[i].shortDescription.toLowerCase()===n)return e[i];throw Error("Can't find metainfo for `"+t+"`")}throw Error("There is no studies metainfo at all")}function i(e){return e.inputs.map(function(e){return{id:e.id,type:e.type,name:e.name}})}function n(n,o){var r,a,l,c,h,u,d,p,_;if(!Array.isArray(n))return r=t(o.model().studiesMetaData(),n),{id:r.id,overlay:e(r)};for(a=n.slice(0),l=a[0],r=t(o.model().studiesMetaData(),l),c=e(r),h=i(r),d=a.splice(1),p=0;p<d.length;++p)u||(u={}),_=s[h[p].type]||s.string,u[h[p].id]=_(d[p]);return{id:r.id,name:l,overlay:c,inputs:u}}function o(e,n,o){function r(e){return e.name.toLowerCase()===a}var s,a,l,c=t(o.model().studiesMetaData(),e),h=i(c),u={};for(s in n)a=s.toLowerCase(),l=h.filter(r),0!==l.length?(l=l[0],u[l.id]=n[s]):console.warn("Uknown input `"+s+"` of `"+e+"`");return{id:c.id,name:e,inputs:u}}var r={},s={bool:function(e){return!!e},integer:function(e){return parseInt(e)},float:function(e){return parseFloat(e)},string:function(e){return e}};return r.getStudyRecordFromArray=function(e,t){return t=t||chartWidget,n(e,t)},r.getStudyRecordFromObject=function(e,t,i){return i=i||chartWidget,o(e,t,i)},r}();e.exports=n},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"LineDataSourceApi",function(){return r}),n=i(12),i.n(n),o=["alwaysShowStats","clonable","entryPrice","interval","lastUpdateTime","points","singleChartOnly","snapTo45Degrees","stopPrice","symbol","targetPrice"],r=function(){function e(e,t,i){this._source=e,this._model=t,this._pointsConverter=i}return e.prototype.isSelectionEnabled=function(){return this._source.isSelectionEnabled()},e.prototype.setSelectionEnabled=function(e){this._source.setSelectionEnabled(e)},e.prototype.isSavingEnabled=function(){return this._source.isSavedInChart()},e.prototype.setSavingEnabled=function(e){this._source.setSavingInChartEnabled(e)},e.prototype.isShowInObjectsTreeEnabled=function(){return this._source.showInObjectTree()},e.prototype.setShowInObjectsTreeEnabled=function(e){this._source.setShowInObjectsTreeEnabled(e)},e.prototype.isUserEditEnabled=function(){return this._source.userEditEnabled()},e.prototype.setUserEditEnabled=function(e){this._source.setUserEditEnabled(e)},e.prototype.bringToFront=function(){this._model.bringToFront(this._source)},e.prototype.sendToBack=function(){this._model.sendToBack(this._source)},e.prototype.getProperties=function(){return this._source.properties().state(o,!0)},e.prototype.setProperties=function(e){this._setProps(this._source.properties(),e,"")},e.prototype.getPoints=function(){return this._pointsConverter.dataSourcePointsToPriced(this._source.points())},e.prototype.setPoints=function(e){
var t,i,n=this._source.pointsCount(),o=-1===n?this._source.points().length:n;if(o!==e.length)throw Error("Wrong points count. Required="+o);for(t=this._pointsConverter.apiPointsToDataSource(e),i=0;i<t.length;++i)this._source.setPoint(i,t[i])},e.prototype._setProps=function(e,t,i){var o,r,s;for(o in t)t.hasOwnProperty(o)&&(r=0===i.length?o:i+"."+o,e.hasOwnProperty(o)?(s=t[o],Object(n.isHashObject)(s)?this._setProps(e[o],s,r):e[o].setValue(s)):console.warn('Unknown property "'+r+'"'))},e}()},function(e,t,i){"use strict";var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"StudyApi",function(){return s}),n=i(1),i(11),o=i(7),i.n(o),r=i(162),s=function(){function e(e,t){this._study=e,this._model=t}return e.prototype.isUserEditEnabled=function(){return this._study.userEditEnabled()},e.prototype.setUserEditEnabled=function(e){this._study.setUserEditEnabled(e)},e.prototype.getInputsInfo=function(){return this._study.metaInfo().inputs.map(function(e){return n.a({},e,{localizedName:void 0!==e.name?window.t(e.name,{context:"input"}):""})})},e.prototype.getInputValues=function(){var e=this._study.inputs();return Object.keys(e).map(function(t){return{id:t,value:e[t]}})},e.prototype.setInputValues=function(e){var t,i,n,o=this.getInputValues(),r=function(e){void 0!==o.find(function(t){return t.id===e.id})?s._study.properties().inputs[e.id].setValue(e.value):console.warn('There is no such input: "'+e.id+'"')},s=this;for(t=0,i=e;t<i.length;t++)n=i[t],r(n)},e.prototype.mergeUp=function(){this._model.mergeSourceUp(this._study),this._showStudyPriceScale()},e.prototype.mergeDown=function(){this._model.mergeSourceDown(this._study),this._showStudyPriceScale()},e.prototype.unmergeUp=function(){this._model.unmergeSourceUp(this._study),this._showStudyPriceScale()},e.prototype.unmergeDown=function(){this._model.unmergeSourceDown(this._study),this._showStudyPriceScale()},e.prototype.changePriceScale=function(e){var t,i,n,r=Object(o.ensureNotNull)(this._model.paneForSource(this._study)),s=null;switch(e){case"left":s=r.priceScaleByName("left");break;case"right":s=r.priceScaleByName("right");break;case"no-scale":s=r.priceScaleByName("");break;case"as-series":if(t=this._model.mainSeries(),(i=Object(o.ensureNotNull)(this._model.paneForSource(t)))!==r)return void console.warn('BEWARE: Attempt to change price scale to "as-series", but series and study are on different panes');n=i.priceScaleName(i.priceScaleForSource(t)),s=r.priceScaleByName(n);break;default:throw Error("Cannot change study's price scale to unknown price scale (\""+e+'")')}this._model.move(this._study,r,s),this._showStudyPriceScale()},e.prototype.isVisible=function(){return this._study.properties().visible.value()},e.prototype.setVisible=function(e){this._study.properties().visible.setValue(e)},e.prototype.bringToFront=function(){this._model.bringToFront(this._study)},e.prototype.sendToBack=function(){this._model.sendToBack(this._study)},e.prototype.applyOverrides=function(e){Object(r.applyOverridesToStudy)(this._study,e)},e.prototype._showStudyPriceScale=function(){
var e=Object(o.ensureNotNull)(this._model.paneForSource(this._study)),t=e.priceScaleName(this._study.priceScale());this._model.setPriceScaleVisibility(t,!0)},e}()},function(e,t,i){"use strict";var n,o;Object.defineProperty(t,"__esModule",{value:!0}),n=function(){function e(e){this._priceScale=e}return e.prototype.getMode=function(){var e=this._priceScale.properties();return e.percentage.value()?2:e.indexedTo100.value()?3:e.log.value()?1:0},e.prototype.setMode=function(e){this._priceScale.setMode({percentage:2===e,log:1===e,indexedTo100:3===e})},e}(),i.d(t,"PaneApi",function(){return o}),o=function(){function e(e){this._priceScales=new WeakMap,this._pane=e}return e.prototype.hasMainSeries=function(){return this._pane.containsMainSeries()},e.prototype.getLeftPriceScale=function(){return this._getPriceScaleApi(this._pane.leftPriceScale())},e.prototype.getRightPriceScale=function(){return this._getPriceScaleApi(this._pane.rightPriceScale())},e.prototype.getMainSourcePriceScale=function(){var e,t=this._pane.mainDataSource();return null===t?null:(e=this._pane.priceScaleForSource(t),null===e?null:this._getPriceScaleApi(e))},e.prototype._getPriceScaleApi=function(e){var t=this._priceScales.get(e);return void 0===t&&(t=new n(e),this._priceScales.set(e,t)),t},e}()},function(e,t,i){"use strict";function n(e,t){var i=function(){e.completed().unsubscribe(null,n),t(!1)},n=function(){e.error().unsubscribe(null,i),t(!0)};e.completed().subscribe(null,i,!0),e.error().subscribe(null,n,!0)}Object.defineProperty(t,"__esModule",{value:!0}),t.onSeriesCompletedOrErrorReceived=n},function(e,t,i){"use strict";var n,o;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"ThemesApi",function(){return o}),n=i(251),o=function(){function e(e){this._opts=e}return e.prototype.isStdTheme=function(){return Object(n.isStdTheme)(Object(n.extractThemeFromModel)(this._getActiveChartModel()))},e.prototype.setStdTheme=function(e){var t=this;return Object(n.getStdTheme)(e).then(function(i){t._opts.chartWidgetCollection.applyTheme(i.content),Object(n.setTheme)(e),Object(n.syncTheme)()})},e.prototype.setStdThemeForLayout=function(e){Object(n.setTheme)(e),Object(n.syncTheme)()},e.prototype.getCurrentThemeName=function(){return Object(n.getCurrentTheme)().name},e.prototype._getActiveChartModel=function(){return this._getActiveChartWidget().model()},e.prototype._getActiveChartWidget=function(){return this._opts.chartWidgetCollection.activeChartWidget.value()},e}()},function(e,t,i){"use strict";var n,o,r,s=i(25);i(183),n=i(687).pivotPointsStandardStudyItem,o=i(688).spreadStudyItem,r=i(689).ratioStudyItem,JSServer.studyLibrary=JSServer.studyLibrary.concat([{name:"Compare",metainfo:{_metainfoVersion:15,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!0,defaults:{styles:{compare:{linestyle:0,linewidth:2,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800080"}},precision:4,inputs:{source:"close",symbol:""}},plots:[{id:"compare",type:"line"}],styles:{compare:{title:"Plot",histogramBase:0}},description:"Compare",shortDescription:"Compare",
is_price_study:!0,inputs:[{defval:"close",id:"source",name:"Source",options:["open","high","low","close","hl2","hlc3","ohlc4"],type:"text"},{id:"symbol",name:"Symbol",type:"symbol",isHidden:!0}],id:"Compare@tv-basicstudies-1"},constructor:function(){this.init=function(e,t){this._context=e,this._context.new_sym(t(1),s.Std.period(this._context),s.Std.period(this._context))},this.main=function(e,t){var i,n,o,r,a;return this._context=e,i=this._context.new_unlimited_var(this._context.symbol.time),this._context.select_sym(1),n=this._context.new_unlimited_var(this._context.symbol.time),o=s.Std[t(0)](this._context),r=this._context.new_unlimited_var(o),this._context.select_sym(0),a=r.adopt(n,i,0),[a]}}},{name:"Overlay",metainfo:{_metainfoVersion:15,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!0,defaults:{styles:{},precision:4,inputs:{symbol:""}},plots:[{id:"open",type:"line"},{id:"high",type:"line"},{id:"low",type:"line"},{id:"close",type:"line"}],styles:{open:{title:"Open"},high:{title:"High"},low:{title:"Low"},close:{title:"Close"}},description:"Overlay",shortDescription:"Overlay",is_price_study:!1,inputs:[{id:"symbol",name:"symbol",defval:"",type:"symbol",isHidden:!0}],id:"Overlay@tv-basicstudies-1"},constructor:function(){this.init=function(e,t){this._context=e,this._context.new_sym(t(0),s.Std.period(this._context),s.Std.period(this._context))},this.main=function(e,t){var i,n,o,r,a,l;return this._context=e,i=this._context.new_unlimited_var(this._context.symbol.time),this._context.select_sym(1),n=this._context.new_unlimited_var(this._context.symbol.time),o=this._context.new_unlimited_var(s.Std.open(this._context)),r=this._context.new_unlimited_var(s.Std.high(this._context)),a=this._context.new_unlimited_var(s.Std.low(this._context)),l=this._context.new_unlimited_var(s.Std.close(this._context)),this._context.select_sym(0),[o.adopt(n,i,1),r.adopt(n,i,1),a.adopt(n,i,1),l.adopt(n,i,1)]}}},{name:"Volume",metainfo:{_metainfoVersion:15,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,transparency:65,defaults:{styles:{vol:{linestyle:0,linewidth:1,plottype:5,trackPrice:!1,transparency:65,visible:!0,color:"#000080"},vol_ma:{linestyle:0,linewidth:1,plottype:4,trackPrice:!1,transparency:65,visible:!0,color:"#0496FF"}},precision:0,palettes:{volumePalette:{colors:{0:{color:"#eb4d5c",width:1,style:0},1:{color:"#53b987",width:1,style:0}}}},inputs:{showMA:!1,maLength:20}},plots:[{id:"vol",type:"line"},{id:"volumePalette",palette:"volumePalette",target:"vol",type:"colorer"},{id:"vol_ma",type:"line"}],styles:{vol:{title:"Volume",histogramBase:0},vol_ma:{title:"Volume MA",histogramBase:0}},description:"Volume",shortDescription:"Volume",is_price_study:!1,palettes:{volumePalette:{colors:{0:{name:"Falling"},1:{name:"Growing"}}}},inputs:[{id:"showMA",name:"show MA",defval:!1,type:"bool"},{id:"maLength",name:"MA Length",defval:20,type:"integer",min:1,max:2e3}],id:"Volume@tv-basicstudies-1"},constructor:function(){this.f_0=function(e,t){return s.Std.gt(e,t)?0:1},this.f_1=function(e,t){return e?t:s.Std.na()},this.main=function(e,t){
var i,n,o,r,a,l,c;return this._context=e,this._input=t,i=this._input(0),n=s.Std.volume(this._context),o=this.f_0(s.Std.open(this._context),s.Std.close(this._context)),r=s.Std.volume(this._context),a=this._context.new_var(r),l=s.Std.sma(a,this._input(1),this._context),c=this.f_1(i,l),[n,o,c]}}},{name:"ZigZag",metainfo:{_metainfoVersion:23,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:2,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,inputs:{in_0:5,in_1:10}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",target:"plot_0",type:"dataoffset"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Zig Zag",shortDescription:"ZigZag",is_price_study:!0,classId:"ScriptWithDataOffset",inputs:[{id:"in_0",name:"deviation",defval:5,type:"integer",min:1,max:100},{id:"in_1",name:"depth",defval:10,type:"integer",min:2,max:1e3}],id:"ZigZag@tv-basicstudies-1"},constructor:function(){this.main=function(e,t){var i,n,o,r,a,l,c,h;return this._context=e,this._input=t,i=this._input(0),n=this._input(1),o=i/100,r=n/2,a=s.Std.zigzag(o,r,this._context),l=s.Std.zigzagbars(o,r,this._context),c=a,h=l,[c,h]}}},{name:"Sessions",metainfo:{_metainfoVersion:44,defaults:{graphics:{vertlines:{sessBreaks:{color:"#4985e7",style:2,visible:!1,width:1}}},linkedToSeries:!0,precision:4},description:"Sessions",graphics:{vertlines:{sessBreaks:{name:"Session Break"}}},id:"Sessions@tv-basicstudies-1",inputs:[],is_hidden_study:!0,is_price_study:!0,name:"Sessions@tv-basicstudies",palettes:{},plots:[],shortDescription:"Sessions"},constructor:function(){function e(e,t){return{id:e,time:e,extendBottom:!0,extendTop:!0}}this.init=function(){this._times=[]},this._getVerticalLineData=function(t){return s.Std.selectSessionBreaks(t,this._times).map(e)},this.main=function(e,t){var i,n,o;return s.Std.isdwm(e)?null:(i=s.Std.time(e),isNaN(i)?null:(n=this._times.length,0!==n&&this._times[n-1]===i||this._times.push(i),e.symbol.isLastBar&&e.symbol.isNewBar?(o=this._getVerticalLineData(e),0===o.length?null:{nonseries:!0,type:"study_graphics",data:{graphicsCmds:{create:{vertlines:[{styleId:"sessBreaks",data:o}]},erase:[{action:"all"}]}}}):null))}}},{name:"SuperTrend",metainfo:{_metainfoVersion:39,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:3,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"},plot_2:{linestyle:0,linewidth:3,plottype:"shape_arrow_up",trackPrice:!1,location:"BelowBar",transparency:35,visible:!0,color:"#00FF00"},plot_3:{linestyle:0,linewidth:3,plottype:"shape_arrow_down",trackPrice:!1,location:"AboveBar",transparency:35,visible:!0,color:"#FF0000"}},precision:4,palettes:{palette_0:{colors:{0:{color:"#008000",width:3,style:0},1:{color:"#800000",width:3,style:0}}}},inputs:{in_0:10,in_1:3}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",palette:"palette_0",target:"plot_0",type:"colorer"},{id:"plot_2",type:"shapes"},{id:"plot_3",type:"shapes"}],styles:{plot_0:{title:"SuperTrend",histogramBase:0,
joinPoints:!1,isHidden:!1},plot_2:{title:"Up Arrow",histogramBase:0,joinPoints:!1,isHidden:!1},plot_3:{title:"Down Arrow",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"SuperTrend",shortDescription:"SuperTrend",is_price_study:!0,palettes:{palette_0:{colors:{0:{name:"Color 0"},1:{name:"Color 1"}},valToIndex:{0:0,1:1}}},inputs:[{id:"in_0",name:"Length",defval:10,type:"integer",min:1,max:100},{id:"in_1",name:"Factor",defval:3,type:"float",min:1,max:100}],id:"SuperTrend@tv-basicstudies-1",scriptIdPart:"",name:"SuperTrend",isCustomIndicator:!0},constructor:function(){this.f_0=function(){var e,t,i,n,o,r=this._input(0),a=this._input(1),l=s.Std.atr(r,this._context);return r=s.Std.hl2(this._context)+l*a,l=s.Std.hl2(this._context)-l*a,e=this._context.new_var(s.Std.close(this._context)),a=this._context.new_var(),t=s.Std.max(l,a.get(1)),a.set(s.Std.gt(e.get(1),a.get(1))?t:l),l=this._context.new_var(),t=s.Std.min(r,l.get(1)),l.set(s.Std.lt(e.get(1),l.get(1))?t:r),r=this._context.new_var(),e=s.Std.nz(r.get(1),1),e=s.Std.lt(s.Std.close(this._context),a.get(1))?-1:e,r.set(s.Std.gt(s.Std.close(this._context),l.get(1))?1:e),a=s.Std.eq(r.get(0),1)?a.get(0):l.get(0),i=s.Std.eq(r.get(0),1)?0:1,n=1===r.get(0)&&-1===r.get(1),o=-1===r.get(0)&&1===r.get(1),[a,i,n,o]},this.main=function(e,t){this._context=e,this._input=t;var i=this.f_0();return[i[0],i[1],i[2],i[3]]}}},n,o,r])},function(e,t,i){"use strict";function n(e){switch(e){case"Traditional":return 0;case"Fibonacci":return 1;case"Woodie":return 2;case"Classic":return 3;case"DeMark":return 4;case"Camarilla":return 5;default:throw Error("Unknown kind "+e)}}function o(e,t){e.setUTCMonth(e.getUTCMonth()+t)}function r(e,t){return new Date(t,e,0).getDate()}function s(e,t){var i,n,s;return u.Std.ismonthly(e)?(i=new Date(t),n=i.getUTCDay(),s=r(i.getUTCMonth(),i.getUTCFullYear()),n<s?(o(i,u.Std.interval(e)),i=u.Std.add_days_considering_dst("Etc/UTC",i,1-i.getUTCDay())):(i=u.Std.add_days_considering_dst("Etc/UTC",i,1),o(i,u.Std.interval(e))),i.valueOf()):t+d.Interval.parse(e.symbol.resolution).inMilliseconds(t)}function a(e,t,i,n,o,r,s,a){var l,c=new p,h=NaN,d=i-n;switch(a){case 0:h=(i+n+o)/3,c.p=h,c.r1=2*h-n,c.s1=2*h-i,c.r2=h+(i-n),c.s2=h-(i-n),c.r3=2*h+(i-2*n),c.s3=2*h-(2*i-n),c.r4=3*h+(i-3*n),c.s4=3*h-(3*i-n),c.r5=4*h+(i-4*n),c.s5=4*h-(4*i-n);break;case 1:h=(i+n+o)/3,c.p=h,c.r1=h+.382*d,c.s1=h-.382*d,c.r2=h+.618*d,c.s2=h-.618*d,c.r3=h+d,c.s3=h-d;break;case 2:h=(i+n+2*e)/4,c.p=h,c.r1=2*h-n,c.s1=2*h-i,c.r2=h+d,c.s2=h-d,c.r3=i+2*(h-n),c.s3=n-2*(i-h),c.r4=c.r3+d,c.s4=c.s3-d;break;case 3:h=(i+n+o)/3,c.p=h,c.r1=2*h-n,c.s1=2*h-i,c.r2=h+d,c.s2=h-d,c.r3=h+2*d,c.s3=h-2*d,c.r4=h+3*d,c.s4=h-3*d;break;case 4:l=NaN,l=u.Std.equal(t,o)?i+n+2*o:u.Std.greater(o,t)?2*i+n+o:2*n+i+o,h=l/4,c.p=h,c.r1=l/2-n,c.s1=l/2-i;break;case 5:h=(i+n+o)/3,c.p=h,c.r1=o+1.1*d/12,c.s1=o-1.1*d/12,c.r2=o+1.1*d/6,c.s2=o-1.1*d/6,c.r3=o+1.1*d/4,c.s3=o-1.1*d/4,c.r4=o+1.1*d/2,c.s4=o-1.1*d/2;break;default:throw Error("Unknown kind")}return c.startIndex__t=r,c.endIndex__t=s,c}function l(e,t){
return(!u.Std.isdaily(e)||"Daily"!==t)&&((!u.Std.isweekly(e)||"Daily"!==t&&"Weekly"!==t)&&(!u.Std.ismonthly(e)||"Daily"!==t&&"Weekly"!==t&&"Monthly"!==t))}function c(e){if(u.Std.isweekly(e)||u.Std.ismonthly(e))return"12M";if(u.Std.isdaily(e))return"1M";if(u.Std.isintraday(e)){var t=u.Std.interval(e);return t>=1&&t<=15?"1D":"1W"}throw Error("Unexpected resolution type: "+e.symbol.resolution)}function h(e,t){switch(t){case"Auto":return c(e);case"Daily":return"1D";case"Weekly":return"1W";case"Monthly":return"1M";case"Yearly":return"12M";default:throw Error("No such pivTimeFrame: "+t)}}var u,d,p,_,f,m;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"pivotPointsStandardStudyItem",function(){return m}),u=i(25),i.n(u),d=i(15),p=function(){function e(){this.p=NaN,this.r1=NaN,this.s1=NaN,this.r2=NaN,this.s2=NaN,this.r3=NaN,this.s3=NaN,this.r4=NaN,this.s4=NaN,this.r5=NaN,this.s5=NaN,this.startIndex__t=NaN,this.endIndex__t=NaN}return e}(),_=function(){function e(){this.pivots=[]}return e}(),f=function(){function e(){this._secondaryRes="1D",this._firstMainSeriesBarTime=NaN}return e.prototype.init=function(e,t){var i,o=t(0),r=t(1),s=t(2),a=t(3);this._data=new _,this._firstMainSeriesBarTime=NaN,this._kindPP=n(o),this._showHistoricalPivots=r,this._historicalPivotsToKeep=a,this._pivTimeFrame=s,this._isValidResolution=l(e,this._pivTimeFrame),this._isValidResolution||u.Std.error("You cannot see this pivot timeframe on this resolution"),this._isValidResolution&&(this._secondaryRes=h(e,this._pivTimeFrame)),i=""===e.symbol.resolution?Math.max(30,2*parseInt(e.symbol.interval))+"":e.symbol.period,e.new_sym(e.symbol.tickerid,this._secondaryRes,this._secondaryRes,i)},e.prototype.main=function(e){var t,i,n,o,r,l,c,h,d,p,_,f,m,y,g;return this._isValidResolution?e.symbol.time?(isNaN(this._firstMainSeriesBarTime)&&(this._firstMainSeriesBarTime=e.symbol.time,this._removeUnusedPivots()),e.symbol.isLastBar&&e.symbol.isNewBar?this._createResponse():null):(e.select_sym(1),t=e.new_var(u.Std.open(e)),i=e.new_var(u.Std.high(e)),n=e.new_var(u.Std.low(e)),o=e.new_var(u.Std.close(e)),r=e.new_var(u.Std.time(e)),l=this._data,c=t.get(0),h=r.get(0),d=t.get(1),p=i.get(1),_=n.get(1),f=o.get(1),m=e.symbol.isLastBar,0!==l.pivots.length&&e.symbol.isNewBar&&(y=l.pivots[l.pivots.length-1],y.endIndex__t!==h&&(y.endIndex__t=h)),0!==e.symbol.index&&e.symbol.isNewBar?(g=a(c,d,p,_,f,h,s(e,h),this._kindPP),e.select_sym(0),this._showHistoricalPivots||(l.pivots=[]),l.pivots.push(g),l.pivots.length>this._historicalPivotsToKeep&&l.pivots.shift(),m?this._createResponse():null):(e.select_sym(0),null)):null},e.prototype._createResponse=function(){return 0===this._data.pivots.length?null:{nonseries:!0,type:"non_series_data",data:{data:this._data}}},e.prototype._removeUnusedPivots=function(){var e=this,t=Math.max(this._data.pivots.findIndex(function(t){return t.startIndex__t>e._firstMainSeriesBarTime})-1,0);t>0&&this._data.pivots.splice(0,t)},e}(),m={name:"Pivot Points Standard",metainfo:{_metainfoVersion:44,defaults:{inputs:{kind:"Traditional",lookBack:15,
pivTimeFrame:"Auto",showHistoricalPivots:!0},precision:"4"},description:"Pivot Points Standard",id:"PivotPointsStandard@tv-basicstudies-80",inputs:[{defval:"Traditional",id:"kind",name:"Type",options:["Traditional","Fibonacci","Woodie","Classic","DeMark","Camarilla"],type:"text"},{defval:!0,id:"showHistoricalPivots",name:"Show historical pivots",type:"bool"},{defval:"Auto",id:"pivTimeFrame",name:"Pivots Timeframe",options:["Auto","Daily","Weekly","Monthly","Yearly"],type:"text"},{defval:15,id:"lookBack",max:5e3,min:2,name:"Number of Pivots Back",type:"integer"}],is_price_study:!0,linkedToSeries:!0,shortDescription:"Pivots"},constructor:f}},function(e,t,i){"use strict";var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"spreadStudyItem",function(){return s}),n=i(1),o=i(299),r=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.c(t,e),t.prototype._doCalculation=function(e,t,i,n){return e*t-i*n},t}(o.a),s={name:"Spread",metainfo:{_metainfoVersion:15,defaults:o.b,plots:o.d,styles:o.e,description:"Spread",shortDescription:"Spread",is_price_study:!1,inputs:o.c,id:"Spread@tv-basicstudies-1"},constructor:r}},function(e,t,i){"use strict";var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"ratioStudyItem",function(){return s}),n=i(1),o=i(299),r=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.c(t,e),t.prototype._doCalculation=function(e,t,i,n){return e*t/(i*n)},t}(o.a),s={name:"Ratio",metainfo:{_metainfoVersion:15,defaults:o.b,plots:o.d,styles:o.e,description:"Ratio",shortDescription:"Ratio",is_price_study:!1,inputs:o.c,id:"Ratio@tv-basicstudies-1"},constructor:r}}],[462]);
time:[-2524521600,-1892678400,-1688428800,-1619222400,-1593820800,-1336003200,-13176e5,-1304380800,-1286064e3,-1272844800,-1254528e3,-1241308800,-1222992e3,-1209772800,-1191369600,-1178150400,-870566400,-865296e3,-740534400,-736387200,-718070400,-713667600,-36633600,-23932800,-3369600,7516800,24451200,37756800,55900800,69206400,87955200,100656e3,118195200,132105600,150854400,163555200,182304e3,195609600,213753600,227059200,245203200,258508800,277257600,289958400,308707200,321408e3,340156800,353462400,371606400,384912e3,403056e3,416361600,434505600,447811200,46656e4,479260800,498009600,510710400,529459200,545184e3,560908800,574214400,592358400,605664e3,624412800,637113600,653443200,668563200,687312e3,700617600,718761600,732067200,750211200,763516800,781660800,794966400,813715200,826416e3,845164800,85968e4,876614400,88992e4,906854400,923184e3,939513600,952819200,971568e3,984268800,1003017600,1015718400,1034467200,1047168e3,1065916800,1079222400,1097366400,1110672e3,1128816e3,1142121600,1160870400,1173571200,119232e4,1206835200,1223769600,1237075200,1255219200,1270339200,1286668800,1304812800,1313884800,1335657600,1346544e3,1367107200,1378598400,1398556800,1410048e3,1463270400,1471132800,149472e4,1502582400,1526169600,1534032e3,1554595200,1567900800,1586044800,1599350400,1617494400,16308e5,1648944e3,1662249600,1680393600,1693699200,1712448e3,1725753600,1743897600,1757203200,1775347200,1788652800,1806796800,1820102400,1838246400,1851552e3,1870300800,1883001600,1901750400,1915056e3,19332e5],offset:[-16966,-16966,-18e3,-16966,-14400,-16966,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-10800,-14400,-18e3,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800]},"Asia/Bahrain":{time:[-1577923200,76204800,1925002800],offset:[12368,14400,10800]},"Asia/Jakarta":{time:[-3231273600,-1451693568,-117288e4,-876614400,-766022400,-683856e3,-620784e3,-189388800,1925017200],offset:[25632,25632,26400,27e3,32400,27e3,28800,27e3,25200]},"Africa/Lagos":{time:[-1588464e3,1924995600],offset:[816,3600]},"Pacific/Norfolk":{
time:[-2177452800,-599616e3,152071200,162961200,1443924e3,1570327200,1586055600,1601776800,1617505200,1633226400,1648954800,1664676e3,1680404400,1696125600,1712458800,172818e4,1743908400,1759629600,1775358e3,1791079200,1806807600,1822528800,1838257200,1853978400,1869706800,1886032800,1901761200,1917482400,1933210800],offset:[40312,40320,41400,45e3,41400,39600,43200,39600,43200,39600,43200,39600,43200,39600,43200,39600,43200,39600,43200,39600,43200,39600,43200,39600,43200,39600,43200,39600,43200]},"America/Juneau":{time:[-3225169588,-2188987200,-880236e3,-769420800,-765410400,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,438998400,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],offset:[54139,-32261,-28800,-25200,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-28800,-28800,-25200,-28800,-25200,-28800,-25200,-32400,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400]},"Asia/Ho_Chi_Minh":{time:[-2004048e3,-1851552e3,-852080400,-782614800,-767836800,-718070400,-457747200,-315622800,171849600,1925017200],offset:[25600,25590,25200,28800,32400,25200,28800,25200,28800,25200]},"Australia/Perth":{
time:[-2337897600,-1672531140,-1665352800,-883605600,-876088800,-860364e3,-844639200,152071200,162961200,436327200,447217200,690343200,699418800,1165111200,1174791600,1193536800,1206846e3,1224986400,1238295600,1925020800],offset:[27804,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Europe/Oslo":{time:[-2366755200,-1691881200,-1680566400,-927507600,-85725e4,-844552800,-828219600,-812498400,-79677e4,-781048800,-765320400,-340840800,-324507600,-308786400,-293058e3,-277336800,-261608400,-245887200,-230158800,-214437600,-198709200,-182988e3,-166654800,-147909600,-135205200,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[2580,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]}}},function(e,t,i){"use strict";function n(e){this._studyId=e,this._maxToVers=o.ZERO,this._maxFromVers=o.ZERO,this._migrs=[]}var o=i(163).Version,r=i(4).getLogger("Chart.StudyMigration");n.prototype.addMigration=function(e,t,i){var n=o.parse(e),r=o.parse(t);n.isGreater(this._maxFromVers)&&(this._maxFromVers=n),r.isGreater(this._maxToVers)&&(this._maxToVers=r),this._migrs.push({fromVers:n,toVers:r,rules:i})},n.prototype.updateInputs=function(e,t,i){var n,o,s;if(!i)return i;for(n=TradingView.clone(i),o=e;o.isLess(t)&&null!=(s=this._findMigration(o));){
if(r.logNormal("Migrating study inputs from "+s.fromVers+" to "+s.toVers+" version, studyId: "+this._studyId+", migration: "+JSON.stringify(s)+", inputs: "+JSON.stringify(i)),n=this._applyMigration(n,s),!o.isLess(s.toVers))throw Error("Problems in study migration process... Possible infinite cycle has been detected and stopped.");o=s.toVers}return o>e&&r.logNormal("Study inputs migration is done, studyId: "+this._studyId+", inputs: "+JSON.stringify(n)),n},n.prototype._findMigration=function(e){var t,i,n=-1,o=this._maxFromVers;for(t=0;t<this._migrs.length;t++)i=this._migrs[t],i.fromVers.isLess(e)||i.fromVers.isLessOrEqual(o)&&(o=i.fromVers,n=t);return n<0?null:this._migrs[n]},n.prototype._applyMigration=function(e,t){var i,n,o,r=e;for(i=0;i<t.rules.length;i++)n=t.rules[i],o=this._getApplyRuleFun(n.type),r=o(r,n);return r},n.prototype._getApplyRuleFun=function(e){if("inputRemoved"===e)return n._applyInputRemovedRule;if("inputChangedType"===e)return n._applyInputChangedTypeRule;if("inputChangedMinMax"===e)return n._applyInputChangedMinMaxRule;if("inputChangedOptions"===e)return n._applyInputChangedOptionsRule;throw Error("Unknown migration rule type: "+e)},n._applyInputRemovedRule=function(e,t){if(!(t.inputId in e))return e;if("removeVal"!==t.action)throw Error("Unexpected rule.action="+t.action+" in rule.type="+t.type);var i=e[t.inputId];return delete e[t.inputId],r.logNormal("Input "+t.inputId+"="+i+" removed"),e},n._applyInputChangedTypeRule=function(e,t){var i=e[t.inputId];if("resetToDefVal"===t.action)return e[t.inputId]=t.defVal,r.logNormal("Input "+t.inputId+"="+i+" reset to default value "+t.defVal),e;if("convertVal"===t.action){if(null==i)return e;if("float"===t.inputTypeFrom&&"integer"===t.inputType)return e[t.inputId]=Math.round(e[t.inputId]),r.logNormal("Input "+t.inputId+"="+i+" converted to value "+e[t.inputId]),e;if("integer"===t.inputTypeFrom&&"float"===t.inputType)return e;if("text"===t.inputTypeFrom&&"source"===t.inputType)return n._isValidSource(i,t.options)?e:(e[t.inputId]=t.defVal,e);throw Error("Cannot convertVal from "+t.inputTypeFrom+" to "+t.inputType)}throw Error("Unknown action "+t.action+" for rule with type "+t.type)},n._isValidSource=function(e,t){return e.indexOf("$")>=0||t.indexOf(e)>=0},n._applyInputChangedMinMaxRule=function(e,t){if("adjustValIfNeeded"!==t.action)throw Error("Unknown action "+t.action+" for rule with type "+t.type);var i=e[t.inputId];return i<t.minVal?e[t.inputId]=t.minVal:i>t.maxVal&&(e[t.inputId]=t.maxVal),r.logNormal("Input "+t.inputId+"="+i+" adjusted to value "+e[t.inputId]),e},n._applyInputChangedOptionsRule=function(e,t){if(!(["text"].indexOf(t.inputType)>=0&&"resetToDefValIfNeeded"===t.action))throw Error("Unexpected rule.inputType="+t.inputType+" in rule.action="+t.action);var i=e[t.inputId];return t.options.indexOf(i)<0&&(e[t.inputId]=t.defVal,r.logNormal("Input "+t.inputId+"="+i+" reset to default value "+t.defVal)),e},e.exports=n},function(e,t,i){"use strict";(function(t,n,o,r){function s(e){return e instanceof M}function a(e){
return e.isNoScale()?null:e.priceScale()}function l(e,t,i,n,o){if(void 0!==o)switch(o){case"right":return e.rightPriceScale();case"left":return e.leftPriceScale();case"no-scale":return null;case"as-series":if(!e.isMainPane()){Y.logWarn('BEWARE: Attempt to set "as-series" price scale to study, but series and study are on different panes');break}return a(t);default:Y.logWarn("Unknown override for priceScale type - "+o+", default will be used")}var r=i.priceScale;return n?null:(s(t)||e.isMainPane()&&void 0===r)&&i.is_price_study?a(t):r===N.None?i.is_price_study?null:(Y.logWarn("Cannot add study "+i.id+" with 'No Scale' setting, because study is not a price study. Using right price scale."),e.rightPriceScale()):r===N.Left?e.leftPriceScale():e.rightPriceScale()}function c(e,i,r,s,a,l,h,u){var d,p,_;for(u=Object.assign({},Z,u),this._version=c.version,this._readOnly=u.readOnly,this._undoModel=l,this._studiesMetaInfoRepository=a,this._properties=r,this._modelIntervals=[],this._isSnapshot=u.isSnapshot,this.setStudiesMetaData(this._studiesMetaInfoRepository.getInternalMetaInfoArray(),this._studiesMetaInfoRepository.getMigrations()),this.m_timeScale=new x(this,u.timeScale),H.init(),d=this,this.m_panes=[],this.m_gridSource=new P,this.m_crossHairSource=new S(this,H.properties(),{additionalMenuEnabled:u.crossHairMenuEnabled}),this.m_crossHairSource.selectBarMode().subscribe(function(e){if(e&&d.lineBeingCreated()){var t=H.tool.value();d.cancelCreatingLine(),H.tool.setValue(t)}}),this.m_width=0,this._tagsChanged=new t,this._lineCancelled=new t,this._magnet=new T(H.properties().magnet,this.m_timeScale,r.paneProperties.magnetSensivity),p=new j("chartproperties.mainSeriesProperties"),p.addExclusion("minTick"),p.addExclusion("priceAxisProperties.lockScale"),p.addExclusion("priceAxisProperties.percentage"),p.addExclusion("priceAxisProperties.log"),this.createPane(void 0,{rightAxisProperties:p.priceAxisProperties.state(["autoScale"])}),this.m_panes[0]._stretchFactor=2*b.DEFAULT_STRETCH_FACTOR,this.m_panes[0]._isMainPane=!0,this.m_selectedSource=null,this._selectedSourceChanged=new t,this._chartApi=e,this._invalidateHandler=i,this.m_hoveredSource=null,this._properties.listeners().subscribe(this,c.prototype.propertyChangeHandler),this._properties.timezone.listeners().subscribe(null,function(){d._chartApi&&d._chartApi.connected()&&d._chartApi.switchTimezone(d.timezone())}),this.m_timeScale.defaultRightOffsetProperty().listeners().subscribe(null,function(){d.recalculateAllPanes()}),p.merge(r.mainSeriesProperties.state()),this.m_mainSeries=new W(this,p,s),this.m_panes[0].addDataSource(this.m_mainSeries,this.m_panes[0].rightPriceScale()),this._mainSeriesPriceScaleNameChanged=new t,this._mainSeriesPriceScaleNameProperty=new K(this),this._mainSeriesScaleRatioProperty=new G(this),this.m_mainSeries.dataEvents().completed().subscribe(this,function(){if(d.clearCurrentPosition(),d._scrollingState&&d.gotoTime(),n.enabled("fix_left_edge")&&this.m_mainSeries.endOfData()){var e=this.m_mainSeries.bars().first()
;null!==e&&this.m_timeScale.setLeftEdgeFix(e.index)}}.bind(this)),this.m_mainSeries.onIntervalChanged().subscribe(this,function(){this._oldStartVisibleIndex=-1,this._oldEndVisibleIndex=-1}),this.m_mainSeries.dataEvents().barReceived().subscribe(this,c.prototype.updateTimeScaleBaseIndex),this.m_mainSeries.properties().symbol.listeners().subscribe(this,this.setPriceAutoScaleForAllMainSources),this._readOnly||(p.addChild("priceAxisProperties",this.m_mainSeries.m_priceScale.properties()),this._properties.paneProperties.legendProperties.showStudyTitles.listeners().subscribe(this,function(e){e.value()||d._properties.paneProperties.legendProperties.showStudyArguments.setValue(!1)})),this._barsMarksSources=h(this),_=0;_<this._barsMarksSources.length;_++)this._barsMarksSources[_].setOwnerSource(this.m_mainSeries);this._syncPointCache={},this.m_watermarkSource=u.watermarkEnabled?new w(this.m_mainSeries):null,this._brandingSource=null,this.strategySources=[],this.strategySources.change=new t,this._activeStrategySource=new o(null),this._oldStartVisibleIndex=-1,this._oldEndVisibleIndex=-1,this._currentTool="",H.hideAllDrawings().subscribe(this,this.visibilityChangeHandler),this._properties.scalesProperties.listeners().subscribe(this,c.prototype.fullUpdate),this._id=q.guid(),this._studyInserted=new t,this._chartThemeLoaded=new t,this._resetScales=new t,this._isScalesResetAvailableChanged=new t,this._isScalesResetAvailable=!1,this._studyShiftColorStartOffset=void 0}var h=i(7).ensureNotNull,u=i(6).Point,d=i(24),p=d.parseRgb,_=d.rgbToBlackWhiteString,f=i(73),m=f.createLineTool,y=f.isLineToolName,g=f.isLineTool,v=f.isStudyLineTool,S=i(598).CrossHair,b=i(176).Pane,w=i(614).Watermark,P=i(615).Grid,T=i(616),x=i(617).TimeScale,C=i(177).PriceScale,L=i(88).BarsMarksContainer,I=i(622).Branding,A=i(28).PriceDataSource,k=i(18),E=i(34),M=E.Study,V=i(180).NonSeriesStudy,D=i(285).createStudy,O=E.prepareStudyProperties,R=i(168),B=i(124),N=i(211).ScaleType,F=i(17).PlotRowSearchMode,W=i(63).Series,H=i(32),j=i(3).DefaultProperty,z=i(39).trackEvent,U=i(632).TimeSynchronizer,q=i(33),Y=i(4).getLogger("Chart.ChartModel"),G=i(633).MainSeriesScaleRatioProperty,K=i(634).MainSeriesPriceScaleNameProperty,Z={isSnapshot:!1,readOnly:!1,watermarkEnabled:!0,crossHairMenuEnabled:!1};c.prototype.applyPreferences=function(e){var t,i;for(t in e)void 0!==this._properties[t]&&"m_mainSeries"!==this._properties[t]&&this._properties[t].mergeAndFire(e[t]);void 0!==e.mainSeriesPriceScaleName&&this.setMainSeriesPriceScaleName(this.mainSeriesPriceScaleName(),e.mainSeriesPriceScaleName),this.m_timeScale.defaultRightOffsetProperty().setValue(e.timeScale.defaultRightOffset),this._properties.saveDefaults(),this.m_mainSeries.checkSessStudy(),i=this.m_mainSeries.sessionsStudy(),i&&i.applyPreferences(e.sessionsStudy),this.m_mainSeries.applyPreferences(e.mainSeries),this.recalculateAllPanes(),this.invalidate(new k(k.FULL_UPDATE))},c.prototype.setStudiesMetaData=function(e,t){this._studiesMetaData=e,this._studyVersioning=new R(this._studiesMetaData,t)},
c.prototype.isSnapshot=function(){return this._isSnapshot},c.prototype.currentTool=function(){return this._currentTool},c.prototype.setCurrentTool=function(e){this._currentTool=e},c.prototype.timezone=function(){return this._properties.timezone.value()},c.prototype.version=function(){return this._version},c.prototype.initConnection=function(){this._chartApi.switchTimezone(this.timezone())},c.prototype.dumpViews=function(){var e,t,i,n,o={};for(o.panes=[],e=0;e<this.m_panes.length;e++)o.panes.push(this.m_panes[e].dumpViews());for(o.dataWindow=[],t=this.dataSources(),e=0;e<t.length;e++)i=t[e],(n=i.dataWindowView())&&o.dataWindow.push(n.dump());return o},c.prototype._paneInvalidationMask=function(e,t){var i=new k,n=this.m_panes.indexOf(e);return void 0===t&&(t=k.LIGHT_UPDATE),i.invalidatePane(n,t),i},c.prototype.updatePane=function(e){var t=this._paneInvalidationMask(e);this.invalidate(t)},c.prototype.fullUpdate=function(){this.invalidate(new k(k.FULL_UPDATE))},c.prototype.lightUpdate=function(){this.invalidate(new k(k.LIGHT_UPDATE))},c.prototype.updateSource=function(e){var t=this.paneForSource(e),i=this._paneInvalidationMask(t);this.invalidate(i)},c.prototype.studiesMetaData=function(){return this._studiesMetaData},c.prototype.studyVersioning=function(){return this._studyVersioning},c.prototype.disconnect=function(){var e,t,i=this.dataSources();for(t=0;t<i.length;t++)e=i[t],e.disconnect&&e.disconnect()},c.prototype.restart=function(){var e,t,i;for(this.initConnection(),this.m_timeScale.reset(),this.m_mainSeries.restart(),e=this.dataSources(),t=0;t<e.length;t++)i=e[t],i.restart&&i!==this.m_mainSeries&&i.restart()},c.prototype.startNotStartedStudies=function(){var e,t;if(!this.m_mainSeries.isStarted())throw Error("Cannot start studies: main series is not started");for(e=this.dataSources(),t=0;t<e.length;t++)s(e[t])&&!e[t].isStarted()&&e[t].restart&&e[t]!==this.m_mainSeries&&e[t].restart()},c.prototype.updateLineTools=function(){var e,t,i=this.dataSources();for(e=0;e<i.length;e++)g(i[e])&&(t=i[e],t.tryCreateServerPoints(),t.checkAlert&&t.checkAlert())},c.prototype.realignLineTools=function(){var e,t,i=this.dataSources();for(e=0;e<i.length;e++)g(i[e])&&(t=i[e],t.calcIsActualSymbol());for(e=0;e<this.m_panes.length;e++)this.m_panes[e].invalidateSourcesCache()},c.prototype.readOnly=function(){return this._readOnly},c.prototype.properties=function(){return this._properties},c.prototype.lineCancelled=function(){return this._lineCancelled},c.prototype.crossHairMoved=function(){return this.m_crossHairSource.moved()},c.prototype.chartApi=function(){return this._chartApi},c.prototype.propertyChangeHandler=function(){this.invalidate(new k(k.LIGHT_UPDATE))},c.prototype.visibilityChangeHandler=function(){this.setSelectedSource(),this.invalidate(new k(k.LIGHT_UPDATE))},c.prototype.updateAllPaneViews=function(){var e,t;for(e=0;e<this.m_panes.length;e++)t=this.m_panes[e],t.updateAllViews()},c.prototype.mainSeries=function(){return this.m_mainSeries},c.prototype.timeScale=function(){return this.m_timeScale},c.prototype.panes=function(){
return this.m_panes},c.prototype.gridSource=function(){return this.m_gridSource},c.prototype.watermarkSource=function(){return this.m_watermarkSource},c.prototype.brandingSource=function(){return this._brandingSource},c.prototype.crossHairSource=function(){return this.m_crossHairSource},c.prototype.publishedChartsTimelineSource=function(){return null},c.prototype.barsMarksSources=function(){return this._barsMarksSources},c.prototype.width=function(){return this.m_width},c.prototype.setPaneHeight=function(e,t){e.setHeight(t),this.recalculateAllPanes(),this.invalidate(new k(k.LIGHT_UPDATE))},c.prototype.setWidth=function(e){var t,i;for(this.m_width=e,this.m_timeScale.setWidth(this.m_width),t=0;t<this.m_panes.length;++t)i=this.m_panes[t],i.setWidth(e);this.recalculateAllPanes(),this.recalcVisibleRangeStudy(this.dataSources())},c.prototype.createPane=function(e,t){var i,n;if(this._undoModel._chartWidget.isMaximizedPane()&&this._undoModel._chartWidget.toggleMaximizePane(),i=this._properties.paneProperties,t&&i.merge(t),n=new b(this.m_timeScale,i,this),"number"==typeof e&&isFinite(e)){if(e<0||e>this.m_panes.length)return void Y.logDebug("ChartModel.createPane: invalid index: "+e);this.m_panes.splice(e,0,n)}else this.m_panes.push(n);return n.onTagsChanged().subscribe(this,c.prototype.onPaneTagsChanged),n},c.prototype.removePane=function(e){var t,i;this._undoModel._chartWidget.isMaximizedPane()&&this._undoModel._chartWidget.toggleMaximizePane(),e.destroy(),t=this.m_panes.indexOf(e),-1!==t&&this.m_panes.splice(t,1),i=this.crossHairSource(),i.pane===e&&this.clearCurrentPosition(),this.invalidate(new k(k.FULL_UPDATE))},c.prototype.startScalePrice=function(e,t,i){e.startScalePrice(t,i)},c.prototype.scalePriceTo=function(e,t,i){e.scalePriceTo(t,i),this.mainSeries().priceScale().isLockScale()?this.invalidate(new k(k.LIGHT_UPDATE)):this.invalidate(this._paneInvalidationMask(e,k.LIGHT_UPDATE)),this._setScalesResetAvailable(!0)},c.prototype.endScalePrice=function(e,t){e.endScalePrice(t),this.invalidate(this._paneInvalidationMask(e,k.LIGHT_UPDATE))},c.prototype.startScrollPrice=function(e,t,i){e.startScrollPrice(t,i)},c.prototype.scrollPriceTo=function(e,t,i){e.scrollPriceTo(t,i),this.invalidate(this._paneInvalidationMask(e,k.LIGHT_UPDATE))},c.prototype.endScrollPrice=function(e,t){e.endScrollPrice(t),this.invalidate(this._paneInvalidationMask(e,k.LIGHT_UPDATE))},c.prototype.setPriceAutoScale=function(e,t,i){e.setPriceAutoScale(t,i),this.invalidate(this._paneInvalidationMask(e,k.LIGHT_UPDATE))},c.prototype.restorePriceScaleState=function(e,t,i){e.restorePriceScaleState(t,i),this.invalidate(this._paneInvalidationMask(e,k.LIGHT_UPDATE))},c.prototype.resetPriceScale=function(e,t){this._setScalesResetAvailable(!1),e.resetPriceScale(t),this.invalidate(this._paneInvalidationMask(e,k.LIGHT_UPDATE))},c.prototype.updateScales=function(e,t){this._undoModel._chartWidget._updateScalesActions()},c.prototype.startScaleTime=function(e){this.m_timeScale.startScale(e)},c.prototype.mainSeriesPriceScaleNameProperty=function(){
return this._mainSeriesPriceScaleNameProperty},c.prototype.mainSeriesPriceScaleName=function(){var e=this.paneForSource(this.m_mainSeries),t=this._mainSeriesPriceScaleName(),i=null;return"left"===t||"right"===t?i=t:e.isOverlay(this.m_mainSeries)&&(i="none"),i},c.prototype.setMainSeriesPriceScaleName=function(e,t){var i,n=this.paneForSource(this.m_mainSeries);e===t||"none"===t&&!n.actionNoScaleIsEnabled(this.m_mainSeries)||(i=n.priceScaleByName(t),this.move(this.m_mainSeries,n,i))},c.prototype.mainSeriesPriceScaleNameChanged=function(){return this._mainSeriesPriceScaleNameChanged},c.prototype.onMainSeriesPriceScaleNameChanged=function(){this._mainSeriesPriceScaleNameChanged.fire()},c.prototype.mainSeriesScaleRatioProperty=function(){return this._mainSeriesScaleRatioProperty},c.prototype.mainSeriesScaleRatioPropertyOnChanged=function(){this._mainSeriesScaleRatioProperty.listeners().fire(this._mainSeriesScaleRatioProperty)},c.prototype._mainSeriesPriceScaleName=function(){var e=this.paneForSource(this.m_mainSeries);return e.priceScaleName(e.priceScaleForSource(this.m_mainSeries))},c.prototype.mainSeriesScaleRatio=function(){var e=this.paneForSource(this.m_mainSeries);return"left"===this._mainSeriesPriceScaleName()?e.leftPriceScaleRatio():e.rightPriceScaleRatio()},c.prototype.setMainSeriesScaleRatio=function(e){var t=this.paneForSource(this.m_mainSeries);"left"===this._mainSeriesPriceScaleName()?t.applyLeftPriceScaleRatio(e):t.applyRightPriceScaleRatio(e)},c.prototype.scaleTimeTo=function(e){this.m_timeScale.scaleTo(e),this.recalculateAllPanes(),this.invalidate(new k(k.LIGHT_UPDATE)),this._setScalesResetAvailable(!0)},c.prototype.endScaleTime=function(){this.m_timeScale.endScale(),this.invalidate(new k(k.LIGHT_UPDATE)),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudy(this.dataSources())},c.prototype.startScrollTime=function(e){this.m_timeScale.startScroll(e),this._isTimeScrolling=!0},c.prototype.scrollTimeTo=function(e){this.m_timeScale.scrollTo(e),this.recalculateAllPanes(),this.updateCrossHair(),this.invalidate(new k(k.LIGHT_UPDATE)),this._setScalesResetAvailable(!0)},c.prototype.endScrollTime=function(){this.m_timeScale.endScroll(),this.invalidate(new k(k.LIGHT_UPDATE)),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudy(this.dataSources()),this._isTimeScrolling=!1},c.prototype.recalcStudyBasedLineTools=function(){this.dataSources().forEach(function(e){v(e)&&e.recalcStudyIfNeeded&&e.recalcStudyIfNeeded()})},c.prototype.recalcVisibleRangeStudy=function(e,t){void 0!==this._recalcVRTimerId&&clearTimeout(this._recalcVRTimerId);var i=this;this._recalcVRTimerId=setTimeout(function(){i._recalcVisibleRangeStudy(e,t)},500)},c.prototype._recalcVisibleRangeStudy=function(e,t){var i,n,o,r,a,l,c,h,u,d,p,_,f,m,y,g;if(!this.timeScale().isEmpty()&&(i=this.timeScale().visibleBars(),n=this.mainSeries().nearestData(i.firstBar(),F.NearestRight),o=this.mainSeries().nearestData(i.lastBar(),F.NearestLeft),r=this.mainSeries().bars().lastIndex(),a=n?n.index:void 0,l=o?o.index:void 0,
c=a===this._oldStartVisibleIndex,h=l===this._oldEndVisibleIndex,!c||!h||t))for(this._oldStartVisibleIndex=a,this._oldEndVisibleIndex=l,u={first_visible_bar_time:1e3*Math.floor(n&&n.value?n.value[TradingView.TIME_PLOT]:0),last_visible_bar_time:1e3*Math.floor(o&&o.value?o.value[TradingView.TIME_PLOT]:0),subscribeRealtime:o&&o.index===r},d=0;d<e.length;d++)if(s(e[d])){for(p=e[d],_=p.metaInfo().inputs,f=[],m=0;m<_.length;m++)u.hasOwnProperty(_[m].id)&&f.push(_[m].id);for(y=p.properties().inputs,m=0;m<f.length;m++)g=f[m],y[g].setValueSilently(u[g]);f.length>0&&y.listeners().fire(y)}},c.prototype.onResetScales=function(){return this._resetScales},c.prototype.resetTimeScale=function(){this.m_timeScale.restoreDefault(),this.recalculateAllPanes(),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudy(this.dataSources()),this.updateCrossHair(),this.invalidate(new k(k.LIGHT_UPDATE)),this._resetScales.fire(),this._setScalesResetAvailable(!1)},c.prototype.restoreTimeScaleState=function(e){this.m_timeScale.restoreState(e),this.recalculateAllPanes(),this.updateCrossHair(),this.invalidate(new k(k.LIGHT_UPDATE)),this._setScalesResetAvailable(!0)},c.prototype.restoreFactoryDefaults=function(e){e.restoreFactoryDefaults(),this.recalcVisibleRangeStudy(this.dataSources(),!0),this.mainSeries().onChartStyleChanged()},c.prototype.restoreDefaults=function(e){e.restoreDefaults(this._studyVersioning),this.recalcVisibleRangeStudy(this.dataSources(),!0),this.mainSeries().onChartStyleChanged()},c.prototype.setSelectedSource=function(e,t){if(!(this.m_selectedSource===e&&this._lastHittestData===t||e&&e.customization&&e.customization.disableSelection)){this._lastHittestData=t;var i=new k;this.m_selectedSource&&(this.m_selectedSource.updateAllViews(),TradingView.alertsDispatcher&&this.m_selectedSource.hasAlert.value()&&this.m_selectedSource.getAlert({fromCache:!0}).done(function(e){e&&e.set("selected",!1)})),this.m_selectedSource=e,this._selectedSourceChanged.fire(e),e&&(e.updateAllViews(),TradingView.alertsDispatcher&&e.hasAlert.value()&&e.getAlert({fromCache:!0}).done(function(e){e&&e.set("selected",!0)})),i.force=!0,this.invalidate(new k(k.LIGHT_UPDATE)),this.setHoveredSource(e,t)}},c.prototype.checkLineToolSelection=function(){this.m_selectedSource&&g(this.m_selectedSource)&&(this.m_selectedSource.calcIsActualSymbol(),this.m_selectedSource.isActualSymbol()||this.setSelectedSource(null))},c.prototype.onSelectedSourceChanged=function(){return this._selectedSourceChanged},c.prototype.setHoveredSource=function(e,t){if(this.m_hoveredSource!==e||this._lastHittestData!==t){this._lastHittestData=t;var i=null;this.m_hoveredSource&&(this.m_hoveredSource.updateAllViews(),i||(i=new k),TradingView.alertsDispatcher&&this.m_hoveredSource.hasAlert.value()&&this.m_hoveredSource.getAlert({fromCache:!0}).done(function(e){e&&e.set("hovered",!1)}),i.merge(this._paneInvalidationMask(this.paneForSource(this.m_hoveredSource),k.LIGHT_UPDATE))),this.m_hoveredSource=e,e&&(e.updateAllViews(),i||(i=new k),
i.merge(this._paneInvalidationMask(this.paneForSource(e),k.LIGHT_UPDATE)),TradingView.alertsDispatcher&&e.hasAlert.value()&&e.getAlert({fromCache:!0}).done(function(e){e&&e.set("hovered",!0)})),i&&this.invalidate(i)}},c.prototype.selectedSource=function(){return this.m_selectedSource},c.prototype.hoveredSource=function(){return this.m_hoveredSource},c.prototype.lastHittestData=function(){return this._lastHittestData},c.prototype.invalidate=function(e){this._invalidateHandler&&this._invalidateHandler(e)},c.prototype.dataSources=function(){var e,t,i,n=[];for(n.push(this.m_crossHairSource),e=0;e<this.m_panes.length;++e)for(t=this.m_panes[e].dataSources(),i=0;i<t.length;i++)n.push(t[i]);return n},c.prototype.orderedDataSources=function(e){var t,i,n=[];for(n.push(this.m_crossHairSource),t=0;t<this.m_panes.length;t++)i=this.m_panes[t].orderedSources().slice(),e&&i.reverse(),n=n.concat(i);return n},c.prototype.dataSourceForId=function(e){var t,i;for(i=0;i<this.m_panes.length;++i)if(t=this.m_panes[i].dataSourceForId(e))return t;return null},c.prototype.children=function(e,t){return this.dataSources().filter(function(i){return(!0!==t||!s(i)||!i.isChildStudy())&&i.ownerSource()===e})},c.prototype.setAndSaveCurrentPosition=function(e,t,i,n){this.m_crossHairSource.saveOriginCoord(e,t),this.setCurrentPosition(e,t,i,n)},c.prototype.setCurrentPosition=function(e,t,i,n){var o,r,s,a,l,c,h,u,d,p,_,f,m,g,v,S=NaN,b=Math.round(this.m_timeScale.coordinateToIndex(e));if(i&&(o=i.defaultPriceScale(),o.isEmpty()||(r=i.mainDataSource().firstValue(),S=o.coordinateToPrice(t,r))),(this._lineBeingCreated||y(this.currentTool()))&&(S=this._magnet.align(S,b,i)),this._isTimeScrolling)return void this.m_crossHairSource.setPosition(this.m_crossHairSource.index,S,i);for(this.m_crossHairSource.setOnHoveredChartWidget(!0),this.m_crossHairSource.setPosition(b,S,i),this.m_crossHairSource.dataWindowView().update(),s=this.m_panes,a=s.length;a--;)for(l=s[a].dataSources(),c=l.length;c--;)h=l[c].dataWindowView(),h&&h.update(),(u=l[c].legendView())&&u.update();this._lineBeingCreated?(this._lineBeingCreated.setLastPoint({index:b,price:S},n),this._lineBeingCreated.updateAllViews(),this.invalidate(new k(k.LIGHT_UPDATE))):this.crossHairSource().startMeasurePoint()?this.invalidate(new k(k.LIGHT_UPDATE)):this.invalidate(new k(k.UPDATE_CURSOR_ONLY)),this._isSettingsExternalPosition||(d=this._undoModel._chartWidget,d._chartWidgetCollection&&(p=this.mainSeries(),(_=p.syncModel())&&(f=this.m_timeScale.points().roughTime(b,_.projectTime.bind(_)),m={timeStamp:f},g=i.mainDataSource(),g instanceof W&&(m.price=S,m.symbol=g.symbol()),m.syncModel=_,v=this._lineBeingCreated||this._linePointBeingEdited||this._sourceBeingMoved,v=v&&H.drawOnAllCharts().value(),d._chartWidgetCollection.syncCrosshair(m,d,v,n))))},c.prototype.clearCurrentPosition=function(){var e,t,i,n,o,r,s,a=this.crossHairSource();for(a.clearPosition(),a.dataWindowView().update(),e=this.m_panes,t=e.length;t--;)for(i=e[t].dataSources(),n=i.length;n--;)o=i[n].dataWindowView(),o&&o.update(),
(r=i[n].legendView())&&r.update();this.invalidate(new k(k.UPDATE_CURSOR_ONLY)),s=this._undoModel._chartWidget,s._chartWidgetCollection&&s._chartWidgetCollection.syncCrosshair(NaN,s)},c.prototype.onSyncScrollNeeded=function(e){var t,i,n,o=this._undoModel._chartWidget;o._chartWidgetCollection&&(t=this.mainSeries(),(i=t.syncModel())&&(n=1e3*this.m_timeScale.points().roughTime(e,i.projectTime.bind(i)),o._chartWidgetCollection.syncScroll(n,this)))},c.prototype.gotoTime=function(e,t){function i(){return p.tickMarks().indexToTime(p.tickMarks().minIndex).valueOf()-e}function n(t){var n,o,r,s,a;if(i()<0){for(n=p.tickMarks().nearestIndex(e),o=h(_.bars().lastIndex()),n=Math.min(n,o),r=p.tickMarks().indexToTime(n).valueOf();r<e&&n<o;)n++,r=p.tickMarks().indexToTime(n).valueOf();return s=p.visibleBars(),a=s.lastBar()-s.firstBar(),!t&&s.contains(n)||(p.zoomToBarsRange(n-a/2,n+a/2),_.requestMoreData()),{timestamp:p.indexToTimePoint(n)}}}var o,r,s,a,l,c,u,d,p=this.timeScale(),_=this.mainSeries();if(t&&t.model&&(o=_.syncModel())&&(r=this._createSyncPoint(t.model.mainSeries().syncModel(),o),e=1e3*r.sourceTimeToTargetTime(e/1e3)),t=t||{centerIfVisible:!0},e)this._scrollingState&&this._scrollingState.deferred.reject(),s=$.Deferred(),this._scrollingState={targetDate:e,deferred:s,centerIfVisible:t.centerIfVisible};else{if(!this._scrollingState)return Y.logError("scrollTo called without an argument"),$.Deferred().reject().promise();e=this._scrollingState.targetDate,s=this._scrollingState.deferred}return a=n(this._scrollingState.centerIfVisible),a||(l=p.tickMarks().minIndex,c=p.visibleBars(),u=c.lastBar()-c.firstBar(),_.endOfData()?(p.zoomToBarsRange(l-u/2,l+u/2),a={timestamp:p.indexToTimePoint(l),eod:!0}):(d=this.timeScale().tickMarks().estimateLeft(e),_.requestMoreData(Math.ceil(d+u/2)))),a&&(this.fullUpdate(),this._scrollingState=null,s.resolve(a)),s.promise()},c.prototype._createSyncPoint=function(e,t){var i,n,o=this._syncPointCache[e.uniqueId()];if(o){if(i=o[t.uniqueId()])return i}else this._syncPointCache[e.uniqueId()]={};return n=new U(e,t),this._syncPointCache[e.uniqueId()][t.uniqueId()]=n,n},c.prototype.setExternalPosition=function(e,t){var i,n,o,r,s,a,l,c,h,u,d,p,_,f=this.crossHairSource();if(f.setOnHoveredChartWidget(!1),!Number.isNaN(e)&&isNumber(e.timeStamp)&&(n=this.mainSeries(),(o=n.syncModel())&&(r=this._createSyncPoint(e.syncModel,o),s=r.sourceTimeToTargetTime(e.timeStamp),i=this.m_timeScale.points().roughIndex(s,o.distance.bind(o)))),this.mainSeries().symbol()===e.symbol)return this._isSettingsExternalPosition=!0,a=this.paneForSource(this.mainSeries()),l=this.m_timeScale.indexToCoordinate(i),c=a.mainDataSource().firstValue(),h=this.mainSeries().priceScale().priceToCoordinate(e.price,c,!0),this.setCurrentPosition(l,h,a,t||{}),f.setOnHoveredChartWidget(!1),void delete this._isSettingsExternalPosition;for(isFinite(i)?f.setPosition(i,NaN,null):(f.clearPosition(),f.dataWindowView().update()),u=this.dataSources(),d=u.length;d--;)p=u[d].dataWindowView(),p&&p.update(),(_=u[d].legendView())&&_.update()
;this.invalidate(new k(k.UPDATE_CURSOR_ONLY))},c.prototype.updateCrossHair=function(){this.m_crossHairSource.update()},c.prototype.updateTimeScale=function(e,t,i,n,o,r){var s,a,l;if(r)for(this.m_timeScale.reset(),s=this.dataSources(),a=0;a<s.length;a++)s[a].clearData&&s[a].clearData();if(n.length>0)for(s=this.dataSources(),a=0;a<s.length;a++)s[a].moveData&&s[a].moveData(n);this.m_timeScale.update(e,t,i,o),l="ChartModel.prototype.updateTimeScale("+e+","+t+","+i.length+","+n.length+","+o.length+","+r+")",l+="TimeScale: {first:"+this.m_timeScale.m_points.firstIndex()+",last:"+this.m_timeScale.m_points.lastIndex()+"}",Y.logDebug(l),this.recalculateAllPanes(),this.invalidate(new k(k.LIGHT_UPDATE))},c.prototype.updateTimeScaleBaseIndex=function(e){var t,i,n,o,r,s,a=this.mainSeries().bars();a.isEmpty()||(t=this.timeScale(),i=t.baseIndex(),n=h(a.lastIndex()),o=t.visibleBars(),null!==o&&(r=o.contains(i),e&&e.index>0&&!r&&(s=n-i,t.setRightOffset(t.rightOffset()-s))),t.setBaseIndex(n))},c.prototype.recalculatePane=function(e){e&&e.recalculate()},c.prototype.paneForSource=function(e){for(var t=this.m_panes.length-1;t>=0;t--)if(-1!==this.m_panes[t].dataSources().indexOf(e))return this.m_panes[t];return e instanceof L?this.paneForSource(this.m_mainSeries):null},c.prototype.recalculateAllPanes=function(){for(var e=0;e<this.m_panes.length;++e)this.m_panes[e].recalculate();this.updateAllPaneViews()},c.prototype._invalidateBarColorerCaches=function(){var e,t,i=this.dataSources();for(e=0;e<i.length;++e)(t=i[e])instanceof W&&t.invalidateBarColorerCache()},c.prototype.addStrategySource=function(e){~this.strategySources.indexOf(e)||(this.strategySources.push(e),this.strategySources.change.fire())},c.prototype.removeStrategySource=function(e){var t,i,n=this.strategySources.indexOf(e);~n&&(t=this.strategySources.splice(n,1),t[0]===this._activeStrategySource.value()&&this.unsetActiveStrategySource(),this.strategySources.length>0&&(i=this.strategySources[this.strategySources.length-1],this.setActiveStrategySource(i)),this.strategySources.change.fire())},c.prototype.setActiveStrategySource=function(e){~this.strategySources.indexOf(e)&&this._activeStrategySource.setValue(e)},c.prototype.unsetActiveStrategySource=function(){this._activeStrategySource.setValue(null)},c.prototype.activeStrategySource=function(){return this._activeStrategySource},c.prototype.insertStudy=function(e,t,i,n,o){var r,s,a,c;return null!==n&&void 0!==n||(n=this.mainSeries()),r=["Study_ESD$TV_SPLITS@tv-scripting","Study_ESD$TV_DIVIDENDS@tv-scripting","Study_ESD$TV_SPLITS@tv-scripting","Volume@tv-basicstudies","Sessions@tv-basicstudies"],-1===r.indexOf(e.id)&&z("studies","Study_"+e.id),s=null,i||e.is_price_study?s=this.paneForSource(n):(s=this.createPane(),t&&t.paneSize&&s.setPaneSize(t.paneSize)),"Compare@tv-basicstudies"===e.id&&(z("compare","symbol:"+t.inputs.symbol),this.m_mainSeries.priceScale().setMode({log:!1,percentage:!0})),a=O(e,t,s,this.studyVersioning(),n),c=D(this,a,n,e),this._recalcVisibleRangeStudy([c],!0),c.start(),
c.childStudyByRebind().subscribe(null,function(){z("SOS","Apply SOS","Rebind SOS")}),s.addDataSource(c,l(s,n,c.metaInfo(),i,o)),c.properties().linkedToSeries&&c.properties().linkedToSeries.value()&&c.setOwnerSource(this.mainSeries()),this.recalculatePane(s),this.invalidate(new k(k.FULL_UPDATE)),this._invalidateBarColorerCaches(),this.recalcVisibleRangeStudy(this.dataSources(),!0),this._studyInserted.fire(c),c},c.prototype.studyInserted=function(){return this._studyInserted},c.prototype.replaceStudyStub=function(e,t){var i,n,o,r=this.paneForSource(e);return null!==r&&(i=e.isNoScale()?null:e.priceScale(),n=e.zorder(),o=e.ownerSource(),r.insertDataSource(t,i,n),t.setOwnerSource(o),this.panes().forEach(function(i){i.dataSources().forEach(function(i){i._ownerSource===e&&i.setOwnerSource(t)})}),this.removeSource(e),t.start(),this.recalculatePane(r),this.invalidate(new k(k.FULL_UPDATE)),!0)},c.prototype.insertStudyStub=function(e){var t=this.mainSeries(),i=this.paneForSource(t),n=new B(this,null,e);return i.addDataSource(n,null),this.recalculatePane(i),this.invalidate(new k(k.FULL_UPDATE)),n},c.prototype.removeStudyStub=function(e){var t=this.dataSourceForId(e);return void 0===t?(Y.logNormal("StudyStub id="+e+" is not found in chart model"),!1):(this.removeSource(t),!0)},c.prototype.detachSource=function(e,t){var i=this.paneForSource(e);if(i)return i.removeDataSource(e),i.isEmpty()?(this._lineBeingCreated&&i===this._paneBeingCreatedLineOn&&this.cancelCreatingLine(),this.removePane(i,t),!0):(this.invalidate(new k(k.FULL_UPDATE)),this._alertsList&&this._alertsList.trigger("reset"),!1)},c.prototype.removeSource=function(e,t){var i,n,o,r;if(e===this.m_selectedSource&&this.setSelectedSource(null),e===this._sourceBeingMoved&&(this._sourceBeingMoved=null,this._linePointBeingMoved=null),e===this._lineBeingEdited&&(this._lineBeingEdited=null),e===this._lineBeingCreated&&(this._lineBeingCreated=null),e.stop&&e.stop(),i=this.detachSource(e,t),e.metaInfo&&e.metaInfo()&&"Compare@tv-basicstudies"===e.metaInfo().id){for(n=this.paneForSource(this.m_mainSeries),o=n.dataSources(),r=0;r<o.length;r++)if(o[r].metaInfo&&"Compare@tv-basicstudies"===o[r].metaInfo().id)return;this.m_mainSeries.priceScale().setMode({percentage:!1})}return this.invalidate(new k(k.FULL_UPDATE)),this._invalidateBarColorerCaches(),e.linkKey&&H.removeLineTool({model:this,linkKey:e.linkKey}),s(e)&&e.isChildStudy()&&e.source().unsetChild(e),e.destroy&&e.destroy(),i},c.prototype._unmergeAvailable=function(e){return TradingView.isInherited(e.constructor,M)&&!TradingView.isInherited(e.constructor,V)||e===this.m_mainSeries},c.prototype.isMergeUpAvailableForSource=function(e){return!!this._unmergeAvailable(e)&&this.paneForSource(e)!==this.panes()[0]},c.prototype.mergeSourceUp=function(e){var t,i,n,o;this.isMergeUpAvailableForSource(e)&&(t=this.paneForSource(e),i=this.panes().indexOf(t),n=this.panes()[i-1],o=n.findSuitableScale(e),this.move(e,n,o))},c.prototype.isMergeDownAvailableForSource=function(e){var t,i;return!!this._unmergeAvailable(e)&&(t=this.paneForSource(e),
i=this.panes(),t!==i[i.length-1])},c.prototype.mergeSourceDown=function(e){var t,i,n,o;this.isMergeDownAvailableForSource(e)&&(t=this.paneForSource(e),i=this.panes().indexOf(t),n=this.panes()[i+1],o=n.findSuitableScale(e),this.move(e,n,o))},c.prototype.isUnmergeAvailableForSource=function(e){var t,i;return!!this._unmergeAvailable(e)&&(t=this.paneForSource(e),i=t.dataSources().filter(function(e){return TradingView.isInherited(e.constructor,A)&&e.showInObjectTree()}),i.length>1)},c.prototype.unmergeSourceUp=function(e){var t,i,n,o;this.isUnmergeAvailableForSource(e)&&(t=this.paneForSource(e),i=this.panes().indexOf(t),n=this.createPane(i),o=n.findSuitableScale(e),this.move(e,n,o))},c.prototype.unmergeSourceDown=function(e){var t,i,n,o;this.isUnmergeAvailableForSource(e)&&(t=this.paneForSource(e),i=this.panes().indexOf(t),n=this.createPane(i+1),o=n.findSuitableScale(e),this.move(e,n,o))},c.prototype.isLeftPriceScaleVisible=function(){return this._properties.scalesProperties.showLeftScale.value()},c.prototype.isRightPriceScaleVisible=function(){return this._properties.scalesProperties.showRightScale.value()},c.prototype.setLeftPriceScaleVisible=function(e){this._properties.scalesProperties.showLeftScale.value()!==e&&this._properties.scalesProperties.showLeftScale.setValue(e)},c.prototype.setRightPriceScaleVisible=function(e){this._properties.scalesProperties.showRightScale.value()!==e&&this._properties.scalesProperties.showRightScale.setValue(e)},c.prototype.setPriceScaleVisibility=function(e,t){"left"===e&&this.setLeftPriceScaleVisible(t),"right"===e&&this.setRightPriceScaleVisible(t)},c.prototype.move=function(e,t,i){var n,o,r,s,a=this.children(e,!0),l=this.paneForSource(e),c=t?t.priceScaleName(i):"right";if(l===t){for(n=t.priceScaleByName(c),o=0;o<a.length;o++)t.move(a[o],n);t.move(e,n)}else{for(r=t||this.createPane(),s=r.priceScaleByName(c),o=0;o<a.length;o++)this.detachSource(a[o]);for(this.detachSource(e),r.addDataSource(e,s),o=0;o<a.length;o++)r.addDataSource(a[o],s)}this._alertsList&&this._alertsList.trigger("reset"),e===this.m_mainSeries&&this.onMainSeriesPriceScaleNameChanged(),this.invalidate(new k(k.FULL_UPDATE))},c.prototype.isSingleInstanceLineTool=function(e){return"LineStudyMtpRiskReward"===e||"LineStudyMtpAnalysis"===e},c.prototype._externalTimeStamp=function(e){var t=this.mainSeries().syncModel();return this.m_timeScale.points().roughTime(e,t&&t.projectTime.bind(t))},c.prototype.createLineTool=function(e,t,i,n,o){var r,s,a,l,c,h,d,p,_,f,g,v;return y(i)?(this.isSingleInstanceLineTool(i)&&this._undoModel.removeAllDrawingTools(i),"LineToolExecution"!==i&&z("drawings","Study_Drawing_"+i),n&&(r=n.state(),s=TradingView.factoryDefaults("linetool"),a=i.toLowerCase(),TradingView.merge(s,TradingView.factoryDefaults(a)),n=TradingView[i].prototype.createPropertiesObject(a,s),n.merge(r)),l=m(i,this,n,null,e.mainDataSource()),n||(n=l.properties()),c=!l.linkKey&&!o,H.drawOnAllCharts().value()?l.linkKey=o||q.randomHash():l.linkKey=o,l.toolname=i,l.setOwnerSource(e.mainDataSource()),h=e.defaultPriceScale(),
e.addDataSource(l,h),l.isFixed()?(p=e.mainDataSource().firstValue(),_=this.m_timeScale.indexToCoordinate(t.index),f=h.priceToCoordinate(t.price,p),d=l.addFixedPoint(new u(_,f))):(g=l.constructor,g.skipMagnetting||(t.price=this._magnet.align(t.price,t.index,e)),d=l.addPoint(t)),d||(this._lineBeingCreated=l,this._paneBeingCreatedLineOn=e),c&&l.enableCurrentIntervalVisibility(),this.invalidate(new k(k.FULL_UPDATE)),o||!H.drawOnAllCharts().value()||l.properties().singleChartOnly||(v=this._externalTimeStamp(t.index),H.createLineTool({point:{price:t.price,timeStamp:v},linetool:i,properties:n,symbol:this.mainSeries().symbol(),model:this,linkKey:l.linkKey})),l):null},c.prototype.lineBeingCreated=function(){return this._lineBeingCreated},c.prototype.paneBeingCreatedLineOn=function(){return this._paneBeingCreatedLineOn},c.prototype.coninueCreatingLine=function(e,t,i,n){var o,r,s,a,l,c=this.paneForSource(this._lineBeingCreated);return e.price=this._magnet.align(e.price,e.index,c),o=this._lineBeingCreated.addPoint(e,t,i),r=this._lineBeingCreated,this._lineBeingCreated.updateAllViews(),s=new k(k.LIGHT_UPDATE),a=null,o&&(a={points:this._lineBeingCreated._timePoint,interval:this.mainSeries().interval()},this._paneBeingCreatedLineOn=null,this._lineBeingCreated=null,s.force=!0),this.invalidate(s),n||!H.drawOnAllCharts().value()||r.properties().singleChartOnly||(l=this._externalTimeStamp(e.index),H.continueLineTool({point:{price:e.price,timeStamp:l},envState:t,finalState:a,model:this})),o},c.prototype.cancelCreatingLine=function(){if(this._lineBeingCreated){var e=this._lineBeingCreated;this.removeSource(this._lineBeingCreated),this._lineBeingCreated=null,this._lineCancelled.fire(),H.drawOnAllCharts().value()&&!e.properties().singleChartOnly&&H.cancelLineTool({model:this})}},c.prototype.startChangingLinetool=function(e,t,i,n){var o,r,s;this._lineBeingEdited=e,this._linePointBeingEdited=i,this._lineBeingEdited.startChanging(i,t),o=this.paneForSource(e),t.price=this._magnet.align(t.price,t.index,o),this._lineBeingEdited.startDragPoint&&this._lineBeingEdited.startDragPoint(i,t),this._lineBeingEdited.setPoint(i,t,n),this._lineBeingEdited.updateAllViews(),r=this._paneInvalidationMask(o,k.LIGHT_UPDATE),r.force=!0,this.invalidate(r),e.linkKey&&!e.properties().singleChartOnly&&(s=this._externalTimeStamp(t.index),H.startChangingLineTool({linkKey:e.linkKey,model:this,symbol:this.mainSeries().symbol(),point:{price:t.price,timeStamp:s},pointIndex:i,envState:n}))},c.prototype.lineBeingEdited=function(){return this._lineBeingEdited},c.prototype.linePointBeingEdited=function(){return this._linePointBeingEdited},c.prototype.changeLinePoint=function(e,t){var i,n,o,r,s,a=this.paneForSource(this._lineBeingEdited);void 0!==e.x&&void 0!==e.y?(o=this._lineBeingEdited.priceScale(),r=a.mainDataSource().firstValue(),i=o.coordinateToPrice(e.y,r),n=Math.round(this.timeScale().coordinateToIndex(e.x)),i=this._magnet.align(i,n,a),this._lineBeingEdited.setPoint(this._linePointBeingEdited,{price:i,index:n
},t)):this._lineBeingEdited.setPoint(this._linePointBeingEdited,e,t),this._lineBeingEdited.updateAllViews(),this.invalidate(new k(k.LIGHT_UPDATE)),this._lineBeingEdited.linkKey&&!this._lineBeingEdited.properties().singleChartOnly&&(s=this._externalTimeStamp(n),H.changeLineTool({linkKey:this._lineBeingEdited.linkKey,model:this,symbol:this.mainSeries().symbol(),point:{price:i,timeStamp:s},envState:t}))},c.prototype.endChangingLinetool=function(e){var t,i,n=this._lineBeingEdited;this._lineBeingEdited.endChanging(!1,e),this._lineBeingEdited=null,this._linePointBeingEdited=null,t=new k(k.LIGHT_UPDATE),t.force=!0,this.invalidate(t),i={points:n._timePoint,interval:this.mainSeries().interval()},n.linkKey&&!n.properties().singleChartOnly&&H.finishChangingLineTool({model:this,linkKey:n.linkKey,symbol:this.mainSeries().symbol(),finalState:i})},c.prototype.startMovingSource=function(e,t,i){var n,o,r;this._sourceBeingMoved=e,this._linePointBeingMoved=i,this._sourceBeingMoved.startMoving(t,i),n=this.paneForSource(this._sourceBeingMoved),o=this._paneInvalidationMask(n,k.LIGHT_UPDATE),o.force=!0,this.invalidate(o),e.linkKey&&!e.properties().singleChartOnly&&(r=this._externalTimeStamp(t.index),H.startMovingLineTool({linkKey:e.linkKey,model:this,symbol:this.mainSeries().symbol(),point:{price:t.price,timeStamp:r}}))},c.prototype.sourceBeingMoved=function(){return this._sourceBeingMoved},c.prototype.moveSource=function(e){if(this._sourceBeingMoved.move(e,this._linePointBeingMoved),this.invalidate(new k(k.LIGHT_UPDATE)),this._sourceBeingMoved.linkKey&&!this._sourceBeingMoved.properties().singleChartOnly){var t=this._externalTimeStamp(e.index);H.moveLineTool({linkKey:this._sourceBeingMoved.linkKey,model:this,point:{price:e.price,timeStamp:t}})}},c.prototype.endMovingSource=function(e){var t,i,n=this._sourceBeingMoved,o=this.paneForSource(this._sourceBeingMoved);this._sourceBeingMoved.endMoving(e),this._sourceBeingMoved=null,this._linePointBeingMoved=null,t=this._paneInvalidationMask(o,k.LIGHT_UPDATE),t.invalidateAll(k.LIGHT_UPDATE),t.force=!0,this.invalidate(t),g(n)&&(i={points:n._timePoint,interval:this.mainSeries().interval()},n.linkKey&&!n.properties().singleChartOnly&&H.finishMovingLineTool({linkKey:n.linkKey,model:this,finalState:i}))},c.prototype.finishLineTool=function(e){var t=this.lineBeingCreated();t&&(t.finish&&t.finish(),!e&&H.drawOnAllCharts().value()&&t.linkKey&&!t.properties().singleChartOnly&&H.finishLineTool({linkKey:t.linkKey,model:this}))},c.prototype.calculateDefaultTags=function(){var e,t,i=[],n=this.dataSources();for(e=0;e<n.length;e++)t=n[e],t.tags&&(i=i.concat(t.tags()));return i},c.prototype.changeZOrder=function(e,t){this.paneForSource(e).changeZOrder(e,t),this.invalidate(new k(k.FULL_UPDATE))},c.prototype.sendToBack=function(e){this.paneForSource(e).sendToBack(e),this.invalidate(new k(k.FULL_UPDATE))},c.prototype.bringToFront=function(e){this.paneForSource(e).bringToFront(e),this.invalidate(new k(k.FULL_UPDATE))},c.prototype.onTagsChanged=function(){return this._tagsChanged},
c.prototype.onPaneTagsChanged=function(){this._tagsChanged.fire()},c.prototype.setTimeViewport=function(e,t){this.timeScale().zoomToBarsRange(e,t),this.recalculateAllPanes(),this.invalidate(new k(k.LIGHT_UPDATE))},c.prototype.zoomToViewport=function(e,t,i,n,o){var s,a,l;this.setTimeViewport(e,t),s=Math.min(i,n),a=Math.max(i,n),l=o.defaultPriceScale(),l.isPercentage()||l.setMode({autoScale:!1}),l.isLog()&&(s=l.priceToLogical(s),a=l.priceToLogical(a)),l.setPriceRange(new r(s,a)),this.recalculateAllPanes(),this.invalidate(this._paneInvalidationMask(o,k.LIGHT_UPDATE)),this._setScalesResetAvailable(!0)},c.prototype.clearAllStudies=function(){var e,t=this.dataSources();for(e=0;e<t.length;e++)t[e].clearData&&t[e].clearData()},c.prototype.allStudies=function(){return this._getAllSources(s)},c.prototype.allLineTools=function(){return this._getAllSources(g)},c.prototype.getStudyById=function(e){var t=this.dataSourceForId(e);return null!==t&&s(t)?t:null},c.prototype.getLineToolById=function(e){var t=this.dataSourceForId(e);return null!==t&&g(t)?t:null},c.prototype._getAllSources=function(e){var t,i,n,o,r,s,a=[],l=this.m_panes,c=l.length;for(t=0;t<c;++t)for(i=l[t],n=i.dataSources(),o=n.length,r=0;r<o;++r)s=n[r],e(s)&&a.push(s);return a},c.prototype.getStudyById=function(e){var t=this.dataSourceForId(e);return t instanceof M?t:null},c.prototype.backgroundColor=function(){return this._properties.paneProperties.background._value},c.prototype.backgroundCounterColor=function(){return"black"===_(p(this.backgroundColor()),150)?"white":"black"},c.prototype.isDark=function(){return"white"===this.backgroundCounterColor()},c.prototype.canZoomIn=function(){return this.m_timeScale.canZoomIn()&&n.enabled("chart_zoom")},c.prototype.canZoomOut=function(){return this.m_timeScale.canZoomOut()&&n.enabled("chart_zoom")},c.prototype.updateAllVolumeStudies=function(){var e,t,i,n,o,r,a=this.m_panes;for(e=a.length;e--;)for(t=!1,i=a[e],n=i.dataSources(),o=n.length;o--;)r=n[o],s(r)&&"Volume"===r.metaInfo().shortId&&(r.updateAllViews(),t||(this.updatePane(i),t=!0))},c.prototype.alertsList=function(){return this._alertsList},c.prototype.setAlertsStudiesList=function(e){this._alertsStudiesList=$.map($.grep(e,function(e){var t,i=e.plots||[];for(t=0;t<i.length;t++)if("line"===i[t].type)return!0;return!1}),function(e){return e.id})},c.prototype.canCreateAlertForDataSource=function(e){if(!n.enabled("alerts"))return!1},c.prototype.setInterval=function(e,t){var i=setInterval(e,t);return this._modelIntervals.push(i),i},c.prototype.clearInterval=function(e){clearInterval(e);var t=this._modelIntervals.indexOf(e);t>-1&&this._modelIntervals.splice(t,1)},c.prototype.clearIntervals=function(){for(var e=0;e<this._modelIntervals.length;e++)clearInterval(this._modelIntervals[e]);this._modelIntervals=[]},c.prototype.destroy=function(){var e;for(e=0;e<this._barsMarksSources.length;e++)this._barsMarksSources[e].destroy();for(this.clearIntervals(),H.hideAllDrawings().unsubscribe(this,this.visibilityChangeHandler),this.resetDeferredStudies(),
this._brandingSource&&this._brandingSource.destroy(),e=0;e<this._barsMarksSources.length;e++)this._barsMarksSources[e].destroy();for(e=0;e<this.m_panes.length;e++)this.m_panes[e].destroy();this.m_panes.length=0},c.prototype.countUserStudies=function(e){var t,i,n,o,r,a,l=0;for(e=e||{},t=0;t<this.m_panes.length;t++)for(i=this.m_panes[t].dataSources(),n=0;n<i.length;n++)if(o=i[n],s(o)&&o.showInObjectTree()){if(r=o.metaInfo&&o.metaInfo()){if(a=r.id,e.dontCountVolume&&"Volume@tv-basicstudies"===a)continue;if(e.dontCountCompare&&"Compare@tv-basicstudies"===a)continue;if(e.dontCountOverlay&&"Overlay@tv-basicstudies"===a)continue}l++}return l},c.prototype.isJustClonedChart=function(){return this._undoModel.isJustClonedChart()},c.prototype.undoModel=function(){return this._undoModel},c.prototype.copyToOtherCharts=function(e){var t,i,n,o;e.linkKey=e.linkKey||q.randomHash(),t=this,i=e.state(),n=this.mainSeries(),(o=n.syncModel())&&(i.points=e._timePoint.map(function(e){var i=t.timeScale().timePointToIndex(e.time_t)+e.offset;return{price:e.price,timeStamp:t._externalTimeStamp(i)}}),i.linetool=e.getType(),i.model=this,i.symbol=this.mainSeries().symbol(),i.finalState={points:e._timePoint,interval:this.mainSeries().interval()},H.copyLineTool(i))},c.prototype.restoreSource=function(e,t,i,n,o){var r,s,a,l,c,h,u,d;return r=e?this.createPane(t):this.panes()[t],a=n.type,s=a.toLowerCase().startsWith("study")?r._restoreStudy(n):r._restoreLineTool(n),l=s.ownerSource()?s.ownerSource().priceScale():r.priceScaleByName(o),l?(s.setPriceScale(l),l.addDataSource(s)):(l=new C(this.properties().scalesProperties),l.setHeight(r.m_height),c=s.metaInfo&&"Volume@tv-basicstudies"===s.metaInfo().id,h=c?.75:r.m_rightPriceScale.topMargin(),u=c?0:r.m_rightPriceScale.bottomMargin(),l.setTopMargin(h),l.setBottomMargin(u),l.addDataSource(s),s.setPriceScale(l),s._isOverlay=!0),d=null,n.ownerSource&&(d=r.dataSourceForId(n.ownerSource)),s.setOwnerSource(d),s.setPriceScale(l),s.start(),s.restore&&s.restore(),e&&r.restoreState(i),this.recalculateAllPanes(),this.mainSeries().invalidateBarColorerCache(),this.invalidate(new k(k.FULL_UPDATE,!0)),s.linkKey&&H.restoreLineTool({model:this,linkKey:s.linkKey,state:{restorePane:e,paneIndex:t,paneState:i,sourceState:n,priceScaleName:o}}),s},c.prototype.restoreLineToolState=function(e,t){e.restorePoints(t.points,t.indexes||[]),e.properties().merge(t.state),e.restoreData&&e.restoreData(t),e.createServerPoints(),this.invalidate(new k(k.FULL_UPDATE)),e.linkKey&&H.restoreLineToolState({model:this,linkKey:e.linkKey,state:t})},c.prototype.createBrandingSource=function(){this._brandingSource=new I(this)},c.prototype.onChartThemeLoaded=function(){return this._chartThemeLoaded},c.prototype.chartThemeLoaded=function(){this._chartThemeLoaded.fire()},c.prototype.selectBarMode=function(){return this.m_crossHairSource.selectBarMode()},c.prototype.toggleSelectBarMode=function(){this.m_crossHairSource.toggleSelectBarMode()},c.prototype.onBarSelected=function(){return this.m_crossHairSource.onBarSelected()},
c.prototype.isSeriesStyleSupported=function(e){return this.m_mainSeries.isStyleSupported(e)},c.prototype.getStudyShiftColorStartOffset=function(){return this._studyShiftColorStartOffset},c.prototype.setStudyShiftColorStartOffset=function(e){this._studyShiftColorStartOffset=e},c.prototype.setPriceAutoScaleForAllMainSources=function(){var e,t;for(e=0;e<this.m_panes.length;++e)null===(t=this.m_panes[e].mainDataSource())||t.priceScale().isLockScale()||t.priceScale().setMode({autoScale:!0})},c.prototype.isInReplay=function(){return this.m_mainSeries.isInReplay()},c.prototype.switchToReplay=function(e){},c.prototype.switchToRealtime=function(){},c.prototype.defaultResolutions=function(){return this.chartApi().chartApi().defaultResolutions()},c.prototype._setScalesResetAvailable=function(e){this._isScalesResetAvailable!==e&&(this._isScalesResetAvailable=e,this._isScalesResetAvailableChanged.fire())},c.prototype.isScalesResetAvailable=function(){return this._isScalesResetAvailable},c.prototype.isScalesResetAvailableChanged=function(){return this._isScalesResetAvailableChanged},e.exports=c}).call(t,i(8),i(5),i(16),i(48).PriceRange)},function(e,t,i){"use strict";function n(e,t){this.array=[];for(var i in e)e[i].key=i,this.array.push(e[i]);this.rearrange(t)}n.prototype.rearrange=function(e){if("function"!=typeof e)throw Error("sort param is not a function");return this.array.sort(e)},n.byValue=function(e){return function(e,t){return e-t}},n.byField=function(e){return function(t,i){return t[e]>i[e]?1:t[e]<i[e]?-1:t[e]===i[e]?0:void 0}},n.byOrder=function(e){return function(t,i){return e.indexOf(t.key)-e.indexOf(i.key)}},e.exports=n},function(e,t,i){"use strict";function n(){s.call(this)}function o(e,t){this._constructor="LineToolFibRetracement";var r=t||this.createPropertiesObject("linetoolfibretracement");a.call(this,e,r),this.version=o.version,this._properties._stateVersion=1,e._fibRetracementLabelsCache||(e._fibRetracementLabelsCache=new n),i.e(0).then(function(e){var t=i(753).FibRetracementPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var r=i(19),s=i(68),a=i(0).LineDataSource,l=i(2).propertyPages;inherit(n,s),n.prototype.levelsCount=function(){return o.LevelsCount},inherit(o,a),o.version=2,o.LevelsCount=24,o.prototype.levelsCount=function(){return o.LevelsCount},o.prototype.stop=function(){a.prototype.stop.call(this),this._model._fibRetracementLabelsCache.removeSource(this.id())},o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Fib Retracement"},o.prototype.name=function(){return"Fib Retracement"},o.prototype.migrateVersion=function(e,t,i){1===e&&this.properties().extendLines.setValue(!0)},o.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},o.prototype.createPropertiesObject=function(e,t,i){return new r(e,t,i,{range:[1,24],names:["coeff","color","visible"]})},o.prototype.getStylesPropertyPage=function(){return l.LineToolFibRetracementStylesPropertyPage},
t.LineToolFibRetracement=o},function(e,t,i){"use strict";(function(t){function i(e){t.call(this,""),this.subscribe(this,i.prototype.checkSelfColor),this.reloadProperties(e)}inherit(i,t),i.prototype.reloadProperties=function(e){for(;this._childs.length>0;)this.removeProperty(this._childs[0]);this._initValues=[];for(var t=0;t<e.length;++t)this._initValues.push(e[t].defaultValue),this.addChild(t,e[t].property);this.checkSelfColor()},i.prototype.setValue=function(e,i){if(this._value!==e||i){var n=this;this._childs.forEach(function(t){n[t].setValue(e||n._initValues[t])}),t.prototype.setValue.call(this,e,i)}},i.prototype.checkSelfColor=function(){var e,i=!0;for(e=0;e<this._initValues.length;++e)if(this[e].value()!==this[0].value()){i=!1;break}t.prototype.setValue.call(this,i?this[0].value():"")},e.exports=i}).call(t,i(13))},function(e,t,i){"use strict";function n(){a.call(this)}function o(e,t){this._constructor="LineToolFibChannel";var s=t||this.createPropertiesObject("linetoolfibchannel");r.call(this,e,s),this.version=o.version,e._fibChannelLabelsCache||(e._fibChannelLabelsCache=new n),i.e(0).then(function(e){var t=i(754).FibChannelPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var r=i(0).LineDataSource,s=i(19),a=i(68),l=i(2).propertyPages;inherit(n,a),n.prototype.levelsCount=function(){return o.LevelsCount},inherit(o,r),o.LevelsCount=24,o.version=2,o.prototype.levelsCount=function(){return o.LevelsCount},o.prototype.migrateVersion=function(e,t,i){i.properties.removeProperty("reverse")},o.prototype.pointsCount=function(){return 3},o.prototype.title=function(){return"Fib Channel"},o.prototype.name=function(){return"Fib Channel"},o.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},o.prototype.createPropertiesObject=function(e,t,i){return new s(e,t,i,{range:[1,24],names:["coeff","color","visible"]})},o.prototype.getStylesPropertyPage=function(){return l.LineToolFibChannelStylesPropertyPage},t.LineToolFibChannel=o},function(e,t,i){"use strict";function n(){a.call(this)}function o(e,t){this._constructor="LineToolFibSpeedResistanceArcs";var o=t||this.createPropertiesObject("linetoolfibspeedresistancearcs");r.call(this,e,o),e._fibSpeedResistanceArcsLabelsCache||(e._fibSpeedResistanceArcsLabelsCache=new n),i.e(0).then(function(e){var t=i(755).FibSpeedResistanceArcsPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var r=i(0).LineDataSource,s=i(19),a=i(68),l=i(2).propertyPages;inherit(n,a),n.prototype.levelsCount=function(){return o.LevelsCount},inherit(o,r),o.LevelsCount=11,o.prototype.levelsCount=function(){return o.LevelsCount},o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Fib Speed Resistance Arcs"},o.prototype.name=function(){return"Fib Speed Resistance Arcs"},o.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},
o.prototype.createPropertiesObject=function(e,t,i){return new s(e,t,i,{range:[1,11]})},o.prototype.getStylesPropertyPage=function(){return l.LineToolFibSpeedResistanceArcsStylesPropertyPage},t.LineToolFibSpeedResistanceArcs=o},function(e,t,i){"use strict";function n(){a.call(this)}function o(e,t){this._constructor="LineToolProjection";var n=t||this.createPropertiesObject("linetoolprojection");l.call(this,e,n),i.e(0).then(function(e){var t=i(756).ProjectionLinePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var r=i(19),s=i(270).LineToolFibWedge,a=i(68),l=i(0).LineDataSource,c=i(2).propertyPages;inherit(n,a),n.prototype.levelsCount=function(){return 1},inherit(o,s),o.prototype.title=function(){return"Projection"},o.prototype.name=function(){return"Projection"},o.prototype.getCache=function(){return this._model._projectionLabelsCache||(this._model._projectionLabelsCache=new n),this._model._projectionLabelsCache},o.prototype.createPropertiesObject=function(e,t,i){return new r(e,t,i,{range:[1,1]})},o.prototype.getStylesPropertyPage=function(){return c.LineToolProjectionStylesPropertyPage},t.LineToolProjection=o},function(e,t,i){"use strict";function n(){a.call(this)}function o(e,t){this._constructor="LineToolTrendBasedFibExtension";var s=t||new this.createPropertiesObject("linetooltrendbasedfibextension");r.call(this,e,s),this.version=o.version,e._trendBasedFibExtensionLabelsCache||(e._trendBasedFibExtensionLabelsCache=new n),i.e(0).then(function(e){var t=i(757).TrendBasedFibExtensionPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var r=i(0).LineDataSource,s=i(19),a=i(68),l=i(2).propertyPages;inherit(n,a),n.prototype.levelsCount=function(){return o.LevelsCount},n.prototype.points=function(e){return[e.points()[0],e.points()[1]]},n.prototype.startPoint=function(e,t){return e.points()[2]},n.prototype.priceRange=function(e,t){var i=this.points(e),n=i[0],o=i[1];return t?n.price-o.price:o.price-n.price},n.prototype.sourceIsReady=function(e){return e.points().length>=3},inherit(o,r),o.version=2,o.LevelsCount=24,o.prototype.levelsCount=function(){return o.LevelsCount},o.prototype.stop=function(){r.prototype.stop.call(this),this._model._trendBasedFibExtensionLabelsCache.removeSource(this.id())},o.prototype.pointsCount=function(){return 3},o.prototype.title=function(){return"Trend-Based Fib Extension"},o.prototype.name=function(){return"Trend-Based Fib Extension"},o.prototype.migrateVersion=function(e,t,i){1===e&&this.properties().extendLines.setValue(!0)},o.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},o.prototype.createPropertiesObject=function(e,t,i){return new s(e,t,i,{range:[0,8]})},o.prototype.getStylesPropertyPage=function(){return l.LineToolTrendBasedFibExtensionStylesPropertyPage},t.LineToolTrendBasedFibExtension=o},function(e,t,i){"use strict";function n(){a.call(this)}function o(e,t){this._constructor="LineToolFibCircles"
;var o=t||this.createPropertiesObject("linetoolfibcircles");r.call(this,e,o),e._fibCirclesLabelsCache||(e._fibCirclesLabelsCache=new n),i.e(0).then(function(e){var t=i(758).FibCirclesPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var r=i(0).LineDataSource,s=i(19),a=i(68),l=i(2).propertyPages;inherit(n,a),n.prototype.levelsCount=function(){return o.LevelsCount},inherit(o,r),o.LevelsCount=11,o.prototype.levelsCount=function(){return o.LevelsCount},o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Fib Circles"},o.prototype.name=function(){return"Fib Circles"},o.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},o.prototype.createPropertiesObject=function(e,t,i){return new s(e,t,i,{range:[1,11]})},o.prototype.getStylesPropertyPage=function(){return l.LineToolFibCirclesStylesPropertyPage},t.LineToolFibCircles=o},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolVertLine";var n=t||new r("linetoolvertline");this._timeAxisView=new a(this,e),o.call(this,e,n),i.e(0).then(function(e){var t=i(759).VertLinePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages,a=i(271).LineToolVertLineTimeAxisView;inherit(n,o),n.prototype.pointsCount=function(){return 1},n.prototype.title=function(){return"Vertical Line"},n.prototype.name=function(){return"Vertical Line"},n.prototype.timeAxisViews=function(){return this.isSourceHidden()?null:this.properties().showTime.value()?[this._timeAxisView]:null},n.prototype.updateAllViews=function(){o.prototype.updateAllViews.call(this),this._timeAxisView.update()},n.prototype.canHasAlert=function(){return!0},n.prototype._getAlertPlots=function(){var e=this._points[0],t={index:e.index,price:e.price+1};return[this._linePointsToAlertPlot([e,t],null,!0,!0)]},n.prototype.getInputsPropertyPage=function(){return s.LineToolVertLineInputsPropertyPage},n.prototype.getStylesPropertyPage=function(){return s.LineToolVertLineStylesPropertyPage},t.LineToolVertLine=n},function(e,t,i){"use strict";var n,o,r,s,a,l,c;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"LineToolCrossLine",function(){return c}),n=i(1),o=i(3),i.n(o),r=i(174),s=i(271),a=i(0),i.n(a),l=i(2),i.n(l),c=function(e){function t(t,n){var a=e.call(this,t,n||new o.DefaultProperty("linetoolcrossline"))||this;return a._constructor="LineToolCrossLine",a._priceAxisView=new r.LineToolHorzLinePriceAxisView(a),a._timeAxisView=new s.LineToolVertLineTimeAxisView(a,t),i.e(0).then(function(e){var t=i(760).CrossLinePaneView;a._setPaneViews([new t(a,a._model)])}.bind(null,i)).catch(i.oe),a}return n.c(t,e),t.prototype.pointsCount=function(){return 1},t.prototype.title=function(){return"Cross Line"},t.prototype.name=function(){return"Cross Line"},t.prototype.priceAxisViews=function(e,t){
return this.isSourceHidden()?null:t===this.priceScale()&&this.properties().showPrice.value()&&this._model.paneForSource(this)===e?[this._priceAxisView]:null},t.prototype.timeAxisViews=function(){return this.isSourceHidden()?null:this.properties().showTime.value()?[this._timeAxisView]:null},t.prototype.updateAllViews=function(){e.prototype.updateAllViews.call(this),this._priceAxisView.update(),this._timeAxisView.update()},t.prototype.canHasAlert=function(){return!1},t.prototype.getInputsPropertyPage=function(){return l.propertyPages.LineToolCrossLineInputsPropertyPage},t.prototype.getStylesPropertyPage=function(){return l.propertyPages.LineToolCrossLineStylesPropertyPage},t.prototype.lineColor=function(){return this.properties().linecolor.value()},t.prototype.lineWidth=function(){return this.properties().linewidth.value()},t.prototype.lineStyle=function(){return this.properties().linestyle.value()},t}(a.LineDataSource),c.prototype.superclass=a.LineDataSource},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolBarsPattern";var r=t||new s("linetoolbarspattern");o.call(this,e,r),r.mirrored.listeners().subscribe(this,n.prototype.mirror),r.flipped.listeners().subscribe(this,n.prototype.flip),r.addExclusion("mirrored"),r.addExclusion("flipped"),this._scaleCoeff=1,this.version=n.version,this._pattern=[],this._properties.mode.listeners().subscribe(this,n.prototype.onModeChanged),i.e(0).then(function(e){var t=i(761).BarsPatternPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(41).Action,s=i(3).DefaultProperty,a=i(17).PlotRowSearchMode,l=i(2).propertyPages,c=i(203).LineToolBarsPatternMode;inherit(n,o),n.version=2,n.prototype.onModeChanged=function(){var e=this.patternPriceDiff();e*=this._pressCoeff,this._points[1].price=this._timePoint[1].price=this._points[0].price+e},n.prototype.additionalActions=function(e){var t,i,n=new r({checked:this.properties().mirrored.value(),checkable:!0,text:$.t("Mirrored"),callbackContext:{target:this}}),o=new r({checked:this.properties().flipped.value(),checkable:!0,text:$.t("Flipped"),callbackContext:{target:this}});return n.callbacks().subscribe(null,function(t){var i=t.callbackContext(),n=i.target;e.setProperty(n.properties().mirrored,!n.properties().mirrored.value(),"Bats Pattern Mirroring"),n.updateAllViews(),n._model.updateSource(n)}),o.callbacks().subscribe(null,function(t){var i=t.callbackContext(),n=i.target;e.setProperty(n.properties().flipped,!n.properties().flipped.value(),"Bats Pattern Flipping"),n.updateAllViews(),n._model.updateSource(n)}),t=new r({checkable:!0,text:$.t("Restore Size")}),i=this,t.callbacks().subscribe(null,function(t){var n=i.points()[0],o=i.patternPriceDiff(),r=n.price+o,s=n.index+i._pattern.length-1;e.startChangingLinetool(i,{price:r,index:s},1,{}),e.changeLinePoint({price:r,index:s},{}),e.endChangingLinetool()}),[n,o,t]},n.prototype.pointsCount=function(){return 2},n.prototype.state=function(e){var t=o.prototype.state.call(this,e);return t.pattern=this._pattern,t},
n.prototype.restoreData=function(e){e.pattern&&(this._pattern=e.pattern)},n.prototype.title=function(){return"Bars Pattern"},n.prototype.name=function(){return"Bars Pattern"},n.prototype.cloneData=function(e){this._pattern=TradingView.clone(e._pattern)},n.prototype.mirror=function(){var e,t,i,n,o,r=this._pattern,s=r[0][TradingView.HIGH_PLOT],a=Math.min(r[0][TradingView.LOW_PLOT],r[0][TradingView.HIGH_PLOT]),l=Math.max(r[0][TradingView.LOW_PLOT],r[0][TradingView.HIGH_PLOT]);for(e=1;e<r.length;e++)a=Math.min(a,r[e][TradingView.LOW_PLOT]),l=Math.max(l,r[e][TradingView.HIGH_PLOT]);if(a<l)for(t=(a+l)/2,i=function(e){return t-(e-t)},e=0;e<r.length;e++)r[e][TradingView.HIGH_PLOT]=i(r[e][TradingView.HIGH_PLOT]),r[e][TradingView.LOW_PLOT]=i(r[e][TradingView.LOW_PLOT]),r[e][TradingView.OPEN_PLOT]=i(r[e][TradingView.OPEN_PLOT]),r[e][TradingView.CLOSE_PLOT]=i(r[e][TradingView.CLOSE_PLOT]);n=r[0][TradingView.HIGH_PLOT]-s,o=r[r.length-1][TradingView.LOW_PLOT]-r[0][TradingView.HIGH_PLOT],this._points[0].price+=n,this._points[1].price=this._points[0].price+o,this.updateAllViews()},n.prototype.flip=function(){var e,t,i;for(this._points[0].price=this._points[1].price,e=0;e<this._pattern.length/2;e++)t=this._pattern[e],this._pattern[e]=this._pattern[this._pattern.length-e-1],this._pattern[this._pattern.length-e-1]=t;i=this._pattern[this._pattern.length-1][TradingView.LOW_PLOT]-this._pattern[0][TradingView.HIGH_PLOT],this._points[1].price=this._points[0].price+i,this.updateAllViews()},n.prototype.firstPatternPrice=function(){var e,t,i=parseInt(this.properties().mode.value(),10);return i===c.LineHL2?(this._pattern[0][TradingView.HIGH_PLOT]+this._pattern[0][TradingView.LOW_PLOT])/2:(e={0:TradingView.HIGH_PLOT,1:TradingView.CLOSE_PLOT,2:TradingView.OPEN_PLOT,3:TradingView.OPEN_PLOT,4:TradingView.HIGH_PLOT,5:TradingView.LOW_PLOT},t=e[i],this._pattern[0][t])},n.prototype.lastPatternPrice=function(){var e,t,i=parseInt(this.properties().mode.value(),10);return i===c.LineHL2?(this._pattern[this._pattern.length-1][TradingView.HIGH_PLOT]+this._pattern[this._pattern.length-1][TradingView.LOW_PLOT])/2:(e={0:TradingView.LOW_PLOT,1:TradingView.CLOSE_PLOT,2:TradingView.CLOSE_PLOT,3:TradingView.OPEN_PLOT,4:TradingView.HIGH_PLOT,5:TradingView.LOW_PLOT},t=e[i],this._pattern[this._pattern.length-1][t])},n.prototype.patternPriceDiff=function(){return this.lastPatternPrice()-this.firstPatternPrice()},n.prototype.pressCoeff=function(){var e=this.patternPriceDiff(),t=this.points()[0].price,i=this.points()[1].price,n=i-t,o=n/e;return this._pressCoeff=o,o},n.prototype.addPoint=function(e,t){var i,n,r,s,l,h,u,d,p,_,f,m=this._model.mainSeries(),y=m.nearestIndex(e.index,a.NearestRight);if(this.properties().mode.value()===c.Bars?e.price=m.bars().valueAt(y)[TradingView.HIGH_PLOT]:e.price=m.bars().valueAt(y)[TradingView.CLOSE_PLOT],i=this.priceScale(),n=this.ownerSource().firstValue(),r=.05*i.height(),s=i.priceToCoordinate(e.price,n)-r,e.price=i.coordinateToPrice(s,n),l=o.prototype.addPoint.call(this,e,t,!0)){
for(h=Math.min(this.points()[0].index,this.points()[1].index),u=Math.max(this.points()[0].index,this.points()[1].index),y=this._model.mainSeries().nearestIndex(h,a.NearestRight),d=this._model.mainSeries().nearestIndex(u,a.NearestLeft),this.points()[0].index>this.points()[1].index&&(this._points[0].price=this._points[1].price),this._pattern=[],p=y;p<=d;p++)_=this._model.mainSeries().data().valueAt(p),this._pattern.push(TradingView.clone(_));this._pattern.length>0&&(f=this.patternPriceDiff(),this._points[1].price=this._points[0].price+f,this._points[1].index=this._points[0].index+(d-y),this.normalizePoints(),this.createServerPoints())}return l},n.prototype.setPoint=function(e,t,i){1===e&&t.index<=this._points[0].index&&(t.index=this._points[0].index+1),0===e&&t.index>=this._points[1].index&&(t.index=this._points[1].index-1),o.prototype.setPoint.call(this,e,t,i)},n.prototype.migrateVersion=function(e,t,i){if(1===e&&this._pattern.length>0){var n=this.patternPriceDiff();2===this._timePoint.length&&(this._timePoint[1].price=this._timePoint[0].price+n),2===this._points.length&&(this._points[1].price=this._points[0].price+n)}},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return l.LineToolBarsPatternStylesPropertyPage},t.LineToolBarsPattern=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolTrendBasedFibTime";var r=t||new this.createPropertiesObject("linetooltrendbasedfibtime");o.call(this,e,r),this.version=n.version,i.e(0).then(function(e){var t=i(762).TrendBasedFibTimePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(19),s=i(2).propertyPages;inherit(n,o),n.version=1,n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Trend-Based Fib Time"},n.prototype.name=function(){return"Trend-Based Fib Time"},n.prototype.migrateVersion=function(e,t,i){},n.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},n.prototype.createPropertiesObject=function(e,t,i){return new r(e,t,i,{range:[1,11]})},n.prototype.getStylesPropertyPage=function(){return s.LineToolTrendBasedFibTimeStylesPropertyPage},t.LineToolTrendBasedFibTime=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolFibTimeZone";var r=t||this.createPropertiesObject("linetoolfibtimezone");o.call(this,e,r),this.version=n.version,i.e(0).then(function(e){var t=i(763).FibTimeZonePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(19),s=i(2).propertyPages;inherit(n,o),n.version=2,n.prototype.migrateVersion=function(e,t,i){var n;if(1===e){for(i.properties.level1.color.setValue(i.properties.baselinecolor.value()),n=2;n<=11;n++)i.properties["level"+n].color.setValue(i.properties.linecolor.value());for(n=1;n<=11;n++)i.properties["level"+n].linewidth.setValue(i.properties.linewidth.value()),
i.properties["level"+n].linestyle.setValue(i.properties.linestyle.value())}},n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Fib Time Zone"},n.prototype.name=function(){return"Fib Time Zone"},n.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},n.prototype.createPropertiesObject=function(e,t,i){return new r(e,t,i,{range:[1,11]})},n.prototype.getStylesPropertyPage=function(){return s.LineToolFibTimeZoneStylesPropertyPage},t.LineToolFibTimeZone=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolCircleLines";var n=t||new r("linetoolcirclelines");o.call(this,e,n),i.e(0).then(function(e){var t=i(764).LineToolCircleLinesPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Cyclic Lines"},n.prototype.name=function(){return"Cyclic Lines"},n.prototype.getStylesPropertyPage=function(){return s.LineToolCircleLinesStylesPropertyPage},t.LineToolCircleLines=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolDateRange";var n=t||new r("linetooldaterange");o.call(this,e,n),i.e(0).then(function(e){var t=i(765).DateRangePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Date Range"},n.prototype.name=function(){return"Date Range"},n.prototype.getStylesPropertyPage=function(){return s.LineToolDateRangeStylesPropertyPage},t.LineToolDateRange=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolPriceRange";var n=t||new r("linetoolpricerange");o.call(this,e,n),i.e(0).then(function(e){var t=i(766).PriceRangePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Price Range"},n.prototype.name=function(){return"Price Range"},n.prototype.getStylesPropertyPage=function(){return s.LineToolDateRangeStylesPropertyPage},t.LineToolPriceRange=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolDateAndPriceRange";var n=t||new r("linetooldateandpricerange");o.call(this,e,n),i.e(0).then(function(e){var t=i(767).DateAndPriceRangePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Date and Price Range"},n.prototype.name=function(){return"Date and Price Range"},n.prototype.getStylesPropertyPage=function(){return s.LineToolDateAndPriceRangeStylesPropertyPage},
t.LineToolDateAndPriceRange=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolParallelChannel";var n=t||new r("linetoolparallelchannel");o.call(this,e,n),i.e(0).then(function(e){var t=i(768).ParallelChannelPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.addPoint=function(e){var t,i=o.prototype.addPoint.call(this,e);return i&&(t=this.points()[0],this._points[2].index=t.index,this._points[2].price=t.price+this._priceOffset),i},n.prototype.calculatePriceDiff=function(){var e,t,i,n,o,r,s,a,l,c,h,u,d,p,_,f,m,y,g,v;if(3===this.points().length){if(e=this.points()[0],t=this.points()[1],i=this.points()[2],e.index===t.index)return;if(null===(n=this.priceScale()))return;if(n.isLog()){if(o=this._model.timeScale(),o.isEmpty())return;r=this.ownerSource().firstValue(),s=o.indexToCoordinate(e.index),a=o.indexToCoordinate(t.index),l=n.priceToCoordinate(e.price,r),c=n.priceToCoordinate(t.price,r),h=o.indexToCoordinate(i.index),u=(c-l)/(a-s),d=l+u*(h-s),p=n.priceToCoordinate(i.price,r),_=p-d,r=this.ownerSource().firstValue(),f=.5*(l+c),m=n.coordinateToPrice(f,r),y=f+_,g=n.coordinateToPrice(y,r),this._priceOffset=g-m}else u=(t.price-e.price)/(t.index-e.index),v=e.price+u*(i.index-e.index),this._priceOffset=i.price-v}},n.prototype.setLastPoint=function(e,t){t&&t.shift&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[0]),o.prototype.setLastPoint.call(this,e),this.calculatePriceDiff()},n.prototype.restorePoints=function(e,t,i){o.prototype.restorePoints.call(this,e,t,i),e&&e.length>=3&&(this._priceOffset=e[2].price-e[0].price)},n.prototype.setPoint=function(e,t,i){i&&i.shift&&e<2&&this._snapPoint45Degree(t,this.points()[1-e]),o.prototype.setPoint.call(this,e,t,i),2===e&&this.calculatePriceDiff();var n=this.points()[0];this._points[2].index=n.index,this._points[2].price=n.price+this._priceOffset},n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Parallel Channel"},n.prototype.name=function(){return"Parallel Channel"},n.prototype.addPoint=function(e,t){return t&&t.shift&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[0]),o.prototype.addPoint.call(this,e,t)},n.prototype.fixAfterRestorePriceAxis=function(){this.priceScale().isLog()||delete this._priceOffset},n.prototype.cloneData=function(e){this._priceOffset=e._priceOffset},n.prototype.restoreData=function(e){e.priceOffset&&(this._priceOffset=e.priceOffset)},n.prototype.state=function(e){var t=o.prototype.state.call(this,e);return t.priceOffset=this._priceOffset,t},n.prototype.canHasAlert=function(){return!0},n.prototype._getAlertPlots=function(){function e(e,t){return e.index<=t.index?[e,t]:[t,e]}var t,i,n,o,r,s,a,l,c=[].concat(this._points).splice(0,2);return c=c.concat([{price:c[0].price+this._priceOffset,time:c[0].time,index:c[0].index},{price:c[1].price+this._priceOffset,time:c[1].time,index:c[1].index}]),t=e(c[0],c[1]),i=e(c[2],c[3]),this._priceOffset<0?(o=i,
n=t):(o=t,n=i),a=this.properties().extendLeft.value(),l=this.properties().extendRight.value(),c[0].index<=c[1].index?(r=a,s=l):(r=l,s=a),[this._linePointsToAlertPlot(n,"Upper",r,s),this._linePointsToAlertPlot(o,"Lower",r,s)]},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return s.LineToolParallelChannelStylesPropertyPage},t.LineToolParallelChannel=n},function(e,t,i){"use strict";(function(e){function n(e,t){this._constructor="LineToolTrendAngleLine";var o=t||new s("linetooltrendangle");r.call(this,e,o),this._properties.addProperty("angle"),this._properties.angle=new n.AngleProperty(this),i.e(0).then(function(e){var t=i(769).TrendAnglePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(6).Point,r=i(0).LineDataSource,s=i(3).DefaultProperty,a=i(2).propertyPages;inherit(n,r),n.AngleProperty=function(t){e.call(this),this._lineSource=t},inherit(n.AngleProperty,e),n.AngleProperty.prototype.value=function(){var e=this._lineSource._angle,t=180*e/Math.PI;return Math.round(t)},n.AngleProperty.prototype.setValue=function(e){var t,i,n,r,s,a,l=e*Math.PI/180;this._lineSource._angle=l,t=this._lineSource.pointToScreenPoint(this._lineSource.points()[0])[0],i=Math.cos(this._lineSource._angle),n=-Math.sin(this._lineSource._angle),r=new o(i,n),s=t.addScaled(r,this._lineSource._distance),a=this._lineSource.screenPointToPoint(s),this._lineSource._points[1]=a,this._lineSource._model.updateSource(this._lineSource),this._lineSource.updateAllViews(),this._lineSource._model.updateSource(this._lineSource)},n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Trend Angle"},n.prototype.name=function(){return"Trend Angle"},n.prototype._calculateAngle=function(){var e,t=this.pointToScreenPoint(this.points()[0])[0],i=this.pointToScreenPoint(this.points()[1])[0],n=i.subtract(t);n.length()>0?(n=n.normalized(),this._angle=Math.acos(n.x),n.y>0&&(this._angle=-this._angle),this._distance=i.subtract(t).length()):delete this._angle,e=this.properties(),e.hasOwnProperty("angle")&&this.properties().angle.listeners().fire(this.properties().angle)},n.prototype.addPoint=function(e,t){var i=r.prototype.addPoint.call(this,e,t);return i&&this._calculateAngle(),i},n.prototype.setLastPoint=function(e,t){r.prototype.setLastPoint.call(this,e,t),this.points().length>1&&this._calculateAngle()},n.prototype.axisPoints=function(){var e,t,i,n,r,s;return this.points().length<2?[]:(e=[this.points()[0]],t=this.pointToScreenPoint(this.points()[0])[1],i=Math.cos(this._angle)*this._distance,n=-Math.sin(this._angle)*this._distance,r=t.add(new o(i,n)),s=this.screenPointToPoint(r),e.push(s),e)},n.prototype.setPoint=function(e,t,i){r.prototype.setPoint.call(this,e,t,i),this.points().length>1&&1===e&&this._calculateAngle()},n.prototype.restoreData=function(e){this._angle=e.angle,this._distance=e.distance},n.prototype.state=function(e){var t=r.prototype.state.call(this,e);return t.angle=this._angle,t.distance=this._distance,t},
n.prototype.cloneData=function(e){this._angle=e._angle,this._distance=e._distance},n.prototype.canHasAlert=function(){return!0},n.prototype._getAlertPlots=function(){return[this._linePointsToAlertPlot(this._points,null,this.properties().extendLeft.value(),this.properties().extendRight.value())]},n.prototype.getInputsPropertyPage=function(){return a.LineToolTrendAngleInputsPropertyPage},n.prototype.getStylesPropertyPage=function(){return a.LineToolTrendAngleStylesPropertyPage},t.LineToolTrendAngle=n}).call(t,i(13))},function(e,t,i){"use strict";var n,o,r,s,a;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"LineToolInfoLine",function(){return a}),n=i(1),o=i(3),i.n(o),r=i(101),i.n(r),s=i(2),i.n(s),a=function(e){function t(t,i){var n=e.call(this,t,i||new o.DefaultProperty("linetoolinfoline"))||this;return n._constructor="LineToolInfoLine",n}return n.c(t,e),t.prototype.pointsCount=function(){return 2},t.prototype.title=function(){return"Info Line"},t.prototype.name=function(){return"Info Line"},t.prototype.getStylesPropertyPage=function(){return s.propertyPages.LineToolInfoLineStylesPropertyPage},t}(r.LineToolTrendLine),a.prototype.superclass=r.LineToolTrendLine},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolPitchfan";var n=t||this.createPropertiesObject("linetoolpitchfan");o.call(this,e,n),i.e(0).then(function(e){var t=i(772).PitchfanLinePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(19),s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Pitchfan"},n.prototype.name=function(){return"Pitchfan"},n.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},n.prototype.createPropertiesObject=function(e,t,i){return new r(e,t,i,{range:[0,8]})},n.prototype.getStylesPropertyPage=function(){return s.LineToolPitchfanStylesPropertyPage},t.LineToolPitchfan=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolGannSquare";var n=t||this.createPropertiesObject("linetoolgannsquare");s.call(this,e,n),i.e(0).then(function(e){var t=i(773).GannSquarePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o,r,s=i(0).LineDataSource,a=i(19),l=i(2).propertyPages;inherit(n,s),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Gann Box"},n.prototype.name=function(){return"Gann Box"},o=[4.5,9,11.25,18,22.5,36,45],r=function(){for(var e=[],t=1e10,i=o.length-1,n=1,r=0,s=0;s<t;)s=o[r]*n,e.push(Math.round(s)),e.push(Math.ceil(-s)),r===i-1&&(n*=10),r=(r+1)%i;return e.sort(function(e,t){return e<t?-1:e>t?1:0}),e}(),n.prototype._alignPriceOnPattern=function(e,t){var i,n,r,s,a,l,c=Math.round(1e6*(e.price-t.price))/1e6;if(0===c)return t.price;for(i=o[0],n=o[o.length-1],r=1,s=Math.abs(c);s<i*r||n*r<s;)s<i*r?r*=.1:n*r<s&&(r*=10);for(a=n*r,l=o.length-2;l>=0&&!(o[l]*r<s);--l)a=o[l]*r;return e.price=t.price+(c>=0?a:-a),e},
n.prototype._alignTimeOnPattern=function(e,t){var i,n=e.index-t.index;if(0===n)return 0;for(i=r.length-2;i>=0&&!(r[i]<n);--i);return i+=n>0?1:0,e.index=t.index+r[i],e},n.prototype._alignPointsFixedIncrement=function(e,t){return this._alignTimeOnPattern(e,t),this._alignPriceOnPattern(e,t),e},n.prototype._preparePoint=function(e,t){return t&&t.shift&&0!==this._points.length&&this._alignPointsFixedIncrement(e,this._points[0]),s.prototype._preparePoint.call(this,e,t)},n.prototype.setPoint=function(e,t,i){if(i&&i.shift){var n=0===e?this._points[1]:this._points[0];this._alignPointsFixedIncrement(t,n)}s.prototype.setPoint.call(this,e,t,i)},n.prototype.createPropertiesObject=function(e,t,i){return new a(e,t,i,{range:[1,7],prefixes:["h","v"],names:["coeff","color","visible"]})},n.prototype.getStylesPropertyPage=function(){return l.LineToolGannSquareStylesPropertyPage},t.LineToolGannSquare=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolFibSpeedResistanceFan";var n=t||this.createPropertiesObject("linetoolfibspeedresistancefan");o.call(this,e,n),i.e(0).then(function(e){var t=i(774).FibSpeedResistanceFanPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(19),s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Fib Speed Resistance Fan"},n.prototype.name=function(){return"Fib Speed Resistance Fan"},n.prototype.processErase=function(e,t){var i="h"===t.type?"hlevel"+t.index:"vlevel"+t.index,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},n.prototype.createPropertiesObject=function(e,t,i){return new r(e,t,i,{range:[1,7],prefixes:["h","v"],names:["coeff","color","visible"]})},n.prototype.getStylesPropertyPage=function(){return s.LineToolFibSpeedResistanceFanStylesPropertyPage},t.LineToolFibSpeedResistanceFan=n},function(e,t,i){"use strict";var n,o,r,s,a,l,c,h,u;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"LineToolGannComplex",function(){return u}),n=i(1),o=i(6),i.n(o),r=i(7),i.n(r),s=i(193),a=i(0),i.n(a),l=i(121),c=i(2),i.n(c),h=i(273),u=function(e){function t(t,n){var o,r=e.call(this,t,null==n?Object(h.a)("linetoolganncomplex"):n)||this;return r.version=2,r._constructor="LineToolGannComplex",r._scaleRatioFormatter=new s.LimitedPrecisionNumericFormatter(7),i.e(0).then(function(e){var t=i(775).GannComplexPaneView;r._setPaneViews([new t(r,r.model())])}.bind(null,i)).catch(i.oe),o=r.properties(),r._adjustScaleRatio(o),o.subscribe(r,r._adjustScaleRatio),o.scaleRatio.subscribe(r,r._correctFirstPoint),r._syncStateExclusions=["scaleRatio"],o.addExclusion("scaleRatio"),r._onRestoringFactoryDefaults.subscribe(r,r._handleRestoringFactoryDefaults),r._onTemplateApplying.subscribe(r,r._handleTemplateApplying),r._onTemplateApplied.subscribe(r,r._correctFirstPoint),r}return n.c(t,e),t.prototype.migrateVersion=function(e,t,i){var n=this;1===e&&(this._points.length>=this.pointsCount()?setTimeout(function(){return n._migratePoint()
}):this._timePoint.length>=this.pointsCount()&&this._pointAdded.subscribe(this,this._migratePoint))},t.prototype.destroy=function(){var e=this.properties();e.unsubscribe(this,this._adjustScaleRatio),e.scaleRatio.unsubscribe(this,this._correctFirstPoint),this._onRestoringFactoryDefaults.unsubscribe(this,this._handleRestoringFactoryDefaults),this._onTemplateApplying.unsubscribe(this,this._handleTemplateApplying),this._onTemplateApplied.unsubscribe(this,this._correctFirstPoint)},t.prototype.pointsCount=function(){return 2},t.prototype.title=function(){return"Gann Square"},t.prototype.name=function(){return"Gann Square"},t.prototype.addPoint=function(t,i,n){var o,s,a;return this._points.length>1&&this._points.pop(),o=e.prototype.addPoint.call(this,t,i,n),s=this.priceScale(),a=Object(r.ensureNotNull)(s).isLog(),!a&&o&&this._correctFirstPoint(),o},t.prototype.setPoint=function(t,i,n){e.prototype.setPoint.call(this,t,i,n),void 0!==n&&n.shift?this._correctPoint(t):this._correctScaleRatio()},t.prototype.setLastPoint=function(t,i){var n=this.priceScale();Object(r.ensureNotNull)(n).isLog()||(this._points[1]=t,this._correctPoint(1)),e.prototype.setLastPoint.call(this,t,i)},t.prototype.createPropertiesObject=function(e,t,i){return Object(h.a)(e,t,i)},t.prototype.getStylesPropertyPage=function(){return c.propertyPages.LineToolGannComplexStylesPropertyPage},t.prototype.isReversed=function(){return this.properties().reverse.value()},t.prototype.levelsCount=function(){return this.properties().levels.childCount()},t.prototype.levels=function(){var e,t,i=[],n=this.properties(),o=n.levels.childCount();for(e=0;e<o;e++)t=n.levels[e],i.push({index:e,visible:t.visible.value(),color:t.color.value(),width:t.width.value()});return i},t.prototype.fanLinesCount=function(){return this.properties().fanlines.childCount()},t.prototype.fanLines=function(){var e,t,i=[],n=this.properties(),o=n.fanlines.childCount();for(e=0;e<o;e++)t=n.fanlines[e],i.push({index:e,visible:t.visible.value(),x:t.x.value(),y:t.y.value(),color:t.color.value(),width:t.width.value()});return i},t.prototype.arcsCount=function(){return this.properties().arcs.childCount()},t.prototype.arcs=function(){var e,t,i=[],n=this.properties(),o=n.arcs.childCount();for(e=0;e<o;e++)t=n.arcs[e],i.push({index:e,visible:t.visible.value(),x:t.x.value(),y:t.y.value(),color:t.color.value(),width:t.width.value()});return i},t.prototype.arcsBackgroundTransparency=function(){return this.properties().arcsBackground.transparency.value()},t.prototype.isArcsBackgroundFilled=function(){return this.properties().arcsBackground.fillBackground.value()},t.prototype.isLabelsVisible=function(){return this.properties().showLabels.value()},t.prototype.getLabelsStyle=function(){var e=this.properties(),t=e.labelsStyle,i=t.font,n=t.fontSize,o=t.bold,r=t.italic,s=e.levels.childCount();return{textColor:e.levels[s-1].color.value(),font:i.value(),fontSize:n.value(),bold:o.value(),italic:r.value()}},t.prototype.getScaleRatioStep=function(){return 1e-7},t.prototype.getScaleRatioFormatter=function(){
return this._scaleRatioFormatter},t.prototype.getPriceDiff=function(){var e,t,i=this.points();return i.length<2?null:(e=i[0],t=i[1],t.price-e.price)},t.prototype.getIndexDiff=function(){var e,t,i=this.points();return i.length<2?null:(e=i[0],t=i[1],t.index-e.index)},t.prototype.getScaleRatio=function(){var e=this.getPriceDiff(),t=this.getIndexDiff();return null!==e&&null!==t&&0!==t?Math.abs(e/t):null},t.prototype._correctScaleRatio=function(){var e=this.properties(),t=this.getScaleRatio();e.scaleRatio.setValue(t)},t.prototype._getAdjustedScaleRatio=function(){var e=this.model().mainSeries().priceScale(),t=this.model().timeScale();return Object(l.scaleRatio)(t,e)},t.prototype._adjustScaleRatio=function(e){var t=e.scaleRatio.value();""!==t&&null!==t||e.scaleRatio.setValue(this._getAdjustedScaleRatio())},t.prototype._correctPoint=function(e){var t,i,n,o,r,s,a,l;this._points.length<2||null!==(t=this.getIndexDiff())&&(i=this.properties(),n=i.scaleRatio.value(),null!==n&&(o=this._points[e],r=0===e?this._points[1]:this._points[0],s=o.price-r.price>0,a=o.index-r.index>0,l=s&&!a||!s&&a?-1:1,0===e&&(l=-l),o.price=r.price+l*t*n,this._pointChanged.fire(e)),this.normalizePoints())},t.prototype._correctFirstPoint=function(){this._correctPoint(this.isReversed()?0:1)},t.prototype._handleRestoringFactoryDefaults=function(){this.properties().scaleRatio.setValue(this._getAdjustedScaleRatio())},t.prototype._handleTemplateApplying=function(e){""===e.scaleRatio&&(e.scaleRatio=this._getAdjustedScaleRatio())},t.prototype._migratePoint=function(){var e,t;this.points().length<this.pointsCount()||null!==(e=this._getScreenPoints())&&(t=this.screenPointToPoint(e[1]),this.setPoint(1,t),this._pointAdded.unsubscribe(this,this._migratePoint))},t.prototype._getScreenPoints=function(){var e,t,i,n,r,s,a,l,c,h,u,d=this._calcAngle();return null===d?null:(t=this.points(),i=t[0],n=t[1],this.isReversed()&&(e=[n,i],i=e[0],n=e[1]),r=this.pointToScreenPoint(i)[0],s=this.pointToScreenPoint(n)[0],a=Math.sqrt(Math.pow(r.x-s.x,2)+Math.pow(r.y-s.y,2)),l=new o.Point(Math.cos(d),-Math.sin(d)),c=l.normalized(),h=c.x<0?-1:1,u=c.y<0?-1:1,[r.addScaled(l,a),r.add(new o.Point(5*a*h,5*a*u))])},t.prototype._calcAngle=function(){var e,t=this.points(),i=t[0],n=t[1],o=this.pointToScreenPoint(i)[0],r=this.pointToScreenPoint(n)[0],s=r.subtract(o);return s.length()>0?(s=s.normalized(),e=Math.acos(s.x),s.y>0&&(e=-e),e):null},t}(a.LineDataSource),u.prototype.superclass=a.LineDataSource},function(e,t,i){"use strict";var n,o,r,s,a,l;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"LineToolGannFixed",function(){return l}),n=i(1),o=i(6),i.n(o),r=i(0),i.n(r),s=i(273),a=i(2),i.n(a),l=function(e){function t(t,n){var o=e.call(this,t,null==n?Object(s.a)("linetoolgannfixed"):n)||this;return o._constructor="LineToolGannFixed",i.e(0).then(function(e){var t=i(776).GannFixedPaneView;o._setPaneViews([new t(o,o.model())])}.bind(null,i)).catch(i.oe),o.properties().reverse.subscribe(o,o._reversePoints),o}return n.c(t,e),t.prototype.pointsCount=function(){return 2},t.prototype.title=function(){
return"Gann Square Fixed"},t.prototype.name=function(){return"Gann Square Fixed"},t.prototype.createPropertiesObject=function(e,t,i){return Object(s.a)(e,t,i)},t.prototype.getStylesPropertyPage=function(){return a.propertyPages.LineToolGannFixedStylesPropertyPage},t.prototype.axisPoints=function(){var e=this.points(),t=this.getScreenPoints();return e.length<2||t.length<2?[]:[e[0],this.screenPointToPoint(t[1])]},t.prototype.getScreenPoints=function(){var e,t,i,n,r,s,a,l,c,h,u=this.points();return u.length<2?[]:null===(e=this._calcAngle())?[]:(t=u[0],i=u[1],n=this.pointToScreenPoint(t)[0],r=this.pointToScreenPoint(i)[0],s=Math.sqrt(Math.pow(n.x-r.x,2)+Math.pow(n.y-r.y,2)),a=new o.Point(Math.cos(e),-Math.sin(e)),l=a.normalized(),c=l.x<0?-1:1,h=l.y<0?-1:1,[n.addScaled(a,s),n.add(new o.Point(5*s*c,5*s*h))])},t.prototype.levelsCount=function(){return this.properties().levels.childCount()},t.prototype.levels=function(){var e,t,i=[],n=this.properties(),o=n.levels.childCount();for(e=0;e<o;e++)t=n.levels[e],i.push({index:e,visible:t.visible.value(),color:t.color.value(),width:t.width.value()});return i},t.prototype.fanLinesCount=function(){return this.properties().fanlines.childCount()},t.prototype.fanLines=function(){var e,t,i=[],n=this.properties(),o=n.fanlines.childCount();for(e=0;e<o;e++)t=n.fanlines[e],i.push({index:e,visible:t.visible.value(),x:t.x.value(),y:t.y.value(),color:t.color.value(),width:t.width.value()});return i},t.prototype.arcsCount=function(){return this.properties().arcs.childCount()},t.prototype.arcs=function(){var e,t,i=[],n=this.properties(),o=n.arcs.childCount();for(e=0;e<o;e++)t=n.arcs[e],i.push({index:e,visible:t.visible.value(),x:t.x.value(),y:t.y.value(),color:t.color.value(),width:t.width.value()});return i},t.prototype.arcsBackgroundTransparency=function(){return this.properties().arcsBackground.transparency.value()},t.prototype.isArcsBackgroundFilled=function(){return this.properties().arcsBackground.fillBackground.value()},t.prototype._calcAngle=function(){var e,t,i,n,o,r,s=this.points();return s.length<2?null:(e=s[0],t=s[1],i=this.pointToScreenPoint(e)[0],n=this.pointToScreenPoint(t)[0],o=n.subtract(i),o.length()<=0?null:(o=o.normalized(),r=Math.acos(o.x),o.y>0&&(r=-r),r))},t.prototype._reversePoints=function(){var e=this._points,t=e[0],i=e[1];this._points[0]=i,this._points[1]=t,this.normalizePoints(),this.restart()},t}(r.LineDataSource),l.prototype.superclass=r.LineDataSource},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolGannFan";var n=t||this.createPropertiesObject("linetoolgannfan");o.call(this,e,n),i.e(0).then(function(e){var t=i(777).GannFanPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(19),s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Gann Fan"},n.prototype.name=function(){return"Gann Fan"},n.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},
n.prototype.createPropertiesObject=function(e,t,i){return new r(e,t,i,{range:[1,9]})},n.prototype.getStylesPropertyPage=function(){return s.LineToolGannFanStylesPropertyPage},t.LineToolGannFan=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolDisjointAngle";var s=t||new r("linetooldisjointangle");o.call(this,e,s),this.version=n.version,i.e(0).then(function(e){var t=i(779).DisjointAnglePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.version=1,n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Disjoint Angle"},n.prototype.name=function(){return"Disjoint Angle"},n.prototype.addPoint=function(e,t){return t&&t.shift&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[this.points().length-2]),o.prototype.addPoint.call(this,e)},n.prototype.setLastPoint=function(e,t){return t&&t.shift&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[this.points().length-2]),o.prototype.setLastPoint.call(this,e)},n.prototype.setPoint=function(e,t,i){var n,r,s,a=.5*(this._points[1].price+this._points[2].price);i&&i.shift&&1===e&&(n=0,this._snapPoint45Degree(t,this.points()[n])),e<3&&o.prototype.setPoint.call(this,e,t),0!==e&&2!==e&&(1===e?(r=this._points[1].price-a,this._points[2].price=this._points[1].price-2*r):3===e&&(s=t.price,r=s-this._points[2].price,this._points[0].price=this._points[1].price-r,this._points[0].index=t.index))},n.prototype.canHasAlert=function(){return!0},n.prototype._getAlertPlots=function(){var e,t,i,n,o,r,s,a,l,c=this._points[0],h=this._points[1],u=[];return c.index<=h.index?(u.push(c),u.push(h)):(u.push(h),u.push(c)),e=this._points[2],e.time=h.time,e.index=h.index,t={price:e.price+(h.price-c.price),time:c.time,index:c.index},i=[],e.index<=t.index?(i.push(e),i.push(t)):(i.push(t),i.push(e)),u[0].price>i[0].price?(n=u,o=i):i[0].price>u[0].price?(n=i,o=u):i[1].price>u[1].price?(n=i,o=u):(n=u,o=i),a=this.properties().extendLeft.value(),l=this.properties().extendRight.value(),c.index<=h.index?(r=a,s=l):(r=l,s=a),[this._linePointsToAlertPlot(n,"Upper",r,s),this._linePointsToAlertPlot(o,"Lower",r,s)]},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return s.LineToolDisjointAngleStylesPropertyPage},t.LineToolDisjointAngle=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolFlatBottom";var s=t||new r("linetoolflatbottom");o.call(this,e,s),this.version=n.version,i.e(0).then(function(e){var t=i(780).FlatBottomPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.version=1,n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Flat Bottom"},n.prototype.name=function(){return"Flat Bottom"},n.prototype.addPoint=function(e,t){
return t&&t.shift&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[this.points().length-2]),o.prototype.addPoint.call(this,e)},n.prototype.setLastPoint=function(e,t){return t&&t.shift&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[this.points().length-2]),o.prototype.setLastPoint.call(this,e)},n.prototype.setPoint=function(e,t,i){if(i&&i.shift&&1===e){this._snapPoint45Degree(t,this.points()[0])}e<3?o.prototype.setPoint.call(this,e,t):this._points[0].index=t.index},n.prototype.canHasAlert=function(){return!0},n.prototype._getAlertPlots=function(){var e,t,i,n,o,r,s,a,l,c=this._points[0],h=this._points[1],u=[];return c.index<=h.index?(u.push(c),u.push(h)):(u.push(h),u.push(c)),e=this._points[2],e.time=h.time,e.index=h.index,t={price:e.price,time:c.time,index:c.index},i=[],e.index<=t.index?(i.push(e),i.push(t)):(i.push(t),i.push(e)),u[0].price>i[0].price?(n=u,o=i):i[0].price>u[0].price?(n=i,o=u):i[1].price>u[1].price?(n=i,o=u):(n=u,o=i),a=this.properties().extendLeft.value(),l=this.properties().extendRight.value(),c.index<=h.index?(r=a,s=l):(r=l,s=a),[this._linePointsToAlertPlot(n,"Upper",r,s),this._linePointsToAlertPlot(o,"Lower",a,s)]},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return s.LineToolFlatBottomStylesPropertyPage},t.LineToolFlatBottom=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolIcon";var s=t||new r("linetoolicon");s.addExclusion("angle"),s.addExclusion("scale"),o.call(this,e,s),this.version=n.version,i.e(0).then(function(e){var t=i(781).IconPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.version=1,n.anchorLimit=80,n.prototype.getAnchorLimit=function(){return n.anchorLimit},n.prototype.pointsCount=function(){return 1},n.prototype.title=function(){return"Icon"},n.prototype.name=function(){return"Icon"},n.prototype.startChanging=function(e,t){var i,r;o.prototype.startChanging.call(this,e,t),i=this.properties(),r=65536*i.icon.value()+i.size.value(),this._startChangeWidth=this._paneViews[0]._cache[r],i.size.value()<n.anchorLimit?this._sizeScale=i.size.value()/n.anchorLimit:this._sizeScale=1,this._origScale=i.scale.value(),this._startChangeWidth*this._origScale<n.anchorLimit?this._resizeRatio=this._startChangeWidth/n.anchorLimit:this._resizeRatio=1},n.prototype.endChanging=function(){o.prototype.endChanging.call(this),delete this._startChangeWidth,delete this._sizeScale,delete this._resizeRatio},n.prototype.setPoint=function(e,t,i){var o,r,s,a,l,c,h,u,d,p=$.extend({},t);i&&i.shift&&this._properties.snapTo45Degrees&&this._snapPoint45Degree(p,this.points()[0]),o=this.pointToScreenPoint(this.points()[0])[1],r=this.pointToScreenPoint(p)[1],0===e||1===e?(s=r.subtract(o).normalized(),a=2*r.subtract(o).length(),a*=this._sizeScale,this._properties.size.setValue(a),l=-s.x,c=Math.acos(l),Math.asin(s.y)>0&&(c=2*Math.PI-c),0===e&&(c+=Math.PI),
this._properties.angle.setValue(c)):(h=this._startChangeWidth,u=r.subtract(o).length(),this._origScale*h<n.anchorLimit?(d=n.anchorLimit/2,this._properties.scale.setValue(this._origScale*u/d)):(d=h/2,this._properties.scale.setValue(u/d)))},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return s.LineToolIconStylesPropertyPage},n.prototype.getSourceIcon=function(){return{type:"text",text:String.fromCharCode(this.properties().icon.value())}},t.LineToolIcon=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolRotatedRectangle";var n=t||new a("linetoolrotatedrectangle");s.call(this,e,n),i.e(0).then(function(e){var t=i(782).RotatedRectanglePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(6).Point,r=i(30).distanceToLine,s=i(0).LineDataSource,a=i(3).DefaultProperty,l=i(2).propertyPages;inherit(n,s),n.prototype.startChanging=function(e,t){var i,n,o,a;s.prototype.startChanging.call(this,e,t),0!==e&&1!==e||(i=this._paneViews[0],n=i._points[0],o=i._points[1],a=i._points[2],this._distance=r(n,o,a).distance)},n.prototype.setPoint=function(e,t,i){var n,r,a,l,c,h,u;s.prototype.setPoint.call(this,e,t,i),0!==e&&1!==e||(n=this._paneViews[0],n.update(),r=n._points[0],a=n._points[1],l=a.subtract(r),c=new o(l.y,-l.x).normalized().scaled(this._distance),h=r.add(c),u=this.screenPointToPoint(h),this._points[2]=u)},n.prototype.endChanging=function(){delete this._distance},n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Rotated Rectangle"},n.prototype.name=function(){return"Rotated Rectangle"},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return l.LineToolRectangleStylesPropertyPage},t.LineToolRotatedRectangle=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolFibSpiral";var n=t||new r("linetoolfibspiral");o.call(this,e,n),i.e(0).then(function(e){var t=i(783).FibSpiralPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Fib Spiral"},n.prototype.name=function(){return"Fib Spiral"},n.prototype.getStylesPropertyPage=function(){return s.LineToolFibSpiralStylesPropertyPage},t.LineToolFibSpiral=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolHeadAndShoulders";var n=t||new r("linetoolheadandshoulders");o.call(this,e,n),i.e(0).then(function(e){var t=i(784).LineToolHeadAndShouldersPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 7},n.prototype.title=function(){return"Head and Shoulders"},n.prototype.name=function(){return"Head and Shoulders"},n.prototype.getStylesPropertyPage=function(){
return s.LineToolLineTool5PointsPatternStylesPropertyPage},t.LineToolHeadAndShoulders=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolTriangle";var n=t||new r("linetooltriangle");o.call(this,e,n),i.e(0).then(function(e){var t=i(785).TrianglePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Triangle"},n.prototype.name=function(){return"Triangle"},n.prototype.getStylesPropertyPage=function(){return s.LineToolTriangleStylesPropertyPage},t.LineToolTriangle=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolTrianglePattern";var n=t||new r("linetooltrianglepattern");o.call(this,e,n),i.e(0).then(function(e){var t=i(786).LineToolTrianglePatternPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 4},n.prototype.title=function(){return"Triangle Pattern"},n.prototype.name=function(){return"Triangle Pattern"},n.prototype.getStylesPropertyPage=function(){return s.LineToolTrianglePatternStylesPropertyPage},t.LineToolTrianglePattern=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolThreeDrivers";var n=t||new r("linetoolthreedrivers");o.call(this,e,n),i.e(0).then(function(e){var t=i(787).LineToolThreeDrivesPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 7},n.prototype.title=function(){return"Three Drives Pattern"},n.prototype.name=function(){return"Three Drives Pattern"},n.prototype.getStylesPropertyPage=function(){return s.LineToolABCDPatternStylesPropertyPage},t.LineToolThreeDrivers=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolABCD";var n=t||new r("linetoolabcd");o.call(this,e,n),i.e(0).then(function(e){var t=i(788).ABCDPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(275).DateTimeFormatter,a=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 4},n.prototype.title=function(){return"ABCD Pattern"},n.prototype.name=function(){return"ABCD Pattern"},n.prototype._tooltipFieldsHash={time0:{title:"Date 1",value:null},price0:{title:"Price 1",value:null},time1:{title:"Date 2",value:null},price1:{title:"Price 2",value:null},time2:{title:"Date 3",value:null},price2:{title:"Price 3",value:null},time3:{title:"Date 4",value:null},price3:{title:"Price 4",value:null}},n.prototype._updateTooltip=function(){var e,t,i,n,o=this._tooltipFieldsHash,r=this.points().m_values;r[0]&&(e=this._model.timeScale().indexToUserTime(r[0].index),o.time0.value=e?new s(this._model.mainSeries().isDWM()).format(e):0,
o.price0.value=this._model.mainSeries()._formatter.format(r[0].price)),r[1]&&(t=this._model.timeScale().indexToUserTime(r[1].index),o.time1.value=t?new s(this._model.mainSeries().isDWM()).format(t):0,o.price1.value=this._model.mainSeries()._formatter.format(r[1].price)),r[2]&&(i=this._model.timeScale().indexToUserTime(r[2].index),o.time2.value=i?new s(this._model.mainSeries().isDWM()).format(i):0,o.price2.value=this._model.mainSeries()._formatter.format(r[2].price)),r[3]&&(n=this._model.timeScale().indexToUserTime(r[3].index),o.time3.value=n?new s(this._model.mainSeries().isDWM()).format(n):0,o.price3.value=this._model.mainSeries()._formatter.format(r[3].price))},n.prototype.tooltip=function(){return this._updateTooltip(),this._formatTooltip()},n.prototype.getStylesPropertyPage=function(){return a.LineToolABCDPatternStylesPropertyPage},t.LineToolABCD=n},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"LineToolRiskRewardPriceAxisView",function(){return r}),n=i(1),o=i(58),r=function(e){function t(t,i){var n=e.call(this)||this;return n._source=t,n._data=i,n}return n.c(t,e),t.prototype._updateRendererData=function(e){var t,i,n,o,r;e.visible=!1,t=this._source.priceScale(),0===this._source.points().length||null===t||t.isEmpty()||(i=this._source.ownerSource(),null!=(n=null!==i?i.firstValue():null)&&(o=this._data.priceProperty.value(),r=this._data.colorProperty.value(),e.background=r,e.color=this.generateTextColor(r),e.coordinate=t.priceToCoordinate(o,n),e.text=t.formatPrice(o,n),e.visible=!0))},t}(o.a)},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolPolyline";var n;t?n=t:(n=new s("linetoolpolyline"),n.filled.setValue(!1)),r.call(this,e,n),n.addExclusion("filled"),i.e(0).then(function(e){var t=i(790).PolylinePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(6).Point,r=i(0).LineDataSource,s=i(3).DefaultProperty,a=i(2).propertyPages;inherit(n,r),n.prototype.pointsCount=function(){return-1},n.prototype.title=function(){return"Polyline"},n.prototype.name=function(){return"Polyline"},n.prototype.addPoint=function(e){var t,i,n,s,a,l,c,h,u=this._model.timeScale().indexToCoordinate(e.index),d=e.price,p=this.ownerSource().firstValue(),_=this.priceScale().priceToCoordinate(d,p),f=5;if(this._points.length>0){if(t=this._points[this._points.length-1],i=this._model.timeScale().indexToCoordinate(t.index),n=t.price,s=this.priceScale().priceToCoordinate(n,p),new o(u,_).subtract(new o(i,s)).length()<f)return this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0;if(a=this._points[0],l=this._model.timeScale().indexToCoordinate(a.index),c=a.price,h=this.priceScale().priceToCoordinate(c,p),new o(u,_).subtract(new o(l,h)).length()<f)return this._properties.filled.setValue(!0),this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0}return r.prototype.addPoint.call(this,e)},n.prototype.setPoint=function(e,t){var i,n,s,a,l,c,h;r.prototype.setPoint.call(this,e,t),
this._model.timeScale().isEmpty()||this.priceScale().isEmpty()||e!==this._points.length-1&&0!==e||(i=5,n=this.ownerSource().firstValue(),s=this._model.timeScale().indexToCoordinate(t.index),a=this.priceScale().priceToCoordinate(t.price,n),l=e===this._points.length-1?this._points[0]:this._points[this._points.length-1],c=this._model.timeScale().indexToCoordinate(l.index),h=this.priceScale().priceToCoordinate(l.price,n),new o(s,a).subtract(new o(c,h)).length()<i&&this._properties.filled.setValue(!0))},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return a.LineToolPolylineStylesPropertyPage},t.LineToolPolyline=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolPrediction";var n=t||new s("linetoolprediction");n.merge({status:l.AlertStatus.Waiting}),r.call(this,e,n),i.e(0).then(function(e){var t=i(791).PredictionPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(7).ensureNotNull,r=i(0).LineDataSource,s=i(3).DefaultProperty,a=i(2).propertyPages,l=i(353);inherit(n,r),n.prototype.status=function(){return this._properties.status.value()},n.prototype.setStatus=function(e){return this._properties.status.setValue(e)},n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Forecast"},n.prototype.name=function(){return"Forecast"},n.prototype.restorePoints=function(e,t,i){r.prototype.restorePoints.call(this,e,t,i),this.checkAlert()},n.prototype.checkAlert=function(){var e,t,i,n;if(!(this._points.length<2||this._model.mainSeries().bars().isEmpty())){if(e=this._points[1],this.status())return void(e.index>this._model.timeScale().baseIndex()&&this.setStatus(l.AlertStatus.Waiting));t=this._model.mainSeries().bars().valueAt(e.index),null!==t&&(i=this.direction(),i===l.Direction.Up&&t[TradingView.HIGH_PLOT]>=e.price?this.setStatus(l.AlertStatus.Success):i===l.Direction.Down&&t[TradingView.LOW_PLOT]<=e.price?this.setStatus(l.AlertStatus.Success):(n=o(this._model.mainSeries().bars().lastIndex()),e.index!==n&&this.setStatus(l.AlertStatus.Failure)))}},n.prototype.addPoint=function(e){var t=r.prototype.addPoint.call(this,e);return t&&this.checkAlert(),t},n.prototype.endChanging=function(){r.prototype.endChanging.call(this),this.setStatus(l.AlertStatus.Waiting),this.checkAlert()},n.prototype.onData=function(e){r.prototype.onData.call(this,e),this.checkAlert()},n.prototype.endMoving=function(){r.prototype.endMoving.call(this),this.setStatus(l.AlertStatus.Waiting),this.checkAlert()},n.prototype.direction=function(){var e,t;return this.points().length<2?l.Direction.Up:(e=this.points()[0],t=this.points()[1],t.price>e.price?l.Direction.Up:l.Direction.Down)},n.prototype.getStylesPropertyPage=function(){return a.LineToolPredictionStylesPropertyPage},t.LineToolPrediction=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolPriceLabel";var n=t||new r("linetoolpricelabel");o.call(this,e,n),i.e(0).then(function(e){var t=i(792).PriceLabelPaneView
;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 1},n.prototype.title=function(){return"Price Label"},n.prototype.name=function(){return"Price Label"},n.prototype.getStylesPropertyPage=function(){return s.LineToolPriceLabelStylesPropertyPage},t.LineToolPriceLabel=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolBrush";var n=t||new r("linetoolbrush");o.call(this,e,n),this._finished=!1,i.e(0).then(function(e){var t=i(794).BrushPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return-1},n.prototype.finished=function(){return this._finished},n.prototype.finish=function(){this._finished=!0,this._lastPoint=null,this.normalizePoints(),this.createServerPoints()},n.prototype.title=function(){return"Brush"},n.prototype.name=function(){return"Brush"},n.prototype.percentDistance=function(e,t){return Math.abs((t-e)/e)},n.prototype.addPoint=function(e){var t,i,n;return!!this._finished||(this._lastPoint=null,this._points.length>0&&(t=this._points[this._points.length-1],i=this.pointToScreenPoint(t)[1],n=this.pointToScreenPoint(e)[1],n.subtract(i).length()<2)?this._finished:(o.prototype.addPoint.call(this,e),this._finished))},n.prototype.restorePoints=function(e,t,i){o.prototype.restorePoints.call(this,e,t,i),this._finished=!0},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return s.LineToolBrushStylesPropertyPage},t.LineToolBrush=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolArc";var o=t||new d("linetoolarc");u.call(this,e,o),this.version=n.version,i.e(0).then(function(e){var t=i(795).ArcPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(6).Point,r=i(30).distanceToLine,s=i(321),a=s.rotationMatrix,l=s.scalingMatrix,c=s.translationMatrix,h=s.transformPoint,u=i(0).LineDataSource,d=i(3).DefaultProperty,p=i(2).propertyPages;inherit(n,u),n.prototype.startChanging=function(e,t){var i,n,s,a,l,c,h;u.prototype.startChanging.call(this,e,t),0!==e&&1!==e||(i=this.pointToScreenPoint(this._points[0])[0],n=this.pointToScreenPoint(this._points[1])[0],s=this.pointToScreenPoint(this._points[2])[0],this._dist=r(i,n,s).distance,a=n.subtract(i),l=new o(-a.y,a.x),c=i.add(n).scaled(.5),h=s.subtract(c),h.dotProduct(l)<0&&(this._dist=-this._dist))},n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Arc"},n.prototype.name=function(){return"Arc"},n.prototype.setPoint=function(e,t){var i,n,s,u,d,p,_,f,m,y,g,v,S=$.extend({},t),b=this.pointToScreenPoint(this._points[0])[0],w=this.pointToScreenPoint(this._points[1])[0],P=this.pointToScreenPoint(this._points[2])[0];switch(e){case 0:b=this.pointToScreenPoint(S)[0],i=w.subtract(b),n=b.add(w).scaled(.5),
s=new o(-i.y,i.x),s=s.normalized(),P=n.add(s.scaled(this._dist)),P=this.screenPointToPoint(P),this._points[0]=S,this._points[2]=P;break;case 1:u=r(b,w,P).distance,w=this.pointToScreenPoint(S)[0],i=w.subtract(b),n=b.add(w).scaled(.5),s=new o(-i.y,i.x),s=s.normalized(),P=n.add(s.scaled(this._dist)),P=this.screenPointToPoint(P),this._points[1]=S,this._points[2]=P;break;case 2:S=this.pointToScreenPoint(S)[0],u=r(b,w,S).distance,i=w.subtract(b),n=b.add(w).scaled(.5),s=new o(-i.y,i.x),s=s.normalized(),P=n.add(s.scaled(u)),d=n.add(s.scaled(-u)),p=i.length(),_=i.x/p,f=i.y/p,m=Math.acos(_),f<0&&(m=-m),y=c(-n.x,-n.y),S=h(y,S),g=h(y,P),y=a(-m),S=h(y,S),g=h(y,g),y=l(1,p/(2*u)),S=h(y,S),g=h(y,g),v=S.y*g.y>=0?new o(P.x,P.y):new o(d.x,d.y),v=this.screenPointToPoint(v),this._points[2]=v}this.normalizePoints()},n.version=2,n.prototype.migrateVersion=function(e,t,i){var n,o;1===e&&2===this._points.length&&(n=(2*this._points[0].price+3*this._points[1].price)/5,this._points.append({price:n,index:this._points[1].index})),1===e&&2===this._timePoint.length&&(n=(2*this._timePoint[0].price+3*this._timePoint[1].price)/5,o={price:n,offset:this._timePoint[1].offset,time_t:this._timePoint[1].time_t},this._timePoint.append(o))},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return p.LineToolArcStylesPropertyPage},t.LineToolArc=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolCallout";var n=t||new a("linetoolcallout");n.hasChild("text")||n.addChild("text",new s($.t("Text"))),n.addExclusion("text"),o.call(this,e,n),this._barOffset=0,this._timeScale=e.timeScale(),i.e(0).then(function(e){var t=i(796).CalloutPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(28).DataSource,s=i(13),a=i(3).DefaultProperty,l=i(2).propertyPages,c=i(354).CalloutConsts;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Callout"},n.prototype.name=function(){return"Callout"},n.prototype.correctPoints=function(e){var t=this._currentMovingPoint.index-this._startMovingPoint.index,i=this._currentMovingPoint.price-this._startMovingPoint.price,n=e[1];n.index+=t,n.price+=i,e[1]=n},n.prototype.addPoint=function(e){var t=o.prototype.addPoint.call(this,e);return t&&this._calculateBarOffset(),t},n.prototype._calculateBarOffset=function(){this.points().length>1&&(this._barOffset=this.points()[1].index-this.points()[0].index)},n.prototype.setLastPoint=function(e){o.prototype.setLastPoint.call(this,e),2===this.points().length&&this._calculateBarOffset()},n.prototype.setPoint=function(e,t){var i,n,r,s,a;switch(e){case 0:o.prototype.setPoint.call(this,e,t),this._calculateBarOffset();break;case 1:if(i=this.properties(),!i.wordWrapWidth)return;if(n=this._points,r=this._dragStartLeftEdgeIndex,s=Math.round((t.index-r)/2),isFinite(r)&&isFinite(s)){if(n[1]={index:r+s,price:n[1].price},this._calculateBarOffset(),this.normalizePoints(),
a=this._timeScale.indexToCoordinate(r+2*s)-this._timeScale.indexToCoordinate(r)-c.RoundRadius-c.TextMargins,!isFinite(a))return;i.wordWrapWidth.setValue(Math.max(c.MinWidth,a));break}n[1]=t,this._calculateBarOffset(),this.normalizePoints()}},n.prototype.startDragPoint=function(e,t){var i=this.properties();1===e&&i.wordWrap&&i.wordWrap.value()&&(this._dragStartLeftEdgeIndex=2*this.points()[1].index-t.index)},n.prototype.move=function(e){o.prototype.move.call(this,e),this._calculateBarOffset()},n.prototype.state=function(e){var t=o.prototype.state.call(this,e);return t.barOffset=this._barOffset,t},n.prototype.restoreData=function(e){e.barOffset?this._barOffset=e.barOffset:this._calculateBarOffset(),this._calculatePoint2()},n.prototype.setPriceScale=function(e){r.prototype.setPriceScale.call(this,e),e&&e.priceRange()&&this._calculatePoint2()},n.prototype._calculatePoint2=function(){var e,t;this._model.lineBeingEdited()!==this&&this._model.sourceBeingMoved()!==this&&(this._points.length<2||(e=this.points()[0],t=this.points()[1],this._points[1]={price:t.price,index:e.index+this._barOffset}))},n.prototype.getStylesPropertyPage=function(){return l.LineToolCalloutStylesPropertyPage},t.LineToolCallout=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolBalloon";var n=t||new s("linetoolballoon");n.hasChild("text")||n.addChild("text",new r($.t("Comment"))),n.addExclusion("text"),o.call(this,e,n),i.e(0).then(function(e){var t=i(797).BalloonPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(13),s=i(3).DefaultProperty,a=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 1},n.prototype.title=function(){return"Balloon"},n.prototype.name=function(){return"Balloon"},n.prototype.getStylesPropertyPage=function(){return a.LineToolBalloonStylesPropertyPage},t.LineToolBalloon=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolHorzLine";var n=t||new a("linetoolhorzline");n.hasChild("text")||n.addChild("text",new s("")),n.addExclusion("text"),this._priceAxisView=new r(this),o.call(this,e,n),i.e(0).then(function(e){var t=i(798).HorzLinePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(174).LineToolHorzLinePriceAxisView,s=i(13),a=i(3).DefaultProperty,l=i(2).propertyPages;inherit(n,o),n.prototype.state=function(e){var t=o.prototype.state.call(this,e);return t.points&&0!==t.points.length&&(t.points[0].offset=0),t},n.prototype.pointsCount=function(){return 1},n.prototype.title=function(){return"Horizontal Line"},n.prototype.name=function(){return"Horizontal Line"},n.prototype.priceAxisViews=function(e,t){return this.isSourceHidden()?null:t===this.priceScale()&&this.properties().showPrice.value()&&this._model.paneForSource(this)===e?[this._priceAxisView]:null},n.prototype.updateAllViews=function(){o.prototype.updateAllViews.call(this),this._priceAxisView.update()},n.prototype.canHasAlert=function(){return!0},
n.prototype._getAlertPlots=function(){return[this.points()[0].price]},n.prototype.getInputsPropertyPage=function(){return l.LineToolHorzLineInputsPropertyPage},n.prototype.getStylesPropertyPage=function(){return l.LineToolHorzLineStylesPropertyPage},t.LineToolHorzLine=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolHorzRay";var n=t||new a("linetoolhorzray");n.hasChild("text")||n.addChild("text",new s("")),n.addExclusion("text"),this._priceAxisView=new r(this),o.call(this,e,n),i.e(0).then(function(e){var t=i(799).HorzRayPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(174).LineToolHorzLinePriceAxisView,s=i(13),a=i(3).DefaultProperty,l=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 1},n.prototype.title=function(){return"Horizontal Ray"},n.prototype.name=function(){return"Horizontal Ray"},n.prototype.priceAxisViews=function(e,t){return this.isSourceHidden()?null:t===this.priceScale()&&this.properties().showPrice.value()&&this._model.paneForSource(this)===e?[this._priceAxisView]:null},n.prototype.updateAllViews=function(){o.prototype.updateAllViews.call(this),this._priceAxisView.update()},n.prototype.canHasAlert=function(){return!0},n.prototype._getAlertPlots=function(){var e=this._points[0],t={index:e.index+1,price:e.price};return[this._linePointsToAlertPlot([e,t],null,!1,!0)]},n.prototype.getStylesPropertyPage=function(){return l.LineToolHorzLineStylesPropertyPage},t.LineToolHorzRay=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolRectangle";var n=t||new r("linetoolrectangle");o.call(this,e,n),i.e(0).then(function(e){var t=i(800).RectanglePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Rectangle"},n.prototype.name=function(){return"Rectangle"},n.prototype.setPoint=function(e,t,i){var n,r,s;if(e<2)return void o.prototype.setPoint.call(this,e,t,i);i&&i.shift&&this._properties.snapTo45Degrees&&(n=this.points()[0],r=this.points()[1],s={price:2===e?n.price:r.price,index:2===e?r.index:n.index},this._snapPoint45Degree(t,s)),3===e?(this._points[0].price=t.price,this._points[1].index=t.index):(this._points[1].price=t.price,this._points[0].index=t.index),this.normalizePoints()},n.prototype.getStylesPropertyPage=function(){return s.LineToolRectangleStylesPropertyPage},t.LineToolRectangle=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolEllipse";var o=t||new a("linetoolellipse");s.call(this,e,o),this.version=n.version,i.e(0).then(function(e){var t=i(801).EllipsePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(6).Point,r=i(30).distanceToLine,s=i(0).LineDataSource,a=i(3).DefaultProperty,l=i(2).propertyPages;inherit(n,s),n.prototype.startChanging=function(e,t){var i,n,o
;s.prototype.startChanging.call(this,e,t),0!==e&&1!==e||(i=this.pointToScreenPoint(this._points[0])[0],n=this.pointToScreenPoint(this._points[1])[0],o=this.pointToScreenPoint(this._points[2])[0],this._dist=r(i,n,o).distance||0)},n.prototype._preparePoint=function(e,t){var i=this._preparePointInternal(e,t,!1);return t&&t.shift&&this._points[0].index===this._points[1].index&&this._fixVerticalDiameterPoints(this._points[1],this._points[0],i),i},n.prototype._preparePointInternal=function(e,t,i){var n,r,a,l,c,h,u,d,p,_,f=$.extend({},e);if(t&&t.shift){if(n=this.points().length,!this._fakePointAdded&&3===n&&!i)return f;(this._fakePointAdded||2===n||i)&&(this._snapPoint45Degree(e,this._points[0]),this._fakePointAdded?this._points[1]=e:i||(this._fakePointAdded=!0,s.prototype._addPointIntenal.call(this,e)),r=this.pointToScreenPoint(this._points[0])[0],a=this.pointToScreenPoint(this._points[1])[0],l=a.x-r.x,c=a.y-r.y,h=Math.sqrt(l*l+c*c)/2,u=a.subtract(r),d=r.add(a).scaled(.5),p=new o(-u.y,u.x),p=p.normalized(),_=d.add(p.scaled(h)),f=this.screenPointToPoint(_),(TradingView.isNaN(f.price)||TradingView.isNaN(f.index))&&(f=this.screenPointToPoint(d)))}else this._fakePointAdded&&(this._points.splice(1,1),this._fakePointAdded=!1);return f},n.prototype._fixVerticalDiameterPoints=function(e,t,i){var n=this.pointToScreenPoint(e)[0],o=this.pointToScreenPoint(t)[0],r=this._model.timeScale(),s=r.indexToCoordinate(e.index),a=r.indexToCoordinate(i.index),l=2*Math.abs(s-a);l*=t.price>e.price?1:-1,e.price=this.screenPointToPoint({x:n.x,y:o.y+l}).price},n.prototype.addPoint=function(e,t,i){var n=s.prototype.addPoint.call(this,e,t,i);return n&&(this._fakePointAdded=!1),n},n.prototype.setPoint=function(e,t,i){var n,s,a,l,c=$.extend({},t),h=this.pointToScreenPoint(this._points[0])[0],u=this.pointToScreenPoint(this._points[1])[0],d=this.pointToScreenPoint(this._points[2])[0];switch(e){case 0:if(i&&i.shift){this._snapPoint45Degree(c,this._points[1]),this._points[0]=c,this._points[2]=this._preparePointInternal(this._points[2],i,!0),this._points[0].index===this._points[1].index&&this._fixVerticalDiameterPoints(this._points[0],this._points[1],this._points[2]);break}h=this.pointToScreenPoint(c)[0],n=u.subtract(h),s=h.add(u).scaled(.5),a=new o(-n.y,n.x),a=a.normalized(),d=s.add(a.scaled(this._dist)),d=this.screenPointToPoint(d),this._points[0]=c,this._points[2]=d;break;case 1:if(i&&i.shift){this._snapPoint45Degree(c,this._points[0]),this._points[1]=c,this._points[2]=this._preparePointInternal(this._points[2],i,!0),this._points[0].index===this._points[1].index&&this._fixVerticalDiameterPoints(this._points[1],this._points[0],this._points[2]);break}u=this.pointToScreenPoint(c)[0],n=u.subtract(h),s=h.add(u).scaled(.5),a=new o(-n.y,n.x),a=a.normalized(),d=s.add(a.scaled(this._dist)),d=this.screenPointToPoint(d),this._points[1]=c,this._points[2]=d;break;case 2:case 3:c=this.pointToScreenPoint(c)[0],l=r(h,u,c).distance,n=u.subtract(h),s=h.add(u).scaled(.5),a=new o(-n.y,n.x),a=a.normalized(),d=s.add(a.scaled(l)),d=this.screenPointToPoint(d),this._points[2]=d}
this.normalizePoints()},n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Ellipse"},n.prototype.name=function(){return"Ellipse"},n.version=2,n.prototype.migrateVersion=function(e,t,i){var n,o,r;1===e&&2===this._points.length&&(n=this._points[0].price,o=.5*(this._points[0].price+this._points[1].price),this._points[0]={price:o,index:this._points[0].index},this._points[1]={price:o,index:this._points[1].index},this._points.push({price:n,index:this._points[0].index})),1===e&&2===this._timePoint.length&&(n=this._timePoint[0].price,o=.5*(this._timePoint[0].price+this._timePoint[1].price),this._timePoint[0].price=o,this._timePoint[1].price=o,r={price:n,offset:this._timePoint[0].offset,time_t:this._timePoint[0].time_t},this._timePoint.push(r))},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return l.LineToolEllipseStylesPropertyPage},t.LineToolEllipse=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolTimeCycles";var n=t||new r("linetooltimecycles");o.call(this,e,n),i.e(0).then(function(e){var t=i(802).TimeCyclesPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Time Cycles"},n.prototype.name=function(){return"Time Cycles"},n.prototype.setPoint=function(e,t,i){var n=$.extend({},t),o=this._points[0],r=this._points[1];o.price=n.price,r.price=n.price,this._points[e]=n,this.normalizePoints()},n.prototype.addPoint=function(e,t,i){var n,r,s=o.prototype.addPoint.call(this,e,t,!0);return s&&(n=this._points[0],r=this._points[1],r.price=n.price,i||(this.normalizePoints(),this.createServerPoints())),s},n.prototype.getStylesPropertyPage=function(){return s.LineToolTimeCyclesPropertyPage},t.LineToolTimeCycles=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolSineLine";var n=t||new r("linetoolsineline");o.call(this,e,n),i.e(0).then(function(e){var t=i(803).SineLinePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Sine Line"},n.prototype.name=function(){return"Sine Line"},n.prototype.getStylesPropertyPage=function(){return s.LineToolTimeCyclesPropertyPage},t.LineToolSineLine=n},function(e,t,i){"use strict";function n(e,t,i){this._source=e,this._index=t,this._bars=i||[]}function o(e,t,i){this._source=e,l.call(this,"linetoolghostfeed",t,i)}function r(e,t,n){var s,l;this._constructor="LineToolGhostFeed",t?(s=t,s._source=this):s=new o(this),n||(l=Math.round(this.calculateATR(e)),s.averageHL.setValue(l)),a.call(this,e,s),this._segments=[],s.averageHL.listeners().subscribe(this,r.prototype.regenerate),s.variance.listeners().subscribe(this,r.prototype.regenerate),s.points||s.addProperty("points"),
this._currentAverageHL=this._properties.averageHL.value(),this._currentVariance=this._properties.variance.value(),this._currentInterval=e.mainSeries().interval(),i.e(0).then(function(e){var t=i(804).GhostFeedPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var s=i(50).sign,a=i(0).LineDataSource,l=i(3).DefaultProperty,c=i(2).propertyPages;n.prototype.setBars=function(e){this._bars=e||[]},n.prototype.clone=function(e){return new n(e,this._index,TradingView.clone(this._bars))},n.prototype.createBar=function(){var e,t,i,n,o,r=this._source.properties().averageHL.value(),s=this._source.properties().variance.value()/100,a=this._source._model.mainSeries().base(),l=Math.random(),c=r*(1-2*l)*s;return l=Math.random(),e=r*(1+(.5-l)*s),t=c-e/2,i=t+e,n=t+Math.random()*e,o=t+Math.random()*e,{o:n/a,h:i/a,l:t/a,c:o/a}},n.prototype.generate=function(){var e,t,i,n,o,r;if(this._bars=[],e=this._source.points(),t=e[this._index],i=e[this._index+1],t&&i&&t.index!==i.index)for(this._avgHL=this._source.properties().averageHL.value(),this._variance=this._source.properties().variance.value()/100,n=this._index?t.index+1:t.index,o=s(i.index-t.index),r=n;r!==i.index;r+=o)this._bars.push(this.createBar())},n.prototype.bars=function(){return this._bars},n.prototype.setSize=function(e){if(e<this._bars.length)this._bars.splice(e,this._bars.length-e);else for(;this._bars.length<e;)this._bars.push(this.createBar())},inherit(o,l),o.prototype.restoreFactoryDefaults=function(){l.prototype.restoreFactoryDefaults.call(this);var e=Math.round(this._source.calculateATR());this.averageHL.setValue(e)},inherit(r,a),r.prototype.createPropertiesObject=function(e,t,i){return new o(null,t,i)},r.prototype.regenerate=function(){this._currentAverageHL=this._properties.averageHL.value(),this._currentVariance=this._properties.variance.value(),this._segments.forEach(function(e){e.generate()}),this.updateAllViews(),this._model.updateSource(this)},r.prototype.propertiesChanged=function(){a.prototype.propertiesChanged.call(this),this._currentAverageHL===this._properties.averageHL.value()&&this._currentVariance===this._properties.variance.value()||this.regenerate()},r.prototype.pointsCount=function(){return-1},r.prototype.title=function(){return"Ghost Feed"},r.prototype.name=function(){return"Ghost Feed"},r.prototype.segmentBars=function(e){return this._segments[e].bars()},r.prototype.segments=function(){return this._segments},r.prototype.generateBars=function(e){this._segments.length<=e&&this._segments.push(new n(this,e)),this._segments[e].generate()},r.prototype.addPoint=function(e){var t,i,n;if(this._points.length>0&&(t=this._points[this._points.length-1],t.index===e.index)){for(this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),i=0;i<this._points.length;i++)this._createPointProperty(i);return!0}return n=a.prototype.addPoint.call(this,e),this._finished&&(this._lastPoint=null),this._points.length>1&&this.generateBars(this._points.length-2),n||this._finished},r.prototype.finish=function(){this._finished=!0,
this._lastPoint=null,this.normalizePoints(),this.createServerPoints()},r.prototype.setPoint=function(e,t,i){var n,o,r;a.prototype.setPoint.call(this,e,t,i),e>0&&(n=this.points()[e-1],o=t.index-n.index,this._segments[e-1].setSize(Math.abs(o))),e<this.points().length-1&&(r=this.points()[e+1],o=r.index-t.index,this._segments[e].setSize(Math.abs(o)))},r.prototype.state=function(e){var t=a.prototype.state.call(this,e);return t.segments=this._segments.map(function(e){return{bars:e.bars()}}),t},r.prototype.restoreData=function(e){var t=this;e.segments&&(this._segments=e.segments.map(function(e,i){return new n(t,i,[].concat(e.bars))})),this._currentAverageHL=this._properties.averageHL.value(),this._currentVariance=this._properties.variance.value()},r.prototype.onData=function(e){if(a.prototype.onData.call(this,e),0===this.properties().points._childs.length)for(var t=0;t<this._points.length;t++)this._createPointProperty(t);this._currentInterval!==this._model.mainSeries().interval()&&(this.regenerate(),this._currentInterval=this._model.mainSeries().interval())},r.prototype.cloneData=function(e){var t=this;this._segments=e._segments.map(function(e){return e.clone(t)})},r.prototype.calculateATR=function(e){var t,i=(void 0!==e?e:this._model).mainSeries(),n=[];return i.bars().each(function(e,t){n.push(t[TradingView.HIGH_PLOT]-t[TradingView.LOW_PLOT])}),t=0===n.length?0:n.reduce(function(e,t){return e+t},0)/n.length,t*=i.base()},r.prototype.getInputsPropertyPage=function(){return c.LineToolGhostFeedInputsPropertyPage},r.prototype.getStylesPropertyPage=function(){return c.LineToolGhostFeedStylesPropertyPage},t.LineToolGhostFeed=r},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolBezierQuadro";var n=t||new r("linetoolbezierquadro");o.call(this,e,n),i.e(0).then(function(e){var t=i(805).BezierQuadroPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Curve"},n.prototype.name=function(){return"Curve"},n.prototype.controlPoint=function(){var e=this.pointToScreenPoint(this.points()[0])[0],t=this.pointToScreenPoint(this.points()[1])[0],i=t.subtract(e).scaled(.5),n=i.transposed().scaled(.3),o=e.add(t).scaled(.5),r=o.add(n);return this.screenPointToPoint(r)},n.prototype.setLastPoint=function(e,t){o.prototype.setLastPoint.call(this,e,t),this._controlPoint=this.controlPoint()},n.prototype.addPoint=function(e,t,i){var n,r=o.prototype.addPoint.call(this,e,t,!0);return r&&(n=this.controlPoint(),this._points.push(n),delete this._controlPoint,i||(this.normalizePoints(),this.createServerPoints()),this._createPointProperty(2)),r},n.prototype.restorePoints=function(e,t,i){o.prototype.restorePoints.call(this,e,t,i),this._createPointProperty(2)},n.prototype.getStylesPropertyPage=function(){return s.LineToolBezierStylesPropertyPage},t.LineToolBezierQuadro=n},function(e,t,i){"use strict";function n(e,t){
this._constructor="LineToolBezierCubic";var n=t||new r("linetoolbeziercubic");o.call(this,e,n),i.e(0).then(function(e){var t=i(806).BezierCubicPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Double Curve"},n.prototype.name=function(){return"Double Curve"},n.prototype.controlPoints=function(){var e=this.pointToScreenPoint(this.points()[0])[0],t=this.pointToScreenPoint(this.points()[1])[0],i=t.subtract(e).scaled(.5),n=i.transposed().scaled(.3),o=e.add(t).scaled(.33),r=e.add(t).scaled(.67),s=o.add(n),a=r.subtract(n);return[this.screenPointToPoint(s),this.screenPointToPoint(a)]},n.prototype.setLastPoint=function(e,t){o.prototype.setLastPoint.call(this,e,t),this._controlPoints=this.controlPoints()},n.prototype.addPoint=function(e,t,i){var n,r=o.prototype.addPoint.call(this,e,t,!0);return r&&(n=this.controlPoints(),delete this._controlPoints,this._points.push(n[0]),this._points.push(n[1]),i||(this.normalizePoints(),this.createServerPoints()),this._createPointProperty(2),this._createPointProperty(3)),r},n.prototype.restorePoints=function(e,t,i){o.prototype.restorePoints.call(this,e,t,i),this._createPointProperty(2),this._createPointProperty(3)},n.prototype.getStylesPropertyPage=function(){return s.LineToolBezierStylesPropertyPage},t.LineToolBezierCubic=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolArrow";var i=t||new r("linetoolarrow");o.call(this,e,i)}var o=i(101).LineToolTrendLine,r=i(3).DefaultProperty;inherit(n,o),n.prototype.title=function(){return"Arrow"},n.prototype.name=function(){return"Arrow"},t.LineToolArrow=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolRay";var i=t||new r("linetoolray");o.call(this,e,i)}var o=i(101).LineToolTrendLine,r=i(3).DefaultProperty;inherit(n,o),n.prototype.title=function(){return"Ray"},n.prototype.name=function(){return"Ray"},t.LineToolRay=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolExtended";var i=t||new r("linetoolextended");o.call(this,e,i)}var o=i(101).LineToolTrendLine,r=i(3).DefaultProperty;inherit(n,o),n.prototype.title=function(){return"Extended Line"},n.prototype.name=function(){return"Extended Line"},t.LineToolExtended=n},function(e,t,i){"use strict";function n(e,t){var i=t||this.createPropertiesObject("linetoolschiffpitchfork");r.call(this,e,i),this._constructor="LineToolSchiffPitchfork"}var o=i(19),r=i(122).LineToolPitchfork;inherit(n,r),n.prototype.title=function(){return $.t("Modified Schiff Pitchfork")},n.prototype.name=function(){return"Modified Schiff Pitchfork"},n.prototype.createPropertiesObject=function(e,t,i){return new o(e,t,i,{range:[0,8]})},t.LineToolSchiffPitchfork=n},function(e,t,i){"use strict";function n(e,t){var i=t||this.createPropertiesObject("linetoolschiffpitchfork2");r.call(this,e,i),this._constructor="LineToolSchiffPitchfork2"}
var o=i(19),r=i(122).LineToolPitchfork;inherit(n,r),n.prototype.title=function(){return $.t("Schiff Pitchfork")},n.prototype.name=function(){return"Schiff Pitchfork"},n.prototype.createPropertiesObject=function(e,t,i){return new o(e,t,i,{range:[0,8]})},t.LineToolSchiffPitchfork2=n},function(e,t,i){"use strict";function n(e,t){var i=t||this.createPropertiesObject("linetoolinsidepitchfork");r.call(this,e,i),this._constructor="LineToolInsidePitchfork"}var o=i(19),r=i(122).LineToolPitchfork;inherit(n,r),n.prototype.title=function(){return $.t("Inside Pitchfork")},n.prototype.name=function(){return"Inside Pitchfork"},n.prototype.createPropertiesObject=function(e,t,i){return new o(e,t,i,{range:[0,8]})},t.LineToolInsidePitchfork=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolFlagMark";var n=t||new s("linetoolflagmark");r.call(this,e,n),i.e(0).then(function(t){var n=i(351).MarkPaneView,r=new n(this,e,this.image,25,25,-8,-21);r.setAnchors(new o(0,0)),this._setPaneViews([r])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(6).Point,r=i(0).LineDataSource,s=i(3).DefaultProperty;inherit(n,r),n.prototype.image=new Image,n.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAAsElEQVR4AWMYWcDExOS/YUd4hWF7+H90bNAePpO2liDwJTxyi2htyVXLvlBOWlry2bAtVIumwWXQERFF4zgJ20iPiP8JDCpLeqSuJ6ZdoRJ0SMIRx7QbQtmItgSXnGFbRCzMEnIzK8ISWgL6WzJqibGxsYaFhYUC7SxBWMQPNMjazMxMjebBZWhoKAq00NHc3FyL5nFiaWkpDTTYz8jISI/mEW9qaqoExGFgS+gFRgEAaE0hWxrw50oAAAAASUVORK5CYII=",n.prototype.pointsCount=function(){return 1},n.prototype.title=function(){return"Flag Mark"},n.prototype.name=function(){return"Flag Mark"},n.prototype.version=2,t.LineToolFlagMark=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolCypherPattern";var n=t||new r("linetoolcypherpattern");o.call(this,e,n),i.e(0).then(function(e){var t=i(807).CypherPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(274).LineTool5PointsPattern;inherit(n,s),t.LineToolCypherPattern=n},function(e,t,i){"use strict";(function(e){function n(e){this._line=e,this._data={bodyText:"position",quantityText:"0"},this._closeEnabled=!0}function o(e,t){var o,s,a,l,u,d;this._adapter=new n(this),this._constructor="LineToolPosition",o=t||new c("linetoolposition",void 0,!1,!1),r.call(this,e,o),i.e(0).then(function(e){var t=i(808).PositionPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe),s=e.mainSeries().symbolInfo(),a=null!==s?s.pricescale:100,l=null!==s&&s.fractional?s.minmov:1,u=null!==s&&s.fractional,d=null!==s?s.minmove2:void 0,this._formatter=new h(a,l,u,d)}var r=i(173),s=i(0).LineDataSource,a=i(596).PositionAveragePriceAxisView,l=i(131),c=i(3).DefaultProperty,h=i(21).PriceFormatter;n.prototype.getPrice=function(){return this._line.points().length>0?this._line.points()[0].price:this._line._timePoint.length>0?this._line._timePoint[0].price:void 0},n.prototype.setPrice=function(e){if(this._line.points().length>0){
var t=this._line.points()[0];t.price=e,this._line._points[0]=t,this._line.normalizePoints(),this._line.updateAllViewsAndRedraw()}return this._line._timePoint.length>0&&(this._line._timePoint[0].price=e),this},n.prototype.getText=function(){return this._data.bodyText},n.prototype.setText=function(e){return this._data.bodyText=e||"",this._line.updateAllViewsAndRedraw(),this},n.prototype.setTooltip=function(e){return null==e?e="":e+="",this._line.properties().tooltip.setValue(e),this},n.prototype.getTooltip=function(){return this._line.properties().tooltip.value()},n.prototype.getQuantity=function(){return this._data.quantityText},n.prototype.setQuantity=function(e){return this._data.quantityText=e||"",this._line.updateAllViewsAndRedraw(),this},n.prototype.getExtendLeft=function(){var e=this._line.properties().extendLeft.value();return"inherit"===e?this._line._model.properties().tradingProperties.extendLeft.value():e},n.prototype.setExtendLeft=function(e){return this._line.properties().extendLeft.setValue(e),this},n.prototype.getLineLength=function(){var e=this._line.properties().lineLength.value();return"inherit"===e?this._line._model.properties().tradingProperties.lineLength.value():e},n.prototype.setLineLength=function(e){return this._line.properties().lineLength.setValue(Math.max(0,Math.min(e,100))),this},n.prototype.getLineColor=function(){return l.getColorFromProperties(this._line.properties().lineColor,this._line.properties().lineTransparency)},n.prototype.setLineColor=function(e){return l.setColorToProperties(e,this._line.properties().lineColor,this._line.properties().lineTransparency),this},n.prototype.getLineStyle=function(){var e=this._line.properties().lineStyle.value();return"inherit"===e?this._line._model.properties().tradingProperties.lineStyle.value():e},n.prototype.setLineStyle=function(e){return this._line.properties().lineStyle.setValue(e),this},n.prototype.getLineWidth=function(){var e=this._line.properties().lineWidth.value();return"inherit"===e?this._line._model.properties().tradingProperties.lineWidth.value():e},n.prototype.setLineWidth=function(e){return this._line.properties().lineWidth.setValue(e),this},n.prototype.getBodyBorderColor=function(){return l.getColorFromProperties(this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency)},n.prototype.setBodyBorderColor=function(e){return l.setColorToProperties(e,this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency),this},n.prototype.getBodyBackgroundColor=function(){return l.getColorFromProperties(this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency)},n.prototype.setBodyBackgroundColor=function(e){return l.setColorToProperties(e,this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency),this},n.prototype.getBodyTextColor=function(){return l.getColorFromProperties(this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency)},n.prototype.setBodyTextColor=function(e){
return l.setColorToProperties(e,this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency),this},n.prototype.getBodyFont=function(){return l.getFontFromProperties(this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic)},n.prototype.setBodyFont=function(e){return l.setFontToProperties(e,this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic),this},n.prototype.getQuantityBorderColor=function(){return l.getColorFromProperties(this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency)},n.prototype.setQuantityBorderColor=function(e){return l.setColorToProperties(e,this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency),this},n.prototype.getQuantityBackgroundColor=function(){return l.getColorFromProperties(this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency)},n.prototype.setQuantityBackgroundColor=function(e){return l.setColorToProperties(e,this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency),this},n.prototype.getQuantityTextColor=function(){return l.getColorFromProperties(this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency)},n.prototype.setQuantityTextColor=function(e){return l.setColorToProperties(e,this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency),this},n.prototype.getQuantityFont=function(){return l.getFontFromProperties(this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic)},n.prototype.setQuantityFont=function(e){return l.setFontToProperties(e,this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic),this},n.prototype.getReverseButtonBorderColor=function(){return l.getColorFromProperties(this._line.properties().reverseButtonBorderColor,this._line.properties().reverseButtonBorderTransparency)},n.prototype.setReverseButtonBorderColor=function(e){return l.setColorToProperties(e,this._line.properties().reverseButtonBorderColor,this._line.properties().reverseButtonBorderTransparency),this},n.prototype.getReverseButtonBackgroundColor=function(){return l.getColorFromProperties(this._line.properties().reverseButtonBackgroundColor,this._line.properties().reverseButtonBackgroundTransparency)},n.prototype.setReverseButtonBackgroundColor=function(e){return l.setColorToProperties(e,this._line.properties().reverseButtonBackgroundColor,this._line.properties().reverseButtonBackgroundTransparency),this},n.prototype.getReverseButtonIconColor=function(){
return l.getColorFromProperties(this._line.properties().reverseButtonIconColor,this._line.properties().reverseButtonIconTransparency)},n.prototype.setReverseButtonIconColor=function(e){return l.setColorToProperties(e,this._line.properties().reverseButtonIconColor,this._line.properties().reverseButtonIconTransparency),this},n.prototype.getCloseButtonBorderColor=function(){return l.getColorFromProperties(this._line.properties().closeButtonBorderColor,this._line.properties().closeButtonBorderTransparency)},n.prototype.setCloseButtonBorderColor=function(e){return l.setColorToProperties(e,this._line.properties().closeButtonBorderColor,this._line.properties().closeButtonBorderTransparency),this},n.prototype.getCloseButtonBackgroundColor=function(){return l.getColorFromProperties(this._line.properties().closeButtonBackgroundColor,this._line.properties().closeButtonBackgroundTransparency)},n.prototype.setCloseButtonBackgroundColor=function(e){return l.setColorToProperties(e,this._line.properties().closeButtonBackgroundColor,this._line.properties().closeButtonBackgroundTransparency),this},n.prototype.getCloseButtonIconColor=function(){return l.getColorFromProperties(this._line.properties().closeButtonIconColor,this._line.properties().closeButtonIconTransparency)},n.prototype.setCloseButtonIconColor=function(e){return l.setColorToProperties(e,this._line.properties().closeButtonIconColor,this._line.properties().closeButtonIconTransparency),this},n.prototype.block=function(){this._blocked=!0,this._line.updateAllViewsAndRedraw()},n.prototype.unblock=function(){this._blocked=!1,this._line.updateAllViewsAndRedraw()},n.prototype.isFunction=function(e){return"function"==typeof e},n.prototype.onReverse=function(e,t){return t?this.isFunction(t)&&(this._onReverseData=e,this._onReverseCallback=t):this.isFunction(e)&&(this._onReverseCallback=e),this},n.prototype.callOnReverse=function(){this.isFunction(this._onReverseCallback)&&this._onReverseCallback.call(this,this._onReverseData)},n.prototype.isOnReverseCallbackPresent=function(){return this.isFunction(this._onReverseCallback)},n.prototype.onClose=function(e,t){return t?this.isFunction(t)&&(this._onCloseData=e,this._onCloseCallback=t):this.isFunction(e)&&(this._onCloseCallback=e),this},n.prototype.setCloseEnabled=function(e){return this._closeEnabled===e?this:(this._closeEnabled=e,this._onCloseCallback&&this._line.updateAllViewsAndRedraw(),this)},n.prototype.isCloseEnabled=function(){return this._closeEnabled},n.prototype.callOnClose=function(){this.isFunction(this._onCloseCallback)&&this._closeEnabled&&this._onCloseCallback.call(this,this._onCloseData)},n.prototype.isOnCloseCallbackPresent=function(){return this._closeEnabled&&this.isFunction(this._onCloseCallback)},n.prototype.onModify=function(e,t){return t?this.isFunction(t)&&(this._onModifyData=e,this._onModifyCallback=t):this.isFunction(e)&&(this._onModifyCallback=e),this},n.prototype.callOnModify=function(){this.isFunction(this._onModifyCallback)&&this._onModifyCallback.call(this,this._onModifyData)},
n.prototype.onContextMenu=function(e,t){return t?this.isFunction(t)&&(this._onContextMenuData=e,this._onContextMenuCallback=t):this.isFunction(e)&&(this._onContextMenuCallback=e),this},n.prototype.callOnContextMenu=function(){if(this.isFunction(this._onContextMenuCallback))return this._onContextMenuCallback.call(this,this._onContextMenuData)},n.prototype.remove=function(){this._line._model.removeSource(this._line),delete this._line},inherit(o,r),o.prototype.setPoint=function(e,t,i){this._points[e]=t,this.normalizePoints()},o.prototype.addPoint=function(e,t){return this._points.push(e),this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0},o.skipMagnetting=!0,o.prototype.title=function(){return"Position"},o.prototype.name=function(){return"Position"},o.prototype.createPriceAxisView=function(e){return this._priceAxisView=new a(this,{pointIndex:e,backgroundProperty:this.properties().lineColor}),this._priceAxisView},o.prototype.paneViews=function(t){return TradingView.printing&&!e.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showPositions.value()?s.prototype.paneViews.call(this,t):null},o.prototype.priceAxisViews=function(t,i){return TradingView.printing&&!e.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showPositions.value()?s.prototype.priceAxisViews.call(this,t,i):null},o.prototype.hasContextMenu=function(){return!0},o.prototype.contextMenuItems=function(){return this._adapter.callOnContextMenu()},o.prototype.formatter=function(){return this._formatter},t.LineToolPosition=o}).call(t,i(5))},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"PositionAveragePriceAxisView",function(){return r}),n=i(1),o=i(169),r=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.c(t,e),t.prototype._formatPrice=function(e,t){return this._source.formatter().format(e)},t}(o.LineToolPriceAxisView)},function(e,t,i){"use strict";(function(e){function n(e){this._line=e,this._data={bodyText:"order",quantityText:"0"},this._editable=!0}function o(e,t){this._adapter=new n(this),this._constructor="LineToolOrder";var o=t||new c("linetoolorder",void 0,!1,!1);r.call(this,e,o),i.e(0).then(function(e){var t=i(809).OrderPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var r=i(173),s=i(169).LineToolPriceAxisView,a=i(131),l=i(0).LineDataSource,c=i(3).DefaultProperty;n.prototype.setEditable=function(e){return this._editable=e,this},n.prototype.getPrice=function(){return this._line.points().length>0?this._line.points()[0].price:this._line._timePoint.length>0?this._line._timePoint[0].price:void 0},n.prototype.setPrice=function(e){if(this._line.points().length>0){var t=this._line.points()[0];t.price=e,this._line._points[0]=t,this._line.normalizePoints(),this._line.updateAllViewsAndRedraw()}return this._line._timePoint.length>0&&(this._line._timePoint[0].price=e),this},n.prototype.getText=function(){return this._data.bodyText},
n.prototype.setText=function(e){return this._data.bodyText=e||"",this._line.updateAllViewsAndRedraw(),this},n.prototype.setTooltip=function(e){return null==e?e="":e+="",this._line.properties().tooltip.setValue(e),this},n.prototype.getTooltip=function(){return this._line.properties().tooltip.value()},n.prototype.getQuantity=function(){return this._data.quantityText},n.prototype.setQuantity=function(e){return this._data.quantityText=e||"",this._line.updateAllViewsAndRedraw(),this},n.prototype.getExtendLeft=function(){var e=this._line.properties().extendLeft.value();return"inherit"===e?this._line._model.properties().tradingProperties.extendLeft.value():e},n.prototype.setExtendLeft=function(e){return this._line.properties().extendLeft.setValue(e),this},n.prototype.getLineLength=function(){var e=this._line.properties().lineLength.value();return"inherit"===e?this._line._model.properties().tradingProperties.lineLength.value():e},n.prototype.setLineLength=function(e){return this._line.properties().lineLength.setValue(Math.max(0,Math.min(e,100))),this},n.prototype.getLineColor=function(){return a.getColorFromProperties(this._line.properties().lineColor,this._line.properties().lineTransparency)},n.prototype.setLineColor=function(e){return a.setColorToProperties(e,this._line.properties().lineColor,this._line.properties().lineTransparency),this},n.prototype.getLineStyle=function(){var e=this._line.properties().lineStyle.value();return"inherit"===e?this._line._model.properties().tradingProperties.lineStyle.value():e},n.prototype.setLineStyle=function(e){return this._line.properties().lineStyle.setValue(e),this},n.prototype.getLineWidth=function(){var e=this._line.properties().lineWidth.value();return"inherit"===e?this._line._model.properties().tradingProperties.lineWidth.value():e},n.prototype.setLineWidth=function(e){return this._line.properties().lineWidth.setValue(e),this},n.prototype.getBodyBorderColor=function(){return a.getColorFromProperties(this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency)},n.prototype.setBodyBorderColor=function(e){return a.setColorToProperties(e,this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency),this},n.prototype.getBodyBackgroundColor=function(){return a.getColorFromProperties(this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency)},n.prototype.setBodyBackgroundColor=function(e){return a.setColorToProperties(e,this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency),this},n.prototype.getBodyTextColor=function(){return a.getColorFromProperties(this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency)},n.prototype.setBodyTextColor=function(e){return a.setColorToProperties(e,this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency),this},n.prototype.getBodyFont=function(){
return a.getFontFromProperties(this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic)},n.prototype.setBodyFont=function(e){return a.setFontToProperties(e,this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic),this},n.prototype.getQuantityBorderColor=function(){return a.getColorFromProperties(this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency)},n.prototype.setQuantityBorderColor=function(e){return a.setColorToProperties(e,this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency),this},n.prototype.getQuantityBackgroundColor=function(){return a.getColorFromProperties(this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency)},n.prototype.setQuantityBackgroundColor=function(e){return a.setColorToProperties(e,this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency),this},n.prototype.getQuantityTextColor=function(){return a.getColorFromProperties(this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency)},n.prototype.setQuantityTextColor=function(e){return a.setColorToProperties(e,this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency),this},n.prototype.getQuantityFont=function(){return a.getFontFromProperties(this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic)},n.prototype.setQuantityFont=function(e){return a.setFontToProperties(e,this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic),this},n.prototype.getCancelButtonBorderColor=function(){return a.getColorFromProperties(this._line.properties().cancelButtonBorderColor,this._line.properties().cancelButtonBorderTransparency)},n.prototype.setCancelButtonBorderColor=function(e){return a.setColorToProperties(e,this._line.properties().cancelButtonBorderColor,this._line.properties().cancelButtonBorderTransparency),this},n.prototype.getCancelButtonBackgroundColor=function(){return a.getColorFromProperties(this._line.properties().cancelButtonBackgroundColor,this._line.properties().cancelButtonBackgroundTransparency)},n.prototype.setCancelButtonBackgroundColor=function(e){return a.setColorToProperties(e,this._line.properties().cancelButtonBackgroundColor,this._line.properties().cancelButtonBackgroundTransparency),this},n.prototype.getCancelButtonIconColor=function(){return a.getColorFromProperties(this._line.properties().cancelButtonIconColor,this._line.properties().cancelButtonIconTransparency)},n.prototype.setCancelButtonIconColor=function(e){
return a.setColorToProperties(e,this._line.properties().cancelButtonIconColor,this._line.properties().cancelButtonIconTransparency),this},n.prototype.block=function(){this._blocked=!0,this._line.updateAllViewsAndRedraw()},n.prototype.unblock=function(){this._blocked=!1,this._line.updateAllViewsAndRedraw()},n.prototype.isFunction=function(e){return"function"==typeof e},n.prototype.onCancel=function(e,t){return t?this.isFunction(t)&&(this._onCancelData=e,this._onCancelCallback=t):this.isFunction(e)&&(this._onCancelCallback=e),this},n.prototype.callOnCancel=function(){this.isFunction(this._onCancelCallback)&&this._onCancelCallback.call(this,this._onCancelData)},n.prototype.isOnCancelCallbackPresent=function(){return this.isFunction(this._onCancelCallback)},n.prototype.onModify=function(e,t){return t?this.isFunction(t)&&(this._onModifyData=e,this._onModifyCallback=t):this.isFunction(e)&&(this._onModifyCallback=e),this},n.prototype.callOnModify=function(){this.isFunction(this._onModifyCallback)&&this._onModifyCallback.call(this,this._onModifyData)},n.prototype.onMove=function(e,t){return t?this.isFunction(t)&&(this._onMoveData=e,this._onMoveCallback=t):this.isFunction(e)&&(this._onMoveCallback=e),this},n.prototype.callOnMove=function(){this.isFunction(this._onMoveCallback)&&this._onMoveCallback.call(this,this._onMoveData)},n.prototype.onContextMenu=function(e,t){return t?this.isFunction(t)&&(this._onContextMenuData=e,this._onContextMenuCallback=t):this.isFunction(e)&&(this._onContextMenuCallback=e),this},n.prototype.callOnContextMenu=function(){if(this.isFunction(this._onContextMenuCallback))return this._onContextMenuCallback.call(this,this._onContextMenuData)},n.prototype.remove=function(){this._line._model.removeSource(this._line),delete this._line},n.prototype.shouldShowModifyOrder=function(){return!!this._onModifyCallback},inherit(o,r),o.skipMagnetting=!0,o.prototype.setPoint=function(e,t,i){this._points[e]=t,this.normalizePoints()},o.prototype.addPoint=function(e,t){return this._points.push(e),this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0},o.prototype.title=function(){return"Order"},o.prototype.name=function(){return"Order"},o.prototype.endMoving=function(e){var t=this._startMovingPoint&&this._currentMovingPoint&&this._startMovingPoint.price!==this._currentMovingPoint.price;r.prototype.endMoving.call(this),!e&&t&&this._adapter.callOnMove()},o.prototype.createPriceAxisView=function(e){return this._priceAxisView=new s(this,{pointIndex:e,backgroundProperty:this.properties().lineColor}),this._priceAxisView},o.prototype.paneViews=function(t){return TradingView.printing&&!e.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showOrders.value()?l.prototype.paneViews.call(this,t):null},o.prototype.priceAxisViews=function(t,i){return TradingView.printing&&!e.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showOrders.value()?l.prototype.priceAxisViews.call(this,t,i):null},o.prototype.hasContextMenu=function(){return!0},
o.prototype.contextMenuItems=function(){return this._adapter.callOnContextMenu()},o.prototype.onlyYMoving=function(){return!0},o.prototype.userEditEnabled=function(){return this._adapter.shouldShowModifyOrder()},t.LineToolOrder=o}).call(t,i(5))},function(e,t,i){"use strict";(function(e){function n(t,i,n){n=n||{},n=Object.assign({},M,n);var o=this;f.call(this),this._properties=i,this._model=t,this._dataWindowView=new h(this,t),this._priceAxisView=new c(this),this._startMeasurePriceAxisView=new c(this),this._endMeasurePriceAxisView=new c(this),this._timeAxisView=new u(this,t),this._startMeasureTimeAxisView=new u(this,t,"measureStartX"),this._endMeasureTimeAxisView=new u(this,t,"measureEndX"),this.visible=!0,t.readOnly()?this.areLinesVisible=!0:m.cursorTool.subscribe(function(e){o.areLinesVisible="arrow"!==e},{callWithLast:!0}),this._movedDelegate=new e,this._subscribed=!1,this._linesShouldBeHidden=this._model.readOnly(),this._selectBarMode=new I(!1),this._barSelectedDelegate=new e,this._mouseClickBoundedHandler=this._mouseClickHandler.bind(this),this._isOnHoveredChartWidget=!1}function o(e,t){this._source=e,this._pane=t,this._pipFormatter=null,this._lastSymbolInfo=null,this._horzTrenRenderer=new d,this._vertTrenRenderer=new d,this._bgRenderer=new _,this._labelRenderer=new p({})}function r(e,t,i,n){this.source=e,this.pane=t,this._horzVisible=i,this._mouseClickHandler=n}function s(e,t,i){this.source=e,this.pane=t,this._axis=i||"x"}var a=i(6).Point,l=i(73).isLineToolName,c=i(599).CrossHairPriceAxisView,h=i(600),u=i(601),d=i(185).TrendLineRenderer,p=i(186).TextRenderer,_=i(303).RectangleRenderer,f=i(28).DataSource,m=i(32),y=i(602).PaneRendererCrossHair,g=i(603).PaneRendererCrossHairLock,v=i(69).CompositeRenderer,S=i(18),b=i(70).PercentageFormatter,w=i(318).TimeSpanFormatter,P=i(315).PipFormatter,T=i(29),x=i(104).LineEnd,C=i(85),L=i(12).isNaN,I=i(16),A=i(38),k=A.forceLTRStr,E=A.startWithLTR,M={additionalMenuEnabled:!1};inherit(n,f),n.prototype.index=0,n.prototype.price=NaN,n.prototype.pane=null,n.prototype.color="white",n.prototype.style="",n.prototype.customization={disableSelection:!0},n.prototype.properties=function(){return this._properties},n.prototype.moved=function(){return this._movedDelegate},n.prototype.saveOriginCoord=function(e,t){this._originX=e,this._originY=t},n.prototype.clearOriginCoord=function(){this._originX=NaN,this._originY=NaN},n.prototype.setPosition=function(e,t,i){this._subscribed||(this._model.mainSeries().onRestarted().subscribe(this,n.prototype.clearMeasure),this._subscribed=!0),this.setLockedPosition(i),this.visible=!0,this._tryToUpdateViews(e,t,i)},n.prototype.update=function(){var e,t,i,n,o,r;this.visible&&(e=this._priceScaleByPane(this.pane),t=this._originX||this.x,i=this._originY||this.y,n=this._model.timeScale().coordinateToIndex(t),o=NaN,null!==e&&(r=this.pane.mainDataSource().firstValue(),o=e.coordinateToPrice(i,r)),this._tryToUpdateViews(n,o,this.pane))},n.prototype._priceScaleByPane=function(e){return e&&!e.defaultPriceScale().isEmpty()?e.defaultPriceScale():null},
n.prototype._tryToUpdateViews=function(e,t,i){this._tryToUpdateData(e,t,i)&&(this.updateAllViews(),this._movedDelegate.fire({time:this._model.timeScale().points().roughTime(this.index),price:this.price}))},n.prototype._tryToUpdateData=function(e,t,i){var n,o=this.x,r=this.y,s=this.price,a=this.index,l=this.pane,c=this._priceScaleByPane(i);return this.index=e,this.x=L(e)?NaN:this._model.timeScale().indexToCoordinate(e),null!==c?(this.pane=i,this.price=t,n=i.mainDataSource().firstValue(),this.y=c.priceToCoordinate(t,n)):(this.pane=null,this.price=NaN,this.y=NaN),o!==this.x||r!==this.y||a!==this.index||s!==this.price||l!==this.pane},n.prototype.setLockedPosition=function(e){delete this.lockedIndex,delete this.lockedX,e!==this._measurePane&&m.lockTimeAxis().value()&&(this.lockedIndex=this._model.timeScale().points().roughIndex(m.lockTimeAxisTime.value()),this.lockedX=this._model.timeScale().indexToCoordinate(this.lockedIndex))},n.prototype.clearPosition=function(){this.visible=!1;var e=this._model.mainSeries().bars().lastIndex();this.index=null!==e?e:NaN,this.price=NaN,this.x=NaN,this.y=NaN,this.pane=null,this.clearOriginCoord()},n.prototype.measureStartY=function(){var e=this._startMeasurePoint.price,t=this._measurePane,i=t.mainDataSource().firstValue();return t.defaultPriceScale().priceToCoordinate(e,i)},n.prototype.measureStartX=function(){return this._model.timeScale().indexToCoordinate(this._startMeasurePoint.index)},n.prototype.measureEndY=function(){var e=this._endMeasurePoint.price,t=this._measurePane,i=t.mainDataSource().firstValue();return t.defaultPriceScale().priceToCoordinate(e,i)},n.prototype.measureEndX=function(){return this._model.timeScale().indexToCoordinate(this._endMeasurePoint.index)},n.prototype.paneViews=function(e){var t=this._selectBarMode.value()&&this._isOnHoveredChartWidget,i=e===this.pane&&!t,n=[new r(this,e,i,this._mouseClickBoundedHandler)];return e===this._measurePane&&(this._measurePaneView||(this._measurePaneView=new o(this,e)),this._measurePaneView.update(),n.push(this._measurePaneView)),m.lockTimeAxis().value()&&n.push(this._timeLockPaneView=this._timeLockPaneView||new s(this,e)),n},n.prototype.dataWindowView=function(){return this._dataWindowView},n.prototype.priceAxisViews=function(e,t){var i,n;return this._linesShouldBeHidden||!this.visible||this.pane!==e||t!==e.defaultPriceScale()?null:(i=[],n=this._selectBarMode.value()&&this._isOnHoveredChartWidget,n||i.push(this._priceAxisView),this._startMeasurePoint&&i.push(this._startMeasurePriceAxisView),this._endMeasurePoint&&i.push(this._endMeasurePriceAxisView),i)},n.prototype.timeAxisView=function(){if(this._linesShouldBeHidden||!this.visible&&!m.lockTimeAxis().value())return null;var e=[this._timeAxisView];return this._startMeasurePoint&&e.push(this._startMeasureTimeAxisView),this._endMeasurePoint&&e.push(this._endMeasureTimeAxisView),e},n.prototype.updateAllViews=function(){this._priceAxisView.update(),this._startMeasurePoint&&(this._startMeasurePriceAxisView.update(),this._startMeasureTimeAxisView.update()),
this._endMeasurePoint&&(this._endMeasurePriceAxisView.update(),this._endMeasureTimeAxisView.update()),this._timeAxisView.update()},n.prototype.startMeasurePoint=function(){return this._startMeasurePoint},n.prototype.startMeasuring=function(e,t){this._startMeasurePoint=e,this._measurePane=t},n.prototype.finishMeasure=function(e){this._endMeasurePoint=e},n.prototype.endMeasurePoint=function(){return this._endMeasurePoint},n.prototype.clearMeasure=function(e){delete this._measurePane,delete this._startMeasurePoint,delete this._endMeasurePoint,delete this._lastValidMeasurePoint,this._model.invalidate(new S(S.LIGHT_UPDATE))},n.prototype.measurePoints=function(){this.updateAllViews();var e=[this._startMeasurePoint];return this._endMeasurePoint?e.push(this._endMeasurePoint):(this._measurePane===this.pane&&(this._lastValidMeasurePoint={x:this.x,y:this.y,rawPrice:this.price,price:this.price,index:this.index}),e.push(this._lastValidMeasurePoint)),e},n.prototype.currentPoint=function(){return new a(this.x,this.y)},n.prototype.appliedIndex=function(){return isFinite(this.lockedIndex)&&this.lockedIndex||this.index},n.prototype.appliedX=function(){return isFinite(this.lockedX)&&this.lockedX||this.x},n.prototype.selectBarMode=function(){return this._selectBarMode},n.prototype.toggleSelectBarMode=function(){this._setSelectBarModeState(!this._selectBarMode.value())},n.prototype.onBarSelected=function(){return this._barSelectedDelegate},n.prototype._setSelectBarModeState=function(e){this._selectBarMode.setValue(e),this._model.invalidate(new S(S.LIGHT_UPDATE))},n.prototype._mouseClickHandler=function(){var e;this._model.mainSeries().bars().contains(this.index)&&null!==(e=this._model.timeScale().indexToTimePoint(this.index))&&(this._setSelectBarModeState(!1),this._barSelectedDelegate.fire(e))},n.prototype.handleContextMenuEvent=function(){this._selectBarMode.value()&&this._setSelectBarModeState(!1)},n.prototype.setOnHoveredChartWidget=function(e){this._isOnHoveredChartWidget=e},n.prototype.isOnHoveredChartWidget=function(){return this._isOnHoveredChartWidget},n.prototype.setLinesShouldBeHidden=function(e){this._linesShouldBeHidden=e},n.prototype.linesShouldBeHidden=function(){return this._linesShouldBeHidden},o.prototype.update=function(){var e,t,i,n,o,r,s,l,c,h,u,d,p,_,f,m,y,g,v,S,T,x,C;if(this._source._endMeasurePoint)e=this._source._endMeasurePoint.price,t=this._source._endMeasurePoint.index;else if(this._source._measurePane===this._source.pane)e=this._source.price,t=this._source.index;else{if(!this._source._lastValidMeasurePoint)return;e=this._source._lastValidMeasurePoint.rawPrice,t=this._source._lastValidMeasurePoint.index}i=e-this._source._startMeasurePoint.price,n=t-this._source._startMeasurePoint.index,o=k(n),r=this._source._startMeasurePoint.price,s=this._source._measurePane.mainDataSource(),l=s.formatter().format(i),this._source._startMeasurePoint.price&&(c=i/this._source._startMeasurePoint.price,l+=" ("+(new b).format(100*c)+")"),h=k(l),this._label=h+"\n"+$.t("{0} bars").format(o),
r=this._source._model._magnet.align(r,this._source._startMeasurePoint.index,this._source._measurePane),e=this._source._model._magnet.align(e,t,this._source._measurePane),u=s.firstValue(),d=this._source._model.timeScale().indexToCoordinate(this._source._startMeasurePoint.index),p=this._source._model.timeScale().indexToCoordinate(t),_=this._source._measurePane.defaultPriceScale().priceToCoordinate(r,u),f=this._source._measurePane.defaultPriceScale().priceToCoordinate(e,u),this._p1=new a(d,_),this._p2=new a(p,f),m=this._source._model.timeScale().indexToUserTime(this._source._startMeasurePoint.index),y=this._source._model.timeScale().indexToUserTime(t),g=this._pane.model().mainSeries().symbolInfo(),g&&g!==this._lastSymbolInfo&&(this._pipFormatter=new P(g.pricescale,g.minmov,g.type,g.minmove2),this._lastSymbolInfo=g),m&&y&&(v=(y.valueOf()-m.valueOf())/1e3,S=this._pipFormatter?this._pipFormatter.format(i):"",T=S?" , "+S:S,x=(new w).format(v),C=E(x),this._label=k(h+T)+"\n"+$.t("{0} bars").format(o)+", "+C)},o.prototype.renderer=function(){var e,t,i,n,o,r,s,l,c,h,u,d,p=new v,_={};return _.points=[this._p1,this._p2],_.width=this._source._model.timeScale().width(),_.height=this._source._measurePane.defaultPriceScale().height(),_.color="#D3E7FF",_.linewidth=0,_.fillBackground=!0,_.transparency=60,_.backcolor="#BADAFF",this._bgRenderer.setData(_),p.append(this._bgRenderer),e=this._p1.add(this._p2).scaled(.5),t=new a(this._p1.x,e.y),i=new a(this._p2.x,e.y),n={points:[t,i],width:_.width,height:_.height,color:"#363c4e",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED,extendleft:!1,extendright:!1,leftend:x.Normal,rightend:x.Arrow},this._horzTrenRenderer.setData(n),p.append(this._horzTrenRenderer),t=new a(e.x,this._p1.y),i=new a(e.x,this._p2.y),n={points:[t,i],width:_.width,height:_.height,color:"#363c4e",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED,extendleft:!1,extendright:!1,leftend:x.Normal,rightend:x.Arrow},this._vertTrenRenderer.setData(n),p.append(this._vertTrenRenderer),o={x:0,y:10},r=function(e,t){return{points:[t],text:e,color:"#FFFFFF",horzAlign:"left",vertAlign:"middle",font:"Arial",offsetX:o.x,offsetY:o.y,bold:!1,italic:!1,fontsize:12,padding:5,highlightBorder:!1,backgroundColor:T.generateColor("#5b85bf",10),backgroundTransparency:10,backgroundVertInflate:5,backgroundHorzInflate:5,backgroundRoundRect:4}},s=.5*(this._p1.x+this._p2.x),l=this._p2.y,c=new a(s,l),h=r(this._label,c),this._labelRenderer.setData(h),u=this._labelRenderer.measure(),d={x:s+h.backgroundHorzInflate+u.textBgPadding-u.width/u.textBgPadding,y:this._p1.y>this._p2.y?c.y-u.height-2*u.textBgPadding-o.y>0?l-u.height-o.y+u.textBgPadding:o.y-2*u.textBgPadding:c.y+u.height+u.textBgPadding+o.y>_.height?_.height-u.height-o.y:l+u.textBgPadding},this._labelRenderer.setPoints([new a(d.x,d.y)]),p.append(this._labelRenderer),p},r.prototype.update=function(){},r.prototype.renderer=function(){var e,t,i,n,o,r,s={},a=this.source.visible&&this.source.areLinesVisible,c=m.lockTimeAxis().value();return s.horzLinesVisible=a&&this._horzVisible,s.vertLinesVisible=a||c,
e=this.pane._model.readOnly(),t=e?defaults("chartproperties.paneProperties.crossHairProperties"):null,i=this.source.selectBarMode().value()&&this.source.isOnHoveredChartWidget(),n=TradingView.isMobile.any()&&l(this.source._model.currentTool())&&!i,o=n?"#a000a0":e?t.color:this.pane._model.properties().paneProperties.crossHairProperties.color.value(),r=e?t.transparency:this.pane._model.properties().paneProperties.crossHairProperties.transparency.value(),!n&&r>0&&(o=T.generateColor(o,r)),s.color=o,s.lineWidth=e?t.width:this.pane._model.properties().paneProperties.crossHairProperties.width.value(),s.lineStyle=e?t.style:this.pane._model.properties().paneProperties.crossHairProperties.style.value(),s.drawCenter=n&&this.pane===this.source.pane,s.w=this.pane.width(),s.h=this.pane.height(),s.x=isFinite(this.source.lockedX)&&this.source.lockedX||this.source.x,s.y=this.source.y,i&&(s.x=Math.max(0,this.source.x-1),s.vertLinesVisible=!0,s.lineStyle=C.LINESTYLE_SOLID,s.mouseClickHandler=this._mouseClickHandler,s.lineWidth=2,s.color="#ff0000"),new y(s)},s.prototype.update=function(){},s.prototype.renderer=function(){var e,t,i,n,o=this.source.visible&&this.source.areLinesVisible,r=m.lockTimeAxis().value(),s=o&&this._horzVisible,a=o||r;if(("y"!==this._axis||s)&&a)return e=9,t=11,i="y"===this._axis?this.pane.width()-e/2:this.source.lockedX+1,n="y"===this._axis?this.source.y:this.pane.height()-t/2-1,new g({x:i,y:n,width:e,height:t,bodyHeight:7})},t.CrossHair=n}).call(t,i(8))},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"CrossHairPriceAxisView",function(){return r}),n=i(1),o=i(58),r=function(e){function t(t){var i=e.call(this)||this;return i._background="#4c525e",i._source=t,i}return n.c(t,e),t.prototype._updateRendererData=function(e){var t,i,n,o;e.visible=!1,null!==(t=this._source.pane)&&(i=t.defaultPriceScale(),n=t.mainDataSource(),o=null!==n?n.firstValue():null,this._source.visible&&!i.isEmpty()&&null!=o&&(e.background=this._background,e.color=this.generateTextColor(this._background),e.coordinate=this._source.y,e.text=i.formatPrice(this._source.price,o),e.visible=!0))},t}(o.a)},function(e,t,i){"use strict";function n(e,t){r.call(this),this._header=null,this._crossHair=e,this._model=t,this._items.push(new s("Date","")),this._items.push(new s("Time","")),this._items.push(new s("Price","")),this._defaultFormatter=new a(100)}var o=i(118),r=o.DataWindowView,s=o.DataWindowItem,a=i(21).PriceFormatter,l=i(201).DateFormatter,c=i(130).TimeFormatter;inherit(n,r),n.prototype.update=function(){var e,t,i,n,o,r,s=this._model.mainSeries().isDWM();this._items[1].setVisible(!s),this._items[0].setValue("n/a"),this._items[1].setValue("n/a"),this._items[2].setValue("n/a"),this._model.timeScale().isEmpty()||(e=this._crossHair.appliedIndex(),t=this._model.timeScale().indexToUserTime(e),null===t?(this._items[0].setValue("n/a"),s||this._items[1].setValue("n/a")):(this._items[0].setValue((new l).format(t)),s||this._items[1].setValue((new c).format(t))),(i=this._crossHair.pane)&&(n=i.defaultPriceScale(),
n.isEmpty()||(o=n.mainSource(),r=o?o.formatter():this._defaultFormatter,this._items[2].setValue(r.format(this._crossHair.price)))))},e.exports=n},function(e,t,i){"use strict";function n(e,t){o.call(this),this._invalidated=!0,this._crosshair=e,this._model=t,this._renderer=new r,this._rendererData={visible:!1,background:"#4c525e",color:"white",text:"",width:0}}var o=i(170).TimeAxisView,r=i(171).TimeAxisViewRenderer,s=i(172).AbbreviatedDateTimeFormatter;inherit(n,o),n.prototype.update=function(){this._invalidated=!0},n.prototype._updateImpl=function(){var e,t,i=this._rendererData;i.visible=!1,e=this._model.timeScale(),e.isEmpty()||(i.width=e.width(),i.coordinate=this._crosshair.appliedX(),(t=e.indexToUserTime(this._crosshair.appliedIndex()))&&(i.text=new s(this._model.mainSeries().isDWM()).format(t),i.visible=!0))},n.prototype.renderer=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._renderer.setData(this._rendererData),this._renderer},e.exports=n},function(e,t,i){"use strict";function n(e){this.data=e}var o=i(9).HitTestResult;n.prototype.draw=function(e){var t,i,n,o,r,s,a,l;this.data&&(t=this.data.vertLinesVisible,i=this.data.horzLinesVisible,(t||i)&&(e.lineStyle=this.data.lineStyle,e.lineWidth=this.data.lineWidth,e.strokeStyle=this.data.color,e.fillStyle=this.data.color,n=e.lineStyle===CanvasEx.LINESTYLE_DASHED||e.lineStyle===CanvasEx.LINESTYLE_DOTTED||e.lineStyle===CanvasEx.LINESTYLE_SPARSE_DOTTED,o=this.data.lineWidth%2==0?.5:0,r=this.data.x+1+o,s=this.data.y+o,a=this.data.w,l=this.data.h,t&&r>=0&&(n?CanvasEx.drawDashedLineVertical(e,r,0,l):CanvasEx.drawSolidLine(e,r,0,r,l)),i&&s>=0&&(n?CanvasEx.drawDashedLineHorizontal(e,0,s,a):CanvasEx.drawSolidLine(e,0,s,a,s)),this.data.drawCenter&&(e.beginPath(),e.arc(r,s,3,0,2*Math.PI,!0),e.fillStyle=this.data.color,e.fill())))},n.prototype.hitTest=function(e){return this.data.mouseClickHandler?new o(o.CUSTOM,{mouseClickHandler:this.data.mouseClickHandler}):null},t.PaneRendererCrossHair=TradingView.PaneRendererCrossHair=n},function(e,t,i){"use strict";function n(e){this._data=e}n.prototype._drawShackle=function(e){var t=this._data.width-3,i=t/2,n=this._data.height-this._data.bodyHeight;e.moveTo(1.5,i),e.arc(this._data.width/2,i,i,Math.PI,2*Math.PI),n>i&&(e.moveTo(1.5,i),e.lineTo(1.5,n),e.moveTo(this._data.width-1.5,i),e.lineTo(this._data.width-1.5,n))},n.prototype.draw=function(e){var t,i,n,o;e.translate(this._data.x-this._data.width/2,this._data.y-this._data.height/2),t="rgba(153,153,153,.3)",i="rgba(153,153,153,.7)",n="#777",o="rgba(255,255,255,.7)",e.strokeStyle=t,e.lineWidth=2,e.beginPath(),this._drawShackle(e),e.stroke(),e.closePath(),e.strokeStyle=i,e.lineWidth=1,e.beginPath(),e.rect(0,this._data.height-this._data.bodyHeight+.5,this._data.width,this._data.bodyHeight),e.closePath(),e.stroke(),e.translate(0,-1),e.strokeStyle=n,e.beginPath(),this._drawShackle(e),e.stroke(),e.closePath(),e.fillStyle=o,e.beginPath(),e.rect(1,this._data.height-this._data.bodyHeight+1.5,this._data.width-2,this._data.bodyHeight-2),e.fill(),e.beginPath(),
e.rect(.5,this._data.height-this._data.bodyHeight+1,this._data.width-1,this._data.bodyHeight-1),e.stroke(),e.closePath(),e.fillStyle=n,e.fillRect(this._data.width/2-.5,this._data.height-this._data.bodyHeight/2,1,2)},t.PaneRendererCrossHairLock=TradingView.PaneRendererCrossHairLock=n},function(e,t,i){"use strict";function n(e,t){o.call(this,t),this._series=e,this._series.onRestarted().subscribe(this,n.prototype.invalidate),this._series.dataEvents().symbolResolved().subscribe(this,n.prototype.invalidate),this._series.dataEvents().completed().subscribe(this,n.prototype.invalidate),this._series.onBoxSizeChanged().subscribe(this,n.prototype.invalidate)}var o=i(267),r=i(278).getTranslatedSymbolDescription,s=i(605),a=s.generateTitleForGui,l=s.generateSplitTitleForGui;inherit(n,o),n.prototype.invalidate=function(){delete this._text,this.update()},n.prototype.getSeriesPrecision=function(){var e=4;return this._series._symbolInfo&&this._series._symbolInfo.pricescale&&(e=Math.round(Math.log(this._series._symbolInfo.pricescale)/Math.log(10))),e},n.prototype.round=function(e){var t=this.getSeriesPrecision(),i=Math.round(e*Math.pow(10,t))/Math.pow(10,t);return i||""},n.prototype.update=function(){"_text"in this||(this._bold=!1,this._size=this._props.mainSeriesProperties.statusViewStyle.fontSize.value()+"px",this._text=a(this._getTitleGenerationOptions()))},n.prototype.getSplitTitle=function(){return l(this._getTitleGenerationOptions())},n.prototype._getTitleGenerationOptions=function(){var e=this._series.symbolInfo()||{};return{description:this._props.mainSeriesProperties.statusViewStyle.showSymbolAsDescription.value()?e.name:r({pro_name:e.pro_name,description:e.description,local_description:e.local_description,language:e.language}),exchange:this._props.mainSeriesProperties.statusViewStyle.showExchange.value()?e.exchange:null,symbol:this._series.symbol(),interval:this._props.mainSeriesProperties.statusViewStyle.showInterval.value()?this._series.interval():null,style:this._series._properties.style.value(),inputs:this._series.getInputsProperties().state(),boxSize:this._series.data().boxSize,reversalAmount:this._series.data().reversalAmount,precision:this.getSeriesPrecision()}},e.exports=n},function(e,t,i){"use strict";function n(e){var t,i,n=e||{},o="QUANDL"===n.exchange,r={symbolDescription:"",interval:"",exchange:"",chartStyle:"",extended:""};switch(n.description&&o?2===n.description.split("/").length?r.symbolDescription=n.description.split("/")[1]:(t=n.description.split("'").filter(function(e){return e.length}),t.forEach(function(e){e=e&&("/"===e[0]||/\d+\/\(?/.test(e))?[e]:e.split("/").filter(function(e){return e.length}),r.symbolDescription+=e[2===e.length?1:0]})):n.description?r.symbolDescription=n.description:r.symbolDescription=n.symbol,n.interval&&(r.interval=a(n.interval)),o&&n.description&&(i=/[\w_]+\/[\w_]+/.exec(n.description),i&&i[0]?r.provider=i[0].split("/")[0]:r.provider=n.description.split("/")[0]),n.exchange&&(r.exchange=n.exchange),n.style){case l.STYLE_HEIKEN_ASHI:r.chartStyle=$.t("Heikin Ashi")}
return n.extended&&(r.extended=window.t("ext",{context:"shorthand_for_extended_session"})),r}function o(e){var t=n(e),i=t.symbolDescription+(t.interval?", "+t.interval:"")+s(t);return i=i.replace(/\'/g,"")}function r(e){var t,i=n(e),o=s(i),r=i.symbolDescription.replace(/\'/g,"");return o=o.replace(/\'/g,""),t=i.interval?", "+i.interval:"",[r,t,o]}function s(e){return(e.provider?", "+e.provider:"")+(e.exchange?", "+e.exchange:"")+(e.chartStyle?", "+e.chartStyle:"")+(e.extended?", "+e.extended:"")}var a=i(123).translatedIntervalString,l=i(40);e.exports={generateSplitTitleForGui:r,generateTitleForGui:o}},function(e,t,i){"use strict";var n,o,r,s,a,l;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"ProjectionSeriesPriceAxisView",function(){return l}),n=i(1),o=i(7),i.n(o),r=i(17),s=i(279),a=i(40),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.c(t,e),t.prototype.lastPrice=function(){return this._getSource().data().lastProjectionPrice},t.prototype._updateRendererData=function(e){var t,i,n,s,l,c,h,u,d,p,_,f,m,y,g,v,S,b,w,P,T;e.visible=!1,t=this._getData().model,t.properties().scalesProperties.showSeriesLastValue.value()&&(i=this._getSource(),n=i.priceScale(),s=t.timeScale(),l=this.lastPrice(),s.isEmpty()||n.isEmpty()||void 0===l||null!==(c=s.visibleBars())&&(h=c.firstBar(),u=c.lastBar(),d=i.data(),null!==(p=d.search(u,r.PlotRowSearchMode.NearestLeft))&&void 0!==(_=i.nearestIndex(h,r.PlotRowSearchMode.NearestRight))&&(f=Object(o.ensureNotNull)(d.valueAt(_))[TradingView.CLOSE_PLOT],m=e.background,y="",g=!1,v=i.properties(),S=v.style.value()===a.STYLE_HEIKEN_ASHI,S&&v.haStyle.showRealLastPrice.value()?(this._isCountdownEnabled()&&v.showCountdown.value()&&(y=this._countdownText()),b=i.lastValueData(TradingView.CLOSE_PLOT,!0),b.noData||b.color===e.background||(m=b.color),w=i.lastValueData(TradingView.CLOSE_PLOT,!1),b.noData||w.noData||(g=b.index===w.index)):(P=i.barColorer(),T=P.barStyle(p.index,!0),m=T.barColor,g=!0),e.background=m,e.secondLine=y,e.visible=g,e.color=this.generateTextColor(m),e.coordinate=n.priceToCoordinate(l,f),e.text=n.formatPrice(l,f))))},t}(s.SeriesPriceAxisView)},function(e,t,i){"use strict";var n,o,r,s,a,l;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"SeriesLegendView",function(){return l}),n=i(1),o=i(280),r=i(42),s=!0,a={open:window.t("O",{context:"in_legend"}),high:window.t("H",{context:"in_legend"}),low:window.t("L",{context:"in_legend"}),close:window.t("C",{context:"in_legend"}),hl2:window.t("HL2",{context:"in_legend"}),hlc3:window.t("HLC3",{context:"in_legend"}),ohlc4:window.t("OHLC4",{context:"in_legend"})},l=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n._showBarChange=i.properties().paneProperties.legendProperties.showBarChange,n._showOnlyPriceSource=i.properties().paneProperties.legendProperties.showOnlyPriceSource,n._showSeriesOHLC=i.properties().paneProperties.legendProperties.showSeriesOHLC,n._seriesStyle=t.properties().style,n._items[0].setTitle(a.open),n._items[1].setTitle(a.high),n._items[2].setTitle(a.low),
n._items[3].setTitle(a.close),n._items[5].setTitle(""),n._showBarChange.subscribe(n,n.update),n._showSeriesOHLC.subscribe(n,n.update),n._items[4].setTitle(a[t.priceSource()]),n}return n.c(t,e),t.prototype.isValuesVisible=function(){return this._showSeriesOHLC.value()||this._showBarChange.value()},t.prototype.additional=function(){return null},t.prototype.destroy=function(){this._showBarChange.unsubscribeAll(this),this._showSeriesOHLC.unsubscribeAll(this)},t.prototype._updateImpl=function(){var t,i,n,o;e.prototype._updateImpl.call(this),t=s&&this._showOnlyPriceSourceValue(),i=this._showSeriesOHLC.value(),n=i&&!t,o=i&&t,this._items[0].setVisible(n),this._items[1].setVisible(n),this._items[2].setVisible(n),this._items[3].setVisible(n),this._items[4].setVisible(o),this._items[5].setVisible(this._showBarChange.value()),this._items[4].setTitle(a[this._series.priceSource()])},t.prototype._showOnlyPriceSourceValue=function(){return this._showOnlyPriceSource.value()&&Object(r.isPriceSourceStyle)(this._seriesStyle.value())},t}(o.SeriesDataWindowView)},function(e,t,i){"use strict";function n(e){var t,i;if(0===e.length)return!1;if(-1===(t=e.findIndex(function(e){return Object(l.coordinateIsValid)(e.y)})))return!1;for(i=e.length-1;i>t&&!Object(l.coordinateIsValid)(e[i].y);)i--;return!(t>=i)}function o(e,t){var i,n,o,a,c,h=[],u=[],d=null;for(i=0;i<e.length;i++){if(n=e[i],o=e[i+1]||{},Object(l.coordinateIsValid)(n.y))n.y<=t&&h.push(n),n.y>=t&&u.push(n),d=n;else{if(null===d)continue;n=d}Object(l.coordinateIsValid)(o.y)&&((n.y>t&&o.y<t||n.y<t&&o.y>t)&&(Math.abs(n.x-o.x)<1?(a=new r.Point(n.x,t),h.push(a),u.push(a)):null!==(c=Object(s.intersectLineSegments)(n,o,new r.Point(n.x,t),new r.Point(o.x,t)))&&(a=n.add(o.subtract(n).scaled(c)),h.push(a),u.push(a))))}return{topItems:h,bottomItems:u}}var r,s,a,l,c,h,u;Object.defineProperty(t,"__esModule",{value:!0}),t.itemsRangeIsValid=n,t.splitItems=o,i.d(t,"PaneRendererBaseline",function(){return u}),r=i(6),i.n(r),s=i(129),i.n(s),a=i(30),i.n(a),l=i(27),c=i(78),h=i(9),u=function(){function e(){this._data=null}return e.prototype.setData=function(e){this._data=e},e.prototype.draw=function(e){var t,i,r,s,a,l,c,h,u,d,p,_,f,m,y;null!==this._data&&(t=this._data,i=t.items,r=t.baseLevelCoordinate,s=t.bottom,a=t.bottomFillColor1,l=t.bottomFillColor2,c=t.topFillColor1,h=t.topFillColor2,u=t.topLineColor,d=t.bottomLineColor,p=t.topLineWidth,_=t.bottomLineWidth,n(i)&&(f=o(i,r),m=f.topItems,y=f.bottomItems,e.lineCap="round",e.lineJoin="round",e.translate(.5,.5),0!==m.length&&(e.beginPath(),e.moveTo(m[0].x,r),this._makeLine(e,m,!0,0),e.closePath(),e.fillStyle=this._makeLinearGradient(e,c,h,r-s,r),e.fill(),e.beginPath(),this._makeLine(e,m,!1,0),e.lineWidth=p,e.strokeStyle=u,e.stroke()),0!==y.length&&(e.beginPath(),e.moveTo(y[0].x,r),this._makeLine(e,y,!0,1),e.closePath(),e.fillStyle=this._makeLinearGradient(e,a,l,r,r+s),e.fill(),e.beginPath(),this._makeLine(e,y,!1,1),e.lineWidth=_,e.strokeStyle=d,e.stroke())))},e.prototype.hitTest=function(e){var t,i,n,o,s,u,d,p,_,f,m;if(null===this._data)return null
;for(t=this._data,i=t.items,n=t.topLineWidth,o=t.bottomLineWidth,s=Object(l.selectionTolerance)((n+o)/2),u=Object(c.lowerbound)(i,e,function(e,t){return e.x<=t.x}),d=Math.max(1,u-1),p=Math.min(i.length-1,u+1),_=d;_<=p;++_)if(f=i[_-1],m=i[_],Object(a.distanceToSegment)(new r.Point(f.x,f.y),new r.Point(m.x,m.y),new r.Point(e.x,e.y)).distance<=s)return new h.HitTestResult(h.HitTestResult.REGULAR);return null},e.prototype._makeLine=function(e,t,i,n){var o,r,s,a,c,h,u,d,p,_;if(null!==this._data&&-1!==(o=t.findIndex(function(e){return Object(l.coordinateIsValid)(e.y)})))for(r=this._data,s=r.barSpacing,a=r.baseLevelCoordinate,c=.25*s,u=t.length,d=o;d<u;d++)if(p=t[d],_=t[d+1]||{},Object(l.coordinateIsValid)(p.y)){if(0===n){if(h&&h.y>=a&&p.y>=a){e.moveTo(p.x,p.y);continue}}else if(h&&h.y<=a&&p.y<=a){e.moveTo(p.x,p.y);continue}if(h&&Object(l.coordinateIsValid)(h.y))e.lineTo(p.x,p.y),i&&!Object(l.coordinateIsValid)(_.y)&&e.lineTo(p.x,a);else if(_&&Object(l.coordinateIsValid)(_.y))i?(d!==o&&e.lineTo(p.x,a),e.lineTo(p.x,p.y)):e.moveTo(p.x,p.y);else if(i){if(0===d)continue;d!==o&&e.lineTo(p.x-c,a),e.lineTo(p.x-c,p.y),e.lineTo(p.x+c,p.y),e.lineTo(p.x+c,a)}else e.moveTo(p.x-c,p.y),e.lineTo(p.x+c,p.y);h=p}},e.prototype._makeLinearGradient=function(e,t,i,n,o){var r=e.createLinearGradient(0,n,0,o);return r.addColorStop(0,t),r.addColorStop(1,i),r},e}()},function(e,t,i){"use strict";(function(t){var i=[{d:"E-Mini S&P 500",t:"ES"},{d:"E-Mini Nasdaq 100",t:"NQ"},{d:"Gold",t:"GC"},{d:"Silver",t:"SI"},{d:"Crude Oil WTI",t:"CL"},{d:"Natural Gas",t:"NG"},{d:"Australian Dollar",t:"6A"},{d:"Australian Dollar (Floor)",t:"AD"},{d:"Euro FX",t:"6E"},{d:"Euro FX (Floor)",t:"EC"},{d:"Corn",t:"ZC"},{d:"Corn (Floor)",t:"C"},{d:"Eurodollar",t:"GE"},{d:"Eurodollar (Floor)",t:"ED"}],n=function(){function e(e,t){var i=function(){};return i.prototype=t.prototype,e.prototype=new i,e}function n(e){return e.replace(/[\^\$\(\)\[\]\{\}\*\+\?\|\\]/g,"\\$&")}function o(){}function r(e){this.value=e}function s(){}function a(){}function l(){}function c(){}function h(){}function u(){}function d(){}function p(){}function _(e){this.value=e}function f(e){this.value=e}function m(e){this.value=e}function y(){_.apply(this,arguments)}function g(){f.apply(this,arguments)}function v(e,t){var i,n,o,s,a,l,c,h,u=[];e:for(;i=H.exec(e);){for(n=j.length;n--;)if(i[n+1]){j[n].ctor&&(o=new j[n].ctor(i[n+1]),o._offset=i.index,u.push(o));continue e}s=new m(i[0]),s._offset=i.index,u.push(s)}if(t&&t.recover)for(n=u.length;n--;)l=u[n],l instanceof f||l instanceof _?(void 0!==a&&(c=new _(""),h=u.splice(n,a-n+1,c),c.value=h.map(function(e){return e.value}).join("")),a=n):l instanceof r||(a=void 0);return u}function S(e){var i,n,o,c,h,u,d,p,y,g;if(t.enabled("charting_library_base"))return{currentState:"var"};for(i="init",n="var",o="operator",c=i,h={warnings:[],errors:[],isEmpty:!0},u=[],d=0;d<e.length;d++)if(!((p=e[d])instanceof r))if(delete h.isEmpty,p.isIncomplete&&(y={status:"incomplete",reason:"incomplete_token",offset:p._offset,token:p},p.incompleteSuggest&&(y.recover={
append:p.incompleteSuggest()}),h.warnings.push(y),d!==e.length-1))y.status="error";else if(p instanceof _||p instanceof f){if(c===n){h.errors.push({status:"error",reason:"unexpected_token",offset:p._offset,token:p});continue}c=n}else if(p instanceof l){if(c!==n){h.errors.push({status:"error",reason:"unexpected_token",offset:p._offset,token:p});continue}c=o}else if(p instanceof s){if(c===n){h.errors.push({status:"error",reason:"unexpected_token",offset:p._offset,token:p});continue}u.push(p),c=i}else if(p instanceof a){if(c!==n){h.errors.push({status:"error",reason:"unexpected_token",offset:p._offset,token:p});continue}g=u.pop(),g||h.errors.push({status:"error",reason:"unbalanced_brace",offset:p._offset,token:p,recover:{prepend:new s}}),c=n}else p instanceof m&&h.errors.push({status:"error",reason:"unparsed_entity",offset:p._offset,token:p});for(h.braceBalance=u.length,c!==n&&h.warnings.push({status:"incomplete"}),g=null;u.length;)p=u.pop(),y={status:"incomplete",reason:"unbalanced_brace",offset:p._offset,token:p},c===n&&(y.recover={append:new a}),h.warnings.push(y);return h.currentState=c,0===h.warnings.length&&delete h.warnings,0===h.errors.length&&delete h.errors,h}function b(e){var t,i=[];for(t=0;t<e.length;t++)e[t]instanceof r||i.push(e[t]);return i}function w(e){var t,i,n,o,r,c,h;for(e=b(e),t=[],i=[],o=0;o<e.length;o++)r=e[o],r instanceof l?i.length&&i[i.length-1].minPrecedence>r.precedence&&(i[i.length-1].minPrecedence=r.precedence):r instanceof s?i.push(n={minPrecedence:1/0,openBraceIndex:o}):r instanceof a&&(n=i.pop(),c=e[n.openBraceIndex-1],(h=e[o+1])instanceof l&&!(h.precedence<=n.minPrecedence)||!(!(c instanceof l)||c.precedence<n.minPrecedence||c.precedence===n.minPrecedence&&c.commutative)||(t.unshift(n.openBraceIndex),t.push(o),i.length&&i[i.length-1].minPrecedence>n.minPrecedence&&(i[i.length-1].minPrecedence=n.minPrecedence)));for(o=t.length;o--;)e.splice(t[o],1);return e}function P(e){for(var t=0;t<e.length;t++)e[t].parse&&e[t].parse();return e}function T(e){var t=x(e);return w(t?t:[new f("1"),new d,new s].concat(e).concat(new a))}function x(e){var t,i,n,o=0,c=1,h=2,u=3,p=o,_=0;for(i=0;i<e.length;i++)if(!((n=e[i])instanceof r))switch(p){case o:if(!(n instanceof f&&1==+n.value))return!1;p=c;break;case c:if(!(p===c&&n instanceof d))return!1;p=h,t=i+1;break;case h:if(n instanceof s)p=u,_=1;else if(n instanceof l)return!1;break;case u:n instanceof s?_++:n instanceof a&&--_<=0&&(p=h)}return e.slice(t)}function C(e){return new _(e).ticker()}function L(e){if("string"!=typeof e)throw new TypeError("expression must be a string");return e=v(e),e.filter(function(e){return e instanceof _}).map(function(e){return e.exchange()}).filter(function(e){return e})}function I(e){return e=L(e),1!==e.length?null:e[0]}function A(e,t){return e=L(e),e.some(function(e){return!!~t.indexOf((e||"").toUpperCase())})}function k(e){return A(e,["BATS"])}function E(e){return(e=I(e))&&-1!==e.toUpperCase().indexOf("_EOD")}function M(e){return A(e,["CHXEUR"])}function V(e){return A(e,["CHXJPY"])}function D(e){
return A(e,pro.getProductsByType(pro.PRODUCT_TYPES.exchange).map(function(e){return e.exchange.toUpperCase()+"_DLY"}))}function O(e,t){return!!(e=I(e))&&e.substr(0,t.length)===t}function R(e){if("string"!=typeof e)throw new TypeError("expression must be a string");var t=w(b(v(e)));return t.forEach(function(e){e instanceof _&&e.exchange(null)}),N(t)}function B(e){if("string"!=typeof e)throw new TypeError("expression must be a string");return N(w(b(v(e))))}function N(e){return e.join("")}var F,W,H,j=[{pattern:"(",ctor:s},{pattern:")",ctor:a},{pattern:"+",ctor:c},{pattern:"-",ctor:h},{pattern:"*",ctor:u},{pattern:"/",ctor:d},{pattern:"^",ctor:p},{pattern:/\d+(?:\.\d*|(?![a-zA-Z0-9_!:\.&]))|\.\d+/,ctor:f},{pattern:/\./,ctor:g},{pattern:t.enabled("charting_library_base")?/[a-zA-Z0-9_\u0370-\u1FFF_\u2E80-\uFFFF^][a-zA-Z0-9_\u0020\u0370-\u1FFF_\u2E80-\uFFFF_!:\.&]*|'.+?'/:/[a-zA-Z0-9_\u0370-\u1FFF_\u2E80-\uFFFF][a-zA-Z0-9_\u0020\u0370-\u1FFF_\u2E80-\uFFFF_!|:\.&]*|'.+?'/,ctor:_},{pattern:/'[^']*/,ctor:y},{pattern:/[\0-\x20\s]+/,ctor:r}];return o.prototype.toString=function(){return this.value},e(r,o),e(s,o),s.prototype.value="(",e(a,o),a.prototype.value=")",e(l,o),e(c,l),c.prototype.value="+",c.prototype.precedence=0,c.prototype.commutative=!0,e(h,l),h.prototype.value="-",h.prototype.precedence=0,h.prototype.commutative=!1,e(u,l),u.prototype.value="*",u.prototype.precedence=1,u.prototype.commutative=!0,e(d,l),d.prototype.value="/",d.prototype.precedence=1,d.prototype.commutative=!1,e(p,l),p.prototype.value="^",p.prototype.precedence=2,p.prototype.commutative=!1,F=/^'?(?:([A-Z0-9_]+):)?(.*?)'?$/i,W=/[\+\-\/\*]/,e(_,o),_.prototype.toString=function(){if(this.hasOwnProperty("_ticker")){var e=W.test(this._ticker)?"'":"";return e+(this._exchange?this._exchange+":":"")+this._ticker+e}return this.value},_.prototype.parse=function(){var e=F.exec(this.value);e[1]&&(this._exchange=e[1]),this._ticker=e[2]},_.prototype.parseAsFutures=function(){var e,t,n;for(this.hasOwnProperty("_ticker")||this.parse(),e=function(e){return i.some(function(t){return t.t===e})},t=2;t>=1;--t)if(n=this._ticker.slice(0,t),e(n)){this._root=n,this._contract=this._ticker.slice(t);break}},_.prototype.exchange=function(e){if(this.hasOwnProperty("_ticker")||this.parse(),!(arguments.length>0))return this._exchange;null===e||void 0===e?delete this._exchange:this._exchange=e+""},_.prototype.ticker=function(e){if(this.hasOwnProperty("_ticker")||this.parse(),!(arguments.length>0))return this._ticker;null===e||void 0===e?delete this._ticker:this._ticker=e+"",delete this._root,delete this._contract},_.prototype.root=function(e){if(this.hasOwnProperty("_root")||this.parseAsFutures(),!(arguments.length>0))return this._root;null===e||void 0===e?delete this._root:(this._root=e+"",this._root&&(this._ticker=this._root+(this._contract||"")))},_.prototype.contract=function(e){if(this.hasOwnProperty("_contract")||this.parseAsFutures(),!(arguments.length>0))return this._root;null===e||void 0===e?delete this._contract:(this._contract=e+"",
this._root&&(this._ticker=this._root+this._contract))},e(f,o),f.prototype.toString=function(){return this.hasOwnProperty("_normalizedValue")?this._normalizedValue:this.value},f.prototype.parse=function(){this._normalizedValue=this.value.replace(/^0+|\.0*$/g,"").replace(/(\.\d*?)0+$/,"$1").replace(/^(\.|$)/,"0$1")},m.prototype.toString=function(){return this.value},e(y,_),y.prototype.isIncomplete=!0,y.prototype.incompleteSuggest=function(){if("'"!==this.value)return"'"},e(g,f),g.prototype.isIncomplete=!0,H=RegExp(j.map(function(e){return"("+("string"==typeof e.pattern?n(e.pattern):e.pattern.source)+")"}).concat(".").join("|"),"g"),{tokenize:v,validate:S,factorOutBraces:w,normalizeTokens:P,flip:T,hasBatsSymbols:k,hasEodSymbols:E,hasChxeurSymbols:M,hasChxjpySymbols:V,hasFreeDelaySymbols:D,getExchange:I,isExchange:O,SymbolToken:_,IncompleteSymbolToken:y,NumberToken:f,BinaryOperatorToken:l,OpenBraceToken:s,CloseBraceToken:a,ticker:C,shortName:R,normalize:B}}();e.exports=n}).call(t,i(5))},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"SyncModel",function(){return r}),n=i(37),i.n(n),o=0,r=function(){function e(e,t){this._session=new n.Session,this._extrapolatedData=[],this._modelId=o++,this._builderCache=null,this._resolution=t,this._symbolInfo=e,this._valid=!!e.timezone&&!!e.session,this._session.init(e.timezone,e.session)}return e.prototype.getSymbolInfo=function(){return this._symbolInfo},e.prototype.getSession=function(){return this._session},e.prototype.getResolution=function(){return this._resolution},e.prototype.uniqueId=function(){return this._modelId},e.prototype.distance=function(e,t){var i,o,r,s,a;return this.isValid()?(i=this._extrapolatedData.length,o=0!==i?this._extrapolatedData[0]:null,r=null!==o?this._extrapolatedData[i-1]:null,1e3*e!==o&&(this._extrapolatedData=[1e3*e],o=null,r=null),(null===o||null!==r&&1e3*t>r)&&(s=Object(n.extrapolateBarsFrontToTime)(this._barBuilder(),r||1e3*e,1e3*t,2e3),this._extrapolatedData=this._extrapolatedData.concat(s),i=this._extrapolatedData.length),(r=this._extrapolatedData[i-1])<1e3*t?{success:!1}:(a=this._extrapolatedData.indexOf(1e3*t),-1===a?{success:!1}:{success:!0,result:a})):{success:!1}},e.prototype.projectTime=function(e,t){var i,o,r,s;return this.isValid()?(i=this._extrapolatedData.length,o=i>0?this._extrapolatedData[0]:null,r=null!==o?this._extrapolatedData[i-1]:null,1e3*e!==o&&(this._extrapolatedData=[1e3*e],o=null,r=null),(null===o||t>=i)&&(s=Object(n.extrapolateBarsFrontByCount)(this._barBuilder(),r||1e3*e,t-i+1),this._extrapolatedData=this._extrapolatedData.concat(s)),i<t?e:this._extrapolatedData[t]/1e3):e},e.prototype.isValid=function(){return this._valid},e.prototype._barBuilder=function(){return null===this._builderCache&&(this._builderCache=Object(n.newBarBuilder)(this._resolution,this._session,this._session)),this._builderCache},e}()},function(e,t,i){"use strict";var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"SeriesHorizontalBaseLinePaneView",function(){return s}),n=i(1),o=i(6),i.n(o),
r=i(178),s=function(e){function t(t){return e.call(this,t)||this}return n.c(t,e),t.prototype._updateImpl=function(){var e,t;this._lineRendererData.visible=!1,e=this._series.priceScale().mode(),(e.percentage||e.indexedTo100)&&null!=(t=this._series.firstValue())&&(this._lineRendererData.visible=!0,this._lineRendererData.points=[new o.Point(0,this._series.priceScale().priceToCoordinate(t,t))],this._lineRendererData.width=this._model.timeScale().width(),this._lineRendererData.height=this._series.priceScale().height(),this._lineRendererData.color=this._series.properties().baseLineColor.value())},t}(r.a)},function(e,t,i){"use strict";var n,o,r,s,a;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"SeriesPriceLinePaneView",function(){return a}),n=i(1),o=i(6),i.n(o),r=i(178),s=i(85),a=function(e){function t(t){var i=e.call(this,t)||this;return i._lineRendererData.linestyle=s.LINESTYLE_DOTTED,i}return n.c(t,e),t.prototype._updateImpl=function(){if(this._lineRendererData.visible=!1,this._series.properties().showPriceLine.value()){var e=this._series.lastValueData(void 0,!0);e.noData||(this._lineRendererData.visible=!0,this._lineRendererData.points=[new o.Point(0,e.coordinate)],this._lineRendererData.color=this._series.priceLineColor(e.color),this._lineRendererData.width=this._model.timeScale().width(),this._lineRendererData.height=this._series.priceScale().height(),this._lineRendererData.linewidth=this._series.properties().priceLineWidth.value())}},t}(r.a)},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"SeriesDataEvents",function(){return r}),n=i(8),o=i.n(n),r=function(){function e(){this._completed=new o.a,this._error=new o.a,this._symbolError=new o.a,this._symbolResolved=new o.a,this._seriesError=new o.a,this._symbolNotPermitted=new o.a,this._symbolGroupNotPermitted=new o.a,this._extendedHoursNotPermitted=new o.a,this._chartTypeNotPermitted=new o.a,this._intradaySpreadNotPermitted=new o.a,this._intradayExchangeNotPermitted=new o.a,this._customIntervalNotPermitted=new o.a,this._tickMarksRangeChanged=new o.a,this._barReceived=new o.a,this._messageReceived=new o.a}return e.prototype.completed=function(){return this._completed},e.prototype.error=function(){return this._error},e.prototype.symbolError=function(){return this._symbolError},e.prototype.symbolResolved=function(){return this._symbolResolved},e.prototype.seriesError=function(){return this._seriesError},e.prototype.symbolNotPermitted=function(){return this._symbolNotPermitted},e.prototype.symbolGroupNotPermitted=function(){return this._symbolGroupNotPermitted},e.prototype.extendedHoursNotPermitted=function(){return this._extendedHoursNotPermitted},e.prototype.chartTypeNotPermitted=function(){return this._chartTypeNotPermitted},e.prototype.intradaySpreadNotPermitted=function(){return this._intradaySpreadNotPermitted},e.prototype.intradayExchangeNotPermitted=function(){return this._intradayExchangeNotPermitted},e.prototype.customIntervalNotPermitted=function(){return this._customIntervalNotPermitted},
e.prototype.tickMarksRangeChanged=function(){return this._tickMarksRangeChanged},e.prototype.barReceived=function(){return this._barReceived},e.prototype.messageReceived=function(){return this._messageReceived},e.prototype.fireCompleted=function(){this._completed.fire()},e.prototype.fireError=function(){this._error.fire()},e.prototype.fireSymbolError=function(e){this._symbolError.fire(e),this.fireError()},e.prototype.fireSymbolResolved=function(e){this._symbolResolved.fire(e)},e.prototype.fireSeriesError=function(e){this._seriesError.fire(e),this.fireError()},e.prototype.fireSymbolNotPermitted=function(e){this._symbolNotPermitted.fire(e),this.fireError()},e.prototype.fireSymbolGroupNotPermitted=function(e){this._symbolGroupNotPermitted.fire(e),this.fireError()},e.prototype.fireExtendedHoursNotPermitted=function(){this._extendedHoursNotPermitted.fire(),this.fireError()},e.prototype.fireChartTypeNotPermitted=function(e){this._chartTypeNotPermitted.fire(e),this.fireError()},e.prototype.fireIntradaySpreadNotPermitted=function(){this._intradaySpreadNotPermitted.fire(),this.fireError()},e.prototype.fireIntradayExchangeNotPermitted=function(){this._intradayExchangeNotPermitted.fire(),this.fireError()},e.prototype.fireCustomIntervalNotPermitted=function(){this._customIntervalNotPermitted.fire(),this.fireError()},e.prototype.fireTickMarksRangeChanged=function(e){this._tickMarksRangeChanged.fire(e)},e.prototype.fireBarReceived=function(e){this._barReceived.fire(e)},e.prototype.fireMessageReceived=function(e){this._messageReceived.fire(e)},e}()},function(e,t,i){"use strict";function n(e){function t(e,t){var i=e.font;return a.hasOwnProperty(i)||(a[i]={}),a[i].hasOwnProperty(t)||(a[i][t]=e.measureText(t).width),a[i][t]}function i(){var i=n.width(),a=n.height();return{draw:function(n){var c,h,u,d,p,_,f,m,y,g=e.symbolInfo();if(g){for(n.fillStyle=o.generateColor(l.color.value(),l.transparency.value()),c=g.name,/QUANDL/.test(g.exchange)&&(h=c.split(/\//),h.length&&(c=h[h.length-1])),u={description:g.description,pro_name:g.pro_name,short_name:g.name},d=[{text:c?c+", "+r(e.interval()):"",font:"96px Verdana, Arial, sans-serif",lineHeight:117,vertOffset:0},{text:s(u)||"",font:"48px Verdana, Arial, sans-serif",lineHeight:58,vertOffset:5}],p=0,_=0;_<d.length;_++)f=d[_],f.text&&(n.font=f.font,m=t(n,f.text),f.zoom=m>i?i/m:1,p+=f.lineHeight*f.zoom);for(y=Math.max((a-p)/2,0),_=0;_<d.length;_++)f=d[_],f.text&&(n.save(),n.translate(i/2,y),n.textBaseline="top",n.textAlign="center",n.font=f.font,n.scale(f.zoom,f.zoom),n.fillText(f.text,0,f.vertOffset),n.restore(),y+=f.lineHeight*f.zoom)}}}}var n=null,a={},l=e.model().properties().symbolWatermarkProperties,c={renderer:i,update:function(){}};this.paneViews=function(e){return e.containsMainSeries()?(n=e,[c]):[]}}var o=i(29),r=i(123).translatedIntervalString,s=i(278).getTranslatedSymbolDescription;t.Watermark=n},function(e,t,i){"use strict";function n(){this.visible=!0,this.horzLinesVisible=!0,this.horzLinesColor="white",this.horzLinesStyle="",this.vertLinesVisible=!0,this.vertLinesColor="white",
this.vertLinesStyle=""}function o(e,t){this.source=e,this.pane=t,this._renderer=new r}function r(){this.data=null}n.prototype.paneViews=function(e){return[new o(this,e)]},o.prototype.update=function(){},o.prototype.renderer=function(){var e={};return this.pane.defaultPriceScale().isEmpty()||this.pane.timeScale().isEmpty()?null:(e.horzLinesVisible=!0,e.vertLinesVisible=!0,e.horzLinesColor=this.pane._model.properties().paneProperties.horzGridProperties.color.value(),e.vertLinesColor=this.pane._model.properties().paneProperties.vertGridProperties.color.value(),e.horzLineStyle=this.pane._model.properties().paneProperties.horzGridProperties.style.value(),e.vertLineStyle=this.pane._model.properties().paneProperties.vertGridProperties.style.value(),e.priceMarks=this.pane.defaultPriceScale().marks(),e.timeMarks=this.pane.timeScale().marks(),e.w=this.pane.width(),e.h=this.pane.height(),this._renderer.setData(e),this._renderer)},r.prototype.setData=function(e){this.data=e},r.prototype.draw=function(e){var t;if(null!==this.data){if(e.lineWidth=1,this.data.vertLinesVisible){for(e.strokeStyle=this.data.vertLinesColor,CanvasEx.setLineStyle(e,this.data.vertLineStyle),e.beginPath(),t=0;t<this.data.timeMarks.length;t++)e.moveTo(this.data.timeMarks[t].coord+1,0),e.lineTo(this.data.timeMarks[t].coord+1,this.data.h);e.stroke()}if(this.data.horzLinesVisible){for(e.strokeStyle=this.data.horzLinesColor,CanvasEx.setLineStyle(e,this.data.horzLineStyle),e.beginPath(),t=0;t<this.data.priceMarks.length;t++)e.moveTo(0,this.data.priceMarks[t].coord),e.lineTo(this.data.w,this.data.priceMarks[t].coord);e.stroke()}}},t.Grid=n},function(e,t,i){"use strict";function n(e,t,i){this._magnetProperty=e,this._timeScale=t}var o=i(63).Series;n.prototype.align=function(e,t,i){var n,r,s,a,l,c,h,u,d,p,_=50,f=i.defaultPriceScale(),m=e;if(!this._magnetProperty.value())return m;for(n=f.dataSources(),r=null,s=0;s<n.length;s++)if(n[s]instanceof o){r=n[s];break}if(r&&(a=r.bars(),a.contains(t)&&(l=a.valueAt(t),c=[l[TradingView.OPEN_PLOT],l[TradingView.HIGH_PLOT],l[TradingView.LOW_PLOT],l[TradingView.CLOSE_PLOT]],f=r.priceScale(),!f.isEmpty()))){for(h=[],u=r.firstValue(),s=0;s<c.length;s++)h.push({y:f.priceToCoordinate(c[s],u),price:c[s]});d=f.priceToCoordinate(e,u),h.sort(function(e,t){return Math.abs(e.y-d)-Math.abs(t.y-d)}),p=h[0],Math.abs(p.y-d)<_&&(m=p.price)}return m},e.exports=n},function(e,t,i){"use strict";(function(e){function n(){return[$.t("Jan"),$.t("Feb"),$.t("Mar"),$.t("Apr"),$.t("May"),$.t("Jun"),$.t("Jul"),$.t("Aug"),$.t("Sep"),$.t("Oct"),$.t("Nov"),$.t("Dec")]}function o(t,i){this._options=Object.assign({},P,i),this._model=t,this._scalesProperties=t.properties().scalesProperties,this.m_width=0,this._baseIndex=null,this._defaultRightOffsetProperty=new f(w),this.m_rightOffset=w,this._defaultRightOffsetProperty.listeners().subscribe(this,function(e){this.setRightOffset(e.value())}),this.m_points=new u,this._barSpacingChanged=new e,this.m_barSpacing=b,this._options.preserveBarSpacing&&(this.m_barSpacing=this._scalesProperties.barSpacing.value()||b),
this.m_scrollStartPoint=null,this.m_scaleStartPoint=null,this._commonTransitionStartState=null,this.m_tickmarks=new l,this._formattedBySpan={},this._onScroll=new e,this._visibleBars=null,this._visibleBarsInvalidated=!0,this._visibleBarsChanged=new e,this._leftEdgeIndex=null}var r=i(50).clamp,s=i(214).BarsRange,a=i(618),l=i(619),c=i(18),h=i(21).numberToStringWithLeadingZero,u=i(620).TimePoints,d=i(161),p=i(4).getLogger("Chart.TimeScale"),_=i(5),f=i(13),m=i(3).saveDefaultProperties,y=null,g=50,v=_.enabled("high_density_bars")?.025:.5,S=5,b=d.DEFAULT_BAR_SPACING,w=5,P={preserveBarSpacing:!1,lockVisibleTimeRangeOnResize:!1};o.prototype.tickMarks=function(){return this.m_tickmarks},o.prototype.reset=function(){this._visibleBarsInvalidated=!0,this.m_points=new u,this.m_scrollStartPoint=null,this.m_scaleStartPoint=null,this._clearCommonTransitionsStartState(),this.m_tickmarks.reset(),this._leftEdgeIndex=null},o.prototype.restoreDefault=function(){this._visibleBarsInvalidated=!0,this.setBarSpacing(b),this.resetRightOffset()},o.prototype.restoreRightOffsetPropertyToDefault=function(){this._defaultRightOffsetProperty.setValue(w)},o.prototype.setLeftEdgeFix=function(e){var t,i;this._leftEdgeIndex=e,(t=this.visibleBars().firstBar()-e)<0&&(i=this.m_rightOffset-t-1,this.scrollToOffsetAnimated(i,500))},o.prototype.baseIndex=function(){return this._baseIndex||0},o.prototype.rightOffset=function(){return this.m_rightOffset},o.prototype.defaultRightOffsetProperty=function(){return this._defaultRightOffsetProperty},o.prototype.rightOffsetForTimePoint=function(e){var t=this.timeToCoordinate(e);return null===t?null:this._rightOffsetForCoordinate(t)},o.prototype._rightOffsetForCoordinate=function(e){return(this.m_width+1-e)/this.m_barSpacing},o.prototype.scrollToRealtime=function(e,t){var i,n,o,r,s=this._defaultRightOffsetProperty.value();if(s<0&&(s=w),e)return i=this,n=this.m_rightOffset,o=this.maxRightOffset(),o>0&&s>o&&(s=o),r=this._model,void $({offset:n}).animate({offset:s},{duration:1e3,easing:"easeInOutQuint",complete:t,step:function(e){i._visibleBarsInvalidated=!0,i.m_rightOffset=e,i._correctOffset(),r.recalculateAllPanes(),r.invalidate(new c(c.LIGHT_UPDATE)),r.recalcVisibleRangeStudy(r.dataSources())}});this._visibleBarsInvalidated=!0,this.m_rightOffset=s,this._correctOffset(),void 0!==t&&t()},o.prototype.points=function(){return this.m_points},o.prototype.width=function(){return this.m_width},o.prototype.setWidth=function(e){var t,i;!isFinite(e)||e<=0||this.m_width!==e&&(this._visibleBarsInvalidated=!0,this._options.lockVisibleTimeRangeOnResize&&this.m_width&&(t=this.m_barSpacing*e/this.m_width,this._tryToUpdateBarSpacing(this.m_barSpacing,t)),null!==this._leftEdgeIndex&&this.visibleBars().firstBar()<=this._leftEdgeIndex&&(i=this.m_width-e,this.m_rightOffset-=Math.round(i/this.m_barSpacing)+1),this.m_width=e,this._correctOffset())},o.prototype.barSpacing=function(){return this.m_barSpacing},o.prototype.setBarSpacing=function(e){if(void 0===e)return void p.logDebug("setBarSpacing: invalid argument")
;this._tryToUpdateBarSpacing(this.m_barSpacing,e)&&(this._correctOffset(),this._options.preserveBarSpacing&&(m(!0),this._scalesProperties.barSpacing.setValue(this.m_barSpacing),m(!1)))},o.prototype._tryToUpdateBarSpacing=function(e,t){return e!==t&&(this._visibleBarsInvalidated=!0,this.m_barSpacing=t,this._barSpacingChanged.fire(e,t),!0)},o.prototype.barSpacingChanged=function(){return this._barSpacingChanged},o.prototype.correctBarSpacing=function(){this.isEmpty()||this.points().size()<this.width()/this.barSpacing()&&(this.setRightOffset(w),this.setBarSpacing(Math.min(this.width()/(this.points().size()+this.rightOffset()),g)))},o.prototype.visibleBars=function(){return this._visibleBarsInvalidated&&(this._visibleBarsInvalidated=!1,this._updateVisibleBars()),this._visibleBars},o.prototype._updateVisibleBars=function(){var e,t,i,n,o;if(this.isEmpty())return void(null!==this._visibleBars&&(this._visibleBars=null,this._visibleBarsChanged.fire()));e=this.baseIndex(),t=Math.ceil(this.m_width/this.m_barSpacing)-1,i=Math.round(this.m_rightOffset+e),n=i-t,o=this._visibleBars,this._visibleBars=new s(n,i),null!==o&&this._visibleBars.equals(o)||this._visibleBarsChanged.fire()},o.prototype.isEmpty=function(){return 0===this.m_width||0===this.m_points.size()},o.prototype.indexToCoordinate=function(e,t){var i,n,o;return this.isEmpty()?0:TradingView.isInteger(e)?(i=this.baseIndex(),n=i+this.m_rightOffset-e,o=this.m_width-(n+.5)*this.m_barSpacing,t?o:Math.round(o)):0},o.prototype.barIndexesToCoordinates=function(e){var t,i,n,o,r=this.baseIndex();for(t=0;t<e.length;t++)i=e[t].time,n=r+this.m_rightOffset-i,o=this.m_width-(n+.5)*this.m_barSpacing,e[t].time=Math.round(o),e[t].exactTime=o},o.prototype.indexesToCoordinates=function(e){var t,i,n,o=this.baseIndex(),r=o+this.m_rightOffset,s=this.m_width-r*this.m_barSpacing-.5*this.m_barSpacing;for(t=0;t<e.length;t++)i=e[t].x,n=s+i*this.m_barSpacing,e[t].x=Math.round(n)},o.prototype.coordinateToIndex=function(e){var t=this._rightOffsetForCoordinate(e),i=this.baseIndex(),n=i+this.m_rightOffset-t,o=Math.round(1e6*n)/1e6;return Math.ceil(o)},o.prototype.timeToCoordinate=function(e){function t(e){return e<=0||e>=l.m_width}var i,n,o,r=this.m_points.closestIndexLeft(e),s=this.m_points.valueAt(r),a=this.indexToCoordinate(r,!0),l=this;return t(a)?null:(i=this.barSpacing(),n=function(){var e=this.baseIndex();return this.m_points.valueAt(e)-this.m_points.valueAt(e-1)}.bind(this)(),o=Math.round(a+(e-s)/n*i)+1,t(o)?null:o)},o.prototype.alignCoordinate=function(e){if(this.isEmpty())return e;var t=this.coordinateToIndex(e);return this.indexToCoordinate(t)},o.prototype.timePointToIndex=function(e){return this.m_points.indexOf(e,!0)},o.prototype.indexToTimePoint=function(e){return this.m_points.valueAt(e)},o.prototype.indexToUserTime=function(e){return this.m_tickmarks.indexToTime(e)},o.prototype.marks=function(){var e,t,i,n,o,r,s,a,l,c,h,u;if(this.isEmpty())return null;for(e=this.m_barSpacing,t=this._scalesProperties.fontSize.value()||0,i=5*(t+4),n=Math.round(i/e),o=this.visibleBars(),
r=Math.max(o.firstBar(),o.firstBar()-n),s=Math.max(o.lastBar(),o.lastBar()-n),a=this.m_tickmarks.build(e,i),l=[],c=0;c<a.length;++c)h=a[c],r<=h.index&&h.index<=s&&null!==(u=this.m_tickmarks.indexToTime(h.index))&&l.push({coord:this.indexToCoordinate(h.index),label:this.formatLabel(u,h.span),span:h.span,major:h.label>=d.DAY_SPAN?1:0});return l},o.prototype.state=function(e){var t={};return t.m_barSpacing=this.barSpacing(),t.m_rightOffset=e?this.m_rightOffset:this._defaultRightOffsetProperty.value(),e&&(t.points=this.m_points.state(),t.tickmarks=this.m_tickmarks.state(),t.width=this.m_width),t},o.prototype.restoreState=function(e,t){var i,n,o;return void 0===e.m_barSpacing?void p.logDebug("restoreState: invalid state"):void 0===e.m_rightOffset?void p.logDebug("restoreState: invalid state"):(i=e.m_barSpacing,n=e.m_rightOffset<0&&!t?w:e.m_rightOffset,o=n<0?w:Math.round(n),this._defaultRightOffsetProperty.setValue(o),this.m_rightOffset=n,t&&(this.m_points.restoreState(e.points),this.m_tickmarks.restoreState(e.tickmarks),e.width&&this.m_width>0&&(i*=this.m_width/e.width)),this._tryToUpdateBarSpacing(this.m_barSpacing,i),void this._correctOffset())},o.prototype.setBaseIndex=function(e){if("number"!=typeof e)return void p.logDebug("setBaseIndex: invalid argument");this._visibleBarsInvalidated=!0,this._baseIndex=e,this._correctOffset()},o.prototype.setRightOffset=function(e){if(void 0===e)return void p.logDebug("setRightOffset: invalid argument");this._visibleBarsInvalidated=!0,this.m_rightOffset=e,this._correctOffset()},o.prototype.resetRightOffset=function(){this.setRightOffset(this._defaultRightOffsetProperty.value())},o.prototype._correctOffset=function(){var e,t=this.maxRightOffset();this.m_rightOffset>t&&(this.m_rightOffset=t,this._visibleBarsInvalidated=!0),null!==(e=this.minRightOffset())&&this.m_rightOffset<e&&(this.m_rightOffset=e,this._visibleBarsInvalidated=!0)},o.prototype.minRightOffset=function(){var e,t=this.m_points.firstIndex(),i=this._baseIndex;return null===t||null===i?null:null!==this._leftEdgeIndex?(e=this.m_width/this.m_barSpacing,this._leftEdgeIndex-i+e-1):t-i-1+S},o.prototype.maxRightOffset=function(){return this.m_width/this.m_barSpacing-S},o.prototype.startScale=function(e){this.m_scrollStartPoint&&this.endScroll(),null===this.m_scaleStartPoint&&null===this._commonTransitionStartState&&(this.isEmpty()||(this.m_scaleStartPoint=e,this._saveCommonTransitionsStartState()))},o.prototype._saveCommonTransitionsStartState=function(){this._commonTransitionStartState={barSpacing:this.barSpacing(),rightOffset:this.rightOffset()}},o.prototype._clearCommonTransitionsStartState=function(){this._commonTransitionStartState=null},o.prototype.scaleTo=function(e){var t,i;null!==this._commonTransitionStartState&&(t=r(this.m_width-e,0,this.m_width),i=r(this.m_width-this.m_scaleStartPoint,0,this.m_width),0!==t&&0!==i&&this.setBarSpacing(this.getValidBarSpacing(this._commonTransitionStartState.barSpacing*t/i)))},o.prototype.getValidBarSpacing=function(e){return void 0===e&&(e=this.barSpacing()),e<v?v:e>g?g:e},
o.prototype.isValidBarSpacing=function(e){return e>=v&&e<=g},o.prototype.endScale=function(){null!==this.m_scaleStartPoint&&(this.m_scaleStartPoint=null,this._clearCommonTransitionsStartState())},o.prototype.startScroll=function(e){null===this.m_scrollStartPoint&&null===this._commonTransitionStartState&&(this.isEmpty()||(this.m_scrollStartPoint=e,this._saveCommonTransitionsStartState()))},o.prototype.scrollTo=function(e){if(this._visibleBarsInvalidated=!0,null!==this.m_scrollStartPoint){var t=(this.m_scrollStartPoint-e)/this.barSpacing();this.m_rightOffset=this._commonTransitionStartState.rightOffset+t,this._correctOffset(),this._onScroll.fire()}},o.prototype.scrollToOffsetAnimated=function(e,t){var i,n,o,r;if(!isFinite(e))throw new RangeError("offset is required and must be finite number");if(void 0===t&&(t=400),!isFinite(t)||t<=0)throw new RangeError("animationDuration (optional) must be finite positive number");i=this,n=this.m_rightOffset,o=+new Date,r=this._model,function s(){i._visibleBarsInvalidated=!0;var a=(new Date-o)/t;if(a>=1)return i.m_rightOffset=e,i._correctOffset(),i._visibleBarsInvalidated=!0,r.recalculateAllPanes(),void r.invalidate(new c(c.LIGHT_UPDATE));i.m_rightOffset=n+(e-n)*a,i._correctOffset(),r.recalculateAllPanes(),setTimeout(s,20)}()},o.prototype.endScroll=function(){null!==this.m_scrollStartPoint&&(this.m_scrollStartPoint=null,this._clearCommonTransitionsStartState())},o.prototype.update=function(e,t,i,n){this._visibleBarsInvalidated=!0,i.length>0&&this.m_points.merge(e,t,i),this.m_tickmarks.merge(n),this._correctOffset()},o.prototype.addTail=function(e,t,i){var n,o,r;for(this.m_tickmarks.removeTail(t),n=e.params,o=this.m_tickmarks.maxIndex+(i?0:1),r=0;r<n.marks.length;r++)n.marks[r].index=o+r;this.m_tickmarks.addTail(n.marks),this.m_points.addTail(n.changes,i),this.m_rightOffset-=n.changes.length},o.prototype.formatLabel=function(e,t){if(this._formattedBySpan[t])return this._formattedBySpan[t].format(e.valueOf());var i=this;return this._formattedBySpan[t]=new a(function(e){return i.formatLabelImpl(new Date(e),t)}),this._formattedBySpan[t].format(e)},o.prototype.formatLabelImpl=function(e,t){if(!(e&&e instanceof Date))return"incorrect time";var i=this._model.mainSeries().isDWM();return t<d.MINUTE_SPAN&&!i?h(e.getUTCHours(),2)+":"+h(e.getUTCMinutes(),2)+":"+h(e.getUTCSeconds(),2):t<d.DAY_SPAN&&!i?h(e.getUTCHours(),2)+":"+h(e.getUTCMinutes(),2):t<d.WEEK_SPAN?e.getUTCDate():t<d.MONTH_SPAN?e.getUTCDate():t<d.YEAR_SPAN?(y||(y=n()),y[e.getUTCMonth()]):e.getUTCFullYear()},o.prototype.normalizeBarIndex=function(e){var t=0,i=0,n=this.baseIndex();return e<this.m_points.firstIndex()?(t=this.m_points.valueAt(this.m_points.firstIndex()),i=e-this.m_points.firstIndex()):e>n?(t=this.m_points.valueAt(n),i=e-n):(t=this.m_points.valueAt(e),i=0),{time_t:t,offset:i}},o.prototype.denormalizeTimePoint=function(e){var t=this.m_points.indexOf(e.time_t);if(null!==t)return t+e.offset},o.prototype.zoomToBarsRange=function(e,t){if(!(t<=e)){var i=this.baseIndex();this.m_rightOffset=t-i,
this.setBarSpacing(this.width()/(t-e+1)),this._visibleBarsInvalidated=!0}},o.prototype.canZoomIn=function(){return this.m_barSpacing<g},o.prototype.canZoomOut=function(){return this.m_barSpacing>v},o.prototype.minBarSpacing=function(){return v},o.prototype.maxBarSpacing=function(){return g},o.prototype.onScroll=function(){return this._onScroll},o.prototype.preserveBarSpacing=function(){return this._options.preserveBarSpacing},o.prototype.visibleBarsChanged=function(){return this._visibleBarsChanged},t.TimeScale=o}).call(t,i(8))},function(e,t,i){"use strict";function n(e,t){this._formatter=e,this._maxSize=t||50,this._actualSize=0,this._cache={},this._usageTick=1,this._oldestTick=1,this._tick2Labels={}}n.prototype.format=function(e){var t,i;return this._cache[e]?this._cache[e].string:(this._actualSize===this._maxSize&&(t=this._tick2Labels[this._oldestTick],delete this._tick2Labels[this._oldestTick],delete this._cache[t],this._oldestTick++,this._actualSize--),i=this._formatter(e),this._cache[e]={string:i,tick:this._usageTick},this._tick2Labels[this._usageTick]=e,this._actualSize++,this._usageTick++,i)},e.exports=n},function(e,t,i){"use strict";(function(t){function i(){this._marksByIndex={},this._marksBySpan=[],this.changed=new t}i.prototype.reset=function(){this._marksByIndex={},this._marksBySpan=[],delete this.minIndex,delete this.maxIndex,delete this._cache,this.changed.fire()},i.prototype.minIndex=void 0,i.prototype.maxIndex=void 0,i.prototype.merge=function(e){var t,i,n,o,r,s=this._marksBySpan,a={};for(t=0;t<e.length;t++){if(i=e[t],n=i.index,o=i.span,r=this._marksByIndex[i.index]){if(r.index===i.index&&r.span===i.span){r.time=i.time;continue}this._removeTickmark(r)}this._marksByIndex[n]=i,this.minIndex<=n||(this.minIndex=n),this.maxIndex>=n||(this.maxIndex=n),s[o]||(s[o]=[]),s[o].push(i),a[o]=!0}for(o=s.length;o--;)s[o]&&(s[o].length||delete s[o],a[o]&&s[o].sort(this._sortByIndexAsc));delete this._cache,this.changed.fire()},i.prototype._removeTickmark=function(e){var t,i,n=e.index;this._marksByIndex[n]===e&&(delete this._marksByIndex[n],n<=this.minIndex&&this.minIndex++,n>=this.maxIndex&&this.maxIndex--,this.maxIndex<this.minIndex&&(delete this.minIndex,delete this.maxIndex),t=this._marksBySpan[e.span],-1!==(i=t.indexOf(e))&&t.splice(i,1))},i.prototype._sortByIndexAsc=function(e,t){return e.index-t.index},i.prototype.removeTail=function(e){var t,i={};this.maxIndex=0;for(t in this._marksByIndex)this._marksByIndex[t].time<e&&(i[t]=this._marksByIndex[t],this.maxIndex=Math.max(this.maxIndex,t));this._marksByIndex=i},i.prototype.addTail=function(e){for(var t=0;t<e.length;t++)e[t].index=this.maxIndex+t+1;this.merge(e)},i.prototype.indexToTime=function(e){var t=this._marksByIndex[e];return t?new Date(1e3*t.time):null},i.prototype.density=function(){var e,t=this.maxIndex-this.minIndex;if(0!==t)return e=this._marksByIndex[this.maxIndex].time-this._marksByIndex[this.minIndex].time,1e3*e/t},i.prototype.estimateLeft=function(e){var t,i=this.density();if(i)return t=1e3*this._marksByIndex[this.minIndex].time-e,t/i},
i.prototype.nearestIndex=function(e){for(var t,i=this.minIndex,n=this.maxIndex;n-i>2;){if(1e3*this._marksByIndex[i].time===e)return i;if(1e3*this._marksByIndex[n].time===e)return n;t=Math.round((i+n)/2),1e3*this._marksByIndex[t].time>e?n=t:i=t}return i},i.prototype.build=function(e,t){var i,n,o,r,s,a,l,c,h,u,d,p,_,f,m=Math.ceil(t/e);if(this._maxbar===m&&this._cache)return this._cache;for(this._maxbar=m,i=[],n=this._marksBySpan.length;n--;)if(this._marksBySpan[n]){for(o=i,i=[],r=o.length,s=0,a=this._marksBySpan[n],l=a.length,c=1/0,h=-1/0,u=0;u<l;u++){for(d=a[u],p=d.index;s<r;){if(_=o[s],!((f=_.index)<p)){c=f;break}s++,i.push(_),h=f,c=1/0}c-p>=m&&p-h>=m&&(i.push(d),h=p)}for(;s<r;s++)i.push(o[s])}return this._cache=i,this._cache},i.prototype.state=function(){var e,t=[];for(e=this._marksBySpan.length;e--;)this._marksBySpan[e]&&(t=t.concat(this._marksBySpan[e]));return t=t.map(function(e){return[e.span,e.time,e.index]}),{marks:t,version:2}},i.prototype.restoreState=function(e){if(this._marksByIndex={},this._marksBySpan=[],delete this.maxIndex,delete this.minIndex,e&&e.marks&&e.marks.length)if(2===e.version){var t=e.marks.map(function(e){return{span:e[0],time:e[1],index:e[2]}});this.merge(t)}else this.merge(e.marks)},e.exports=i}).call(t,i(8))},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"TimePoints",function(){return r}),n=i(4),o=Object(n.getLogger)("Chart.TimePoints"),r=function(){function e(){this._zoffset=0,this._items=[]}return e.prototype.clear=function(){this._zoffset=0,this._items=[]},e.prototype.size=function(){return this._items.length},e.prototype.firstIndex=function(){return this._offsetToIndex(0)},e.prototype.lastIndex=function(){return this._offsetToIndex(this._items.length-1)},e.prototype.merge=function(e,t,i){var n,r,s,a,l,c,h,u;if(0===i.length)return o.logError("merge: 'values' does not contain any time points"),[];if(t>this._zoffset&&e+t>0)return o.logError("merge: when the first time point index is updated, we should fill the time points starting from the first one"),[];if(0===this._items.length)return this._items=i,this._zoffset=t,[{change:"rebuild",index:this._validOffsetToIndex(0)}];if((n=e+this._zoffset)<0){if(r=Math.abs(n),i.length<r)return o.logError("merge: 'values' does not contain enough time points to fill in the new items. 'index': "+e+", previous 'zoffset': "+this._zoffset+", new 'zoffset': "+t+", 'values.length': "+i.length),[];for(this._items=Array(r).concat(this._items),this._zoffset=t,s=0;s<i.length;++s)this._items[e+s+t]=i[s];return[{change:"rebuild",index:this._validOffsetToIndex(0)}]}for(a=[],l=n;l<this._items.length&&l-n<i.length;++l)this._items[l]=i[l-n],a.push({change:"update",index:this._validOffsetToIndex(l),value:i[l-n]});if((c=n+i.length)>this._items.length)for(r=c-this._items.length,h=l;h<l+r;++h)u=this._items.length,this._items.push(i[h-n]),a.push({change:"append",index:this._validOffsetToIndex(u),value:i[h-n]});return this._zoffset=t,a},e.prototype.addTail=function(e,t){for(var i=t?1:0;i<e.length;i++)this._items.push(e[i])},
e.prototype.remove=function(e){var t,i,n,o=this._indexToOffset(e);if(null===o)return[];for(t=this._items.splice(o),i=[],n=0;n<t.length;n++)i.push({change:"remove",index:e+n,value:t[n]});return i},e.prototype.valueAt=function(e){var t=this._indexToOffset(e);return null!==t?this._items[t]:null},e.prototype.indexOf=function(e,t){if(this._items.length<1)return null;if(e>this._items[this._items.length-1])return t?this._validOffsetToIndex(this._items.length-1):null;for(var i=0;i<this._items.length;++i){if(e===this._items[i])return this._validOffsetToIndex(i);if(e<this._items[i])return t?this._validOffsetToIndex(i):null}return null},e.prototype.state=function(){return{items:this._items,zoffset:this._zoffset}},e.prototype.restoreState=function(e){null!==e&&(this._items=e.items,this._zoffset=e.zoffset)},e.prototype.roughTime=function(e,t){var i,n,o,r,s,a,l,c,h,u,d,p;return void 0===t&&(t=null),null!==(i=this.valueAt(e))?i:(n=this._items,!n.length||n.length<2?null:(o=0,r=n.length-1,s=this._validOffsetToIndex(o),a=this._validOffsetToIndex(r),l=n[o],c=n[r],h=(c-l)/(a-s),e<s?(u=s-e,d=u*h,l-d):(p=500,e>a?(u=e-a)<p&&null!=t?t(c,u):(d=u*h,c+d):null)))},e.prototype.roughIndex=function(e,t){var i,n,o,r,s,a,l,c,h,u,d,p;return void 0===t&&(t=null),i=this._items,!i.length||i.length<2?null:(n=0,o=i.length-1,r=this._validOffsetToIndex(n),s=this._validOffsetToIndex(o),a=i[n],l=i[o],e>=a&&e<=l?this.closestIndexLeft(e):(c=(l-a)/(s-r),e<a?(h=a-e,u=Math.round(h/c),r-u):(d=500,e>l?(h=e-l,u=Math.trunc(h/c),u<d&&null!==t&&(p=t(l,e),p.success&&(u=p.result)),s+u):null)))},e.prototype.closestIndexLeft=function(e){var t,i,n,o,r,s,a=this._items;if(!a.length)return null;if(Number.isNaN(e))return null;if(t=a.length-1,i=a[t],e>=i)return this._validOffsetToIndex(t);if(n=0,o=a[n],e<o)return null;if(e===o)return this._validOffsetToIndex(n);for(;t>n+1;)if(r=n+t>>1,(s=a[r])>e)t=r;else{if(!(s<e))return s===e?this._validOffsetToIndex(r):null;n=r}return this._validOffsetToIndex(n)},e.prototype._validOffsetToIndex=function(e){return e-this._zoffset},e.prototype._offsetToIndex=function(e){return 0<=e&&e<this.size()?this._validOffsetToIndex(e):null},e.prototype._indexToOffset=function(e){var t=e+this._zoffset;return 0<=t&&t<this.size()?t:null},e}()},function(e,t,i){"use strict";function n(e,t){this.tooltips={},this.tooltipFactory=e,this.source=t}function o(e,t){this.renderer=e,this._tooltip=t,this.visible=!1}n.prototype.findOrCreateTooltip=function(e){var t=this.tooltips[e.id];return null==t&&(e.hovered||e.pinned)&&(t=this._createTooltip(),this.tooltips[e.id]=t),t},n.prototype.showPlate=function(e,t){var i=this.findOrCreateTooltip(e);null!=i&&(i._drawPlate(e,t),i.plateData=e)},n.prototype.draw=function(e,t){this.hoveredId=null;for(var i=0;i<e.length;i++)e[i].hovered&&(this.hoveredId=e[i].id);e.forEach(function(e){this.showPlate(e,t)}.bind(this))},n.prototype.endDraw=function(){var e,t,i=this;for(e in this.tooltips)this.tooltips.hasOwnProperty(e)&&(t=this.tooltips[e],t.toggleVisibility(),i.hoveredId&&t.plateData.id!==i.hoveredId&&!t.plateData.pinned&&(t.remove(),
delete this.tooltips[e]))},n.prototype.removeAll=function(){var e,t;for(e in this.tooltips)this.tooltips.hasOwnProperty(e)&&(t=this.tooltips[e],t.remove());this.tooltips={}},n.prototype.removeTooltip=function(e){delete this.tooltips[e]},n.prototype._createTooltip=function(){return new o(this,this.tooltipFactory())},o.prototype._drawPlate=function(e,t){var i=this;this.visible=!0,this._tooltip.setSource(this.renderer.source),this._tooltip.showPlate(e,t),e.hovered||e.pinned||this._tooltip.hide(function(){i.renderer.removeTooltip(e.id)})},o.prototype.remove=function(){this._tooltip._removeLayout()},o.prototype.toggleVisibility=function(){this._tooltip._toggleLayout(this.visible),this.visible=!1},t.TooltipRenderer=n},function(e,t,i){"use strict";function n(e){var t,i;if(e&&e.__esModule)return e;if(t={},null!=e)for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t,i){var n,o=2*J,r=document.createElement("canvas");return r.width=t*o,r.height=i*o,r.style.width=t+"px",r.style.height=i+"px",n=r.getContext("2d"),n.setTransform(o,0,0,o,0,0),n.drawImage(e,0,0,t,i),r}function s(e,t){return function(){i.e(11).then(function(){X=i(811),e.call(t)}.bind(null,i)).catch(i.oe)}}function a(e){return!x||e>L}function l(e){return!T||e>C}var c,h,u,d,p,_,f,m,y,g,v,S,b,w,P,T,x,C,L,I,A,k,E,M,V,D,O,R,B,N,F,W,H,j,z,U,q,Y,G,K,Z,J,X,Q,ee;Object.defineProperty(t,"__esModule",{value:!0}),t.Branding=void 0,c=function(){function e(e,t){var i,n,o=[],r=!0,s=!1,a=void 0;try{for(i=e[Symbol.iterator]();!(r=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);r=!0);}catch(e){s=!0,a=e}finally{try{!r&&i.return&&i.return()}finally{if(s)throw a}}return o}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),h=function(){function e(e,t){var i,n;for(i=0;i<t.length;i++)n=t[i],n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),u=i(6),d=i(60),p=i(5),_=n(p),f=i(9),m=i(184),y=i(29),g=i(194),v=i(46),S=i(24),b=i(257).debounce,w=i(623),P=!1,T=_.enabled("adaptive_logo"),x=_.enabled("small_no_display"),P=_.enabled("38914"),C=500,L=480,I="TradingView",A="Ch{0}ar{1}t{2}by{3}{4}".format("",""," "," ",I),k="po{0}wer{1}ed{2}by{3}{4}".format("",""," "," ",I),E="by{3}{4}".format("",""," "," ",I),M=P?E:k,V="site_branding",D="widget_branding",O="widget_referral_branding",R="widget_custom_branding",B="widget_custom_no_powered_branding",N="fundamental_branding",F="fundamental_custom_branding",W="fundamental_custom_no_powered_branding",H="library_branding",j="library_custom_branding",z="library_custom_no_powered_branding",U=.2,q=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,Y=q&&navigator.userAgent.toLowerCase().indexOf("windows")>-1,
G=navigator.userAgent.toLowerCase().indexOf("chrome")>-1&&-1===navigator.userAgent.toLowerCase().indexOf("edge"),K=function(){var e,t=window.navigator.userAgent,i=t.indexOf("MSIE ");return i>0?parseInt(t.substring(i+5,t.indexOf(".",i)),10):t.indexOf("Trident/")>0&&(e=t.indexOf("rv:"),parseInt(t.substring(e+3,t.indexOf(".",e)),10))}(),Z=window.urlParams||{},window.initData,J=window.hidpiCanvasRatio||1,X=null,Q=function(){function e(t){var i=t.layout,n=void 0===i?V:i,r=t.symbol,a=void 0===r?"":r,l=t.model,c=t.onReadyCallback;o(this,e),this._model=l,this._image=null,this._imageReady=!1,this._needDisplayImage=!1,this._imageWidth=22,this._imageHeight=13,this._layout=n,this._symbol=a,this.showAnimatedBranding=_.enabled("show_animated_logo"),this.show=!0,this.width=100,this.height=14,this._bottomShift=0,this._brandCircleSize=32,this._animatedWidth=this._brandCircleSize,this._animatedOpacity=0,this.width=this.showAnimatedBranding?this._brandCircleSize:100,this.height=14,this._fillColor=m.color.brandNew,this._colorOldBlue=m.color.brandDown,this._colorOldGray=m.color.black30,this._strokeColor=m.color.black255,this._brandCircleShadowColor=m.color.black0,this._strokeWidth=4,this._fontSize=this.showAnimatedBranding?11:14,this._font='px "Trebuchet MS", Tahoma, Arial, sans-serif',this._txt="TradingView",this._onReadyCallback=c,this._upscaleRatio=G?1:2,this._verticalTextShift=q?this.showAnimatedBranding?2:4:0,this._strokeCanv=null,this._fillCanv=null,K&&(this._init=s(this._init,this)),this._init()}return h(e,[{key:"_init",value:function(){this._checkLayout(),this.show&&(this._updateStrokeColor(),this.showAnimatedBranding?(this._loadImage(w,"tvLogo"),this._createFillText()):this._loadImage(w,"tvLogo"),this._model.properties().paneProperties.background.subscribe(this,this._updateStrokeColor),this._model.onChartThemeLoaded().subscribe(this,this._updateStrokeColor))}},{key:"_updateStrokeColor",value:function(){var e=(0,y.getLuminance)(this._model.properties().paneProperties.background.value());this._strokeCanv=null,this._fillCanv=null,e>U?(this._brandCircleColor=m.color.black255,this._animatedColorBg=m.color.black255,this._brandCircleShadowOpacity=.09,this._strokeOpacity=.8):(this._brandCircleColor=m.color.black27,this._animatedColorBg=m.color.black27,this._brandCircleShadowOpacity=.09,this._strokeOpacity=.1)}},{key:"_loadImage",value:function(e,t){var i,n=this;this._needDisplayImage&&(this._image=new Image,this.showAnimatedBranding&&(this._imageWhite=new Image),K?(this._image.src=X.fallbackImages[t+"Blue"],this.showAnimatedBranding&&(this._imageWhite.src=X.fallbackImages[t+"White"])):(i=e.replace(/fill="#[\da-f]{6}"/i,'fill="#FFFFFF"'),this._image.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(e),this.showAnimatedBranding&&(this._imageWhite.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(i))),this._image.addEventListener("load",function(){Y&&(n._image=r(n._image,n._imageWidth,n._imageHeight)),n._imageReady=!0,"function"==typeof n._onReadyCallback&&n._onReadyCallback()}))}},{key:"_checkLayout",value:function(){
switch(this._layout){case D:case O:case R:case N:case F:case j:case H:this.show=!0;break;case V:case B:case W:case z:this.show=!1}switch(this._layout){case H:this._needDisplayImage=!0,this._txt=$.t(A);break;case j:this._txt=$.t(M)}}},{key:"_drawTextStroke",value:function(e){var t,i;this._strokeCanv||(this._strokeCanv=document.createElement("canvas"),t=this._strokeCanv.getContext("2d"),i=Math.round(this._strokeWidth*this._upscaleRatio),t.font=this._fontSize*this._upscaleRatio+this._font,this._textWidth=t.measureText(this._txt).width,this._strokeCanv.width=(this._textWidth+2*i)*J,this._strokeCanv.height=(this._fontSize+2*i)*this._upscaleRatio*J,this._strokeCanv.width%2==0&&(this._strokeCanv.width+=1,this._strokeCanv.height+=1),t.textBaseline="top",t.textAlign="start",t.font=this._fontSize*this._upscaleRatio+this._font,t.strokeStyle=this._strokeColor,t.lineWidth=this._strokeWidth*this._upscaleRatio*J,t.lineJoin="round",t.strokeText(this._txt,i,this._verticalTextShift)),e.save(),e.globalAlpha=this._strokeOpacity,e.drawImage(this._strokeCanv,0,0,this._strokeCanv.width,this._strokeCanv.height,0,0,this._strokeCanv.width/this._upscaleRatio/J,this._strokeCanv.height/this._upscaleRatio/J),e.restore()}},{key:"_drawTextFill",value:function(e){this._createFillText(),e.save(),e.drawImage(this._fillCanv,0,0,this._fillCanv.width,this._fillCanv.height,0,0,this._fillCanv.width/this._upscaleRatio/J,this._fillCanv.height/this._upscaleRatio/J),e.restore()}},{key:"_createFillText",value:function(){var e,t;null===this._fillCanv&&(this._fillCanv=document.createElement("canvas"),e=this._fillCanv.getContext("2d"),t=Math.round(this._strokeWidth*this._upscaleRatio),e.font=this._fontSize*this._upscaleRatio+this._font,void 0===this._textWidth&&(this._textWidth=Math.round(e.measureText(this._txt).width)),this._setSizeFillTextCanvas(t),e.textBaseline="top",e.textAlign="start",e.font=this._fontSize*this._upscaleRatio+this._font,e.fillStyle=this._fillColor,e.fillText(this._txt,t,this._verticalTextShift))}},{key:"_updateFillTextWithColor",value:function(e){var t=Math.round(this._strokeWidth*this._upscaleRatio),i=this._fillCanv.getContext("2d");this._setSizeFillTextCanvas(t),i.clearRect(0,0,this._fillCanv.width,this._fillCanv.height),i.textBaseline="top",i.textAlign="start",i.font=this._fontSize*this._upscaleRatio+this._font,i.fillStyle=e,i.fillText(this._txt,t,this._verticalTextShift)}},{key:"_setSizeFillTextCanvas",value:function(e){this._fillCanv.width=(this._textWidth+2*e)*J,this._fillCanv.height=(this._fontSize+2*e)*this._upscaleRatio*J,this._fillCanv.width%2==0&&(this._fillCanv.width+=1,this._fillCanv.height+=1)}},{key:"_drawFillTextCropWidth",value:function(e,t,i){this._fillCanv?this._updateFillTextWithColor(i):this._createFillText(),e.save(),e.drawImage(this._fillCanv,0,0,t*this._upscaleRatio*J,this._fillCanv.height,0,0,t,this._fillCanv.height/this._upscaleRatio/J),e.restore()}},{key:"_drawBgCircle",value:function(e){e.save(),e.beginPath(),e.fillStyle=this._brandCircleShadowColor,e.globalAlpha=this._brandCircleShadowOpacity,
e.arc(this._imageWidth/2,this._imageHeight/2,this._brandCircleSize/2+1,0,2*Math.PI),e.fill(),e.closePath(),e.restore(),e.save(),e.beginPath(),e.fillStyle=this._brandCircleColor,e.arc(this._imageWidth/2,this._imageHeight/2,this._brandCircleSize/2,0,2*Math.PI,!1),e.fill(),e.closePath(),e.restore()}},{key:"_drawFillRectWithRoundedCorner",value:function(e,t,i,n,o,r,s){e.save(),(0,v.drawRoundRect)(e,t-1,i-1,n+2,o+2,r),e.globalAlpha=this._brandCircleShadowOpacity,e.fillStyle=this._brandCircleShadowColor,e.fill(),e.closePath(),e.restore(),e.save(),(0,v.drawRoundRect)(e,t,i,n,o,r),e.fillStyle=s,e.fill(),e.closePath(),e.restore()}},{key:"_drawImageWithColor",value:function(e){e.save(),e.globalAlpha=this._animatedOpacity,e.drawImage(this._imageWhite,0,-.5,this._imageWidth,this._imageHeight),e.restore(),e.save(),e.globalAlpha=1-this._animatedOpacity,e.drawImage(this._image,0,-.5,this._imageWidth,this._imageHeight),e.restore()}},{key:"bottomShift",value:function(){return this._bottomShift}},{key:"minimizedAnimationWidth",value:function(){return this._brandCircleSize}},{key:"maximizedAnimationWidth",value:function(){return this._fillCanv.width/this._upscaleRatio/J+this._brandCircleSize-3}},{key:"animatedDrawStep",value:function(e,t){var i,n,o,r,s,a,l,h,u,d,p,_,f,m,y,g;this._animatedWidth=t,i=this._animatedWidth<this._brandCircleSize+20?0:this._animatedWidth/this.maximizedAnimationWidth(),n=(0,S.parseRgb)(this._brandCircleColor),o=c(n,3),r=o[0],s=o[1],a=o[2],l=(0,S.parseRgb)(this._fillColor),h=c(l,3),u=h[0],d=h[1],p=h[2],_=(0,S.parseRgb)(this._strokeColor),f=c(_,3),m=f[0],y=f[1],g=f[2],this._animatedColorBg=(0,S.rgbaToString)((0,S.blendRgba)([r,s,a,(0,S.normalizeAlphaComponent)(1)],[u,d,p,(0,S.normalizeAlphaComponent)(i)])),this._animatedColorText=(0,S.rgbaToString)((0,S.blendRgba)([u,d,p,(0,S.normalizeAlphaComponent)(1)],[m,y,g,(0,S.normalizeAlphaComponent)(i)])),this._animatedOpacity=i}},{key:"draw",value:function(e,t){var i,n,o,r,s,c,h,u,d,p;this.showAnimatedBranding?this._needDisplayImage&&this._imageReady&&(e.save(),i=(this._brandCircleSize-this._imageWidth)/2,n=(this._brandCircleSize-this._imageHeight)/2,e.translate(-i,-n),this._drawFillRectWithRoundedCorner(e,0,0,this._animatedWidth,this._brandCircleSize,this._brandCircleSize/2,this._animatedColorBg),e.translate(i,n),this._drawImageWithColor(e),o=12+(G?-.5:0),r=this._imageWidth+o,this._animatedWidth>r&&(e.translate(this._imageWidth/2+o,.5),this._drawFillTextCropWidth(e,this._animatedWidth-r,this._animatedColorText)),e.restore(),this.width=this._animatedWidth,this.height=this._brandCircleSize,this._bottomShift=this._brandCircleSize-this._imageHeight):this._layout===R||this._layout===F?(s='12px "Trebuchet MS", Tahoma, Arial, sans-serif',e.font=s,c=e.measureText(this._txt).width,this.width=c+e.measureText("TradingView").width,e.save(),e.globalAlpha=.7,e.fillStyle=this._colorOldGray,e.fillText(this._txt,0,12),e.fillStyle=this._colorOldBlue,e.fillText("TradingView",c,12),e.restore()):a(t)&&(this._needDisplayImage&&this._imageReady?(e.save(),
h=(this._brandCircleSize-this._imageWidth)/2,e.translate(h,0),this._drawBgCircle(e),e.drawImage(this._image,0,-.5,this._imageWidth,this._imageHeight),u=12+(G?-.5:0),e.translate(this._imageWidth+u,-.5),d=l(t),d&&(this._drawTextStroke(e),this._drawTextFill(e)),e.restore(),this.width=this._imageWidth+h,this.width+=d?u+this._strokeCanv.width/this._upscaleRatio/J:h,this.height=this._brandCircleSize,this._bottomShift=this._brandCircleSize-this._imageHeight):(e.save(),e.translate(G?-.5:0,-.5),p=l(t),p&&(this._drawTextStroke(e),this._drawTextFill(e)),e.restore(),p&&(this.width=this._strokeCanv.width/this._upscaleRatio/J)))}}]),e}(),ee=function(){function e(t){var i=t.layout,n=void 0===i?V:i,r=t.src,a=t.onReadyCallback;o(this,e),this._img=new Image,this._ready=!1,this.show=!1,this.width=0,this.height=0,this._layout=n,this._src=r,this._onReadyCallback=a,K&&(this._init=s(this._init,this)),this._init()}return h(e,[{key:"_init",value:function(){var e,t,i=this;this._checkLayout(),this.show&&(e=this._src.match(/(\w+)\.svg/),K&&e&&2===e.length?(t=e[1],this._img.src=X.fallbackImages[t],this._img.addEventListener("load",function(){var e=X.logoSizes;t in e?(i.width=e[t].width,i.height=e[t].height):(i.width=135,i.height=25),i._ready=!0,"function"==typeof i._onReadyCallback&&i._onReadyCallback()})):(this._img.src=this._src,this._img.addEventListener("load",function(){i.width=Math.round(i._img.width),i.height=Math.round(i._img.height),Y&&(i._img=r(i._img,i.width,i.height)),i._ready=!0,"function"==typeof i._onReadyCallback&&i._onReadyCallback()})))}},{key:"_checkLayout",value:function(){switch(this._layout){case R:case B:case F:case W:case j:case z:this.show=!0;break;case V:case D:case O:case N:case H:this.show=!1}}},{key:"draw",value:function(e){this._ready&&e.drawImage(this._img,0,0,this.width,this.height)}}]),e}(),t.Branding=function(){function e(t){var i,n=this;o(this,e),this._model=t,this._mainSeries=this._model.mainSeries(),this._canvasWidth=0,this._paneHeight=0,this._left=13,this._bottom=24,this._layout=V,this._needToShow=!0,this._customLogoSrc="",this._customLogoLink="",this._checkLayout(),this._layout!==R&&this._layout!==F||(this._left=8,this._bottom=5),i=function(){n._needToShow?n._layout===V?n._showBranding=window.innerWidth>=768:n._showBranding=!0:n._showBranding=!1},this._resizeHandlerDelayed=b(i,200),i(),window.addEventListener("resize",this._resizeHandlerDelayed),this._model.isSnapshot()?this._init():this._mainSeries.dataEvents().symbolResolved().subscribe(this,this._init),this._cubicBezier=new m.CubicBezier(.4,.01,.22,1)}return h(e,[{key:"destroy",value:function(){window.removeEventListener("resize",this._resizeHandlerDelayed)}},{key:"_init",value:function(){var e=this,t=this._mainSeries.symbolInfo()||{};this._powBy=new Q({layout:this._layout,symbol:t.name,model:this._model,onReadyCallback:function(){return e._model.fullUpdate()}}),this._custom=new ee({layout:this._layout,src:this._customLogoSrc,onReadyCallback:function(){return e._model.fullUpdate()}}),this._openAnimation=null,this._closeAnimation=null}},{
key:"_checkLayout",value:function(){if(_.enabled("widget"));else if(_.enabled("charting_library")||_.enabled("amp_terminal")||_.enabled("cqg_terminal")||_.enabled("trading_terminal")){var e=JSON.parse(Z.logo)||{};e.image?(this._customLogoSrc=e.image,this._customLogoLink=e.link,this._needToShow=_.enabled("widget_logo"),_.enabled("link_to_tradingview")?this._layout=j:this._layout=z):(this._layout=H,this._needToShow=_.enabled("widget_logo"))}else this._layout=V}},{key:"_startOpenAnimation",value:function(){null===this._openAnimation&&(null!==this._closeAnimation&&(this._closeAnimation.stop(),this._closeAnimation=null),this._openAnimation=(0,g.doAnimate)({from:this._currentStateForAnimation(),to:this._openedStateForAnimation(),duration:200,easing:this._cubicBezier.easingFunc,onStep:this._animatedDrawStep.bind(this)}))}},{key:"_startCloseAnimation",value:function(){null===this._closeAnimation&&(null!==this._openAnimation&&(this._openAnimation.stop(),this._openAnimation=null),this._closeAnimation=(0,g.doAnimate)({from:this._currentStateForAnimation(),to:this._closedStateForAnimation(),duration:200,easing:this._cubicBezier.easingFunc,onStep:this._animatedDrawStep.bind(this)}))}},{key:"_currentStateForAnimation",value:function(){return this._powBy.width}},{key:"_closedStateForAnimation",value:function(){return this._powBy.minimizedAnimationWidth()}},{key:"_openedStateForAnimation",value:function(){return this._powBy.maximizedAnimationWidth()}},{key:"_animatedDrawStep",value:function(e,t){this._powBy.animatedDrawStep(e,t),this._model.lightUpdate()}},{key:"updateAllViews",value:function(){}},{key:"priceScale",value:function(){}},{key:"priceAxisViews",value:function(){}},{key:"onClickOutside",value:function(){}},{key:"hasContextMenu",value:function(){return!1}},{key:"hitTest",value:function(e){var t=this;return!this._showBranding||_.enabled("logo_without_link")?null:this._powBy&&this._layout!==V&&this._layout!==B&&this._layout!==W&&(0,d.pointInRectangle)(e,new u.Point(this._left,this._paneHeight-this._bottom+this._powBy.bottomShift()/2-Math.max(this._powBy.height,void 0!==this._custom?this._custom.height:0)),new u.Point(this._left+Math.max(this._powBy.width,void 0!==this._custom?this._custom.width:0),this._paneHeight-this._bottom+this._powBy.bottomShift()/2))?new f.HitTestResult(f.HitTestResult.CUSTOM,{mouseUpHandler:function(){window.open(t.tvUrl(),"_blank").opener=null},mouseEnterHandler:function(){t._startOpenAnimation()},mouseLeaveHandler:function(){t._startCloseAnimation()}}):void 0}},{key:"tvUrl",value:function(){var e,t="https://www.tradingview.com/";if(this._customLogoLink)return this._customLogoLink;if(this._layout===H||this._layout===j){switch(e=void 0,!0){case _.enabled("charting_library"):e="library";break;case _.enabled("trading_terminal"):case _.enabled("amp_terminal"):case _.enabled("cqg_terminal"):e="trading-terminal"}return t+="/"===t[t.length-1]?"?":"&",t+="utm_source="+window.location.origin+"&utm_medium=library"+(e?"&utm_campaign="+e:"")}return t}},{key:"draw",value:function(e){if(this._showBranding){var t=0
;this._powBy&&this._powBy.show&&(t=this._powBy.height-this._powBy.bottomShift(),e.save(),e.translate(this._left,this._paneHeight-this._bottom-t),this._powBy.draw(e,this._canvasWidth),e.restore()),this._custom&&this._custom.show&&(e.save(),e.translate(this._left,this._paneHeight-this._bottom-t-this._custom.height),this._custom.draw(e),e.restore())}}},{key:"renderer",value:function(e,t){return this._paneHeight=this._pane.height(),this._canvasWidth=t,{draw:this.draw.bind(this),hitTest:this.hitTest.bind(this)}}},{key:"paneViews",value:function(e){var t=_.enabled("move_logo_to_main_pane");return t&&e.isMainPane()||!t&&e.isLast()||e.isMaximized()?(this._pane=e,[{renderer:this.renderer.bind(this)}]):[]}}]),e}()},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 13" width="22" height="13"><path fill="#37A6EF" fill-rule="nonzero" d="M19.354 4.932c.379.55.611 1.207.642 1.918A3.007 3.007 0 0 1 22 9.686a3.003 3.003 0 0 1-3 3.006H4a3.983 3.983 0 0 1-2.814-1.16l6.363-5.048a1.657 1.657 0 0 0 1.495.037l3.034 2.66a1.672 1.672 0 0 0 1.589 2.175 1.668 1.668 0 0 0 1.552-2.28l4.135-4.144zm-.942-.945L14.276 8.13a1.66 1.66 0 0 0-1.32.044l-3.034-2.66A1.672 1.672 0 0 0 8.333 3.34a1.668 1.668 0 0 0-1.611 2.097l-6.316 5.01A3.999 3.999 0 0 1 0 8.683a4.004 4.004 0 0 1 4.041-4.008A5.338 5.338 0 0 1 9.333 0a5.337 5.337 0 0 1 5.124 3.857 3.644 3.644 0 0 1 1.876-.517c.772 0 1.488.239 2.079.647z"/></svg>'},function(e,t,i){"use strict";(function(e){function n(e,t,i,n){this._prices=[],this._canvas=$("<canvas>"),this._cache=this._canvas.get(0).getContext("2d"),this.reset({font:e,fontSize:t,backColors:i,colors:n}),this._priceAxisFontSize=11}function o(e,t){this._model=e,this._source=t,this._pivots=[],this._textCache={}}function r(e,t){this._source=e,this._model=e._model,this._prices=[],this._invidated=!0,this._cache=t}function s(e,t,i,n){var o,r,s;for(p.call(this,e,t,i,n),o=["P","S1/R1","S2/R2","S3/R3","S4/R4","S5/R5"],r=this.properties().levelsStyle.visibility,s=0;s<o.length;s++)r[o[s]].listeners().subscribe(this,TradingView.Study.prototype.processHibernate)}var a=i(6).Point,l=i(24),c=l.parseRgb,h=l.rgbToBlackWhiteString,u=i(119),d=i(117).StudyDataWindowView,p=i(180).NonSeriesStudy,_=i(625).StandardPivotPointsPriceAxisView,f=i(185).TrendLineRenderer,m=i(100),y=i(312),g=i(9).HitTestResult,v=i(69).CompositeRenderer,S=i(17).PlotRowSearchMode,b=i(2).propertyPages,w=i(104).LineEnd;n.prototype.destroy=function(){this._canvas.remove()},n.prototype.reset=function(e){this._prices=[],this._params=e,this._cache.setFont(e.fontSize+"px "+e.font);var t=this;this._labelWidth=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5","/"].reduce(function(e,i){var n=t._cache.measureText(i).width;return Math.max(n,e)},0)},n.prototype.rowHeight=function(){return this._priceAxisFontSize+4},n.prototype._labelRectByIndex=function(e){return{left:0,top:Math.round(this._topByIndex(e)),width:Math.round(this._labelWidth+4),height:this._params.fontSize+8}},n.prototype.params=function(){return this._params},n.prototype._centerByIndex=function(e){
return Math.round((e+.5)*(this._params.fontSize+8))},n.prototype._topByIndex=function(e){return Math.round(e*(this._params.fontSize+8))},n.prototype.setPrices=function(e){var t,i,n,o,r,s,a=8,l=!1,c=function(e,t){return void 0===e&&void 0===t||e.formatted===t.formatted};if(e.length!==this._prices.length)l=!0;else for(t=0;t<this._prices.length;t++)if(!c(this._prices[t],e[t])){l=!0;break}if(l){for(i=this,i._cache.save(),i._cache.font=this._priceAxisFontSize+"px Arial",i._cache.restore(),n=this._labelWidth+6,o=window.hidpiCanvasRatio||1,n*=o,this._canvas.prop("width",n),r=Math.max(e.length,22)*(this._params.fontSize+a),r*=o,this._canvas.prop("height",r),this._canvas.css("width",n).css("height",r),this._prices=e,this._cache.clearRect(0,0,n,r),this._cache.save(),this._cache.translate(.5,.5),this._cache.font=this._params.fontSize+"px "+this._params.font,this._cache.textBaseline="middle",t=0;t<this._prices.length;t++)this._prices[t]&&(s=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5"][t],this._cache.fillStyle=this._params.backColors[t],this._cache.fillText(s,0,this._centerByIndex(t)),this._cache.fillText("/",0,this._centerByIndex(t+11)));this._prices=e,this._cache.restore()}},o.prototype.setCache=function(e){this._cache=e},o.prototype.priceAxisViews=function(e,t){return this._priceAxisViews},o.prototype.mergeLabel=function(e,t,i){var n=""+t;void 0===e[n]?(e[n]={},e[n].text=i,e[n].ids=[this.complete(i)]):(e[n].text+="/"+i,e[n].ids.push(this.complete(i)))},o.prototype.complete=function(e){return"P"===e?e:"S"+e[1]+"/R"+e[1]},o.prototype.update=function(){this._invalidated=!0},o.prototype._updateImpl=function(){var e,t,i,n,o,r,s,a,l,c,h,u,d,p,_,f,m,y;if(this._source.pricesView().prices(),this._pivots=[],this._source.customData()&&this._source.customData().pivots&&this._source.properties().visible.value()&&(e=this._source.customData().pivots,t=this._source._indexes,i=this._model.timeScale(),(n=this._source.priceScale())&&!n.isEmpty()&&!i.isEmpty()&&e&&(o=i.visibleBars(),r=o.firstBar(),s=o.lastBar(),this._source.ownerSource())))for(a=this._source.ownerSource().firstValue(),l=0;l<e.length;l++)if(e[l]&&(c=t[e[l].startIndex],!((h=t[e[l].endIndex])<r||c>s))){u={},d=this._source.properties().levelsStyle.visibility,d.P.value()&&this.mergeLabel(u,e[l].p,"P"),d["S1/R1"].value()&&(this.mergeLabel(u,e[l].s1,"S1"),this.mergeLabel(u,e[l].r1,"R1")),d["S2/R2"].value()&&(this.mergeLabel(u,e[l].s2,"S2"),this.mergeLabel(u,e[l].r2,"R2")),d["S3/R3"].value()&&(this.mergeLabel(u,e[l].s3,"S3"),this.mergeLabel(u,e[l].r3,"R3")),d["S4/R4"].value()&&(this.mergeLabel(u,e[l].s4,"S4"),this.mergeLabel(u,e[l].r4,"R4")),d["S5/R5"].value()&&(this.mergeLabel(u,e[l].s5,"S5"),this.mergeLabel(u,e[l].r5,"R5")),p=i.indexToCoordinate(c),_=i.indexToCoordinate(h);for(f in u)m=parseFloat(f),y=n.priceToCoordinate(m,a),this._pivots.push({x1:p,x2:_,y:y,label:u[f].text,labelIds:u[f].ids})}},o.prototype.renderer=function(){var e,t,i,n,o,r,s,l,c,h,u,d,p,_,m,S,b;for(this._invalidated&&(this._updateImpl(),this._invalidated=!1),e=new v,
t=this._source.properties().levelsStyle.colors,i=this._source.properties().levelsStyle.widths,n=0;n<this._pivots.length;n++)if(o=this._pivots[n],r=new a(o.x1,o.y),s=new a(o.x2,o.y),l={points:[r,s],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:t[o.labelIds[0]].value(),linewidth:i[o.labelIds[0]].value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:w.Normal,rightend:w.Normal},c=new f,c.setData(l),c.setHitTest(new g(g.REGULAR)),e.append(c),this._source.properties().levelsStyle.showLabels.value())for(h=o.label.split("/"),u=0,d=0;d<h.length;d++)p=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5"].indexOf(h[d]),d>0&&(_=this._cache._labelRectByIndex(p+11),m={left:r.x-_.width+u,top:Math.round(r.y-_.height/2),width:_.width,height:_.height},u+=_.width/2,S=this._cache._canvas.get(0),b=new y(S,_,m),e.append(b)),_=this._cache._labelRectByIndex(p),m={left:r.x-_.width+u,top:Math.round(r.y-_.height/2),width:_.width,height:_.height},u+=_.width,S=this._cache._canvas.get(0),b=new y(S,_,m),e.append(b);return e},r.prototype._updateImpl=function(){var e,t,i,n,o,r,s,a,l,c,h,u,d,p,_,f,m,y,g,v;if(!this._model.timeScale().isEmpty()&&!this._source.priceScale().isEmpty()&&null!==(e=this._model.timeScale().visibleBars())&&this._source.customData()&&this._source.customData().pivots&&(t=this._model.mainSeries(),i=this._source.priceScale(),null!==(n=t.bars().search(e.lastBar(),S.NearestLeft)))){for(o=n.index,r=this._source.customData().pivots,s=this._source._indexes,a=this._source.properties(),l=this._source.firstValue(),c=0;c<r.length;c++)if(r[c]&&(h=s[r[c].startIndex],u=s[r[c].endIndex],d=a.inputs.showHistoricalPivots.value(),u>=o&&h<=o||!d))for(p=["p","s1","r1","s2","r2","s3","r3","s4","r4","s5","r5"],this._prices=[],_=0;_<p.length;_++)f=p[_],void 0!==(m=r[c][f])&&(y=i.priceToCoordinate(m,l),g={P:"P",S1:"S1/R1",S2:"S2/R2",S3:"S3/R3",S4:"S4/R4",S5:"S5/R5",R1:"S1/R1",R2:"S2/R2",R3:"S3/R3",R4:"S4/R4",R5:"S5/R5"},v=a.levelsStyle.colors[g[f.toUpperCase()]].value(),this._prices.push({formatted:i.formatPrice(m,l),price:m,coordinate:y,color:v}));this._cache.setPrices(this._prices)}},r.prototype.update=function(){this._invidated=!0},r.prototype.prices=function(){return this._invidated&&(this._updateImpl(),this._invidated=!1),this._prices},inherit(s,p),s.prototype.lastValueData=function(e,t,i){var n=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5"].indexOf(e.toUpperCase()),o={noData:!0},r=this._pricesView.prices()[n];return null!==r&&void 0!==r?r:o},s.prototype.lastPriceLabelFixedCoordinate=function(e){var t=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5"].indexOf(e.toUpperCase());return this._priceAxisViews[t]._fixedCoordinate},s.prototype.priceLabelText=function(e){return this._metaInfo.shortDescription+":"+e.toUpperCase()},s.prototype.pricesView=function(){return this._pricesView},s.prototype._getActualCacheParams=function(){var e={};return e.font=this.properties().font.value(),e.fontSize=this.properties().fontsize.value(),
e.backColors=[this.properties().levelsStyle.colors.P.value(),this.properties().levelsStyle.colors["S1/R1"].value(),this.properties().levelsStyle.colors["S1/R1"].value(),this.properties().levelsStyle.colors["S2/R2"].value(),this.properties().levelsStyle.colors["S2/R2"].value(),this.properties().levelsStyle.colors["S3/R3"].value(),this.properties().levelsStyle.colors["S3/R3"].value(),this.properties().levelsStyle.colors["S4/R4"].value(),this.properties().levelsStyle.colors["S4/R4"].value(),this.properties().levelsStyle.colors["S5/R5"].value(),this.properties().levelsStyle.colors["S5/R5"].value()],e.colors=e.backColors.map(function(e){return"black"===h(c(e),150)?"white":"black"}),e},s.prototype.updateAllViews=function(){p.prototype.updateAllViews.call(this),this._pricesView.update()},s.prototype.createViews=function(){var e,t,i,s,a,l=this._getActualCacheParams();for(this._cache&&this._cache.destroy(),this._cache=new n(l.font,l.fontSize,l.backColors,l.colors),this._priceAxisViews=[],e=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5"],this._paneViews.length=0,t=new o(this._model,this),t.setCache(this._cache),this._paneViews.push(t),i=this.properties().levelsStyle.visibility,s=0;s<e.length;s++)this._priceAxisViews.push(new _(this,{name:e[s],cache:this._cache})),a="P"===e[s].toUpperCase()?"P":"S"+e[s][1]+"/R"+e[s][1],i[a]&&i[a].value()&&this._paneViews.push(new m(this._model,this,e[s],"priceLabelText","showStudyPlotLabels"));this._dataWindowView||(this._dataWindowView=new d(this,this._model)),this._statusView||(this._statusView=new u(this,this._model.properties())),this._legendView=null,this._pricesView=new r(this,this._cache)},s.prototype._postProcessGraphics=function(){},s.prototype.isVisible=function(){var e,t,i;if(!this.properties().visible.value())return!1;for(e=["P","S1/R1","S2/R2","S3/R3","S4/R4","S5/R5"],t=this.properties().levelsStyle.visibility,i=0;i<e.length;i++)if(t[e[i]].value())return!0;return!1},s.prototype.stop=function(){TradingView.Study.prototype.stop.call(this),this._cache&&(this._cache.destroy(),this._cache=null)},s.prototype.priceRange=function(t,i){var n,o,r,s,a,l,c,h;if(!this.customData()||!this.customData().pivots||!this._indexes)return null;if(!this.priceScale())return null;for(n=this.customData().pivots,o=this._indexes,r=null,s=0;s<n.length;s++)if(n[s]&&(a=o[n[s].startIndex],!(o[n[s].endIndex]<t||a>i)))for(l=[],c=this._properties.levelsStyle.visibility,c.P.value()&&l.push(n[s].p),c["S1/R1"].value()&&l.push(n[s].s1,n[s].r1),c["S2/R2"].value()&&l.push(n[s].s2,n[s].r2),c["S3/R3"].value()&&l.push(n[s].s3,n[s].r3),c["S4/R4"].value()&&l.push(n[s].s4,n[s].r4),c["S5/R5"].value()&&l.push(n[s].s5,n[s].r5),h=0;h<l.length;h++)l[h]&&(null===r?r=new e(l[h],l[h]):r.apply(l[h],l[h]));return this.priceScale().isLog()&&r?new e(this.priceScale().priceToLogical(r.minValue()),this.priceScale().priceToLogical(r.maxValue())):r},s.prototype.getStylesPropertyPage=function(){return b.StudyPivotPointsStandardStylesPropertyPage},t.study_PivotPointsStandard=s}).call(t,i(48).PriceRange)},function(e,t,i){"use strict"
;var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"StandardPivotPointsPriceAxisView",function(){return s}),n=i(1),o=i(58),r=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5"],s=function(e){function t(t,i){var n,o=e.call(this)||this;return o._source=t,o._data=i,n=i.name,o._completeName="P"===n.toUpperCase()?"P":"S"+n[1]+"/R"+n[1],o}return n.c(t,e),t.prototype._updateRendererData=function(e){var t,i,n,o,s,a,l,c,h,u;e.visible=!1,t=this._source.properties(),t.visible.value()&&(i=this._completeName,n=t.levelsStyle.visibility,n[i]&&n[i].value()&&(o=this._source.model(),s=o.timeScale(),a=this._source.priceScale(),s.isEmpty()||null===s.visibleBars()||null!==a&&a.isEmpty()||(l=this._source.customData())&&l.pivots&&(c=this._source.pricesView().prices(),h=r.indexOf(this._data.name.toUpperCase()),(u=c[h])&&(e.background=u.color,e.color=this.generateTextColor(u.color),e.coordinate=u.coordinate,e.floatCoordinate=u.floatCoordinate,e.text=u.formatted,e.visible=!0))))},t}(o.a)},function(e,t,i){"use strict";function n(e,t){this._source=e,this._model=t,this._points=[new s(0,0)],this._lineRenderer=new P}function o(e){return null==e[TradingView.OPEN_PLOT]}function r(e,t,i,n){this._waterlineView=null,this._symbolLabelView=new T(e,this,void 0,"symbol","showSymbolLabels"),l.call(this,e,t,i,n),this.m_data=new M(E(),o),this._formatter=null,this._paneView=null;var r=this;this.properties().minTick.listeners().subscribe(null,function(){r._createFormatter(),r.updateAllViews(),r._model.invalidate(new x(x.FULL_UPDATE))}),this.properties().style.listeners().subscribe(this,this._updateBarFunction),this.properties().lineStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this.properties().areaStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this.properties().baselineStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this._updateBarFunction()}var s=i(6).Point,a=i(63).Series,l=i(34).Study,c=i(17).PlotRowSearchMode,h=i(627).OverlayPriceAxisView,u=i(282),d=u.SeriesAreaPaneView,p=u.SeriesLinePaneView,_=u.SeriesHollowCandlesPaneView,f=u.SeriesCandlesPaneView,m=u.SeriesBarsPaneView,y=u.SeriesBaselinePaneView,g=i(283).SeriesWaterlinePaneView,v=i(119),S=i(286).OverlayDataWindowView,b=i(628).OverlayLegendView,w=i(166).SeriesBarColorer,P=i(110).HorizontalLineRenderer,T=i(100),x=i(18),C=i(21).PriceFormatter,L=i(2).propertyPages,I=i(5),A=i(48).PriceRange,k=i(72).barFunction,E=i(72).seriesPlotFunctionMap,M=i(17).PlotList,V=!I.enabled("hide_study_overlay_legend_item"),D=I.enabled("uppercase_instrument_names"),O=i(4).getLogger("Chart.StudyOverlay");n.prototype.update=function(){if(this._visible=!1,this._source.properties().showPriceLine.value()){var e=this._source.lastValueData(void 0,!0);e.noData||(this._visible=!0,this._points=[new s(0,e.coordinate)],this._color=e.color)}},n.prototype.renderer=function(){var e={};return e.width=this._model.timeScale().width(),e.height=this._source.priceScale().height(),e.points=this._points,e.color=this._color,e.linewidth=1,
e.linestyle=CanvasEx.LINESTYLE_DOTTED,e.visible=this._visible,this._lineRenderer.setData(e),this._lineRenderer},inherit(r,l),r.prototype.createPlotLabels=function(e){},r.prototype._showLastValueOnPriceScale=function(){return this._model.properties().scalesProperties.showSeriesLastValue.value()},r.prototype.symbol=function(){var e,t=this.properties().inputs.symbol.value(),i=this._resolvedSymbols?this._resolvedSymbols[t]:null;return e=i?i.name:t,D?e.toUpperCase():e},r.prototype.lastValueData=function(e,t,i){var n,o,r,s,l,h,u,d,p,_,f,m,y,g={noData:!0};if(this._model.timeScale().isEmpty()||null==this.priceScale()||this.priceScale().isEmpty()||this.data().isEmpty())return g;if(null===(n=this._model.timeScale().visibleBars()))return g;if(!this.properties().visible.value())return g;if(null==(o=this.nearestIndex(n.lastBar(),c.NearestLeft)))return g;if(r=this._lastNonEmptyPlotRow(TradingView.CLOSE_PLOT),s=null!==r&&n.contains(r.index),l=null!==r?r.value:null,h=t||s?l:this.data().valueAt(o),u=this._barFunction(h),!h||!isNumber(u))return g;if(d={noData:!1},i&&(d.price=u),!(p=this.firstValue()))return g;switch(d.text=this.priceScale().formatPrice(u,p),d.floatCoordinate=this.priceScale().priceToCoordinate(u,p,!0),d.coordinate=Math.round(d.floatCoordinate),d.item=h,_=this.properties(),_.style.value()){case a.STYLE_BARS:d.color=h[TradingView.OPEN_PLOT]<=h[TradingView.CLOSE_PLOT]?_.barStyle.upColor.value():_.barStyle.downColor.value();break;case a.STYLE_CANDLES:case a.STYLE_HOLLOW_CANDLES:d.color=h[TradingView.OPEN_PLOT]<=h[TradingView.CLOSE_PLOT]?_.candleStyle.upColor.value():_.candleStyle.downColor.value();break;case a.STYLE_LINE:d.color=_.lineStyle.color.value();break;case a.STYLE_AREA:d.color=_.areaStyle.color1.value();break;case a.STYLE_BASELINE:f=_.baselineStyle,m=this.priceScale(),y=Math.round(m.height()*(Math.abs(100-f.baseLevelPercentage.value())/100)),d.color=d.coordinate<y?_.baselineStyle.topLineColor.value():_.baselineStyle.bottomLineColor.value()}return d},r.prototype.firstValue=function(){var e,t,i=this._model.timeScale().visibleBars();return null===i?null:(e=i.firstBar(),0===this.data().size()?null:(t=this.data().search(e,c.NearestRight,!0),null!==t?this._barFunction(t.value):null))},r.prototype.barFunction=function(){return this._barFunction},r.prototype._updateBarFunction=function(){var e=this.priceSource()||"close";this._barFunction=k(e)},r.prototype.priceSource=function(){switch(this._properties.style.value()){case a.STYLE_LINE:return this._properties.lineStyle.priceSource.value();case a.STYLE_AREA:return this._properties.areaStyle.priceSource.value();case a.STYLE_BASELINE:return this._properties.baselineStyle.priceSource.value()}return null},r.prototype.priceRange=function(e,t){var i,n,o;return TradingView.isInteger(e)?TradingView.isInteger(t)?0===this.m_data.size()?null:(i=this.priceSource(),n=null!==i?this.m_data.minMaxOnRangeCached(e,t,[{name:i,offset:0}]):this.m_data.minMaxOnRangeCached(e,t,[{name:"low",offset:0},{name:"high",offset:0}]),o=null!==n?new A(n.min,n.max):null,
this._postProcessPriceRange(o)):void O.logDebug("priceRange: incorrect endBar"):void O.logDebug("priceRange: incorrect startBar")},r.prototype.createViews=function(){this._priceAxisViews=[],this._priceAxisViewsBase=[new h(this)],this._paneViews=[];var e=null;switch(this._properties.style.value()){case a.STYLE_BARS:e=new m(this,this._model);break;case a.STYLE_CANDLES:e=new f(this,this._model);break;case a.STYLE_HOLLOW_CANDLES:e=new _(this,this._model);break;case a.STYLE_LINE:e=new p(this,this._model);break;case a.STYLE_AREA:e=new d(this,this._model);break;case a.STYLE_BASELINE:e=new y(this,this._model),this._waterlineView=new g(this)}e&&this._paneViews.push(e),null!==this._waterlineView&&this._paneViews.push(this._waterlineView),this._paneViews.push(new n(this,this._model)),this._paneViews.push(this._symbolLabelView),this._dataWindowView||(this._dataWindowView=new S(this,this._model)),this._legendView||(this._legendView=new b(this,this._model)),this._statusView||(this._statusView=new v(this,this._model.properties())),this._priceAxisViews=[].concat(this._priceAxisViewsBase,this._hlinesPriceAsisViews,this._horizlinesPriceAsisViews)},r.prototype.barColorer=function(){return new w(this)},r.prototype.start=function(e){this._formatter=null,l.prototype.start.apply(this,arguments),this.priceScale()&&this.priceScale().updateFormatter()},r.prototype._createFormatter=function(){var e,t,i,n,o,r,s;"default"===this.properties().minTick.value()?(e=this.properties().inputs.symbol.value(),t=this._resolvedSymbols[e],this._formatter=new C(t?t.pricescale:100,t?t.minmov:1,!!t&&t.fractional)):(i=this.properties().minTick.value(),n=isNumber(i)?["100","1","false"]:i.split(","),o=parseInt(n[0]),r=parseInt(n[1]),s="true"===n[2],this._formatter=new C(o,r,s)),this.priceScale()&&this.priceScale().updateFormatter()},r.prototype.formatter=function(){return this._formatter||this._createFormatter(),this._formatter},r.prototype._tryChangeInputs=function(){l.prototype._tryChangeInputs.call(this),this.m_formatter=null,this.priceScale().updateFormatter()},r.prototype.title=function(){var e,t=this.properties().inputs.symbol.value(),i=this._resolvedSymbols[t];return i?(e=i.name,i.exchange&&0!==i.exchange.length&&(e+=", "+i.exchange)):e=t,D?e.toUpperCase():e},r.prototype.bars=function(){return this.m_data},r.prototype.open=function(e){return this.bars().valueAt(e)[TradingView.OPEN_PLOT]},r.prototype.high=function(e){return this.bars().valueAt(e)[TradingView.HIGH_PLOT]},r.prototype.low=function(e){return this.bars().valueAt(e)[TradingView.LOW_PLOT]},r.prototype.close=function(e){return this.bars().valueAt(e)[TradingView.CLOSE_PLOT]},r.prototype.hl2=function(e){return(this.high(e)+this.low(e))/2},r.prototype.hlc3=function(e){return(this.high(e)+this.low(e)+this.close(e))/3},r.prototype.ohlc4=function(e){return(this.open(e)+this.high(e)+this.low(e)+this.close(e))/4},r.prototype.symbolInfo=function(){if(!this._resolvedSymbols)return null;var e=this._properties.inputs.symbol.value();return e?this._resolvedSymbols[e]:null},
r.prototype.lastPriceLabelFixedCoordinate=function(){return this._priceAxisViews[0]._fixedCoordinate},r.prototype.tags=function(){var e=[],t=this.symbolInfo();return t?e.push(t.name):this._properties.inputs.symbol.value()&&e.push(this._properties.inputs.symbol.value()),e},r.prototype.statusView=function(){return V?l.prototype.statusView.call(this):null},r.prototype.getStylesPropertyPage=function(){return L.StudyOverlayStylesPropertyPage},t.study_Overlay=r},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"OverlayPriceAxisView",function(){return r}),n=i(1),o=i(58),r=function(e){function t(t){var i=e.call(this)||this;return i._source=t,i}return n.c(t,e),t.prototype._updateRendererData=function(e){e.visible=!1;var t=this._source.lastValueData("close",!1);t.noData||(e.background=t.color,e.color=this.generateTextColor(t.color),e.coordinate=t.coordinate,e.floatCoordinate=t.floatCoordinate,e.text=t.text,e.visible=!0)},t}(o.a)},function(e,t,i){"use strict";var n,o,r,s,a;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"OverlayLegendView",function(){return a}),n=i(1),o=i(286),r=i(42),s=!0,a=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n._additional=null,n._showBarChange=i.properties().paneProperties.legendProperties.showBarChange,n._showOnlyPriceSource=i.properties().paneProperties.legendProperties.showOnlyPriceSource,n._showSeriesOHLC=i.properties().paneProperties.legendProperties.showSeriesOHLC,n._seriesStyle=t.properties().style,n._studyOverlay=t,n._showBarChange.subscribe(n,n.update),n._showSeriesOHLC.subscribe(n,n.update),n}return n.c(t,e),t.prototype.isValuesVisible=function(){return this._showSeriesOHLC.value()||this._showBarChange.value()},t.prototype.additional=function(){return this._additional},t.prototype.destroy=function(){this._showBarChange.unsubscribeAll(this),this._showSeriesOHLC.unsubscribeAll(this)},t.prototype._updateImpl=function(){var t,i,n,o;e.prototype._updateImpl.call(this),t=s&&this._showOnlyPriceSourceValue(),i=this._showSeriesOHLC.value(),n=i&&!t,o=i&&t,this._items[0].setVisible(n),this._items[1].setVisible(n),this._items[2].setVisible(n),this._items[3].setVisible(n),this._items[5].setVisible(this._showBarChange.value()),this._items[4].setVisible(o)},t.prototype._showOnlyPriceSourceValue=function(){return this._showOnlyPriceSource.value()&&Object(r.isPriceSourceStyle)(this._seriesStyle.value())},t}(o.OverlayDataWindowView)},function(e,t,i){"use strict";function n(e,t,i,n){this._symbolLabelView=new a(e,this,"compare","symbol","showSymbolLabels"),o.call(this,e,t,i,n);var r=this;this._properties.minTick.listeners().subscribe(null,function(){r._createFormatter()}),this.properties().minTick.listeners().subscribe(null,function(){r._model.invalidate(new l(l.FULL_UPDATE))}),this._properties.merge({skipHistogramBaseOnAutoScale:!0})}
var o=i(34).Study,r=i(630).CompareLegendView,s=i(287).CompareDataWindowView,a=i(100),l=i(18),c=i(21).PriceFormatter,h=i(2).propertyPages,u=i(5),d=!u.enabled("hide_study_compare_legend_item"),p=u.enabled("uppercase_instrument_names");inherit(n,o),n.prototype.createPlotLabels=function(e){},n.prototype._showLastValueOnPriceScale=function(){return this._model.properties().scalesProperties.showSeriesLastValue.value()},n.prototype.createViews=function(){this._legendView||(this._legendView=new r(this,this._model)),this._dataWindowView||(this._dataWindowView=new s(this,this._model)),o.prototype.createViews.call(this),this._paneViews.push(this._symbolLabelView)},n.prototype._createFormatter=function(){var e,t,i,n,o,r=this.properties().inputs.symbol.value(),s=this._resolvedSymbols?this._resolvedSymbols[r]:null;"default"===this.properties().minTick.value()?this._formatter=new c(s?s.pricescale:100,s?s.minmov:1,!!s&&s.fractional):(e=this.properties().minTick.value(),t=isNumber(e)?["100","1","false"]:e.split(","),i=parseInt(t[0]),n=parseInt(t[1]),o="true"===t[2],this._formatter=new c(i,n,o)),this.priceScale()&&this.priceScale().updateFormatter()},n.prototype.symbol=function(){var e,t=this.properties().inputs.symbol.value(),i=this._resolvedSymbols?this._resolvedSymbols[t]:null;return e=i?i.name:t,p?e.toUpperCase():e},n.prototype.title=function(e){var t,i=this.properties().inputs.symbol.value(),n=this._resolvedSymbols?this._resolvedSymbols[i]:null;return n?(t=n.name,n.exchange&&0!==n.exchange.length&&(t+=", "+n.exchange)):t=i,p?t.toUpperCase():t},n.prototype.symbolInfo=function(){if(!this._resolvedSymbols)return null;var e=this._properties.inputs.symbol.value();return e?this._resolvedSymbols[e]:null},n.prototype.lastPriceLabelFixedCoordinate=function(){return this._priceAxisViews[0]._fixedCoordinate},n.prototype.tags=function(){var e=this.symbol();return e?[e]:[]},n.prototype.statusView=function(){return d?o.prototype.statusView.call(this):null},n.prototype.getInputsPropertyPage=function(){return h.StudyCompareInputsPropertyPage},n.prototype.guiPlotName=function(e){return this.properties().inputs.symbol.value()},t.study_Compare=n},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"CompareLegendView",function(){return r}),n=i(1),o=i(287),r=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n._additional=null,n._showStudyValues=i.properties().paneProperties.legendProperties.showStudyValues,n._showStudyValues.subscribe(n,n.update),n}return n.c(t,e),t.prototype.isValuesVisible=function(){return this._showStudyValues.value()},t.prototype.destroy=function(){this._showStudyValues.unsubscribeAll(this)},t.prototype.additional=function(){return this._additional},t.prototype._updateImpl=function(){e.prototype._updateImpl.call(this)},t}(o.CompareDataWindowView)},function(e,t,i){"use strict";function n(e,t,i,n){s.call(this,e,t,i,n),this._underlyingData=new a(l(n))}var o=i(7).assert,r=i(12).clone,s=i(34).Study,a=i(17).PlotList,l=i(269).studyPlotFunctionMap;inherit(n,s),
n.prototype.clearData=function(){s.prototype.clearData.call(this),this._underlyingData.clear()},n.prototype._mergeData=function(e){var t,i;this._invalidateLastNonEmptyPlotRowCache(),t=this._underlyingData.firstIndex(),this._underlyingData.merge(e),t!==this._underlyingData.firstIndex()&&(this.m_data=new a(l(this._metaInfo))),i=this.m_data.lastIndex(),this._underlyingData.range(i,this._underlyingData.lastIndex()).each(function(e,t){return this.m_data.add(e,r(t)),!1}.bind(this)),this._plotsForStrategyProcessing().forEach(function(e){this._createStrategy(e.strategy,e.strategyIndex,e.targetIndex,i).rebuildData(this.m_data)},this)},n.prototype._plotsForStrategyProcessing=function(){var e=["dataoffset"],t=[];return this._metaInfo.plots.forEach(function(i,n){var r,s;e.indexOf(i.type)>-1&&(r=null,this._metaInfo.plots.forEach(function(e,t){e.id===i.target&&(r=t)}),o(r>=0,"target plot not found for strategy plot "+i.id),s={strategy:i.type,strategyIndex:n,targetIndex:r},t.push(s))},this),t},n.prototype._createStrategy=function(e,t,i,o){return new n["Strategy_"+e](t,i,o)},n.Strategy_dataoffset=function(e,t,i){this._strategyPlotIndex=e,this._targetPlotIndex=t,this._startIndex=i},n.Strategy_dataoffset.prototype.rebuildData=function(e){var t=this._targetPlotIndex+1,i=this._strategyPlotIndex+1,n=null,o=null;e.range(this._startIndex||e.firstIndex(),e.lastIndex()).each(function(r,s){var a,l,c,h=s[t],u=s[i]?Math.round(s[i]):null;return s[t]=null,s[i]=null,!(!u||u>0)&&(a=r+u,l={pointIndex:a,value:h},o?o.pointIndex!==l.pointIndex&&(a>=0&&(e.valueAt(a)[t]=h),c=!1,n&&(c=n.value<=o.value&&o.value<=h||n.value>=o.value&&o.value>=h),c?o.pointIndex>=0&&(e.valueAt(o.pointIndex)[t]=null):n=o,o=l):o=l,!1)})},t.study_ScriptWithDataOffset=n},function(e,t,i){"use strict";function n(){return null===c&&(c=new l.Session,c.init("Etc/UTC","24x7")),c}function o(e,t){return e.timezone===t.timezone&&e.session===t.session}var r,s,a,l,c,h;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"TimeSynchronizer",function(){return h}),r=i(15),s=i(35),a=i.n(s),l=i(37),i.n(l),c=null,h=function(){function e(e,t){this._sourceTargetBarBuilder=null,this._cache=new Map,this._source=e,this._target=t,this._isResolutionTheSame=r.Interval.isEqual(e.getResolution(),t.getResolution()),this._isSessionTheSame=o(e.getSymbolInfo(),t.getSymbolInfo()),this._shouldCorrectTradingDay=r.Interval.isDWM(e.getResolution())&&!this._isSessionTheSame}return e.prototype.sourceTimeToTargetTime=function(e){var t,i,n,o,r,s;return this._isSessionTheSame&&this._isResolutionTheSame?e:this._source.isValid()&&this._target.isValid()?(t=this._cache.get(e),void 0===t&&(i=1e3*e,this._shouldCorrectTradingDay&&(n=a.a.utc_to_cal(this._source.getSession().timezone,i),n=this._source.getSession().spec.correctTradingDay(n,this._source.getSession().timezone),o=new Date(n),a.a.set_hms(o,0,0,0,0,this._source.getSession().timezone),i=o.valueOf()),r=this._sourceTargetBuilder(),r.moveTo(i),s=r.indexOfBar(i),t=r.startOfBar(Math.max(0,s))/1e3,this._cache.set(e,t)),t):e},e.prototype._sourceTargetBuilder=function(){
if(null===this._sourceTargetBarBuilder){var e=this._isSessionTheSame?this._target.getSession():n();this._sourceTargetBarBuilder=Object(l.newBarBuilder)(this._target.getResolution(),this._target.getSession(),e)}return this._sourceTargetBarBuilder},e}()},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"MainSeriesScaleRatioProperty",function(){return r}),n=i(8),o=i.n(n),r=function(){function e(e){this._changed=new o.a,this._model=e}return e.prototype.getStepChangeValue=function(){return.1},e.prototype.getMinValue=function(){return 1e-7},e.prototype.getMaxValue=function(){return 9999},e.prototype.value=function(){return this._model.mainSeriesScaleRatio()},e.prototype.setValue=function(e,t){(e!==this.value()||t)&&(this._model.setMainSeriesScaleRatio(e),this._onChanged())},e.prototype.state=function(){return null},e.prototype.clone=function(){return new e(this._model)},e.prototype.listeners=function(){return this._changed},e.prototype.subscribe=function(e,t){this._changed.subscribe(e,t)},e.prototype.unsubscribe=function(e,t){this._changed.unsubscribe(e,t)},e.prototype.unsubscribeAll=function(e){this._changed.unsubscribeAll(e)},e.prototype._onChanged=function(){this._changed.fire(this)},e}()},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"MainSeriesPriceScaleNameProperty",function(){return r}),n=i(8),o=i.n(n),r=function(){function e(e){var t=this;this._changed=new o.a,this._defaultValues=["left","right","none"],this._model=e,this._model.mainSeriesPriceScaleNameChanged().subscribe(null,function(){return t._onChanged()})}return e.prototype.getValues=function(e){var t,i=[],n=this._defaultValues.length-1;for(t=0;t<=n;t++)(t!==n||e)&&i.push(this._defaultValues[t]);return i},e.prototype.value=function(){return this._model.mainSeriesPriceScaleName()},e.prototype.setValue=function(e,t){var i=this.value();(e!==i||t)&&this._model.setMainSeriesPriceScaleName(i,e)},e.prototype.state=function(){return null},e.prototype.clone=function(){return new e(this._model)},e.prototype.listeners=function(){return this._changed},e.prototype.subscribe=function(e,t){this._changed.subscribe(e,t)},e.prototype.unsubscribe=function(e,t){this._changed.unsubscribe(e,t)},e.prototype.unsubscribeAll=function(e){this._changed.unsubscribeAll(e)},e.prototype._onChanged=function(){this._changed.fire(this)},e}()},function(e,t,i){"use strict";function n(e){"LineToolGannComplex"!==e.type||void 0!==e.version&&1!==e.version||(e.type="LineToolGannFixed")}Object.defineProperty(t,"__esModule",{value:!0}),t.migrateState=n},function(e,t){},function(e,t,i){"use strict";function n(e){return null==e._parentMenu?null:o(e._parentMenu)}function o(e){return null==e._parentMenuItem?e:n(e._parentMenuItem)}function r(e,t){this.action=e,this._parentMenu=t}function s(e,t){this.action=e,this._parentMenu=t}var a,l,c;i(208),a=i(289),l=i(290),c=i(38).IS_RTL,r.prototype._createIconTag=function(){var e=this._iconTagAttributes();return this.jqIcon=l.create(a.ICON_CELL_TAG,e),
this.jqIcon.addClass("context-menu"),this.jqIcon},r.prototype._createDeleteButton=function(){var e,t,i;if(!this.action.deleteButton)return null;e=this,t=this.action.deleteButton.action,i=l.create("span",{class:"context-menu-delete-button"}),t&&i.click(function(){return t.call(e),!1}),this.jqSubmenu.addClass("delete-spacer"),this.jqSubmenu.append(i)},r.prototype._createTextTag=function(){var e=this._textTagAttributes();return this.jqText=l.create(a.TEXT_CELL_TAG,e),this.jqIcon.addClass("context-menu"),this.jqText},r.prototype._createRightTag=function(){var e=this._rightTagAttributes();return this.jqRight=l.create(a.RIGHT_CELL_TAG,e),this.jqIcon.addClass("context-menu"),this.jqRight},r.prototype._createSubmenuTag=function(){var e=this._submenuTagAttributes();return this.jqSubmenu=l.create(a.SUBMENU_CELL_TAG,e),this.jqIcon.addClass("context-menu"),this.jqSubmenu},r.prototype._iconTagAttributes=function(){var e={},t=[];return this.action&&(this.action.icon?(t.push("icon"),t.push(this.action.icon.replace(/\./,"_"))):this.action.checkable?(t.push("icon"),this.action.checked?(t.push("checked-icon"),e.html=i(195)):t.push("unchecked-icon")):t.push("spacer")),e.class=t.join(" "),e},r.prototype._textTagAttributes=function(){return{class:"text",html:this.action?this.action.text:""}},r.prototype.highlight=function(e){e?(this.jqRow.addClass("context-menu-hover"),this.jqIcon.addClass("context-menu-hover")):(this.jqRow.removeClass("context-menu-hover"),this.jqIcon.removeClass("context-menu-hover")),this.action&&this.action.hasSubActions()&&(e?this.jqSubmenu.addClass("expanded"):this.jqSubmenu.removeClass("expanded"))},r.prototype._rightTagAttributes=function(){var e={},t=["right"];return this.action&&this.action.shortcut&&(t.push("shortcut"),e.class=t.join(" "),e.html=this.action.shortcut),e},r.prototype._submenuTagAttributes=function(){var e={};return this.action&&this.action.hasSubActions()?e.class="submenu-arrow":e.class="context-menu spacer",e},r.prototype.render=function(){var e,t;return this._createRow(),e=this._createIconTag(),this.jqRow.append(c?this._createSubmenuTag():e),this.jqRow.append(this._createTextTag()),this.jqRow.append(this._createRightTag()),this.jqRow.append(c?e:this._createSubmenuTag()),this._createDeleteButton(),this.appendCallback(),t=this,this.jqRow.mouseenter(function(e){t.showSubmenu(e),t.highlight(!0),t._parentMenu&&t._parentMenu._parentMenuItem&&t._parentMenu._parentMenuItem.highlight(!0)}),this.jqRow.mouseleave(function(){t.highlight(!1)}),this.jqRow},r.prototype._createRow=function(){var e,t,i=this._rowTagAttributes();this.jqRow=l.create(a.ITEM_ROW_TAG,i),this.jqRow.addClass("context-menu"),e=this,this.action&&!this.action.hasSubActions()&&(t=function(e){e.destroy(),e._parentMenuItem&&t(e._parentMenuItem._parentMenu)},this.jqRow.click(function(i){t(e._parentMenu)}))},r.prototype.showSubmenu=function(e){var t,n;this._parentMenu.closeOtherSubmenus(this),this.action&&!this.action.hasSubActions()||(this._menu||(t=i(89),n={},this._menu=t.createMenu(this.action.subActions,n,this)),
e.pageX=this._parentMenu.jqMenu.width()-2,e.pageY=this.jqSubmenu.offset().top-this._parentMenu.jqMenu.offset().top-1,this._menu.show(e,this._parentMenu.jqMenu))},r.prototype._rowTagAttributes=function(){var e=[];return this.action&&(!1===this.action.enabled&&e.push("disabled"),!1===this.action.visible&&e.push("hidden"),this.action.font&&e.push("font_"+this.action.font),this.action.hasSubActions()&&e.push("has_submenu"),this.action.htmlclass&&e.push(this.action.htmlclass)),{class:e.join(" ")}},r.prototype.appendCallback=function(){var e=this;this.jqRow.click(function(t){e.action.enabled&&e.action.executeCallback(t)})},r.prototype.getTopLevelMenu=function(){return n(this)},s.prototype.render=function(e){this._createRow();var t=this;return this.action.deferred.then(function(n){var o,r,s,a=i(288);for(o in n)r=n[o],s=t._parentMenu.addItem(r),a.renderItem(e,s)}).always(function(){t.jqRow.hide()}),this.jqRow},s.prototype._createIconTag=function(){var e=this._iconTagAttributes();return this.jqIcon=l.create(a.ICON_CELL_TAG,e),this.jqIcon.addClass("context-menu"),this.jqIcon},s.prototype._createRow=function(){var e=this._rowTagAttributes();this.jqRow=l.create(a.ITEM_ROW_TAG,e),this.jqRow.append(this._createIconTag()),this.jqRow.addClass("context-menu")},s.prototype._rowTagAttributes=function(){var e=[];return this.action&&e.push("spinner"),{class:e.join(" ")}},s.prototype.highlight=function(e){},s.prototype._iconTagAttributes=function(){var e={},t=[];return t.push("spacer"),e.class=t.join(" "),e.colspan="10",e},t.Item=r,t.ItemPlaceholder=s},function(e,t,i){"use strict";function n(e){var t,i;return e.getClientRects().length?(t=e.getBoundingClientRect(),"fixed"===getComputedStyle(e).position?{top:t.top,left:t.left}:(i=e.ownerDocument.defaultView,{top:t.top+i.pageYOffset,left:t.left+i.pageXOffset})):{top:0,left:0}}function o(e,t){var i,o,a,l,c,h,u=getComputedStyle(e),d=u.position;"static"===d&&(e.style.position="relative"),i=n(e),o=u.top,a=u.left,l=0,c=0,"absolute"!==d&&"fixed"!==d||"auto"!==o&&"auto"!==a?(o&&(l=parseFloat(o)),a&&(c=parseFloat(a))):(h=r(e),l=h.top,c=h.left),Object(s.isNumber)(t.top)&&(e.style.top=t.top-i.top+l+"px"),Object(s.isNumber)(t.left)&&(e.style.left=t.left-i.left+c+"px")}function r(e){var t=e.ownerDocument,i=e.offsetParent||t.documentElement,o=n(e),r=n(i);return{top:o.top-r.top,left:o.left-r.left}}var s;Object.defineProperty(t,"__esModule",{value:!0}),t.getOffset=n,t.setOffset=o,t.getPosition=r,s=i(84),i.n(s)},function(e,t,i){"use strict";(function(t){function n(e,t,i,n){this.reset(e,t,i,n)}var o=i(79).makeFont,r=i(116),s=t.enabled("charting_library_debug_mode");n.prototype.maxCount=200,n.prototype.reset=function(e,t,i,n){this._textWidthCache=new r(this.maxCount),this._fontSize=e,this._color=n,this._font=o(e,t,i),this._keys=[],this._hash={}},n.prototype.paintTo=function(e,t,i,n,o){var r=this.getLabelImage(e,t);"left"!==o&&(i-=r.textWidth),n-=Math.floor(r.height/2),e.drawImage(r.canvas,i,n)},n.prototype.getLabelImage=function(e,t){var i,n,o,r,a
;return Object.prototype.hasOwnProperty.call(this._hash,t)?i=this._hash[t]:(this._keys.length>=this.maxCount&&(n=this._keys.shift(),delete this._hash[n]),i={text:t,textWidth:0,width:0,height:0,canvas:document.createElement("canvas")},o=Math.ceil(this._fontSize/4.5),r=Math.round(this._fontSize/10),a=Math.ceil(this._textWidthCache.measureText(e,t)),i.textWidth=Math.round(Math.max(1,a)),i.width=Math.round(a+2*o),i.height=this._fontSize+2*o,0!==a?(this._keys.push(i.text),this._hash[i.text]=i):s&&console.log('Canvas 2d context measureText return zero width for "'+t+'" text'),i.canvas.width=i.width,i.canvas.height=i.height,e=i.canvas.getContext("2d"),e.font=this._font,e.fillStyle=this._color,e.fillText(t,0,i.height-o-r)),i},e.exports=n}).call(t,i(5))},function(e,t,i){"use strict";function n(e,t,i){return void 0===i&&(i="promise rejected by time-out"),new Promise(function(n,o){var r=setTimeout(function(){return o(i)},t);e.then(function(e){clearTimeout(r),n(e)}),e.catch(function(e){clearTimeout(r),o(e)})})}Object.defineProperty(t,"__esModule",{value:!0}),t.makeTimeLimited=n},function(e,t,i){"use strict";function n(e,t,i){this.chart=e,this.paneA=e.paneWidgets()[t],this.paneB=e.paneWidgets()[i],this.jqRow=$(document.createElement("tr")),this.jqRow.height(n.HEIGHT),this.jqCell=$(document.createElement("td")),this.jqCell.appendTo(this.jqRow),this.jqCell.addClass("pane-separator"),this.jqCell.attr("colspan","3"),this.jqCell.css("background",this.chart.properties().scalesProperties.lineColor.value()),this.jqCell.click(function(){}),this.handle=$('<div class="handle">').appendTo(this.jqCell),this._mouseEventHandler=new r(this.handle,this,!0)}var o,r;i(642),o=i(50).clamp,r=i(111).MouseEventHandler,n.prototype.destroy=function(){this._mouseEventHandler.destroy(),this.jqRow.remove()},n.HEIGHT=1,n.prototype.hide=function(){this.jqRow.addClass("js-hidden")},n.prototype.show=function(){this.jqRow.removeClass("js-hidden")},n.prototype.mouseDownEvent=function(e){(0===e.button||Modernizr.touch)&&(this.startY=e.pageY,this.deltaY=0,this.totalHeight=this.paneA.size.h+this.paneB.size.h,this.totalStretch=this.paneA.stretchFactor()+this.paneB.stretchFactor(),this.prevStretchA=this.paneA.stretchFactor(),this.minPaneHeight=30,this.maxPaneHeight=this.totalHeight-this.minPaneHeight,this.pixelStretchFactor=this.totalStretch/this.totalHeight)},n.prototype.pressedMouseMoveEvent=function(e){var t,i,n,r;(0===e.button||Modernizr.touch)&&(e.preventDefault(),this.deltaY=e.pageY-this.startY,t=this.paneA.size.h,i=o(t+this.deltaY,this.minPaneHeight,this.maxPaneHeight),n=i*this.pixelStretchFactor,r=this.totalStretch-n,this.paneA.setStretchFactor(n),this.paneB.setStretchFactor(r),this.chart._adjustSize(),this.paneA.size.h!==t&&(this.startY=e.pageY),this.chart.paint())},n.prototype.mouseUpEvent=function(e){(0===e.button||Modernizr.touch)&&(this.chart._model.addPaneStretchFactorUndoCommand(this.paneA._state,this.paneB._state,this.prevStretchA,this.paneA.stretchFactor()),this.startY=0,this.deltaY=0,this.totalHeight=0,this.totalStretch=0,this.minPaneHeight=0,
this.maxPaneHeight=0,this.pixelStretchFactor=0)},n.prototype.update=function(){this.jqCell.css("background",this.chart.properties().scalesProperties.lineColor.value())},n.prototype.paint=function(){},n.prototype.image=function(){var e={},t=n.HEIGHT,i=this.paneA.lhsPriceAxisWidget.size.w,o=this.paneA.size.w,r=this.paneA.rhsPriceAxisWidget.size.w,s=$('<canvas width="'+i+'" height="'+t+'">')[0],a=s.getContext("2d");return a.fillStyle=this.chart.properties().scalesProperties.lineColor.value(),a.fillRect(0,0,i,t),e.leftAxis={content:s.toDataURL(),contentWidth:i,contentHeight:t},s=$('<canvas width="'+o+'" height="'+t+'">')[0],a=s.getContext("2d"),a.fillStyle=this.chart.properties().scalesProperties.lineColor.value(),a.fillRect(0,0,o,t),e.content=s.toDataURL(),e.contentWidth=o,e.contentHeight=t,s=$('<canvas width="'+r+'" height="'+t+'">')[0],a=s.getContext("2d"),a.fillStyle=this.chart.properties().scalesProperties.lineColor.value(),a.fillRect(0,0,r,t),e.rightAxis={content:s.toDataURL(),contentWidth:r,contentHeight:t},e},e.exports=n},function(e,t){},function(e,t,i){"use strict";function n(e,t,n,r,s,a,l,c,h){var u=i(644).ChartUndoModel,d=new u(e,t,n,r,s,a,l,c,h);return d.model().invalidate(new o(o.FULL_UPDATE)),d}var o=i(18),r=i(26);TradingView.MAMetaInfo=function(){return new r({id:"MASimple",inputs:[{id:"length",type:"integer",defval:10},{id:"source",type:"text",defval:"close"}],plots:[{id:"MovAvg",type:"line"}],properties:[{id:"is_price_study",type:"bool",value:"true"}],palettes:{}})},TradingView.VolumeMetaInfo=function(){var e={id:"Volume",inputs:[],plots:[{id:"Volume",type:"histogram"},{id:"Color",type:"colorer",palette:"volumePalette",target:"Volume"}],properties:[{id:"is_price_study",type:"bool",value:"false"}],palettes:{volumePalette:{colors:{0:{color:"#007F0E",width:1,style:CanvasEx.LINESTYLE_SOLID,name:"Up Volume"},1:{color:"#872323",width:1,style:CanvasEx.LINESTYLE_SOLID,name:"Down Volume"}}}}};return new r(e)},TradingView.DMMetaInfo=function(){return new r({id:"DM",inputs:[{id:"ADX smoothing",max:50,min:1,type:"integer",defval:14},{id:"DI Length",max:500,min:1,type:"integer",defval:14}],plots:[{id:"ADX",type:"line"},{id:"DI_P",type:"line"},{id:"DI_N",type:"line"}],properties:[{id:"is_price_study",type:"bool",value:"false"}],palettes:{}})},TradingView.RSIMetaInfo=function(){return new r({id:"RSI",inputs:[{id:"length",type:"integer",defval:14}],plots:[{id:"RelativeStrengthIndex",type:"line"}],properties:[{id:"is_price_study",type:"bool",value:"false"}],palettes:{}})},e.exports=n},function(e,t,i){"use strict";(function(e){function n(t,i,n,o,r,s,a,l,c){this._chartWidget=s,this.m_model=new z(t,i,n,o,r,this,l,c),this.m_zoomStack=new oe,this.undoHistory=a,this._onRearrangePanes=new e,this._onSimpleZoomIn=new e,this._onSimpleZoomOut=new e,this._currentCustomMoveSource=null,this._currentLineMoveCommand=null,this.beginUndoMacro=a.beginUndoMacro.bind(a),this.endUndoMacro=a.endUndoMacro.bind(a),this.createUndoCheckpoint=a.createUndoCheckpoint.bind(a),this.undoToCheckpoint=a.undoToCheckpoint.bind(a)}function o(e,t,i,n){
re.call(this,i),this._targetObj=e,this._newValue=t,this._model=n}function r(e,t,i,n){re.call(this,i),this._priceScale=t,this._newMode=e,this._model=n}function s(e,t,i,n){re.call(this,i),this._property=e,this._newValue=t,this._model=n,this._priceScale=this._model.mainSeries().priceScale()}function a(e,t,i,n){re.call(this,"scale price",!1),this.m_model=e,this.m_pane=t,this.m_priceScale=i,this.m_state=n,this.m_newPriceScaleState=null}function l(e,t,i){re.call(this,i,!1),this.setCustomFlag("doesnt_affect_save",!0),this.m_model=e,this.m_state=t,this.m_newTimeScaleState=null}function c(e,t,i,n){this._model=e,this._series=t,this._oldSymbol=t.symbol(),this._oldInterval=t.interval(),this._symbol=i,this._interval=n}function h(e,t,i,n,o){re.call(this,"Insert "+t.id),this._model=e,this._studyMetaInfo=t,this._props=i,this._isOverlay=n,this._parentSource=o,this._oldShowLeftScale=e.isLeftPriceScaleVisible(),this._oldShowRightScale=e.isRightPriceScaleVisible()}function u(e,t){re.call(this,"Remove Source"),this._model=e,this._sourceId=t.id()}function d(e,t){re.call(this,"Remove Drawing(s)"),this._model=e,this._linetools=t,this._statesByPaneIndexes={}}function p(e,t,i,n){this._model=e,this._oldPane=this._model.paneForSource(t),re.call(this,this._oldPane===i?"Change Price Scale":"Move Source"),this._sourceId=t.id(),this._oldPaneIndex=e.panes().indexOf(this._oldPane),this._oldScaleName=this._oldPane.priceScaleName(t.priceScale()),this._oldShowLeftScale=e.isLeftPriceScaleVisible(),this._oldShowRightScale=e.isRightPriceScaleVisible(),this._pane=i,this._paneIndex=e.panes().indexOf(i),this._pane?this._scaleName=this._pane.priceScaleName(n):this._paneIndex=e.panes().length}function _(e,t,i){this._model=e,this._sourceId=t.id(),this._oldShowLeftScale=e.isLeftPriceScaleVisible(),this._oldShowRightScale=e.isRightPriceScaleVisible(),re.call(this,i)}function f(e,t){_.call(this,e,t,"Merge Up"),this._mergeRedoFn=this._model.mergeSourceUp,this._mergeUndoFn=this._model.unmergeSourceDown}function m(e,t){_.call(this,e,t,"Merge Down"),this._mergeRedoFn=this._model.mergeSourceDown,this._mergeUndoFn=this._model.unmergeSourceUp}function y(e,t){_.call(this,e,t,"Unmerge Up"),this._mergeRedoFn=this._model.unmergeSourceUp,this._mergeUndoFn=this._model.mergeSourceDown}function g(e,t){_.call(this,e,t,"Unmerge Down"),this._mergeRedoFn=this._model.unmergeSourceDown,this._mergeUndoFn=this._model.mergeSourceUp}function v(e,t,i){re.call(this,"Create line "+i,!1),this._model=e,this._paneIndex=e.panes().indexOf(t),this._lineTool=i}function S(e,t,i,n){re.call(this,"Move Drawing",!1),this._model=e,this._sourceId=t.id(),this._origPoint=i instanceof F?i.clone():TradingView.clone(i),this._pointIndex=n}function b(e,t,i){re.call(this,"Change %1 Z order (%2)".format(t.title(),i>0?"Forward":"Backward")),this._model=e,this._sourceId=t.id(),this._shift=i}function w(e,t){re.call(this,"Send "+t.title()+" to back"),this._model=e,this._sourceId=t.id()}function P(e,t){re.call(this,"Bring "+t.title()+" to front"),this._model=e,this._sourceId=t.id()}function T(e,t,i){
re.call(this,"Remove pane"),this._model=e,this._index=t,this._pane=this._model.panes()[t],this._chart=i}function x(e,t,i,n){re.call(this,"Rearrange panes"),this._model=e,this._index=t,this._direction=i,this._chart=n}function C(e,t,i,n,o,r){re.call(this,"Zoom"),this._model=e,this._startBar=t,this._endBar=i,this._startPrice=n,this._endPrice=o,this._pane=r}function L(e,t,i){re.call(this,"Zoom"),this._baseCmd=e,this._zoomStack=t,this._inOut=i}function I(e,t,i,n,o){re.call(this,"",!1),this._model=e,this._paneA=t,this._paneB=i,this._prevStretchA=n,this._currStretchA=o}function A(e,t){re.call(this,"Restore Defaults"),this._model=e,this._defaultProperty=t,this._state=t.state(t._exclusions),this._chartWidget=e._undoModel._chartWidget}function k(e,t){re.call(this,"Apply Chart Theme"),this._model=e,this._newChartProps=TradingView.factoryDefaults("chartproperties"),this._newSeriesProps=TradingView.factoryDefaults("chartproperties.mainSeriesProperties"),["candleStyle","hollowCandleStyle","haStyle"].forEach(function(e){t.mainSourceProperties[e].wickUpColor=t.mainSourceProperties[e].wickUpColor||t.mainSourceProperties[e].wickColor,t.mainSourceProperties[e].wickDownColor=t.mainSourceProperties[e].wickDownColor||t.mainSourceProperties[e].wickColor}),t.chartProperties.paneProperties.vertGridProperties=t.chartProperties.paneProperties.vertGridProperties||t.chartProperties.paneProperties.gridProperties,t.chartProperties.paneProperties.horzGridProperties=t.chartProperties.paneProperties.horzGridProperties||t.chartProperties.paneProperties.gridProperties,t.chartProperties.paneProperties.legendProperties=this._model.properties().state().paneProperties.legendProperties,this._newChartProps=$.extend(!0,{},this._newChartProps,t.chartProperties),delete this._newChartProps.scalesProperties.showLeftScale,delete this._newChartProps.scalesProperties.showRightScale,delete this._newChartProps.scalesProperties.scaleSeriesOnly,delete this._newChartProps.scalesProperties.showSeriesLastValue,delete this._newChartProps.scalesProperties.showStudyLastValue,delete this._newChartProps.scalesProperties.showSymbolLabels,delete this._newChartProps.scalesProperties.showStudyPlotLabels,e.timeScale().preserveBarSpacing()&&delete this._newChartProps.scalesProperties.barSpacing,this._newSeriesProps=$.extend(!0,{},this._newSeriesProps,t.mainSourceProperties),this._newChartProps.symbolWatermarkProperties||(this._newChartProps.symbolWatermarkProperties=defaults("chartproperties.symbolWatermarkProperties"),this._newChartProps.symbolWatermarkProperties.color=this._newChartProps.scalesProperties.textColor),this._oldChartProps=e.properties().state(),delete this._oldChartProps.paneProperties.topMargin,delete this._oldChartProps.paneProperties.bottomMargin,this._oldSeriesProps=e.properties().state().mainSeriesProperties}function E(e,t,i,n){var o;n=n||"",o=n+" Study template",re.call(this,o),this._model=e,this._oldProps=t,this._newProps=i,this._oldShowLeftScale=e.model().isLeftPriceScaleVisible(),this._oldShowRightScale=e.model().isRightPriceScaleVisible(),
this._newSourcesPriceScalesNames=[]}function M(e,t,i,n,o){re.call(this,e),this._property=t,this._value=i,this._forceSetProperty=o,this._prevValue=t.value(),this._cw=n}function V(e,t){var i,n,o,r,s=t.priceScale(),a=[],l=t.firstValue();for(i=0;i<e.length;i++)n={offset:e[i].offset,time_t:e[i].time_t},o=e[i].price,r=s.priceToCoordinate(o,l),r-=40,o=s.coordinateToPrice(r,l),n.price=o,a.push(n);return a}function D(e,t,i){re.call(this,"clone "+t.title()),this._model=e,this._originalSource=t,this._withoutShift=i}function O(e,t){re.call(this,"Stop Sincing Drawing"),this._model=e,this._sourceId=t.id(),this._linkKey=t.linkKey}function R(e,t,i){re.call(this,"Paste Drawing"),this._model=e,this._clipboardData=t,this._paneIndex=this._model.panes().indexOf(i||this._model.paneForSource(this._model.mainSeries()))}function B(e,t){re.call(this,"Paste Indicator"),this._model=e,this._clipboardData=t}function N(e,t){re.call(this,"Move",!1),this._origPoint=e.clone(),this._point=null,this._handler=t}var F=i(6).Point,W=i(73).createLineTool,H=i(0).LineDataSource,j=i(5),z=i(120),U=i(32),q=i(18),Y=i(194).doAnimate,G=i(301),K=i(3),Z=K.saveDefaultProperties,J=i(182),X=i(63).Series,Q=i(34),ee=Q.Study,te=i(124),ie=i(33),ne=i(292).showTooManyStudiesNotice,oe=i(293).UndoStack,re=i(43).UndoCommand,se=i(645).SaveLineToolStateUndoCommand,ae=i(646).ApplyLineToolTemplateUndoCommand,le=i(647).SetChartStyleCommand,ce=i(648).SetResolutionUndoCommand,he=i(42).preparePriceAxisProperties,ue=i(294).RestoreFactoryDefaultsUndoCommand,de=i(294).RestoreUserDefaultsUndoCommand,pe=i(42).getChartStyleByResolution,_e=i(4).getLogger("Chart.ChartUndoModel");inherit(n,G),n.prototype.version=function(){return this.m_model._version},n.prototype.onData=function(e){switch(e.method){case"timescale_update":var t=e.params;this.m_model.updateTimeScale(t.index,t.zoffset,t.changes,t.index_diff,t.marks,t.clear)}},n.prototype.paneForSource=function(e){return this.m_model.paneForSource(e)},n.prototype.createPane=function(e){return this.m_model.createPane(e)},n.prototype.dumpViews=function(){return this.m_model.dumpViews()},n.prototype.readOnly=function(){return this.m_model.readOnly()},n.prototype.restart=function(){this.m_model.restart()},n.prototype.disconnect=function(){this.m_model.disconnect()},n.prototype.studiesMetaData=function(){return this.m_model.studiesMetaData()},n.prototype.studyVersioning=function(){return this.m_model.studyVersioning()},n.prototype.chartModel=function(){return this.m_model},n.prototype.pushUndoCommand=function(e){this.undoHistory.pushUndoCommand(e)},n.prototype.startScalePrice=function(e,t,i){this.pushUndoCommand(new a(this.m_model,e,t,t.state())),this.chartModel().startScalePrice(e,t,i)},n.prototype.scalePriceTo=function(e,t,i){this.chartModel().scalePriceTo(e,t,i)},n.prototype.endScalePrice=function(e,t){this.chartModel().endScalePrice(e,t)},n.prototype.startScrollPrice=function(e,t,i){t.isAutoScale()||(this._initialPriceScrollState=t.state(),this._initialPriceScrollPos=i,this.chartModel().startScrollPrice(e,t,i))},
n.prototype.scrollPriceTo=function(e,t,i){t.isAutoScale()||(this._initialPriceScrollPos&&Math.abs(this._initialPriceScrollPos-i)>20&&(this.pushUndoCommand(new a(this.m_model,e,t,this._initialPriceScrollState)),delete this._initialPriceScrollState,delete this._initialPriceScrollPos),this.chartModel().scrollPriceTo(e,t,i))},n.prototype.endScrollPrice=function(e,t){t.isAutoScale()||(delete this._initialPriceScrollState,delete this._initialPriceScrollPos,this.chartModel().endScrollPrice(e,t))},n.prototype.setPriceAutoScale=function(e,t,i){this.pushUndoCommand(new a(this.m_model,e,t,t.state())),this.chartModel().setPriceAutoScale(e,t,i)},n.prototype.resetPriceScale=function(e,t){this.pushUndoCommand(new a(this.m_model,e,t,t.state())),this.chartModel().resetPriceScale(e,t)},n.prototype.startScaleTime=function(e){this.pushUndoCommand(new l(this.m_model,this.m_model.timeScale().state(),"scale time")),this.chartModel().startScaleTime(e)},n.prototype.scaleTimeTo=function(e){this.chartModel().scaleTimeTo(e)},n.prototype.endScaleTime=function(){this.chartModel().endScaleTime()},n.prototype.startScrollTime=function(e){this._initialTimeScrollState=this.m_model.timeScale().state(),this._initialTimeScrollPos=e,this.chartModel().startScrollTime(e)},n.prototype.scrollTimeTo=function(e){this._initialTimeScrollPos&&Math.abs(e-this._initialTimeScrollPos)>20&&(this.pushUndoCommand(new l(this.m_model,this._initialTimeScrollState,"scroll time")),delete this._initialTimeScrollPos,delete this._initialTimeScrollState),this.chartModel().scrollTimeTo(e)},n.prototype.gotoTime=function(e,t){var i,n,o=this.timeScale().visibleBars();if(null===o)return $.Deferred().reject().promise();i=o.firstBar(),n=this.m_model.timeScale().state(),this.chartModel().gotoTime(e,t),i!==this.timeScale().visibleBars().firstBar()&&this.pushUndoCommand(new l(this.m_model,n,"scroll time"))},n.prototype.endScrollTime=function(){this.chartModel().endScrollTime(),delete this._initialTimeScrollPos,delete this._initialTimeScrollState},n.prototype.resetTimeScale=function(){this.pushUndoCommand(new l(this.m_model,this.m_model.timeScale().state())),this.chartModel().resetTimeScale()},n.prototype.canZoomIn=function(){return this.chartModel().canZoomIn()},n.prototype.canZoomOut=function(){return this.chartModel().canZoomOut()},n.prototype.setWidth=function(e){this.m_model.setWidth(e)},n.prototype.setPaneHeight=function(e,t){this.m_model.setPaneHeight(e,t)},n.prototype.gridSource=function(){return this.m_model.gridSource()},n.prototype.watermarkSource=function(){return this.m_model.watermarkSource()},n.prototype.brandingSource=function(){return this.m_model.brandingSource()},n.prototype.addAlertsSource=function(e){return this.m_model.addAlertsSource(e)},n.prototype.alertsSources=function(){return this.m_model.alertsSources()},n.prototype.publishedChartsTimelineSource=function(){return this.m_model.publishedChartsTimelineSource()},n.prototype.barsMarksSources=function(){return this.m_model.barsMarksSources()},n.prototype.crossHairSource=function(){return this.m_model.crossHairSource()
},n.prototype.model=function(){return this.m_model},n.prototype.chartWidget=function(){return this._chartWidget},n.prototype.mainSeries=function(){return this.m_model.m_mainSeries},n.prototype.mainSeriesScaleRatioProperty=function(){return this.m_model.mainSeriesScaleRatioProperty()},n.prototype.mainSeriesPriceScaleNameProperty=function(){return this.m_model.mainSeriesPriceScaleNameProperty()},n.prototype.panes=function(){return this.m_model.m_panes},n.prototype.timeScale=function(){return this.m_model.timeScale()},n.prototype.setSelectedSource=function(e,t){this.m_model.setSelectedSource(e,t)},n.prototype.setHoveredSource=function(e,t){this.m_model.setHoveredSource(e,t)},n.prototype.selectedSource=function(){return this.m_model.selectedSource()},n.prototype.onSelectedSourceChanged=function(){return this.m_model.onSelectedSourceChanged()},n.prototype.hoveredSource=function(){return this.m_model.hoveredSource()},n.prototype.activeStrategySource=function(){return this.m_model.activeStrategySource()},n.prototype.invalidate=function(e){this.m_model.invalidate(e)},n.prototype.setCurrentPosition=function(e,t,i,n){this.m_model.setCurrentPosition(e,t,i,n)},n.prototype.setAndSaveCurrentPosition=function(e,t,i,n){this.m_model.setAndSaveCurrentPosition(e,t,i,n)},n.prototype.modifySeries=function(e,t,i){var n=new c(this.m_model,e,t,i);this.pushUndoCommand(n)},n.prototype.canCreateStudy=function(e){return this.model().chartApi().chartApi().isCanCreateStudy(e)},n.prototype.checkIfFeatureAvailable=function(e,t){var i=this.canCreateStudy(),n=t&&t instanceof ee;return!this.readOnly()&&n&&(i=this.canCreateStudy(!0)),!!i||void(n||ne())},n.prototype._insertStudy=function(e,t,i,n){var o=new h(this.m_model,e,t,i,n);return this.pushUndoCommand(o),o.insertedStudy()},n.prototype.insertStudyWithoutCheck=function(){return this._insertStudy.apply(this,arguments)},n.prototype.insertStudy=function(e,t,i,n){if(this.checkIfFeatureAvailable(e,n))return this._insertStudy(e,t,i,n)},n.prototype.setProperty=function(e,t,i){if(e&&e.value()!==t){var n=new o(e,t,i,this.m_model);this.pushUndoCommand(n),this.emitEvent("setProperty")}},n.prototype.setPriceScaleMode=function(e,t,i){var n,o,s=Object.keys(e),a=t.mode(),l=!1;for(n=0;n<s.length;n++)if(a[s[n]]!==e[s[n]]){l=!0;break}l&&(o=new r(e,t,i,this.m_model),this.pushUndoCommand(o))},n.prototype.setChartStyleProperty=function(e,t,i){if(e.value()!==t){var n=new le(e,t,this.mainSeries(),i,this.m_model,this._chartWidget);this.pushUndoCommand(n),this.emitEvent("setChartStyleProperty")}},n.prototype.setScaleRatioProperty=function(e,t,i){if(e.value()!==t){var n=new s(e,t,i,this.m_model);this.pushUndoCommand(n)}},n.prototype.setScreenChartProperty=function(e,t,i,n,o){if(o||e.value()!==t){var r=new M(n,e,t,i,o);this.pushUndoCommand(r)}},n.prototype.setResolutionProperty=function(e,t,i,n){if(e.value()!==t){var o=new ce(e,t,i,n);this.pushUndoCommand(o)}},n.prototype._getSourcesTree=function(e){var t,i=[],n=this.m_model.children(e);for(t=0;t<n.length;t++)i=i.concat(this._getSourcesTree(n[t]));return i.push(e),i},
n.prototype.removeSource=function(e,t){var i,n,o;if(e.isUserDeletable()){if(i=this._getSourcesTree(e),this.lineBeingCreated()===e)this.cancelCreatingLine();else{for(this.beginUndoMacro("Remove source"),n=0;n<i.length;++n)o=new u(this.m_model,i[n]),this.pushUndoCommand(o);this.endUndoMacro()}t||(1===i.length?this.emitEvent("removeSource",[i[0]]):this.emitEvent("removeSources",[i]))}},n.prototype.removeSelectedSource=function(){var e,t=this.m_model.selectedSource();t&&t.isUserDeletable()&&(this.setSelectedSource(null),e=new u(this.m_model,t),this.pushUndoCommand(e),this.emitEvent("removeSource",[t]))},n.prototype.removeLineTools=function(e){var t,i,n=this.lineBeingCreated();n&&-1!==(t=e.indexOf(n))&&(this.cancelCreatingLine(),e.splice(t,1)),i=new d(this.m_model,e),this.pushUndoCommand(i),this.emitEvent("removeSources",[e])},n.prototype.move=function(e,t,i){var n=new p(this.m_model,e,t,i);this.pushUndoCommand(n),this.emitEvent("moveSource",[e])},n.prototype.mergeSourceUp=function(e){var t=new f(this.m_model,e);this.pushUndoCommand(t),this.emitEvent("mergeSourceUp",[e])},n.prototype.mergeSourceDown=function(e){var t=new m(this.m_model,e);this.pushUndoCommand(t),this.emitEvent("mergeSourceDown",[e])},n.prototype.unmergeSourceUp=function(e){var t=new y(this.m_model,e);this.pushUndoCommand(t),this.emitEvent("unmergeSourceUp",[e])},n.prototype.unmergeSourceDown=function(e){var t=new g(this.m_model,e);this.pushUndoCommand(t),this.emitEvent("unmergeSourceDown",[e])},n.prototype.createLineTool=function(e,t,i,n,o){var r,s;return"LineToolRegressionTrend"!==i||this.canCreateStudy()?(this._createLineCommand=new v(this.m_model,e,i),r=this._createLineCommand.startCreatingLine(t,n,o),s=this._createLineCommand.line(),r&&(this.pushUndoCommand(this._createLineCommand),delete this._createLineCommand),s):void ne()},n.prototype.lineBeingCreated=function(){return this.m_model.lineBeingCreated()},n.prototype.paneBeingCreatedLineOn=function(){return this.m_model.paneBeingCreatedLineOn()},n.prototype.coninueCreatingLine=function(e,t,i){var n=this._createLineCommand.continueCreatingLine(e,t,i);return n&&(this.pushUndoCommand(this._createLineCommand),delete this._createLineCommand),n},n.prototype.finishLineTool=function(e){this.m_model.finishLineTool(e)},n.prototype.cancelCreatingLine=function(){this.m_model.cancelCreatingLine()},n.prototype.lineCancelled=function(){return this.m_model.lineCancelled()},n.prototype.startChangingLinetool=function(e,t,i,n){this._currentLineChangeCommand=new se(this.m_model,e,"Change "+i+"point",!1),this.m_model.startChangingLinetool(e,t,i,n)},n.prototype.lineBeingEdited=function(){return this.m_model.lineBeingEdited()},n.prototype.changeLinePoint=function(e,t){this.m_model.changeLinePoint(e,t)},n.prototype.endChangingLinetool=function(e){this.m_model.endChangingLinetool(e),this.pushUndoCommand(this._currentLineChangeCommand),this._currentLineChangeCommand=null},n.prototype.startMovingSource=function(e,t,i){e.doesMovingAffectsUndo()&&(this._currentLineMoveCommand=new S(this.m_model,e,t,i)),
this.m_model.startMovingSource(e,t,i)},n.prototype.sourceBeingMoved=function(){return this.m_model.sourceBeingMoved()},n.prototype.moveSource=function(e){null!==this._currentLineMoveCommand&&this._currentLineMoveCommand.setPoint(e),this.m_model.moveSource(e)},n.prototype.endMovingSource=function(e){this.m_model.endMovingSource(e),null!==this._currentLineMoveCommand&&this._currentLineMoveCommand._point&&(this.pushUndoCommand(this._currentLineMoveCommand),this._currentLineChangeCommand=null),this._currentLineMoveCommand=null},n.prototype.dataSources=function(){return this.m_model.dataSources()},n.prototype.orderedDataSources=function(e){return this.m_model.orderedDataSources(e)},n.prototype.dataSourceForId=function(e){return this.m_model.dataSourceForId(e)},n.prototype.state=function(e,t){return this.m_model.state(e,t)},n.prototype.asyncState=function(e){return this.m_model.asyncState(e)},n.prototype.restoreState=function(e,t){return this.m_model.restoreState(e,t)},n.prototype.calculateDefaultTags=function(){return this.m_model.calculateDefaultTags()},n.prototype.onTagsChanged=function(){return this.m_model.onTagsChanged()},n.prototype.changeZOrder=function(e,t){var i=new b(this.m_model,e,t);this.pushUndoCommand(i),this.emitEvent("changeZOrder",[e,t])},n.prototype.sendToBack=function(e){var t=new w(this.m_model,e);this.pushUndoCommand(t),this.emitEvent("changeZOrder",[e])},n.prototype.bringToFront=function(e){var t=new P(this.m_model,e);this.pushUndoCommand(t),this.emitEvent("changeZOrder",[e])},n.prototype.removeAllStudies=function(){var e,t,i;for(this.beginUndoMacro("remove all studies"),e=this.m_model.dataSources(),t=0;t<e.length;t++)i=e[t],(TradingView.isInherited(i.constructor,ee)&&!i.isChildStudy()&&i.removeByRemoveAllStudies()||TradingView.isInherited(i.constructor,te))&&this.removeSource(i);this.endUndoMacro()},n.prototype.removeAllDrawingTools=function(e){var t,i,n;for(this.beginUndoMacro("remove all drawing tools"),this.lineBeingCreated()&&this.cancelCreatingLine(),t=this.m_model.dataSources(),i=0;i<t.length;i++)n=t[i],TradingView.isInherited(n.constructor,H)&&n.isActualSymbol()&&n.isUserDeletable()&&(e&&e!==n._constructor||this.removeSource(n));this.endUndoMacro()},n.prototype.unlinkLine=function(e){var t=new O(this.m_model,e);this.pushUndoCommand(t)},n.prototype.copyToOtherCharts=function(e){this.m_model.copyToOtherCharts(e)},n.prototype.moveLeft=function(){var e,t;try{this.beginUndoMacro("Move Left")}catch(e){return}e=this.m_model.timeScale().width(),t=this,Y({to:e/5,onStep:function(e){t.startScrollTime(e),t.scrollTimeTo(0),t.endScrollTime()},onComplete:function(){t.endUndoMacro()}})},n.prototype.moveRight=function(){var e,t;try{this.beginUndoMacro("Move Right")}catch(e){return}e=this.m_model.timeScale().width(),t=this,Y({to:e/5,onStep:function(e){t.startScrollTime(0),t.scrollTimeTo(e),t.endScrollTime()},onComplete:function(){t.endUndoMacro()}})},n.prototype.scrollChart=function(e){j.enabled("chart_scroll")&&(this.startScrollTime(0),this.scrollTimeTo(e),this.endScrollTime())},
n.prototype.scrollChartByBar=function(e){if(j.enabled("chart_scroll")){var t=e*this.m_model.timeScale().barSpacing();this.startScrollTime(0),this.scrollTimeTo(t),this.endScrollTime()}},n.prototype.zoomIn=function(e,t){var i,n,o=this.m_model.timeScale().width(),r=this;if(t=t||1,this.canZoomIn())if(e)i=t*o/10,n=i*((e+1)/2),this.startScaleTime(i),this.scaleTimeTo(0),this.endScaleTime(),this.startScrollTime(0),this.scrollTimeTo(i-n),this.endScrollTime(),this._onSimpleZoomIn.fire();else{try{this.beginUndoMacro("Zoom In")}catch(e){return}Y({to:o/5,onStep:function(e){r.startScaleTime(e),r.scaleTimeTo(0),r.endScaleTime()},onComplete:function(){r.endUndoMacro(),r._onSimpleZoomIn.fire()}})}},n.prototype.zoomOut=function(e,t){var i=this.m_model.timeScale().width(),n=this;if(t=t||1,this.canZoomOut())if(e)this.startScaleTime(0),this.scaleTimeTo(t*i/10),this.endScaleTime(),this.startScrollTime(t*(i/20-i/20*e)),this.scrollTimeTo(0),this.endScrollTime(),this._onSimpleZoomOut.fire();else{try{this.beginUndoMacro("Zoom Out")}catch(e){return}Y({to:i/5,onStep:function(e){n.startScaleTime(0),n.scaleTimeTo(e),n.endScaleTime()},onComplete:function(){n.endUndoMacro(),n._onSimpleZoomOut.fire()}})}},n.prototype.resetScales=function(){var e,t;for(this.beginUndoMacro("Reset scales"),this.resetTimeScale(),e=0;e<this.panes().length;e++)t=this.panes()[e],this.resetPriceScale(t,t.leftPriceScale()),this.resetPriceScale(t,t.rightPriceScale());this.endUndoMacro(),this.m_model.recalculateAllPanes()},n.prototype.zoomToViewport=function(e,t,i,n,o){var r=new C(this.m_model,e,t,i,n,o),s=new L(r,this.m_zoomStack,!0);this.pushUndoCommand(s)},n.prototype.zoomFromViewport=function(){var e=new L(this.m_zoomStack.head(),this.m_zoomStack,!1);this.pushUndoCommand(e)},n.prototype.zoomStack=function(){return this.m_zoomStack},n.prototype.addPaneStretchFactorUndoCommand=function(e,t,i,n){var o=new I(this.m_model,e,t,i,n);this.pushUndoCommand(o)},n.prototype.restoreFactoryDefaults=function(e){var t=new ue(this.m_model,e);this.pushUndoCommand(t)},n.prototype.restoreDefaults=function(e){var t=new de(this.m_model,e);this.pushUndoCommand(t)},n.prototype.chartLoadTheme=function(e,t){var i=new k(e,t);this.pushUndoCommand(i)},n.prototype.applyLineToolTemplate=function(e,t,i){this.beginUndoMacro(i),this.saveLineToolState(e,i);var n=new ae(e,t,i);this.pushUndoCommand(n),this.saveLineToolState(e,i),this.endUndoMacro(),this.model().updateSource(e)},n.prototype.restoreLineToolFactoryDefaults=function(e,t){this.beginUndoMacro(t),this.saveLineToolState(e,t),e.restoreFactoryDefaults(),this.saveLineToolState(e,t),this.endUndoMacro()},n.prototype.studyLoadTemplate=function(e,t,i,n){var o=new E(e,t,i,n);this.pushUndoCommand(o)},n.prototype.onRearrangePanes=function(){return this._onRearrangePanes},n.prototype.onSimpleZoomIn=function(){return this._onSimpleZoomIn},n.prototype.onSimpleZoomOut=function(){return this._onSimpleZoomOut},n.prototype.loadRange=function(e){e.res!==this.m_model.mainSeries().properties().interval.value()?(this.m_model.mainSeries().setDefaultTimeframe(e.val),
this.setProperty(this.m_model.mainSeries().properties().interval,e.res,"Change date range")):this.m_model.mainSeries().loadDataTo(e.val)},n.prototype.cloneLineTool=function(e,t){var i=new D(this.m_model,e,t);return this.pushUndoCommand(i),this.emitEvent("cloneLineTool"),i.clonedLineToolId()},n.prototype.alertsList=function(){return this.m_model.alertsList()},n.prototype.alertsListChanged=function(){return this.m_model.alertsListChanged()},n.prototype.insertStudyStub=function(e){return this.m_model.insertStudyStub(e)},n.prototype.removeStudyStub=function(e){return this.m_model.removeStudyStub(e)},n.prototype.isJustClonedChart=function(){return this._chartWidget.isJustClonedChart()},n.prototype.copySourceToClip=function(e){if(e&&!e.properties().blockCopying){var t={};if(e instanceof H)t.type="drawing",t.geometry=e.geometry();else{if(!(e instanceof ee))return!1;t.type="study"}return t.source=e.state&&e.state(),(delete t.source.alertId,delete t.source.linkKey,t.source)?(t.title=e.title&&e.title(),t.modelId=this.m_model._id,J.set(t),!0):!1}},n.prototype.cutSourceToClip=function(e){if(!this.copySourceToClip(e))return!1;this.removeSource(e)},n.prototype.pasteLineTool=function(e,t){var i=new R(this.m_model,t,e);this.pushUndoCommand(i)},n.prototype.pasteStudy=function(e){var t=new B(this.m_model,e);this.pushUndoCommand(t)},n.prototype.pasteSourceFromClip=function(e,t){var i=J.get();if(!i)return!1;"drawing"===i.type&&this.pasteLineTool(e,i),"study"===i.type&&this.checkIfFeatureAvailable(i.state)&&this.pasteStudy(i)},n.prototype.trackTime=function(){return this._chartWidget.trackTime()},n.prototype.isInReplay=function(){return this.m_model.isInReplay()},n.prototype.switchToReplay=function(e){},n.prototype.switchToRealtime=function(){},n.prototype.startCustomMoving=function(e,t,i){this._currentCustomMoveCommand=new N(t,i),this._currentCustomMoveSource=e},n.prototype.customMoveBeingProcessed=function(){return null!==this._currentCustomMoveSource},n.prototype.processCustomMove=function(e){this._currentCustomMoveCommand.setPoint(e)},n.prototype.endCustomMoving=function(){null!==this._currentCustomMoveCommand.point()&&(this.pushUndoCommand(this._currentCustomMoveCommand),this._currentCustomMoveCommand=null,this._currentCustomMoveSource=null)},n.prototype.saveLineToolState=function(e,t){this.pushUndoCommand(new se(this.m_model,e,t))},inherit(o,re),o.prototype.redo=function(){this._oldValue=this._targetObj.value(),Z(!0),this._targetObj.setValue(this._newValue),Z(!1),this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new q(q.LIGHT_UPDATE)))},o.prototype.undo=function(){Z(!0),this._targetObj.setValue(this._oldValue),Z(!1),this._oldValue=null,this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new q(q.LIGHT_UPDATE)))},inherit(r,re),r.prototype.redo=function(){this._oldMode=this._priceScale.mode(),Z(!0),this._priceScale.setMode(this._newMode),Z(!1),this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new q(q.LIGHT_UPDATE)))},r.prototype.undo=function(){Z(!0),
this._priceScale.setMode(this._oldMode),Z(!1),this._oldMode=null,this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new q(q.LIGHT_UPDATE)))},inherit(s,re),s.prototype.redo=function(){this._oldValue=this._property.value(),this._oldMode=this._priceScale.mode(),Z(!0),this._priceScale.setMode({autoScale:!1,percentage:!1,log:!1}),this._property.setValue(this._newValue),Z(!1),this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new q(q.LIGHT_UPDATE)))},s.prototype.undo=function(){Z(!0),this._property.setValue(this._oldValue),this._priceScale.setMode(this._oldMode),Z(!1),this._oldMode=null,this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new q(q.LIGHT_UPDATE)))},inherit(a,re),a.prototype.undo=function(){if(null!==this.m_newPriceScaleState)return void _e.logDebug("PriceScaleChangeUndoCommand.undo: Command is already undone");this.m_newPriceScaleState=this.m_priceScale.state(),this.m_model.restorePriceScaleState(this.m_pane,this.m_priceScale,this.m_state)},a.prototype.redo=function(){if(null===this.m_newPriceScaleState)return void _e.logDebug("PriceScaleChangeUndoCommand.redo: Command is not undone");this.m_model.restorePriceScaleState(this.m_pane,this.m_priceScale,this.m_newPriceScaleState),this.m_newPriceScaleState=null},inherit(l,re),l.prototype.undo=function(){if(null!==this.m_newTimeScaleState)return void _e.logDebug("TimeScaleChangeUndoCommand.undo: Command is already undone");this.m_newTimeScaleState=this.m_model.timeScale().state(),this.m_model.restoreTimeScaleState(this.m_state)},l.prototype.redo=function(){if(null===this.m_newTimeScaleState)return void _e.logDebug("TimeScaleChangeUndoCommand.redo: Command is not undone");this.m_model.restoreTimeScaleState(this.m_newTimeScaleState),this.m_newTimeScaleState=null},inherit(c,re),c.prototype.redo=function(){this._model.modifySeries(this._series,this._symbol,this._interval)},c.prototype.undo=function(){this._model.modifySeries(this._series,this._oldSymbol,this._oldInterval)},inherit(h,re),h.prototype.redo=function(){var e,t,i=null;return this._studyState?(i=this._model.restoreSource(this._restorePane,this._paneIndex,this._paneState,this._studyState,this._priceScaleName),this._studyId!==i.id()&&_e.logError("Study was restored improperly - study ids does not match"),delete this._studyState):(i=this._model.insertStudy(this._studyMetaInfo,this._props,this._isOverlay,this._parentSource),this._studyId=i.id()),e=this._model.paneForSource(i),t=e.priceScaleName(i.priceScale()),this._model.setPriceScaleVisibility(t,!0),i},h.prototype.insertedStudy=function(){return this._model.dataSourceForId(this._studyId)},h.prototype.undo=function(){var e,t=this.insertedStudy();this._studyState=t.state(),e=this._model.paneForSource(t),this._paneIndex=this._model.panes().indexOf(e),this._paneState=e.state(),this._restorePane=this._model.removeSource(t),this._model.setLeftPriceScaleVisible(this._oldShowLeftScale),this._model.setRightPriceScaleVisible(this._oldShowRightScale)},inherit(u,re),u.prototype.redo=function(){
var e,t=this._model.dataSourceForId(this._sourceId);this._sourceState=t.state(),e=this._model.paneForSource(t),this._paneIndex=this._model.panes().indexOf(e),this._priceScaleName=e.priceScaleName(t.priceScale()),this._paneState=e.state(),this._restorePane=this._model.removeSource(t)},u.prototype.undo=function(){var e=this._model.restoreSource(this._restorePane,this._paneIndex,this._paneState,this._sourceState,this._priceScaleName);this._sourceId!==e.id()&&_e.logError("Source was restored improperly - source ids does not match")},inherit(d,re),d.prototype.redo=function(){var e,t,i;for(e=0;e<this._linetools.length;e++)t=this._model.paneForSource(this._linetools[e]),i=this._model.panes().indexOf(t),this._statesByPaneIndexes[i]=this._statesByPaneIndexes[i]||[],this._statesByPaneIndexes[i].push({state:this._linetools[e].state(),owner:this._linetools[e].ownerSource().id()}),t.removeDataSource(this._linetools[e]);delete this._linetools},d.prototype.undo=function(){var e,t,i,n,o,r,s;this._linetools=[];for(e in this._statesByPaneIndexes)for(t=this._model.panes()[e],i=this._statesByPaneIndexes[e],n=0;n<i.length;n++)o=i[n],r=this._model.dataSourceForId(o.owner),s=t._restoreLineTool(o.state),s.setOwnerSource(r),s.updateAllViews(),this._linetools.push(s);this._model.invalidate(new q(q.LIGHT_UPDATE))},inherit(p,re),p.prototype.redo=function(){var e,t;-1===this._model.panes().indexOf(this._pane)&&(this._pane=this._model.createPane(this._paneIndex)),e=this._model.dataSourceForId(this._sourceId),this._model.move(e,this._pane,this._pane.priceScaleByName(this._scaleName)),t=this._pane.priceScaleName(e.priceScale()),this._model.setPriceScaleVisibility(t,!0)},p.prototype.undo=function(){-1===this._model.panes().indexOf(this._oldPane)&&(this._oldPane=this._model.createPane(this._oldPaneIndex)),this._model.move(this._model.dataSourceForId(this._sourceId),this._oldPane,this._oldPane.priceScaleByName(this._oldScaleName)),this._model.setLeftPriceScaleVisible(this._oldShowLeftScale),this._model.setRightPriceScaleVisible(this._oldShowRightScale)},inherit(_,re),_.prototype.redo=function(){var e,t,i=this._model.dataSourceForId(this._sourceId);this._mergeRedoFn.call(this._model,i),e=this._model.paneForSource(i),t=e.priceScaleName(i.priceScale()),this._model.setPriceScaleVisibility(t,!0)},_.prototype.undo=function(){var e=this._model.dataSourceForId(this._sourceId);this._mergeUndoFn.call(this._model,e),this._model.setLeftPriceScaleVisible(this._oldShowLeftScale),this._model.setRightPriceScaleVisible(this._oldShowRightScale)},inherit(f,_),inherit(m,_),inherit(y,_),inherit(g,_),inherit(v,re),v.prototype.startCreatingLine=function(e,t,i){var n,o;return this._points=[{point:e}],n=this._model.panes()[this._paneIndex],o=this._model.createLineTool(n,e,this._lineTool,t,i),this._lineId=o.id(),!this._model.lineBeingCreated()},v.prototype.continueCreatingLine=function(e,t,i){return this._points||_e.logError("continueCreatingLine is called before startCreatingLine"),this._points.push({point:e,envState:t}),this._model.coninueCreatingLine(e,t,i)},
v.prototype.line=function(){return this._lineId?this._model.dataSourceForId(this._lineId):null},v.prototype.undo=function(){var e=this.line();e&&(this._lineState=e.state(),this._model.removeSource(e),delete this._lineId)},v.prototype.redo=function(){this._lineState||_e.logError("This command was never undone - nothing to redo");var e=this._model.restoreSource(!1,this._paneIndex,null,this._lineState,null);this._lineId=e.id(),delete this._lineState},inherit(S,re),S.prototype.setPoint=function(e){this._point=e instanceof F?e.clone():TradingView.clone(e)},S.prototype.undo=function(){var e=this._model.dataSourceForId(this._sourceId);this._model.startMovingSource(e,this._point,this._pointIndex),this._model.moveSource(this._origPoint),this._model.endMovingSource()},S.prototype.redo=function(){var e=this._model.dataSourceForId(this._sourceId);this._model.startMovingSource(e,this._origPoint,this._pointIndex),this._model.moveSource(this._point),this._model.endMovingSource()},inherit(b,re),b.prototype.undo=function(){var e=this._model.dataSourceForId(this._sourceId);this._model.changeZOrder(e,-this._shift)},b.prototype.redo=function(){var e=this._model.dataSourceForId(this._sourceId);this._model.changeZOrder(e,this._shift)};inherit(w,re),w.prototype.undo=function(){var e=this._model.dataSourceForId(this._sourceId);this._model.bringToFront(e)},w.prototype.redo=function(){var e=this._model.dataSourceForId(this._sourceId);this._model.sendToBack(e)},inherit(P,re),P.prototype.undo=function(){var e=this._model.dataSourceForId(this._sourceId);this._model.sendToBack(e)},P.prototype.redo=function(){var e=this._model.dataSourceForId(this._sourceId);this._model.bringToFront(e)},n.prototype.removePane=function(e,t){var i=new T(this,t,e);this.pushUndoCommand(i)},inherit(T,re),T.prototype.redo=function(){this._model.panes().splice(this._index,1),this._chart._updateGui()},T.prototype.undo=function(){this._model.panes().splice(this._index,0,this._pane),this._chart._updateGui()},n.prototype.rearrangePanes=function(e,t,i){var n=new x(this,t,i,e);this.pushUndoCommand(n),this._onRearrangePanes.fire()},inherit(x,re),x.prototype.redo=function(){var e=this._model.panes()[this._index];"up"===this._direction&&this._index>0&&(this._model.panes().splice(this._index,1),this._model.panes().splice(this._index-1,0,e)),"down"===this._direction&&this._index<this._model.panes().length-1&&(this._model.panes().splice(this._index,1),this._model.panes().splice(this._index+1,0,e)),this._model.invalidate(new q(q.FULL_UPDATE))},x.prototype.undo=function(){var e;"up"===this._direction&&(e=this._model.panes()[this._index-1],this._model.panes().splice(this._index-1,1),this._model.panes().splice(this._index,0,e)),"down"===this._direction&&(e=this._model.panes()[this._index+1],this._model.panes().splice(this._index+1,1),this._model.panes().splice(this._index,0,e)),this._model.invalidate(new q(q.FULL_UPDATE))},inherit(C,re),C.prototype.redo=function(){this._timeScaleState=this._model.timeScale().state(),this._priceScaleState=this._pane.defaultPriceScale().state(),
this._model.zoomToViewport(this._startBar,this._endBar,this._startPrice,this._endPrice,this._pane)},C.prototype.undo=function(){this._model.timeScale().restoreState(this._timeScaleState),this._pane.defaultPriceScale().restoreState(this._priceScaleState),this._model.recalculateAllPanes(),this._model.invalidate(new q(q.LIGHT_UPDATE))},inherit(L,re),L.prototype.undo=function(){if(this._inOut){if(this._baseCmd!==this._zoomStack.head())return void _e.logDebug("zoom stack inconsistency");this._baseCmd.undo(),this._zoomStack.pop()}else this._baseCmd.redo(),this._zoomStack.push(this._baseCmd)},L.prototype.redo=function(){if(this._inOut)this._baseCmd.redo(),this._zoomStack.push(this._baseCmd);else{if(this._baseCmd!==this._zoomStack.head())return void _e.logDebug("zoom stack inconsistency");this._baseCmd.undo(),this._zoomStack.pop()}},inherit(I,re),I.prototype.redo=function(){var e=this._paneA._stretchFactor+this._paneB._stretchFactor;this._paneA._stretchFactor=this._currStretchA,this._paneB._stretchFactor=e-this._currStretchA,this._model.invalidate(new q(q.FULL_UPDATE))},I.prototype.undo=function(){var e=this._paneA._stretchFactor+this._paneB._stretchFactor;this._paneA._stretchFactor=this._prevStretchA,this._paneB._stretchFactor=e-this._prevStretchA,this._model.invalidate(new q(q.FULL_UPDATE))},inherit(A,re),A.prototype.redo=function(){this._model.restoreFactoryDefaults(this._defaultProperty)},A.prototype.undo=function(){this._defaultProperty.merge(this._state),this._defaultProperty.listeners().fire(this._defaultProperty),this._model.mainSeries().onChartStyleChanged()},inherit(k,re),k.prototype._merge=function(e,t){var i=this._model;Z(!0),e&&(i.properties().paneProperties.mergeAndFire(e.paneProperties),i.properties().scalesProperties.mergeAndFire(e.scalesProperties),i.properties().symbolWatermarkProperties.mergeAndFire(e.symbolWatermarkProperties)),i.mainSeries().priceScale().setMode({autoScale:t.priceAxisProperties.autoScale,percentage:t.priceAxisProperties.percentage,log:t.priceAxisProperties.log,lockScale:t.priceAxisProperties.lockScale}),i.mainSeries().setChartStyleWithIntervalIfNeeded(t.style),delete t.style,delete t.interval,i.mainSeries().properties().mergeAndFire(t),i.mainSeries().properties().saveDefaults(),i.mainSeries().createPaneView(),i.mainSeries().invalidateBarStylesCache(),i._version=t.version,i.recalculateAllPanes(),i.invalidate(new q(q.FULL_UPDATE)),i.properties().saveDefaults(),Z(!1)},k.prototype.undo=function(){this._merge(this._oldChartProps,this._oldSeriesProps),this._model.mainSeries().onChartStyleChanged(),this._model.updateScales(),this._model.chartThemeLoaded()},k.prototype.redo=function(){this._merge(this._newChartProps,this._newSeriesProps),this._model.mainSeries().onChartStyleChanged(),this._model.updateScales(),this._model.chartThemeLoaded()},inherit(E,re),E.prototype._merge=function(e){var t,i,n,o,r,s,a,l,c,h,u,d,p,_=this._model.model(),f=_.mainSeries();for(f.priceScale().properties().lockScale.setValue(!1),e.interval&&(t=pe(e.interval,f.properties().style.value()),
f.setChartStyleWithIntervalIfNeeded(t,e.interval)),i=[],n=_.panes(),o=n.length;o--;)for(r=n[o],s=r.containsMainSeries(),a=r.dataSources(),l=a.length;l--;)c=a[l],(!s||c instanceof ee)&&(c.isRemovedByStudyTemplates()||i.push(c),_.removeSource(c));for(h=e.panes,function(e,t){return e.dataSources().some(function(e){return e.alert&&e.alert().id===t.alert.id})},o=0;o<h.length;o++){for(u=!1,d=h[o],l=0;l<d.sources.length;l++)c=d.sources[l],"MainSeries"===c.type&&(delete c.state,u=!0),-1!==d.leftAxisSources.indexOf(c.id)&&-1===this._newSourcesPriceScalesNames.indexOf("left")&&this._newSourcesPriceScalesNames.push("left"),-1!==d.rightAxisSources.indexOf(c.id)&&-1===this._newSourcesPriceScalesNames.indexOf("right")&&this._newSourcesPriceScalesNames.push("right");if(r=null,r=u?n[o]:_.createPane(o),r.restoreState(h[o],!1,e.version),u)for(p=0;p<i.length;p++)i[p].restore&&i[p].restore()}f.priceScale().setMode({autoScale:!0}),_._version=e.version,_.startNotStartedStudies(),_.recalculateAllPanes(),_.invalidate(new q(q.FULL_UPDATE))},E.prototype.redo=function(){var e,t,i;for(this._merge(this._newProps),e=this._model.model(),e.mainSeries().onChartStyleChanged(),t=this._model.model().mainSeries().properties(),he(t),e._recalcVisibleRangeStudy(e.dataSources(),!0),i=0;i<this._newSourcesPriceScalesNames.length;i++)e.setPriceScaleVisibility(this._newSourcesPriceScalesNames[i],!0)},E.prototype.undo=function(){this._merge(this._oldProps),this._model.model().mainSeries().onChartStyleChanged(),this._model.model().setLeftPriceScaleVisible(this._oldShowLeftScale),this._model.model().setRightPriceScaleVisible(this._oldShowRightScale)},inherit(M,re),M.prototype.redo=function(){this._cw.screen.show(),this._property.setValue(this._value,this._forceSetProperty)},M.prototype.undo=function(){this._cw.screen.show(),this._property.setValue(this._prevValue,this._forceSetProperty)},inherit(D,re),D.prototype.redo=function(){var e,t,i,n,o,r,s,a,l,c,h;if(this._lineState)r=this._model.restoreSource(!1,this._paneIndex,null,this._lineState,null);else{for(e=this._originalSource,t=e.priceScale(),i=this._model.paneForSource(e),n=TradingView.className(e.constructor),o=e.properties().clone(),r=W(n,this._model,o,null,e.ownerSource()),r.setOwnerSource(e.ownerSource()),r.properties().visible._value=!0,r._fixedPoints=r._fixedPoints.concat(e._fixedPoints),s=0;s<r._fixedPoints.length;s++)r._fixedPoints[s]=r._fixedPoints[s].add(new F(20,20));a=e._timePoint,l=this._withoutShift?TradingView.clone(a):V(a,e.ownerSource()),c=e._points,h=c,r.restorePoints(l,h),r.cloneData&&r.cloneData(e),i.addDataSource(r,t),this._model.updateSource(r),r.checkAlert&&r.checkAlert(),this._paneIndex=this._model.panes().indexOf(i),U.drawOnAllCharts().value()&&this._model.copyToOtherCharts(r),this._lineState=r.state()}},D.prototype.undo=function(){this._lineState||_e.logError("This command was never executed - nothing to undo");var e=this._model.dataSourceForId(this._lineState.id);this._model.removeSource(e)},D.prototype.clonedLineToolId=function(){return this._lineState.id},inherit(O,re),
O.prototype.redo=function(){delete this._model.dataSourceForId(this._sourceId).linkKey},O.prototype.undo=function(){this._model.dataSourceForId(this._sourceId).linkKey=this._linkKey},inherit(R,re),R.prototype.redo=function(){var e,t,i,n,o,r,s,a,l,c,h=this._model.panes()[this._paneIndex],u=h.dataSourceForId(this._clipboardData.source.ownerSource)||h.mainDataSource();this._sourceState||(e=!0,t=this._clipboardData.source.state.symbol,i=h.mainDataSource(),n=i.symbol?i.symbol():"",o=t===n,o&&(u instanceof X&&(e=!1),u instanceof ee&&(e=!u.metaInfo().is_price_study)),r=TradingView.clone(this._clipboardData.source),delete r.state.symbol,e?(s=this._model,a=function(e){var t=e.x*s.timeScale().width(),i=e.y*u.priceScale().height();return new F(t,i)},l=u.firstValue(),r.points=this._clipboardData.geometry.map(function(e){var t=a(e),i=s.timeScale().coordinateToIndex(t.x),n=s.timeScale().normalizeBarIndex(i);return n.price=u.priceScale().coordinateToPrice(t.y,l),n})):this._model._id===this._clipboardData.modelId&&u.id()===this._clipboardData.source.ownerSource&&(r.points=V(this._clipboardData.source.points,u)),r.id=ie.guid(),this._sourceState=r),c=h._restoreLineTool(this._sourceState,null,!1),c.calcIsActualSymbol(),c.setOwnerSource(u),c.setPriceScale(u.priceScale()),u.priceScale().addDataSource(c),c.createServerPoints(),this._model.invalidate(new q(q.LIGHT_UPDATE,!0))},R.prototype.undo=function(){var e,t;this._sourceState||_e.logError("This command was never executed - nothing to undo"),e=this._model.panes()[this._paneIndex],t=e.dataSourceForId(this._sourceState.id),this._model.removeSource(t)},inherit(B,re),B.prototype.redo=function(){var e,t,i,n;this._sourceState||(e=TradingView.clone(this._clipboardData.source),e.id=ie.guid(),this._sourceState=e),t=null,i=null,this._sourceState.metaInfo.is_price_study?(t=this._model.paneForSource(this._model.mainSeries()),i=this._model.mainSeries().priceScale()):(t=this._model.createPane(),i=t.defaultPriceScale()),n=t._restoreStudy(this._sourceState),n.start(),n.setPriceScale(i),t.move(n,i)},B.prototype.undo=function(){this._sourceState||_e.logError("This command was never executed - nothing to undo");var e=this._model.dataSourceForId(this._sourceState.id);this._model.removeSource(e)},inherit(N,re),N.prototype.setPoint=function(e){this._point=e.clone(),this._handler(e)},N.prototype.point=function(){return this._point},N.prototype.undo=function(){this._handler(this._origPoint)},N.prototype.redo=function(){this._handler(this._point)},t.ChartUndoModel=n}).call(t,i(8))},function(e,t,i){"use strict";var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"SaveLineToolStateUndoCommand",function(){return s}),n=i(1),o=i(7),i.n(o),r=i(43),s=function(e){function t(t,i,n,o){void 0===o&&(o=!0);var r=e.call(this,n,o)||this;return r._model=t,r._savedState=i.state(!0),r}return n.c(t,e),t.prototype.redo=function(){this._toggleState()},t.prototype.undo=function(){this._toggleState()},t.prototype._getSource=function(){return Object(o.ensureNotNull)(this._model.dataSourceForId(this._savedState.id))},
t.prototype._toggleState=function(){var e=this._getSource(),t=this._savedState;this._savedState=e.state(!0),this._model.restoreLineToolState(e,t)},t}(r.UndoCommand)},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"ApplyLineToolTemplateUndoCommand",function(){return r}),n=i(1),o=i(43),r=function(e){function t(t,i,n){var o=e.call(this,n)||this;return o._source=t,o._newState=i,o._oldState=t.properties().state(),o}return n.c(t,e),t.prototype.redo=function(){this._source.applyTemplate(this._newState)},t.prototype.undo=function(){this._source.applyTemplate(this._oldState)},t}(o.UndoCommand)},function(e,t,i){"use strict";var n,o,r,s,a,l,c,h,u;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"SetChartStyleCommand",function(){return u}),n=i(1),o=i(43),r=i(3),i.n(r),s=i(42),a=i(62),l=i(18),c=i.n(l),h=i(61),u=function(e){function t(t,i,n,o,r,s){var a=e.call(this,o)||this;return a._prevPriceAxisProps={},a._property=t,a._mainSeries=n,a._value=i,a._model=r,a._chartWidget=s,a}return n.c(t,e),t.prototype.redo=function(){var e,t,i,n=this._mainSeries,o=n.properties();o.style===this._property&&n.isNeedRestart(this._value)&&this._chartWidget.screen.show(),this._prevResolution=o.interval.value(),this._prevValue=this._property.value(),this._storePriceAxisProps(),Object(r.saveDefaultProperties)(!0),e=o.interval.value(),t=this._model.defaultResolutions(),i=Object(h.getResolutionByChartStyle)(this._value,e,t),a.linking.interval.setValue(i),n.setChartStyleWithIntervalIfNeeded(this._value,i),Object(s.setLastUsedStyle)(this._value),Object(s.preparePriceAxisProperties)(o),Object(r.saveDefaultProperties)(!1),this._invalidateModel()},t.prototype.undo=function(){var e=this._mainSeries;e.properties().style===this._property&&e.isNeedRestart(this._value)&&this._chartWidget.screen.show(),Object(r.saveDefaultProperties)(!0),e.setChartStyleWithIntervalIfNeeded(this._prevValue,this._prevResolution),this._restorePriceAxisProps(),a.linking.interval.setValue(this._prevResolution),Object(r.saveDefaultProperties)(!1),this._invalidateModel()},t.prototype._storePriceAxisProps=function(){var e=this._mainSeries.priceScale();this._prevPriceAxisProps=e.mode()},t.prototype._restorePriceAxisProps=function(){this._mainSeries.priceScale().setMode(this._prevPriceAxisProps)},t.prototype._invalidateModel=function(){this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new c.a(c.a.LIGHT_UPDATE)))},t}(o.UndoCommand)},function(e,t,i){"use strict";var n,o,r,s,a,l;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"SetResolutionUndoCommand",function(){return l}),n=i(1),o=i(43),r=i(15),s=i(42),a=i(40),l=function(e){function t(t,i,n,o){var r=e.call(this,o)||this;return r._property=t,r._value=i,r._prevValue=t.value(),r._chartWidget=n,r}return n.c(t,e),t.prototype.redo=function(){this._chartWidget.screen.show(),this._property.setValue(this._value),this._handleResolution(this._value)},t.prototype.undo=function(){this._chartWidget.screen.show(),this._property.setValue(this._prevValue),
this._handleResolution(this._prevValue)},t.prototype._handleResolution=function(e){var t=this._chartWidget.model().mainSeries().properties(),i=t.style.value(),n=Object(s.isRangeStyle)(i),o=r.Interval.isRange(e);!n&&o?t.style.setValue(a.STYLE_RANGE):n&&!o&&t.style.setValue(Object(s.getLastUsedStyle)())},t}(o.UndoCommand)},function(e,t,i){"use strict";(function(e){function n(e,t){this._options=Object.assign({},b,t),this.chart=e,this._properties=e.properties().scalesProperties,this.contextMenu=null,this.jqRow=$(document.createElement("tr")),this.jqLhsTimeAxisStub=$(document.createElement("td")),this.jqLhsTimeAxisStub.addClass("chart-markup-table"),this.jqLhsTimeAxisStub.appendTo(this.jqRow),this.jqLhsStub=$("<div>"),this.jqLhsStub.css("width","100%"),this.jqLhsStub.css("height","100%"),this.jqLhsStub.css("position","relative"),this.jqLhsStub.css("overflow","hidden"),this.jqLhsStub.appendTo(this.jqLhsTimeAxisStub),this.lhsCanvas=f(this.jqLhsStub,new m(16,16)),$(this.lhsCanvas).css("position","absolute"),$(this.lhsCanvas).css("z-order","2"),$(this.lhsCanvas).css("left",0),$(this.lhsCanvas).css("top",0),this.lhsCtx=this.lhsCanvas.getContext("2d"),this.jqCell=$(document.createElement("td")),this.jqCell.appendTo(this.jqRow),this.jqCell.addClass("chart-markup-table"),this.jqCell.addClass("time-axis"),this.jqCell.height(25),this._dv=$("<div>"),this._dv.css("width","100%"),this._dv.css("height","100%"),this._dv.css("position","relative"),this._dv.css("overflow","hidden"),this._dv.appendTo(this.jqCell),this.canvas=f(this._dv,new m(16,16)),$(this.canvas).css("position","absolute"),$(this.canvas).css("z-order","2"),$(this.canvas).css("left",0),$(this.canvas).css("top",0),this.ctx=this.canvas.getContext("2d"),this.top_canvas=f(this._dv,new m(16,16)),$(this.top_canvas).css("position","absolute"),$(this.top_canvas).css("z-order","1"),$(this.top_canvas).css("left",0),$(this.top_canvas).css("top",0),this.top_ctx=this.top_canvas.getContext("2d"),this.jqRhsTimeAxisStub=$(document.createElement("td")),this.jqRhsTimeAxisStub.addClass("chart-markup-table"),this.jqRhsTimeAxisStub.appendTo(this.jqRow),this.jqRhsStub=$("<div>"),this.jqRhsStub.css("width","100%"),this.jqRhsStub.css("height","100%"),this.jqRhsStub.css("position","relative"),this.jqRhsStub.css("overflow","hidden"),this.jqRhsStub.appendTo(this.jqRhsTimeAxisStub),this.rhsCanvas=f(this.jqRhsStub,new m(16,16)),$(this.rhsCanvas).css("position","absolute"),$(this.rhsCanvas).css("z-order","2"),$(this.rhsCanvas).css("left",0),$(this.rhsCanvas).css("top",0),this.rhsCtx=this.rhsCanvas.getContext("2d"),this.restoreDefaultCursor(),this.update(),this._minVisibleSpan=S.MINUTE_SPAN,this._mouseEventHandler=new y(this.jqCell,this,!0),this.updatePriceScalesVisibility()}var o,r,s,a,l,c,h,u,d,p,_,f,m,y,g,v,S,b;i(650),o=i(125).PriceAxisWidget,r=i(0).LineDataSource,s=i(116),a=i(41),l=a.ActionSeparator,c=i(89),h=i(18),u=i(82),d=u.resizeCanvas,p=u.hardResizeCanvas,_=u.clearRect,f=u.addCanvasTo,m=u.Size,y=i(111).MouseEventHandler,g=i(39).trackEvent,v=i(79).makeFont,S=i(161),b={contextMenuEnabled:!0,
timezoneMenuEnabled:!0},n.prototype.destroy=function(){this._mouseEventHandler.destroy()},n.prototype._BORDER_SIZE=1,n.prototype._OFFSET_SIZE=1,n.prototype._TICK_LENGTH=3,n.prototype.backgroundColor=function(){return this.chart.properties().paneProperties.background.value()},n.prototype.lineColor=function(){return this._properties.lineColor.value()},n.prototype.textColor=function(){return this._properties.textColor.value()},n.prototype.fontSize=function(){return this._properties.fontSize.value()},n.prototype.baseFont=function(){return v(this.fontSize(),"Arial","")},n.prototype.baseBoldFont=function(){return v(this.fontSize(),"Arial","bold")},n.prototype.rendererOptions=function(){var e,t;return this._rendererOptions||(this._rendererOptions={borderSize:this._BORDER_SIZE,offsetSize:this._OFFSET_SIZE,tickLength:this._TICK_LENGTH,fontSize:NaN,font:"",widthCache:new s}),e=this._rendererOptions,e.fontSize!==this.fontSize()&&(t=this.fontSize(),e.fontSize=t,e.font=this.baseFont(),e.font=v(this.fontSize(),"'Trebuchet MS', Tahoma, Arial, sans-serif",""),e.paddingTop=Math.ceil(t/2.5),e.paddingBottom=e.paddingTop,e.paddingHorizontal=Math.ceil(t/2),e.baselineOffset=Math.round(this.fontSize()/5),e.widthCache.reset()),this._rendererOptions},n.prototype.updatePriceScalesVisibility=function(){var e=this.chart.properties().scalesProperties;e.showLeftScale.value()?this.jqLhsTimeAxisStub.css("display","table-cell"):this.jqLhsTimeAxisStub.css("display","none"),e.showRightScale.value()?this.jqRhsTimeAxisStub.css("display","table-cell"):this.jqRhsTimeAxisStub.css("display","none")},n.prototype.mouseDownEvent=function(t){if(this._mousedown||!e.enabled("chart_zoom"))return!0;this._mousedown=!0;var i=this.chart.model();i.timeScale().isEmpty()||(this.setCursor("ew-resize"),i.startScaleTime(t.localX))},n.prototype.mouseDownOutsideEvent=function(e){var t=this.chart.model();!t.timeScale().isEmpty()&&this._mousedown&&(this._mousedown=!1,t.endScaleTime(),this.restoreDefaultCursor())},n.prototype.pressedMouseMoveEvent=function(e){var t,i,n=this.chart.model();n.timeScale().isEmpty()||(t=!1,i=(new Date).valueOf(),this._lastScrollScaleTime&&i-this._lastScrollScaleTime<100&&(t=!0),t||(n.scaleTimeTo(e.localX),this._lastScrollScaleTime=i))},n.prototype.mouseUpEvent=function(e){this._mousedown=!1;var t=this.chart.model();t.timeScale().isEmpty()||(t.endScaleTime(),this.restoreDefaultCursor())},n.prototype.contextMenuEvent=function(e,t){this._options.contextMenuEnabled&&this._createContextMenu().show(e)},n.prototype._createContextMenu=function(){return c.createMenu(this.getContextMenuActions(),{statName:"TimeScaleContextMenu"})},n.prototype.getContextMenuActions=function(){var t,i,n=this.chart;return n.model().mainSeries().createSessStudy(),n.updateActions(),t=n.actions(),i=e.enabled("charting_library_base")?[t.timeScaleReset,new l,t.applyTimeZone,t.sessionBreaks]:[t.timeScaleReset,new l,t.applyTimeZone,t.sessionBreaks,t.extendedHours],this._options.timezoneMenuEnabled||i.splice(2,1),
e.enabled("show_chart_property_page")&&e.enabled("chart_property_page_timezone_sessions")&&t.tmzProperties&&i.push(new l,t.tmzProperties),i},n.prototype.mouseClickEvent=function(e){},n.prototype.mouseDoubleClickEvent=function(e){g("GUI","Double click time scale"),this.chart.model().resetTimeScale()},n.prototype.optimalHeight=function(){var e=this.rendererOptions();return Math.ceil(e.offsetSize+e.borderSize+e.tickLength+e.fontSize+e.paddingTop+e.paddingBottom)},n.prototype.setSize=function(e,t,i){this.size&&this.size.equals(e)||(this.lhsStubSize=t,d(this.lhsCanvas,t),this.jqLhsTimeAxisStub.width(t.w),this.jqLhsTimeAxisStub.height(t.h),this.rhsStubSize=i,d(this.rhsCanvas,i),this.jqRhsTimeAxisStub.width(i.w),this.jqRhsTimeAxisStub.height(i.h),this.size=e,d(this.canvas,e),d(this.top_canvas,e),this.lhsCanvas.getContext("2d"),this.rhsCanvas.getContext("2d"),this.canvas.getContext("2d"),this.top_canvas.getContext("2d"),this.jqCell.width(e.w),this.jqCell.height(e.h))},n.prototype._spanIndex=function(e){for(var t=[S.MINUTE_SPAN,S.HOUR_SPAN,S.DAY_SPAN,S.MONTH_SPAN,S.YEAR_SPAN],i=t.length-1;i>0;){if(t[i]<=e)return i;i--}return i},n.prototype._spanOffset=function(e,t){if(t<e)throw Error("actual span cuold not be less then base");return this._spanIndex(t)-this._spanIndex(e)},n.prototype.update=function(){var e,t;this.chart.model()&&(e=this.chart.model().timeScale().marks())&&(t=this,this._minVisibleSpan=S.YEAR_SPAN,$.each(e,function(){t._minVisibleSpan=Math.min(this.span,t._minVisibleSpan)}))},n.prototype._hightlightBackground=function(e,t){var i,n,o,r,s=this.chart.model(),a=s.timeScale(),l=t[0].index,c=t[0].index;for(i=1;i<t.length;i++)l=Math.min(l,t[i].index),c=Math.max(c,t[i].index);n=a.indexToCoordinate(l),o=a.indexToCoordinate(c),r="rgba(109, 158, 235, 0.3)",_(e,n,1,o-n,this.size.h-1,r)},n.prototype.drawBackground=function(e){var t,i,n,o,s;if(_(e,0,0,this.size.w,this.size.h,this.backgroundColor()),t=this.chart.model()){if(i=t.timeScale(),(n=t.model().selectedSource())&&n instanceof r&&!i.isEmpty()){if(o=n.axisPoints(),0===o.length)return;this._hightlightBackground(e,o)}s=t.model().crossHairSource(),s.startMeasurePoint()&&this._hightlightBackground(e,s.measurePoints())}},n.prototype.drawBorder=function(e){e.save(),e.fillStyle=this.lineColor(),e.fillRect(-.5,.5,this.size.w+.5,this._BORDER_SIZE),e.restore()},n.prototype.drawStubs=function(){var e,t=this._BORDER_SIZE,i=2*this._BORDER_SIZE,n=this.lhsCtx;_(n,0,0,this.lhsStubSize.w,this.lhsStubSize.h,this.backgroundColor()),n.fillStyle=this.lineColor(),n.fillRect(this.lhsStubSize.w-i-.5,.5,i,t),n.fillRect(this.lhsStubSize.w-i-.5,-.5,t,t),e=this.rhsCtx,_(e,0,0,this.rhsStubSize.w,this.rhsStubSize.h,this.backgroundColor()),e.fillStyle=this.lineColor(),e.fillRect(-.5,.5,i,t),e.fillRect(.5,-.5,t,t)},n.prototype.drawTickMarks=function(e){var t,i,n,o,r,s,a,l,c,h,u,d=this.chart.model().timeScale().marks();if(d&&0!==d.length){for(t=d.reduce(function(e,t){return e.span>t.span?e:t},d[0]).span,t>30&&t<40&&(t=30),e.save(),e.strokeStyle=this.lineColor(),i=this.rendererOptions(),
n=i.borderSize+i.tickLength+i.paddingTop+i.fontSize-i.baselineOffset,e.textAlign="center",e.translate(.5,.5),e.fillStyle=this.lineColor(),e.beginPath(),o=d.length;o--;)e.rect(d[o].coord,i.borderSize,1,i.tickLength);for(e.fill(),e.fillStyle=this.textColor(),r={},s=this.baseFont(),a=this.baseBoldFont(),o=0;o<d.length;o++)l=d[o].span>=t?a:s,c=r[l]||[],c.push(d[o]),r[l]=c;for(h in r)for(e.setFont(h),u=r[h],o=0;o<u.length;o++)e.fillText(u[o].label,u[o].coord,n);e.restore()}},n.prototype.drawBackLabels=function(e){var t,i,n,o,r,s,a,l;for(e.save(),t=this.chart.model().dataSources(),i=this.chart.model(),n=i.sourceBeingMoved()||i.lineBeingEdited()||i.lineBeingCreated(),o=this.rendererOptions(),r=0;r<t.length;r++)if((s=t[r])!==this.chart.model().crossHairSource()&&s!==n&&s.timeAxisViews&&(a=s.timeAxisViews()))for(l=0;l<a.length;l++)a[l].renderer().draw(e,o);e.restore()},n.prototype.drawCrossHairLabel=function(e){var t,i,n,o,r;if(this.top_ctx.clearRect(-.5,-.5,this.size.w,this.size.h),t=this.chart.model(),i=t.sourceBeingMoved()||t.lineBeingEdited()||t.lineBeingCreated(),n=this.rendererOptions(),i){if(e.save(),i.timeAxisViews&&(o=i.timeAxisViews()))for(r=0;r<o.length;r++)o[r].renderer().draw(e,n);return void e.restore()}if(e.save(),o=this.chart.model().crossHairSource().timeAxisView())for(r=0;r<o.length;r++)o[r].renderer().draw(e,n);e.restore()},o.prototype.hardResetCanvas=function(){this.size&&(p(this.canvas,this.size),p(this.top_canvas,this.size))},n.prototype.paint=function(e){if(0!==e)if(e===h.UPDATE_CURSOR_ONLY)this.drawCrossHairLabel(this.top_ctx);else{var t=this.ctx;this.drawBackground(t),this.drawBorder(t),this.drawStubs(),this.chart.model()&&(this.drawTickMarks(t),this.drawBackLabels(t),this.drawCrossHairLabel(this.top_ctx))}},n.prototype.setStubVisible=function(e,t){var i=o.isLeft(e)?this.jqLhsTimeAxisStub:this.jqRhsTimeAxisStub;t?i.css("display","table-cell"):i.css("display","none")},n.prototype.restoreDefaultCursor=function(){this.setCursor("")},n.prototype.setCursor=function(e){var t="";"grabbing"!==e&&"ew-resize"!==e||(t="time-axis--cursor-"+e),this._currentCursorClassName!==t&&(this._currentCursorClassName&&this.jqCell.removeClass(this._currentCursorClassName),t&&this.jqCell.addClass(t),this._currentCursorClassName=t,this.jqCell.css("cursor"))},n.prototype.image=function(){var e={};return e.content=this.canvas.toDataURL(),e.contentWidth=this.size.w,e.contentHeight=this.size.h,e.lhsStub={},e.lhsStub.content=this.lhsCanvas.toDataURL(),e.lhsStub.contentWidth=this.lhsStubSize.w,e.lhsStub.contentHeight=this.lhsStubSize.h,e.rhsStub={},e.rhsStub.content=this.rhsCanvas.toDataURL(),e.rhsStub.contentWidth=this.rhsStubSize.w,e.rhsStub.contentHeight=this.rhsStubSize.h,e},t.TimeAxisWidget=n}).call(t,i(5))},function(e,t){},function(e,t,i){"use strict";function n(e,t){i.e(13).then(function(n){i(359).showSymbolInfoDialog(e,t)}.bind(null,i)).catch(i.oe)}Object.defineProperty(t,"__esModule",{value:!0}),t.showSymbolInfoDialog=n},function(e,t,i){"use strict";var n,o,r,s,a,l,c,h,u,d,p,_;Object.defineProperty(t,"__esModule",{value:!0
}),n=i(1),o=i(8),r=i.n(o),s=i(7),a=i(16),l=i.n(a),c=i(33),h=i(4),u=Object(h.getLogger)("ChartApi.AbstractSession"),d="",p=function(){function e(e,t,i){this._isConnected=new l.a(!1),this._state=0,this._isConnectForbidden=!1,this._sessionId=d,this._sessionIdChanged=new r.a,this._chartApi=e,this._sessionPrefix=t,this._shouldReconnectAfterCriticalError=i}return e.prototype.destroy=function(){this._logNormal("Destroying session"),this._isConnected.unsubscribe(),this.disconnect(),this._sessionIdChanged.destroy(),delete this._chartApi,this._logNormal("Session has been destroyed")},e.prototype.isConnected=function(){return this._isConnected},e.prototype.sessionId=function(){return this._sessionId},e.prototype.onSessionIdChanged=function(){return this._sessionIdChanged},e.prototype.connect=function(){0===this._state&&(Object(s.assert)(!this._isConnectForbidden,"Cannot call connect because it is forbidden at this moment"),this._setSessionId(this._sessionPrefix+"_"+Object(c.randomHash)()),this._logNormal("Connecting session - wait until transport stay connected"),this._state=1,this._chartApi.createSession(this._sessionId,this))},e.prototype.disconnect=function(){var e=this;0!==this._state&&(Object(s.assert)(this._sessionId!==d,"sessionId must not be invalid"),this._logNormal("Disconnecting session..."),this._forbidConnectWhile(function(){e._chartApi.connected()&&e._sendRemoveSession(),e._processDestroyingOnServer()}))},e.prototype.onMessage=function(e){var t,i;switch(e.method){case"connected":return void this._onChartApiConnected();case"disconnected":return void this._onChartApiDisconnected();case"critical_error":return t=e.params[0]+"",i=e.params[1]+"",void this._onCriticalError(t,i)}this._onMessage(e)},e.prototype._getChartApi=function(){return this._chartApi},e.prototype._generateLogMessage=function(e){return"["+this._sessionId+"] "+e},e.prototype._onCriticalError=function(e,t){var i=this;this._logError("Critical error. Reason="+e+", info="+t+"."),this._forbidConnectWhile(function(){i._processDestroyingOnServer()}),this._shouldReconnectAfterCriticalError?(this._logNormal("Reconnecting after critical error..."),this.connect()):this._logNormal("Reconnecting after critical error skipped")},e.prototype._onChartApiConnected=function(){Object(s.assert)(1===this._state,"Session is not registered"),this._logNormal("Transport is connected. Creating session on the server"),this._sendCreateSession(),this._state=2,this._isConnected.setValue(!0)},e.prototype._onChartApiDisconnected=function(){var e=this;this._logNormal("Transport is disconnected. Reconnecting..."),this._forbidConnectWhile(function(){e._processDestroyingOnServer()}),this.connect()},e.prototype._setSessionId=function(e){var t=this._sessionId;this._logNormal("Changing sessionId: old="+t+", new="+e),this._sessionId=e,this._sessionIdChanged.fire(e,t)},e.prototype._logNormal=function(e){u.logNormal(this._generateLogMessage(e))},e.prototype._logError=function(e){u.logError(this._generateLogMessage(e))},e.prototype._processDestroyingOnServer=function(){this._state=0,
this._isConnected.setValue(!1),this._chartApi.removeSession(this._sessionId),this._setSessionId(d)},e.prototype._forbidConnectWhile=function(e){this._isConnectForbidden=!0,e(),this._isConnectForbidden=!1},e}(),i.d(t,"ChartSession",function(){return _}),Object(h.getLogger)("ChartSession"),_=function(e){function t(t,i){void 0===i&&(i=!1);var n=e.call(this,t,"cs",!1)||this;return n._sessionDisabled=!1,n._handler=null,n._criticalError=new r.a,n._disableStatistics=i,n}return n.c(t,e),t.prototype.destroy=function(){this._criticalError.destroy(),this._handler=null,e.prototype.destroy.call(this)},t.prototype.serverTimeOffset=function(){return this._getChartApi().serverTimeOffset()},t.prototype.switchTimezone=function(e){return this._getChartApi().switchTimezone(this.sessionId(),e)},t.prototype.resolveSymbol=function(e,t,i){return this._getChartApi().resolveSymbol(this.sessionId(),e,t,i)},t.prototype.requestFirstBarTime=function(e,t,i){return this._getChartApi().requestFirstBarTime(this.sessionId(),e,t,i)},t.prototype.createSeries=function(e,t,i,n,o,r){return this._getChartApi().createSeries(this.sessionId(),e,t,i,n,o,r)},t.prototype.modifySeries=function(e,t,i,n,o){return this._getChartApi().modifySeries(this.sessionId(),e,t,i,n,o)},t.prototype.removeSeries=function(e,t){return!!this.isConnected().value()&&this._getChartApi().removeSeries(this.sessionId(),e,t)},t.prototype.requestMoreData=function(e,t,i){return this._getChartApi().requestMoreData(this.sessionId(),e,t,i)},t.prototype.requestMoreTickmarks=function(e,t,i){return this._getChartApi().requestMoreTickmarks(this.sessionId(),e,t,i)},t.prototype.requestMetadata=function(e,t){var i=this,n=function(){return i._getChartApi().requestMetadata(i.sessionId(),e,t)};n()},t.prototype.isCanCreateStudy=function(e){return this._getChartApi().isCanCreateStudy(e)},t.prototype.createStudy=function(e,t,i,n,o,r,s){return this._getChartApi().createStudy(this.sessionId(),e,t,i,n,o,r,s)},t.prototype.rebindStudy=function(e,t,i,n,o,r,s){return this._getChartApi().rebindStudy(this.sessionId(),e,t,i,n,o,r,s)},t.prototype.modifyStudy=function(e,t,i,n){return this._getChartApi().modifyStudy(this.sessionId(),e,t,i,n)},t.prototype.removeStudy=function(e,t,i){return this._getChartApi().removeStudy(this.sessionId(),e,t,i)},t.prototype.createPointset=function(e,t,i,n,o,r){return this._getChartApi().createPointset(this.sessionId(),e,t,i,n,o,r)},t.prototype.modifyPointset=function(e,t,i,n){return this._getChartApi().modifyPointset(this.sessionId(),e,t,i,n)},t.prototype.removePointset=function(e){return this._getChartApi().removePointset(this.sessionId(),e)},t.prototype.setVisibleTimeRange=function(e,t,i,n){this._getChartApi().setVisibleTimeRange(e,this.sessionId(),t,i,n)},t.prototype.criticalError=function(){return this._criticalError},t.prototype.connect=function(t){void 0===t&&(t=null),null!==t&&(this._handler=t),e.prototype.connect.call(this)},t.prototype.setHandler=function(e){this._handler=e},t.prototype.connected=function(){return this.isConnected().value()&&!this._sessionDisabled},
t.prototype.disable=function(){this._sessionDisabled=!0},t.prototype.chartApi=function(){return this._getChartApi()},t.prototype._sendCreateSession=function(){var e=this;Object.keys(this).forEach(function(t){/^(s|st|symbol_)\d+$/.test(t)&&delete e[t]}),this._getChartApi().chartCreateSession(this.sessionId(),this._disableStatistics)},t.prototype._sendRemoveSession=function(){this._getChartApi().chartDeleteSession(this.sessionId())},t.prototype._onMessage=function(e){this._handler&&this._handler(e)},t.prototype._onCriticalError=function(t,i){this._criticalError.fire(t,i),e.prototype._onCriticalError.call(this,t,i)},t}(p)},function(e,t,i){"use strict";var n,o,r,s,a,l,c;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"MarketStatusIndicator",function(){return c}),n=i(1),i(11),o=i(654),i.n(o),r=i(295),s={invalid:"tv-market-status--invalid",market:"tv-market-status--market",out_of_session:"tv-market-status--out-of-session",post_market:"tv-market-status--post-market",pre_market:"tv-market-status--pre-market",loading:"tv-market-status--loading",holiday:"tv-market-status--holiday",replay:"tv-market-status--replay"},a={invalid:$.t("Invalid Symbol"),market:$.t("Market Open"),out_of_session:$.t("Market Closed"),post_market:$.t("Post Market"),pre_market:$.t("Pre Market"),loading:$.t("Loading"),holiday:$.t("Holiday"),replay:""},l={classMap:s,classSuffix:"",data:{},extraTitle:"",labelMap:a,short:!1,showTooltip:!0,tooltipType:"custom"},c=function(e){function t(t){var i=e.call(this,t)||this;return i._quoteSessionPrefix="market-status-indicator",i._componentClass="tv-market-status",i._extraTitle="",i._init(t),i}return n.c(t,e),t.prototype.setStatus=function(e,t){var i={values:{current_session:e}};this.update(i,t)},t.prototype.getTooltipText=function(){var t=e.prototype.getTooltipText.call(this);return""===t?t:(""!==this._extraTitle&&(t=t+", "+this._extraTitle),t)},t.prototype.setExtraTitle=function(e){this._extraTitle=e},t.prototype.reset=function(){this._clearClasses(),this._labelEl.textContent="",this._extraTitle="",this._el.setAttribute("title",""),this._value=""},t.prototype.enableShortMode=function(t){void 0===t&&(t=!0),void 0!==this._labelEl&&this._labelEl.classList.add("i-hidden"),e.prototype.enableShortMode.call(this)},t.prototype.disableShortMode=function(){void 0!==this._labelEl&&this._labelEl.classList.remove("i-hidden"),e.prototype.disableShortMode.call(this)},t.prototype._renderLabel=function(){this._labelEl.textContent=this.getLabel()},t.prototype._getValueFromData=function(e){return void 0!==e.values&&void 0!==e.values.current_session?e.values.current_session:this.getValue()},t.prototype._render=function(){this._renderLabelElement(),this._renderDotElement(),e.prototype._render.call(this)},t.prototype._init=function(t){var i=Object.assign({},l,t);e.prototype._init.call(this,i),this.setExtraTitle(i.extraTitle),this._render()},t.prototype._renderLabelElement=function(){void 0===this._labelEl&&(this._labelEl=document.createElement("span"),this._labelEl.classList.add(this._componentClass+"__label"),
this._labelEl.classList.add(this._componentClass+"__label"+this._classSuffix),this._el.appendChild(this._labelEl))},t.prototype._renderDotElement=function(){void 0===this._dotEl&&(this._dotEl=document.createElement("span"),this._dotEl.classList.add(this._componentClass+"__dot"),this._dotEl.classList.add(this._componentClass+"__dot"+this._classSuffix),this._el.appendChild(this._dotEl))},t}(r.a)},function(e,t){},function(e,t,i){"use strict";var n,o,r,s,a,l,c,h,u,d;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"DataModeIndicator",function(){return d}),n=i(1),i(11),i(86),o=i(656),i.n(o),r=i(295),s={connecting:"tv-data-mode--connecting",delayed:"tv-data-mode--delayed",delayed_streaming:"tv-data-mode--delayed",endofday:"tv-data-mode--endofday",forbidden:"tv-data-mode--forbidden",realtime:"tv-data-mode--realtime",snapshot:"tv-data-mode--snapshot",loading:"tv-data-mode--loading",replay:"tv-data-mode--replay"},a={connecting:$.t("Connecting"),delayed:$.t("Delayed"),delayed_streaming:$.t("Delayed"),endofday:$.t("End of Day"),forbidden:$.t("Instrument is not allowed"),realtime:$.t("Real-time"),snapshot:$.t("Snapshot"),loading:"",replay:$.t("Replay Mode")},l={connecting:$.t("C",{context:"data_mode_connecting_letter"}),delayed:$.t("D",{context:"data_mode_delayed_letter"}),delayed_streaming:$.t("D",{context:"data_mode_delayed_streaming_letter"}),endofday:$.t("E",{context:"data_mode_end_of_day_letter"}),forbidden:$.t("F",{context:"data_mode_forbidden_letter"}),realtime:$.t("R",{context:"data_mode_realtime_letter"}),snapshot:$.t("S",{context:"data_mode_snapshot_letter"}),loading:"",replay:$.t("R",{context:"data_mode_replay_letter"})},c=600,h={streaming:"realtime"},u={classMap:s,classSuffix:"",data:{values:{update_mode:"connecting"}},labelMap:a,modeInterval:c,short:!1,shortLabelMap:l,showTooltip:!0,tooltipType:"custom"},d=function(e){function t(t){var i=e.call(this,t)||this;return i._quoteSessionPrefix="data-mode-indicator",i._componentClass="tv-data-mode",i._init(t),i}return n.c(t,e),t.prototype.getLabel=function(){return!0===this._shortMode?this._shortLabelMap[this._value]||"":e.prototype.getLabel.call(this)},t.prototype.setMode=function(e,t){this.update({values:{update_mode:e,update_mode_seconds:t}})},t.prototype.hide=function(){this._el.classList.add("i-hidden")},t.prototype.show=function(){this._el.classList.remove("i-hidden")},t.prototype.getTooltipText=function(){var e="",t=this.getValue();if(""===t)return e;switch(t){case"delayed":e=$.t("Quotes are delayed by {0} min and updated every 30 seconds");break;case"delayed_streaming":e=$.t("Quotes are delayed by {0} min");break;default:e=this._labelMap[t]||e}return["delayed","delayed_streaming"].includes(t)&&(e=e.format(Math.round(this._modeInterval/60))),e},t.prototype._init=function(t){void 0===t&&(t={});var i=Object.assign({},u,t);this._modeInterval=i.modeInterval||c,this._shortLabelMap=i.shortLabelMap||l,e.prototype._init.call(this,i),this._render()},t.prototype._getValueFromData=function(e){var t
;return t=void 0!==e.values&&void 0!==e.values.update_mode?e.values.update_mode:this.getValue(),h[t]||t},t.prototype._updateValue=function(t,i){void 0!==t.values&&void 0!==t.values.update_mode_seconds&&(this._modeInterval=t.values.update_mode_seconds),e.prototype._updateValue.call(this,t,i)},t}(r.a)},function(e,t){},function(e,t,i){"use strict";var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"StudyMetaInfoRepository",function(){return s}),i(11),n=i(26),o=i.n(n),r=i(4),Object(r.getLogger)("Chart.Studies.StudyMetaInfoRepository",{color:"#606"}),s=function(){function e(e){this._nextRequestNumber=1,this._rawStudiesMetaInfo=[],this._metaInfoReceived=!1,this._onRawMetaReceivedDfd=null,this._tvScriptsRequestDfd=null,this._isReady=!1,this._metaInfoQueryQueue=[],this._studiesMetaInfo=[],this._studiesMigrations=[],this._studyScriptingPkgVers=null,this._gateway=e}return e.prototype.getStudyScriptingPkgVers=function(){return this._studyScriptingPkgVers},e.prototype.requestMetaInfo=function(){var e=this;return this._requestStarted(),new Promise(function(t){e._gateway.requestMetadata(e._makeNextRequestId(),function(i){var n=i.params[1].metainfo.slice();e._processLibraryMetaInfo(n),e._requestFinished(),t()})})},e.prototype.requestAlertsMetaInfo=function(){throw Error("not supported")},e.prototype.findById=function(e){if(this._isReady){var t=this._findStudyMetaInfo(e);if(!t)throw new ReferenceError("unexpected study id:"+e);return Promise.resolve(t)}return this._enqueueMetaInfoQuery(e)},e.prototype.isReady=function(){return this._isReady},e.prototype.getInternalMetaInfoArray=function(){return this._studiesMetaInfo},e.prototype.getMigrations=function(){return this._studiesMigrations},e.prototype._processMigrations=function(e){throw Error("not implemented")},e.prototype._addPineMetaInfo=function(e){throw Error("not implemented")},e.prototype._processSiteMetaInfo=function(e,t){throw Error("not implemented")},e.prototype._processLibraryMetaInfo=function(t){for(var i=0;i<t.length;++i)o.a.addOrReplaceStudyMetaInfo(this._studiesMetaInfo,e._applyLocalizationToMetadata(t[i]));this._studiesMetaInfo=this._studiesMetaInfo.sort(function(e,t){var i=e.description_localized||e.description,n=t.description_localized||t.description;return i>n?1:i<n?-1:0}),o.a.overrideDefaults(this._studiesMetaInfo)},e.prototype._requestStarted=function(){this._isReady=!1,this._studiesMetaInfo=[],this._studiesMigrations=[],this._studyScriptingPkgVers=null,this._tvScriptsRequestDfd=null,this._rawStudiesMetaInfo=[],this._metaInfoReceived=!1},e.prototype._requestFinished=function(){this._isReady=!0,this._processPendingMetaInfoQueries()},e.prototype._enqueueMetaInfoQuery=function(e){var t=this;return new Promise(function(i){t._metaInfoQueryQueue.push({studyId:e,resolver:i})})},e.prototype._processPendingMetaInfoQueries=function(){for(var e,t;this._metaInfoQueryQueue.length;){if(e=this._metaInfoQueryQueue.shift(),null===(t=this._findStudyMetaInfo(e.studyId)))throw new ReferenceError("unexpected study id:"+e.studyId);e.resolver(t)}},
e.prototype._findStudyMetaInfo=function(e){for(var t=0;t<this._studiesMetaInfo.length;t+=1)if(this._studiesMetaInfo[t].id===e)return this._studiesMetaInfo[t];return null},e.prototype._makeNextRequestId=function(){return"metadata_"+this._nextRequestNumber++},e._applyLocalizationToMetadata=function(e){return e.description_localized=window.t(e.description,{context:"study"}),e},e}()},function(e,t,i){"use strict";function n(){}function o(e){r(e),s(e)}var r,s;Object.defineProperty(t,"__esModule",{value:!0}),t.addPerfMark=o,r=console.timeStamp?console.timeStamp.bind(console):n,s=window.performance&&performance.mark?performance.mark.bind(performance):n},function(e,t,i){"use strict";function n(){function e(){return b}function t(e){return g&&i(),g=new r.UndoMacroCommand(e)}function i(){if(g){var e=g;g=null,e.isEmpty()||a(e)}}function n(){if(v.isEmpty())return!1;var e=v.pop();return!!e&&(e.undo(),S.push(e),d.logNormal("UNDO: "+e.text()),b.fire(y()),!0)}function s(){if(S.isEmpty())return!1;var e=S.pop();return!!e&&(e.redo(),v.push(e),d.logNormal("REDO: "+e.text()),b.fire(y()),!0)}function a(e){var t,i,n;g?g.addCommand(e):(S.clear(),t=v.head(),i=t&&t.text(),v.push(e),""!==(n=e.text())&&n!==i&&d.logNormal("DO: "+n)),e.executeOnPush()&&e.redo(),g||b.fire(y())}function c(){return{lastActualCommand:v.isEmpty()?null:v.head()}}function h(e){for(;!v.isEmpty()&&e.lastActualCommand!==v.head();)v.pop().undo();S.clear(),b.fire(y())}function p(){return v}function _(){return S}function f(){v.clear(),S.clear(),b.fire(y())}function m(e,t,i){if(e.value()!==t){var n=new l(e,t,i);a(n),n.redo()}}function y(){var e=v.head(),t=S.head();return{enableUndo:!v.isEmpty(),undoText:void 0===e?void 0:e.text(),enableRedo:!S.isEmpty(),redoText:void 0===t?void 0:t.text()}}var g=null,v=new o.UndoStack,S=new o.UndoStack,b=new u.a;return{beginUndoMacro:t,clearStack:f,createUndoCheckpoint:c,endUndoMacro:i,pushUndoCommand:a,redo:s,redoStack:_,setWatchedValue:m,undo:n,undoStack:p,undoToCheckpoint:h,state:y,onChange:e}}var o,r,s,a,l,c,h,u,d;Object.defineProperty(t,"__esModule",{value:!0}),o=i(293),r=i(258),s=i(1),a=i(43),l=function(e){function t(t,i,n){var o=e.call(this,n)||this;return o._wv=t,o._newValue=i,o._oldValue=t.value(),o}return s.c(t,e),t.prototype.redo=function(){this._wv.setValue(this._newValue)},t.prototype.undo=function(){this._wv.setValue(this._oldValue)},t}(a.UndoCommand),c=i(4),h=i(8),u=i.n(h),t.createUndoHistory=n,d=Object(c.getLogger)("Common.UndoHistory")},function(e,t,i){"use strict";function n(e,t,n){void 0===t&&(t={}),i.e(4).then(function(o){i(137).getImageOfChart(e,t,n)}.bind(null,i)).catch(i.oe)}function o(e,t,n){void 0===t&&(t={}),i.e(4).then(function(o){i(137).getImageOfChartSilently(e,t,n)}.bind(null,i)).catch(i.oe)}Object.defineProperty(t,"__esModule",{value:!0}),t.getImageOfChart=n,t.getImageOfChartSilently=o},function(e,t,i){"use strict";var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"SetChartLayoutCommand",function(){return s}),n=i(1),o=i(43),r=i(109),s=function(e){function t(t,i){
var n=this,o="Change Chart Layout to "+r.layouts[i].title;return n=e.call(this,o)||this,n._chartWidgetCollection=t,n._newLayoutType=i,n._oldLayoutType=t.layout.value(),n}return n.c(t,e),t.prototype.redo=function(){this._chartWidgetCollection.layout.setValue(this._newLayoutType)},t.prototype.undo=function(){this._chartWidgetCollection.layout.setValue(this._oldLayoutType)},t}(o.UndoCommand)},function(e,t,i){"use strict";function n(e){return new Promise(function(t,i){e.subscribe(null,t,!0)})}Object.defineProperty(t,"__esModule",{value:!0}),t.delegateToPromise=n},function(e,t,i){"use strict";function n(e){r.call(this,e);var t=this;a.hideMarksOnBars().subscribe(this,function(){t._properties.visible.setValue(!a.hideMarksOnBars().value())})}function o(e){s.call(this)}var r=i(88).BarsMarksContainer,s=i(179).BarMarkTooltip,a=i(32);inherit(n,r),n.prototype._initialize=function(e){this._properties.visible.setValue(!0)},n.prototype.userEditEnabled=function(){return!1},n.prototype._constructor="UserDefinedBarsMarks",n.prototype._plateViewData=function(e){var t={text:e.text};return"object"==typeof e.color&&(t.theme="user_defined_theme",t.overridedTheme={},t.overridedTheme.border=e.color.border,t.overridedTheme.background=e.color.background),t},n.prototype.onClicked=function(){var e=this._model.lastHittestData().id;this._marks[e].onClicked()},n.prototype.clearMarks=function(){r.prototype.clearMarks.call(this),this.onNeedRepaint.fire()},n.prototype._getData=function(e){var t,i,n,o=this._model.mainSeries().symbolInfo();o&&(t=this.roundRange(this._rangeDifference(e)),i=this,n=this._model.mainSeries().properties().interval.value(),ChartApiInstance.getMarks(o,t.start,t.end,function(t){t.forEach(function(e){i._marks[e.id]=e},i),i._loadedRange=i._rangeUnion(e,i._loadedRange),i.onNeedRepaint.fire()},n))},n.prototype._createTooltip=function(){return new o},n.prototype.updatePlateData=function(e,t){return t.barWidth=this.barWidth(),t.text=e.text,t.tooltipMargin=-1*Math.max(e.minSize/2,.4*this.barWidth()),t},n.prototype.hasContextMenu=function(){return!1},inherit(o,s),o.prototype._createLayout=function(){this._layout=$('<div class="bar-mark-tooltip"></div>'),this._layout_text=$('<div class="text"></div>').appendTo(this._layout)},o.prototype._updatePlate=function(e){this._currentId=e.id,this._layout.css("border-color",e.theme.border),this._layout.css("margin-top",e.tooltipMargin+"px"),this._layout_text.html(e.text),this._layout.append(this._layout_text)},e.exports=n},function(e,t,i){"use strict";function n(e){a.call(this,e);var t=this;l.hideMarksOnBars().subscribe(this,function(){t._properties.visible.setValue(!l.hideMarksOnBars().value())}),this._paneView=new o(this)}function o(e,t){this.source=e,this._rendererFactory=t,this.stylesCache={},this.templatesCache={},this._lollipops={},this._createLollipops()}var r=i(6).Point,s=i(665).ESDPaneView,a=i(88).BarsMarksContainer,l=i(32),c=i(31),h=i(296).Tooltip;inherit(n,a),n.prototype._initialize=function(e){this._properties.visible.setValue(!0)},n.prototype.userEditEnabled=function(){return!1},
n.prototype._constructor="UserDefinedTimescaleMarks",n.prototype._plateViewData=function(e){return{text:e.text}},n.prototype.onClicked=function(){var e=this._model.lastHittestData().id;c.emit("onTimescaleMarkClick",e)},n.prototype.clearMarks=function(){a.prototype.clearMarks.call(this),this._paneView.clearCaches(),this.onNeedRepaint.fire()},n.prototype._getData=function(e){var t,i,n,o=this._model.mainSeries().symbolInfo();o&&(t=this.roundRange(this._rangeDifference(e)),i=this,n=this._model.mainSeries().properties().interval.value(),ChartApiInstance.getTimescaleMarks(o,t.start,t.end,function(t){t.forEach(function(e){i._marks[e.id]=e},i),i._loadedRange=i._rangeUnion(e,i._loadedRange),i.onNeedRepaint.fire()},n))},n.prototype.updatePlateData=function(e,t){return t.barWidth=this.barWidth(),t.text=e.text,t.tooltipMargin=-1*Math.max(e.minSize/2,.4*this.barWidth()),t},n.prototype.hasContextMenu=function(){return!1},n.prototype.paneViews=function(e){return this._properties.visible.value()?[this._paneView]:[]},n.prototype.onClickOutside=function(e){this._paneView.onClickOutside(e)},inherit(o,s),o.prototype._createLollipops=function(){var e=this.source._model.timeScale(),t=s.prototype._getY.call(this.source),i=this.source._model.lastHittestData(),n=this;$.each(this.source._marks,function(o,s){var a=s.id;n._lollipops[a]={id:a,basePoint:new r(e.indexToCoordinate(e.timePointToIndex(s.tickmark))+1,t),hovered:i&&i.id===a||a===n.getLastClickedLollipopId(),barY:null,label:s.label,color:s.color,items:s.tooltip,tooltip:n._lollipops.hasOwnProperty(a)?n._lollipops[a].tooltip:new h,visible:!0}})},o.prototype.clearCaches=function(){this._lollipops={}},o.prototype.update=function(){this._createLollipops()},o.prototype.renderer=function(){return this.update(),s.prototype.renderer.call(this)},o.prototype._generateTemplateStyle=function(e,t,i){var n,o,r=e+t+i;return r in this.stylesCache||(n={strokeStyle:t,lineWidth:1,fillStyle:"white",barLine:{lineStyle:CanvasEx.LINESTYLE_DASHED},lollipop:{width:32,height:96,circleHeight:16,radius:12,lineWidth:1.5,fillStyle:"white",strokeStyle:"#E2745B",text:{label:i,strokeStyle:t,font:"normal 12px Verdana, Arial, sans-serif"}}},o={strokeStyle:t,lollipop:{fillStyle:t,fillCircle:!0,text:{strokeStyle:"white"}}},this.stylesCache[r]="default"===e?n:$.extend(!0,{},n,o)),this.stylesCache[r]},o.prototype.getTemplate=function(e,t){var i=e+t.color+t.label;return i in this.templatesCache||(this.templatesCache[i]=this.createTemplate(this._generateTemplateStyle(e,t.color,t.label))),this.templatesCache[i]},o.prototype.getStyle=function(e,t){return this._generateTemplateStyle(e,t.color,t.label)},o.prototype.createText=function(e,t){"string"==typeof e.items?t.addTextLine(e.items):Array.isArray(e.items)&&e.items.forEach(function(e){t.addTextLine(e)})},o.prototype.hasTooltip=function(e){return!!e.tooltip&&e.tooltip.length},e.exports=n},function(e,t,i){"use strict";function n(e,t){this._lastClickedId=null,this._model=e,this._study=t,this._metaInfo=t.metaInfo(),this._lollipops={},this._textCache={},this.templatesCache={},
this._invalidated=!0,this.templatesCache.hovered=this.createTemplate(this.hoveredStyle),this.templatesCache.default=this.createTemplate(this.defaultStyle),e.properties().paneProperties.background.subscribe(this,this.onPaneBgChange)}function o(e){this.data=e}function r(e){this.data=e,this._hittest=new c(c.CUSTOM,e)}function s(e,t){this._data=e,this._paneView=t,this.textRenderer=new s.TextRenderer(e.style.lollipop.importance)}var a=i(6).Point,l=i(60).pointInCircle,c=i(9).HitTestResult,h=i(69).CompositeRenderer,u=i(296).Tooltip;i(70).PercentageFormatter,i(667).roundToFirstValuable;n.prototype.onPaneBgChange=function(){this.defaultStyle.lollipop.fillStyle=this._model.properties().paneProperties.background.value(),this._stylesCache=null,Object.keys(this.templatesCache).forEach(function(e){0===e.indexOf("default")&&(this.templatesCache[e]=null)},this)},n.prototype.onClickOutside=function(){this._lastClickedId=null},n.prototype.closeTooltips=function(){var e,t;for(e in this._lollipops)this._lollipops.hasOwnProperty(e)&&(t=this._lollipops[e],t.visible&&(t.tooltip.isOpened()&&t.tooltip.hide(),t.visible=!1))},n.prototype.getLastClickedLollipopId=function(){return this._lastClickedId},n.prototype._setStackStudies=function(){this._stackStudies=[]},n.prototype._getY=function(){var e,t,i=0,n=this._model.panes();for(e=n.length;e--;)t=n[e],t.containsMainSeries()&&(i+=t.height());return i},n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){var e,t,i,n,o,r,s,a,l,c,h,u;this._setStackStudies(),e=this,t=this._study.data(),i=this._model.timeScale(),n=i.visibleBars(),o=this._model.mainSeries().bars(),r=this._study.priceScale(),s=this._model.mainSeries(),a=s.firstBar(),r&&!r.isEmpty()&&!i.isEmpty()&&a&&t&&(this.closeTooltips(),l=this._getY(),c=n.firstBar(),h=n.lastBar(),u=t.range(c,h),u.each(function(t,n){var s,a=0;for(s=0;s<e._stackStudies.length;++s)e._stackStudies[s].data().contains(t)&&++a;t>c&&t<h&&e.addLollipop(l,o,i,r,t,n,a)}),this.afterUpdate(l,o,i,r))},n.prototype.addLollipop=function(e,t,i,n,o,r,s){var l,c,h,d,p,_,f,m,y=r[0],g=this._model.mainSeries().symbolInfo();g&&(l=g.name,c=null,h=this._study.metaInfo().id+"_"+y+"_"+l,d=this._model.lastHittestData(),p=d&&d.id===h,p&&null!==(_=t.valueAt(o))&&(f=_[TradingView.LOW_PLOT],m=this._model.mainSeries().firstValue(),c=n.priceToCoordinate(f,m)),this._lollipops[h]=$.extend({id:h,visible:!0,basePoint:new a(i.indexToCoordinate(o)+1,e),hovered:p||h===this.getLastClickedLollipopId(),barY:c,stack:s,tooltip:this._lollipops.hasOwnProperty(h)?this._lollipops[h].tooltip:new u},this.extraData(r)))},n.prototype.afterUpdate=function(e,t,i){},n.prototype.extraData=function(e){throw Error("Not Implemented")},n.prototype.createText=function(e,t){throw Error("Not Implemented")},n.prototype.showBarLine=function(){return!0},n.prototype.getStyle=function(e,t){var i,n=e;return t.stack&&(n+="_stack:"+t.stack),"hovered"===n?this.hoveredStyle:"default"===n?this.defaultStyle:(this._stylesCache||(this._stylesCache={}),
this._stylesCache[n]||(i=TradingView.clone("hovered"===e?this.hoveredStyle:this.defaultStyle),t.stack&&(i.lollipop.incHeight=24*t.stack),this._stylesCache[n]=i),this._stylesCache[n])},n.prototype.hasTooltip=function(e){return!0},n.prototype.renderer=function(){var e,t,i,n,l,c,u,d,p;this._invalidated&&(this.updateImpl(),this._invalidated=!1),e=new h;for(t in this._lollipops)this._lollipops.hasOwnProperty(t)&&(i=this._lollipops[t],n=15,l=this.getStyle(i.hovered?"hovered":"default",i),i.visible&&(c=$.extend({tooltipPoint:new a(i.basePoint.x,i.basePoint.y-l.lollipop.circleHeight-n-(l.lollipop.incHeight||0)),style:l,createText:this.createText.bind(this)},i),u=this.getTemplate(i.hovered?"hovered":"default",i),d={circlePoint:new a(i.basePoint.x,i.basePoint.y-l.lollipop.circleHeight-(l.lollipop.incHeight||0)),style:l,template:u,basePoint:i.basePoint,id:i.id,mouseClickHandler:this._lollipopMouseClickHandler.bind(this,i.id)},e.append(new r(d)),i.hovered&&this.hasTooltip(i)&&i.barY&&this.showBarLine()&&(p={style:{lineStyle:l.barLine.lineStyle,strokeStyle:l.strokeStyle,lineWidth:l.lineWidth},startPoint:new a(i.basePoint.x,i.basePoint.y-l.lollipop.circleHeight),endPoint:new a(i.basePoint.x,i.barY)},e.append(new o(p))),e.append(new s(c,this))));return e},n.prototype.getTemplate=function(e,t){var i=e;return t.stack&&(i+="_stack:"+t.stack),this.templatesCache[i]||(this.templatesCache[i]=this.createTemplate(this.getStyle(e,t))),this.templatesCache[i]},n.prototype.createTemplate=function(e){var t=document.createElement("canvas"),i=t.getContext("2d"),n=new a(e.lollipop.width/2,e.lollipop.height-e.lollipop.circleHeight-(e.lollipop.incHeight||0));return this.drawCircle(i,e,n),this.drawLabel(i,e,n),t},n.prototype.drawCircle=function(e,t,i){e.strokeStyle=t.strokeStyle,e.fillStyle=t.lollipop.fillStyle,e.lineWidth=t.lollipop.lineWidth,CanvasEx.setLineStyle(e,CanvasEx.LINESTYLE_SOLID),e.beginPath(),e.arc(i.x,i.y,t.lollipop.radius,0,2*Math.PI,!1),e.closePath(),e.stroke(),t.lollipop.fillCircle&&e.fill()},n.prototype.drawLabel=function(e,t,i){e.textAlign="center",e.textBaseline="middle",e.fillStyle=t.lollipop.text.strokeStyle,e.font=t.lollipop.text.font,e.fillText(t.lollipop.text.label,i.x,i.y)},n.prototype._lollipopMouseClickHandler=function(e){this._lastClickedId=this._lastClickedId===e?null:e},o.prototype.draw=function(e){e.strokeStyle=this.data.style.strokeStyle,e.lineWidth=this.data.style.lineWidth,CanvasEx.setLineStyle(e,this.data.style.lineStyle),CanvasEx.drawLine(e,this.data.startPoint.x,this.data.startPoint.y,this.data.endPoint.x,this.data.endPoint.y)},o.prototype.hitTest=function(e){return null},r.prototype.hitTest=function(e){return l(e,this.data.circlePoint,this.data.style.lollipop.radius)?this._hittest:null},r.prototype.draw=function(e){var t=this.data.template;e.drawImage(t,this.data.basePoint.x-(.5+this.data.style.lollipop.width/2<<0)+.5,this.data.basePoint.y-this.data.style.lollipop.height+.5)},s.prototype.draw=function(e){this._data.createText(this._data,this.textRenderer),
this._paneView.getLastClickedLollipopId()===this._data.id?this._data.tooltip.show({items:[this.textRenderer],x:this._data.basePoint.x,y:this._data.basePoint.y-this._data.style.lollipop.circleHeight-10-2*this._data.style.lollipop.radius*(this._data.stack?this._data.stack:0),wrapElement:e.canvas.parentNode,leftBorderColor:this._data.color}):this._data.tooltip.hide()},s.prototype.hitTest=function(e){return null},s.TextRenderer=function(e){this.lines=[],this.fontHeight=12,this.font=this.fontHeight+"px Arial, sans-serif",this.lineSpacing=8,this.fillStyle="black",e&&(this.importance=e)},s.TextRenderer.prototype.draw=function(e,t){var i,n,o=t.y;for(i=0;i<this.lines.length;i++)n=this.lines[i],e.font=this.font,n.options.fontWeight&&(e.font=n.options.fontWeight+" "+this.font),e.fillStyle=this.fillStyle,n.renderer(e,n.line,{x:t.x,y:o}),o+=this.lineSpacing+this.fontHeight},s.TextRenderer.prototype.measure=function(){return this.lines.length*(this.fontHeight+this.lineSpacing)-this.lineSpacing},s.TextRenderer.prototype.basicRenderer=function(e,t,i){e.fillText(t,i.x,i.y)},s.TextRenderer.prototype.addMulticolorTextLine=function(e,t){this.addTextLine(e,t,this.multicolorRenderer)},s.TextRenderer.prototype.addTextLine=function(e,t,i){i||(i=this.basicRenderer),t||(t={}),this.lines.push({line:e,renderer:i,options:t})},s.TextRenderer.prototype.multicolorRenderer=function(e,t,i){var n,o,r=i.x;for(n=0;n<t.length;++n)o=t[n],e.fillStyle=o.color,e.fillText(o.text,r,i.y),r+=e.measureText(o.text).width},t.ESDPaneView=n},function(e,t){},function(e,t,i){"use strict";function n(e){var t,i=""+e,n=i.split(".")[1],o=2;return n&&(t=n.match(/^([0]+)/))&&(o=t[1].length+1),parseFloat(i).toFixed(o)}Object.defineProperty(t,"__esModule",{value:!0}),t.roundToFirstValuable=n},function(e,t,i){"use strict";var n=i(72).TimePointIndexSearchMode,o=i(37),r=i(25),s=i(670),a=i(297),l=i(268),c=l.ChartApiInterface,h=l.HandlerInfo,u=i(12).requireFullInterfaceImplementation,d=i(4).getLogger("Chart.ChartApiLocal");TradingView.STUDY_COUNT_LIMIT=210,JSServer.ChartApi=function(e){this._notificationHandlers={},this._sessions={},this.studyCounter=0,this._connected=!1,this._enabled=!1,this._studyEngine=new s(e),this._callbacks={},this._symbolIdCache={},this._seriesIdCache={},this._recentSeriesId={},this._enableLogging=!1,this._enabledMoreBarsRequest=!0,this._serverTimeOffset=0;var t=this;this._studyEngine.on("configuration_received",function(){t._fireEvent("configuration_received")}),this._studyEngine.on("realtime_tick",function(e){var i={time:e.value[0]/1e3,open:e.value[1],high:e.value[2],low:e.value[3],close:e.value[4],volume:e.value[5]};t._fireEvent("realtime_tick",i,!0)}),this._setVisibleRangeTimeout=null},JSServer.ChartApi.prototype._makeSymbolKey=function(e,t){if(!e||!t)throw Error("incorrect identifiers");return e+"_"+t},JSServer.ChartApi.prototype._makeSeriesKey=function(e,t){if(!e||!t)throw Error("incorrect identifiers");return e+"_"+t},JSServer.ChartApi.prototype.destroy=function(){this._studyEngine.destroy(),this._studyEngine=null},
JSServer.ChartApi.prototype.purgeCache=function(e){this._symbolIdCache={},this._studyEngine.purgeCache(),this._studyEngine.purgeRangeExtensionData(),this._studyEngine.purgeDataCache()},JSServer.ChartApi.prototype.setAdditionalBarsRequestEnabled=function(e){this._enabledMoreBarsRequest=e},JSServer.ChartApi.prototype.defaultWatchlistSymbols=function(){return this._watchlistSettings.default_symbols},JSServer.ChartApi.prototype.defaultResolutions=function(){return this._studyEngine.supportedResolutions()||["1","3","5","15","30","45","60","120","180","240","D","W","M"]},JSServer.ChartApi.prototype.supportedSymbolsTypes=function(){return this._studyEngine.supportedSymbolsTypes()},JSServer.ChartApi.prototype.supportedExchangesList=function(){return this._studyEngine.supportedExchangesList()},JSServer.ChartApi.prototype.futuresRegex=function(){return this._studyEngine.futuresRegex()},JSServer.ChartApi.prototype.start=function(){this._enabled=!0,this._fireEvent("start_enabled")},JSServer.ChartApi.prototype._logMessage=function(e){this._enableLogging&&console.log(e)},JSServer.ChartApi.prototype.unsubscribe=function(e,t){var i=this._callbacks[e];i&&i.splice(i.indexOf(t),1)},JSServer.ChartApi.prototype.on=function(e,t){return this._callbacks.hasOwnProperty(e)||(this._callbacks[e]=[]),this._callbacks[e].push(t),this},JSServer.ChartApi.prototype._fireEvent=function(e,t,i){var n,o;if(this._callbacks.hasOwnProperty(e))for(n=this._callbacks[e].slice(0),i||(this._callbacks[e]=[]),o=0;o<n.length;++o)n[o](t)},JSServer.ChartApi.prototype.chartCreateSession=function(e,t){},JSServer.ChartApi.prototype.chartDeleteSession=function(e){},JSServer.ChartApi.prototype.createSession=function(e,t){TradingView.ChartapiMessagerInstances[e]=new a(this,e),this._sessions[e]=t,this._notificationHandlers[e]={},this.connected()&&t.onMessage({method:"connected",params:[]})},JSServer.ChartApi.prototype.removeSession=function(e){delete this._sessions[e],delete this._notificationHandlers[e],this._studyEngine.stopSources(e)},JSServer.ChartApi.prototype.connected=function(){return this._connected},JSServer.ChartApi.prototype.connect=function(){if(!this._enabled){var e=this;return void this.on("start_enabled",function(){e.connect()})}this.connected()||(this._connected=!0,this.sessionid="dummy session id",this._notifySessions({method:"connected",params:[]}))},JSServer.ChartApi.prototype.disconnect=function(){this._connected=!1,this._notifySessions({method:"disconnected",params:[]})},JSServer.ChartApi.prototype.switchTimezone=function(e,t){if(TradingView.ChartapiMessagerInstances[e].timezone()!==t&&(TradingView.ChartapiMessagerInstances[e].setTimezone(t),this._recentSeriesId[e])){var i=this;this._doWhenSeriesSymbolIdIsReady(e,this._recentSeriesId[e],function(t){var n=i._seriesIdCache[i._makeSeriesKey(e,i._recentSeriesId[e])].resolution;i._studyEngine.recreateSources(t.name,n,e,!0),i._doWhenSeriesDataReceived(e,function(){
var n=i._seriesIdCache[i._makeSeriesKey(e,i._recentSeriesId[e])].resolution,o=TradingView.ChartapiMessagerInstances[e].lastBarTime(i._recentSeriesId[e]);o&&i._studyEngine.rebuildExtrapolatedData(e,t.name,n,t.info,1e3*o)})})}},JSServer.ChartApi.prototype.receiveLocalResponse=function(e){this._logMessage("< "+e.method),this._dispathNotification(e),this._fireEvent("message_"+e.method,void 0,!0)},JSServer.ChartApi.prototype.getMarks=function(e,t,i,n,o){this._studyEngine.getMarks(e,t,i,n,o)},JSServer.ChartApi.prototype.getTimescaleMarks=function(e,t,i,n,o){this._studyEngine.getTimescaleMarks(e,t,i,n,o)},JSServer.ChartApi.prototype.resolveSymbol=function(e,t,i,n,o){function r(t,n){Object.keys(s._seriesIdCache).some(function(e){return s._seriesIdCache[e].symbolId===t})&&TradingView.ChartapiMessagerInstances[e].onSeriesClearData(0,""),TradingView.ChartapiMessagerInstances[e].onSymbolError(t,n),s._symbolIdCache[s._makeSymbolKey(e,t)]={name:i,status:"invalid_symbol"},s._fireEvent("resolve_fail",{session:e,symbolId:t},!0),s._fireEvent(s._makeSymbolKey(e,t)+"_resolve_fail")}this._notificationHandlers[e][t]=new h(n,t),this._symbolIdCache[this._makeSymbolKey(e,t)]=null;var s=this;this._studyEngine.resolveSymbol(i,function(n){if(n.errmsg)return void r(t,n.errmsg);s._symbolIdCache[s._makeSymbolKey(e,t)]={name:i,info:n,status:"ok"},s._fireEvent("symbol_resolved",{symbolInfo:n,symbolId:t,session:e},!0),s._fireEvent(s._makeSymbolKey(e,t)+"_resolved",n),TradingView.ChartapiMessagerInstances[e].onSymbolResolved(t,n)},function(e){r(t,e)})},JSServer.ChartApi.prototype._doWhenSymbolIdIsReady=function(e,t,i){function n(){return{name:r._symbolIdCache[r._makeSymbolKey(e,t)].name,info:r._symbolIdCache[r._makeSymbolKey(e,t)].info}}function o(){s&&(i(n()),s=!1,r.unsubscribe(r._makeSymbolKey(e,t)+"_resolved",o),r.unsubscribe(r._makeSymbolKey(e,t)+"_resolve_fail",o))}var r=this,s=!0;this._symbolIdCache[this._makeSymbolKey(e,t)]?o():(this.on(this._makeSymbolKey(e,t)+"_resolved",o),this.on(this._makeSymbolKey(e,t)+"_resolve_fail",o))},JSServer.ChartApi.prototype._doWhenSeriesDataReceived=function(e,t){TradingView.ChartapiMessagerInstances[e].seriesCompleted.subscribe(null,t,!0)},JSServer.ChartApi.prototype._doWhenSeriesSymbolIdIsReady=function(e,t,i,n){function o(){var t=c._symbolIdCache[c._makeSymbolKey(e,h)];return{name:t.name,info:t.info}}function r(){i(o())}function s(){c.unsubscribe("symbol_resolved",l),c.unsubscribe("resolve_fail",a)}function a(t){t.symbolId===h&&t.session===e&&(s(),n&&n())}function l(t){t.symbolId===h&&t.session===e&&(s(),r())}var c=this,h=this._seriesIdCache[e+"_"+t].symbolId;this._symbolIdCache[this._makeSymbolKey(e,h)]?r():(this.on("symbol_resolved",l),this.on("resolve_fail",a))},JSServer.ChartApi.prototype.createSeries=function(e,t,i,n,o,s,a){i=i||"";var l=this;this._notificationHandlers[e][t]=new h(function(s){if("series_completed"===s.method){var c=r.Symbol.parsePeriod(o);c.range&&l._applyRange(e,n,t,i,c.range)}a(s)},t),this._recentSeriesId[e]=t,
TradingView.ChartapiMessagerInstances[e].setResolution(r.Symbol.parsePeriod(o).pureResolution),this._seriesIdCache[e+"_"+t]={symbolId:n,resolution:o,turnaround:i},this._studyEngine.updateSeriesTurnaround(e,t,i),this._doWhenSeriesSymbolIdIsReady(e,t,function(n){l._studyEngine.seriesTurnaround(e,t)===i&&l._studyEngine.createSeries(n.name,o,e,t,i)})},JSServer.ChartApi.prototype.removeSeries=function(e,t,i){this._notificationHandlers[e][t]=new h(i,t),this._studyEngine.removeSeries(e,t)},JSServer.ChartApi.prototype.setVisibleTimeRange=function(e,t,i,o,r){function s(){var s,a;u=e.data(),s=[u.plotValueToTimePointIndex(i,TradingView.TIME_PLOT,n.FromLeft),u.plotValueToTimePointIndex(o,TradingView.TIME_PLOT,n.FromRight)],s[1]<s[0]||(u.valueAt(s[1])[0]<o&&e.syncModel()&&(a=e.syncModel().distance(u.valueAt(s[1])[0],o),a.success&&(s[1]+=a.result)),TradingView.ChartapiMessagerInstances[t].onSeriesTimeframeUpdate(p,_,s[0],s[1],!0),e.requestMoreData(),r&&r())}function a(e,t){e===p&&t===_&&(c.unsubscribe(null,a),h.unsubscribe(null,l),s())}function l(e,t){e===p&&t===_&&c.unsubscribe(null,a)}var c,h,u=e.data(),d=!!u.plotValueToTimePointIndex(i,TradingView.TIME_PLOT,n.FromLeft),p=this._recentSeriesId[t],_=this._seriesIdCache[t+"_"+p].turnaround;if(d)return void s();c=TradingView.ChartapiMessagerInstances[t].seriesCompleted,h=TradingView.ChartapiMessagerInstances[t].seriesError,null!==this._setVisibleRangeTimeout&&clearTimeout(this._setVisibleRangeTimeout),this._setVisibleRangeTimeout=setTimeout(function(){this._setVisibleRangeTimeout=null,c.subscribe(null,a,!0),h.subscribe(null,l,!0),this._studyEngine.ensureExtendedTo(p,t,i)}.bind(this),0)},JSServer.ChartApi.prototype._exactBarsCountOfTimeFrame=function(e,t){var i,n=chartWidget.model().mainSeries().bars(),r=chartWidget.model().mainSeries().symbolInfo().session,s=n._valueAt(n.size()-1)[0],a=o.alignPeriodsBack(r,e.resolution,e.interval,1,1e3*s),l=n.size();for(a/=1e3,i=0,i=0;i<l&&!(n._valueAt(i)[0]>a);++i);return l-i},JSServer.ChartApi.prototype._applyRange=function(e,t,i,n,o){var r,s,a,l=chartWidget.model().mainSeries().bars().size();0!==l&&(r=this._exactBarsCountOfTimeFrame(o,this._symbolIdCache[this._makeSymbolKey(e,t)].info),s=Math.max(0,l-1-r),a=Math.max(s,l-1),TradingView.ChartapiMessagerInstances[e].onSeriesTimeframeUpdate(i,n,s,a))},JSServer.ChartApi.prototype.modifySeries=function(e,t,i,n,o,s,a){var l,c;i=i||"",l=this._seriesIdCache[e+"_"+t]?this._seriesIdCache[e+"_"+t].resolution:void 0,TradingView.ChartapiMessagerInstances[e].setResolution(r.Symbol.parsePeriod(o).pureResolution),c=this,this._notificationHandlers[e][t]=new h(function(a){var h,u;"series_completed"===a.method&&(h=r.Symbol.parsePeriod(l),u=r.Symbol.parsePeriod(o),u.range&&h.range!==u.range&&c._applyRange(e,n,t,i,u.range)),s(a)},t),this._recentSeriesId[e]=t,this._studyEngine.updateSeriesTurnaround(e,t,i),a&&(this._seriesIdCache[this._makeSeriesKey(e,a)]=null),this._seriesIdCache[this._makeSymbolKey(e,t)]={symbolId:n,resolution:o,turnaround:i},this._doWhenSeriesSymbolIdIsReady(e,t,function(t){
c._studyEngine.purgeRangeExtensionData(e),c._studyEngine.recreateSources(t.name,o,e,!0)})},JSServer.ChartApi.prototype.requestMoreData=function(e,t,i,n){if(this._enabledMoreBarsRequest){var o=this;setTimeout(function(){o._notificationHandlers[e][t]=new h(n,t),o._studyEngine.extendSeriesRange(t,e,i)})}},JSServer.ChartApi.prototype.setStudiesAccessController=function(e){this.studiesAccessController=e},JSServer.ChartApi.prototype.setWatchlistSettings=function(e){this._watchlistSettings=e},JSServer.ChartApi.prototype.allStudiesMetadata=function(){return this._studyEngine.studiesMetadata()},JSServer.ChartApi.prototype.requestMetadata=function(e,t,i){this._notificationHandlers[e][t]=new h(i,t);var n=this.studiesAccessController.getEnabledTools();TradingView.ChartapiMessagerInstances[e].onRequestMetadata(t,n)},JSServer.ChartApi.prototype.isCanCreateStudy=function(){return this.studyCounter<TradingView.STUDY_COUNT_LIMIT},JSServer.ChartApi.prototype.createStudy=function(e,t,i,n,o,r,s){var a,l,c;if(!this.isCanCreateStudy())throw Error("Exceeded the limit of studies");a=this,i=i||"",this._notificationHandlers[e][t]=new h(s,t),l=this._seriesIdCache[this._makeSeriesKey(e,n)].symbolId,c=this._seriesIdCache[this._makeSeriesKey(e,n)].resolution,this._doWhenSymbolIdIsReady(e,l,function(n){a._studyEngine.createStudy(n.name,c,e,t,i,o,r),a.studyCounter++})},JSServer.ChartApi.prototype.rebindStudy=function(e,t,i,n,o,r,s,a){throw Error("Not implemented")},JSServer.ChartApi.prototype.removeStudy=function(e,t){this._notificationHandlers[e][t]=null,this._studyEngine.removeStudy(e,t),this.studyCounter--},JSServer.ChartApi.prototype.modifyStudy=function(e,t,i,n,o){var r=this;setTimeout(function(){i=i||"",r._notificationHandlers[e][t]=new h(o,t),r._studyEngine.recomputeStudy(t,n,e,i)},0)},JSServer.ChartApi.prototype.createPointset=function(e,t,i,n,o,r,s){i=i||"",this._notificationHandlers[e][t]=new h(s,t);var a=this;this._doWhenSymbolIdIsReady(e,n,function(i){a._studyEngine.createPointset(e,t,i.info.full_name,i.info,o,r)})},JSServer.ChartApi.prototype.modifyPointset=function(e,t,i,n,o){throw Error("This call is not implemented")},JSServer.ChartApi.prototype.removePointset=function(e,t,i){this._notificationHandlers[e][t]=null,this._studyEngine.removePointset(t)},JSServer.ChartApi.prototype.requestMoreTickmarks=function(e,t,i,n){this._notificationHandlers[e][t]=new h(n,t);var o=this;this._doWhenSeriesSymbolIdIsReady(e,t,function(n){var r=o._seriesIdCache[o._makeSeriesKey(e,t)].resolution;o._studyEngine.onMoreTickmarksRequested(e,n.name,n.info,r,i)})},JSServer.ChartApi.prototype.requestFirstBarTime=function(e,t,i,n){this._notificationHandlers[e][t]=new h(n,t)},JSServer.ChartApi.prototype._invokeHandler=function(e,t){e&&e(t)},JSServer.ChartApi.prototype._sendRequest=function(e,t){throw Error("This method is not implemented")},JSServer.ChartApi.prototype._onMessage=function(e){throw Error("This method is not implemented")},JSServer.ChartApi.prototype._convertTimescaleResponse=function(e){var t,i=e.marks;for(t=0;t<i.length;++t)i[t]={span:i[t][0],
time:i[t][1],index:i[t][2]};return e},JSServer.ChartApi.prototype._dispathNotification=function(e){var t,i,n,o,r,s,a,l,c,h,u=e.params.shift();if(this._notificationHandlers[u])switch(e.method){case"timescale_update":t=e.params[0],i=e.params[1],n=this._convertTimescaleResponse(i),n.clear=0===i.changes.length&&0===i.marks.length,this._sessions[u].onMessage({method:"timescale_update",params:n});for(o in t)r={},r.customId=o,r.plots=t[o].series,t[o].ns&&(r.nonseries=t[o].ns),r.turnaround=t[o].turnaround,s={method:"data_update",params:r},this._invokeNotificationHandler(u,o,s);break;case"tickmark_update":n=this._convertTimescaleResponse(e.params[0]),n.changes=[],this._sessions[u].onMessage({method:"timescale_update",params:n});break;case"data_update":for(o in e.params[0]){a=e.params[0][o],r={},r.customId=o,r.plots=a.series?a.series:a.plots,r.turnaround=a.turnaround,"s"in a&&"ns"in a&&(r.plots=a.s,r.nonseries=a.ns);for(l=0;l<r.plots.length;l++)for(c in r.plots[l].value)1e100===r.plots[l].value[c]&&(r.plots[l].value[c]=void 0);s={method:"data_update",params:r},this._invokeNotificationHandler(u,o,s)}break;case"index_update":for(o in e.params[0])s={method:"index_update",params:e.params[0][o]},this._invokeNotificationHandler(u,o,s);break;case"critical_error":d.logNormal(new Date+" critical_error session:"+this.sessionid+" reason:"+e.params[0]),this._sessions[u].onMessage({method:"critical_error",params:e.params});break;case"quote_symbol_data":case"quote_list_fields":case"depth_symbol_error":case"depth_symbol_success":case"dd":case"dpu":case"depth_bar_last_value":this._sessions[u].onMessage({method:e.method,params:e.params});break;default:h=e.params[0],this._invokeNotificationHandler(u,h,e)}},JSServer.ChartApi.prototype._invokeNotificationHandler=function(e,t,i){if(void 0!==t){var n=this._notificationHandlers[e][t];void 0!==n&&n&&this._invokeHandler(n.handler,i),"series_deleted"!==i.method&&"study_deleted"!==i.method||delete this._notificationHandlers[e][t]}},JSServer.ChartApi.prototype.searchSymbols=function(e,t,i,n,o,r,s,a,l,c){0===e.length&&0===t.length&&0===i.length&&c([]),this._studyEngine.searchSymbols(e,t,i,c)},JSServer.ChartApi.prototype._notifySessions=function(e){var t,i;for(t in this._sessions){if(!this._sessions.hasOwnProperty(t))return;i=this._sessions[t],"function"==typeof i.onMessage&&i.onMessage(e)}},JSServer.ChartApi.prototype.unpack=function(e){throw Error("This method is not implemented")},JSServer.ChartApi.prototype.quoteCreateSession=function(e){return this._studyEngine.quoteCreateSession(e)},JSServer.ChartApi.prototype.quoteDeleteSession=function(e){return this._studyEngine.quoteDeleteSession(e)},JSServer.ChartApi.prototype.quoteSetFields=function(e,t){return this._studyEngine.quoteSetFields(e,t)},JSServer.ChartApi.prototype.quoteAddSymbols=function(e,t){return-1!==t.indexOf(void 0)&&(console.warn("Got undefined in quoteAddSymbols"),t=t.filter(function(e){return!!e})),this._studyEngine.quoteAddSymbols(e,t)},JSServer.ChartApi.prototype.quoteRemoveSymbols=function(e,t){
return this._studyEngine.quoteRemoveSymbols(e,t)},JSServer.ChartApi.prototype.quoteFastSymbols=function(e,t){return this._studyEngine.quoteFastSymbols(e,t)},JSServer.ChartApi.prototype.quoteHibernateAll=function(e){return this._studyEngine.quoteHibernateAll(e)},JSServer.ChartApi.prototype.depthCreateSession=function(e){return this._studyEngine.depthCreateSession(e)},JSServer.ChartApi.prototype.depthDeleteSession=function(e){return this._studyEngine.depthDeleteSession(e)},JSServer.ChartApi.prototype.depthSetSymbol=function(e,t){return this._studyEngine.depthSetSymbol(e,t)},JSServer.ChartApi.prototype.depthClearSymbol=function(e){},JSServer.ChartApi.prototype.depthSetScale=function(e,t){},JSServer.ChartApi.prototype.createStudiesAccessController=function(e,t,i){return new this.StudiesAccessController(this._studyEngine,e&&JSON.parse(e)||{type:"black",tools:[]})},JSServer.ChartApi.prototype.StudiesAccessController=function(e,t){this._studyEngine=e,this._studiesAccess=t},JSServer.ChartApi.prototype.StudiesAccessController.prototype._findTool=function(e){var t,i,n=null;for(t=0;t<this._studiesAccess.tools.length;++t)if(i=this._studiesAccess.tools[t],i.name===e||i===e){n=i;break}return n},JSServer.ChartApi.prototype.StudiesAccessController.prototype.getEnabledTools=function(){return this._studyEngine.studiesMetadata().filter(function(e){var t=this._findTool(e.description);return"black"===this._studiesAccess.type?!t||t.grayed:!!t},this)},JSServer.ChartApi.prototype.StudiesAccessController.prototype.isToolGrayed=function(e){var t=this._findTool(e);return t&&t.grayed},JSServer.ChartApi.prototype.serverTimeOffset=function(){return this._studyEngine.serverTimeOffset()},JSServer.ChartApi.prototype.alignTimePoint=function(e,t,i){return this._studyEngine.alignTimePoint(e,t,i)},JSServer.ChartApi.prototype.disconnectCount=function(){return 0},u(JSServer.ChartApi,"JSServer.ChartApi",c,"ChartApiInterface"),e.exports=JSServer.ChartApi},function(e,t,i){"use strict";var n,o;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"StudyError",function(){return o}),n=i(1),o=function(e){function t(t){var i=e.call(this,t)||this;return i.studyError=!0,i}return n.c(t,e),t}(Error)},function(e,t,i){"use strict";(function(t,n){function o(e){var t=e.findIndex(function(e){return e.index!==_});return 0===t?e:e.slice(t)}function r(e,i){var n=t.get_timezone(i.timezone),o=new b.Session;return o.init(n,i.session),y.Symbol.newBarBuilder(e,o,o)}function s(e){function t(e){console.warn("SymbolInfo validation: "+e)}var i,o;if(e.has_empty_bars&&n.enabled("disable_resolution_rebuild")&&t('both has_empty_bars field and featureset "disable_resolution_rebuild" are enabled and may cause data issues (see #3329)'),(void 0===e.minmov||e.minmov<=0)&&t("minmov must be positive"),(void 0===e.pricescale||e.pricescale<=0)&&t("pricescale must be positive"),void 0!==e.name&&0!==e.name.length||t("name must be non-empty string"),void 0!==e.session&&0!==e.session.length||t("session must be non-empty string"),
void 0===e.timezone||0===e.timezone.length?t("timezone must be non-empty string"):"exchange"!==e.timezone&&p(e.timezone)||"UTC"!==e.timezone&&t('unsupported timezone "{0}"'.format(e.timezone)),void 0!==e.intraday_multipliers)if(i=e.intraday_multipliers,Array.isArray(i))for(o=0;o<i.length;++o)"string"!=typeof i[o]&&t('intraday_multipliers[{0}] = "{1}" must be string (now: {2})'.format(o+1,i[o],typeof i[o]));else t("intraday_multipliers must be array");(e.supported_resolutions||[]).filter(function(e){return!w.isValid(e)}).forEach(function(e){t("supported_resolutions field contains invalid value: "+e)})}function a(e){var t,i;if(e.base_name||(e.base_name=[e.name]),e.legs||(e.legs=[e.name]),e.exchange||(e.exchange=e["exchange-listed"]),e.full_name||(e.full_name=e.symbol||(e.exchange?e.exchange+":"+e.name:e.name)),e.pro_name||(e.pro_name=e.full_name),e.data_status||(e.data_status="streaming"),e.ticker||(e.ticker=e.symbol||e.name),!e.session&&e["session-regular"]&&(e.session=e["session-regular"]),!e.minmov&&e.minmovement&&(e.minmov=e.minmovement),e.supported_resolutions)for(t=0;t<e.supported_resolutions.length;t++)i=w.parse(e.supported_resolutions[t]),i.isValid()&&(e.supported_resolutions[t]=i.value())}function l(e,t){null!=e.graphicsCmds&&null!=e.graphicsCmds.create&&null!=e.graphicsCmds.create.vertlines&&e.graphicsCmds.create.vertlines.forEach(function(e){e.data.forEach(t)})}function c(e,t){var i,n,o=e.length,r=t.length,s=0;for(i=0;i<o;++i){for(n=e[i];s<r&&t[s].value[0]<n;)++s;s>=r?e[i]=t[r-1].index:e[i]=t[s].index}}function h(e,t){var i,n;null!==t&&0!==t.length&&(i={},T(e,function(e){x(e)&&Object.keys(e).forEach(function(t){t.endsWith("__t")&&(i[e[t]]=!0)})},{visitInstances:!0}),n=Object.keys(i).map(Number).sort(function(e,t){return e-t}),n.forEach(function(e,t){i[e]=t}),Object.assign(e,T(e,function(e){return x(e)&&Object.keys(e).forEach(function(t){t.endsWith("__t")&&(e[t.slice(0,-3)]=i[e[t]])}),e},{visitInstances:!0})),c(n,t),e.indexes=n)}function u(e,t){var i,n;null!==t&&0!==t.length&&(i={},l(e.data,function(e){i[e.time]=!0}),n=Object.keys(i).map(Number).sort(function(e,t){return e-t}),n.forEach(function(e,t){i[e]=t}),l(e.data,function(e){e.index=i[e.time]}),c(n,t),e.indexes=n)}var d,p,_,f,m=i(671),y=i(25),g=i(672),v=i(674),S=i(675),b=i(37),w=i(15).Interval,P=i(31),T=i(676).visitObject,x=i(12).isObject;i(183),i(297),d=i(677).DatafeedRequestsCachedProcessor,p=i(200).timezoneIsAvailable,_=-5e6,f=function(e){function t(e,t,i){return function(n){var o,a;n&&n.count()&&(o=r(t,e),a=1e3*s.getCurrentUTCTime(),o.moveTo(a),o.indexOfBar(a)>=0&&n.setLastBarClosed(!1)),i(n)}}function i(e,i,n,o,r){return s._cachedDatafeed.subscribe(e,i,n,t(e,i,o),r)}function n(e){return s._cachedDatafeed.unsubscribe(e)}function o(e,t,i){s.resolveSymbol(e,t,i)}var s=this;this._studiesCache={},this._sessionsLastDataCache={},this._metainfoCache=[],this._barsCoefficientsCache={},this._extrapolationManager=v,this._externalDatafeed=e,this._datafeedConfiguration=null,this._marketStatusWatchers={},this._resolveRequests={},this._callbacks={},
this._serverTimeOffset=0,s._logMessage("Datafeed settings received: {0}".format(JSON.stringify(window.configurationData))),s._datafeedConfiguration=s._adoptConfigurationData(window.configurationData),s._fireEvent("configuration_received"),s._externalDatafeed.getServerTime&&s._externalDatafeed.getServerTime(function(e){s._serverTimeOffset=e-(new Date).valueOf()/1e3}),this._pointsetsManager=S,this._rangeExtensionData={},this._quotesInfo=[],this._depthInfo=[],this._fullNameSymbolInfoMap={},this._endOfData={},this._computeStudyCounter=0,this._cachedDatafeed=new d(e,f.createDWMAligner),this._extendedRange=function(e){return s._rangeExtensionData[e]&&s._rangeExtensionData[e].summary},this._extendedRangeForStudy=function(e){var t=s._rangeExtensionData[e];return t?t.summary+t.realtimeBarsCount:0},this._extendedTime=function(e){return s._rangeExtensionData[e]&&s._rangeExtensionData[e].time},g.setupFeed({resolve:o,subscribe:i,unsubscribe:n,calculateHistoryDepth:this._externalDatafeed.calculateHistoryDepth?this._externalDatafeed.calculateHistoryDepth.bind(this._externalDatafeed):void 0})},f.createDWMAligner=function(e,i,n){var o=t.get_timezone(i),r=new b.Session;return r.init(o,n),b.createDWMAligner(e,r)},f.prototype._barsCoefficients=function(e,t){if(0!==e.indexOf("="))return{};var i=e+t;return this._barsCoefficientsCache[i]||(this._barsCoefficientsCache[i]={}),this._barsCoefficientsCache[i]},f.prototype.destroy=function(){this._cachedDatafeed.destroy(),this._externalDatafeed=null},f.prototype.purgeCache=function(){this._endOfData={},this._resolveRequests={}},f.prototype.purgeDataCache=function(){this._cachedDatafeed.purgeCache()},f.prototype._logMessage=function(e){n.enabled("charting_library_debug_mode")&&console.log(e)},f.prototype._extendRange=function(e,t){this._rangeExtensionData[e]||(this._rangeExtensionData[e]={}),void 0===this._rangeExtensionData[e].summary&&(this._rangeExtensionData[e].summary=0),this._rangeExtensionData[e].summary+=t},f.prototype.on=function(e,t){return this._callbacks.hasOwnProperty(e)||(this._callbacks[e]=[]),this._callbacks[e].push(t),this},f.prototype._fireEvent=function(e,t,i){var n,o;if(this._callbacks.hasOwnProperty(e)){for(n=this._callbacks[e],o=0;o<n.length;++o)n[o](t);i||(this._callbacks[e]=[])}},f.prototype._adoptConfigurationData=function(e){var t,i,n,o=TradingView.merge({},e),r=o.supported_resolutions;if(!r||0===r.length)return o.supported_resolutions=void 0,o;for(t=[],i=0;i<r.length;i++){if(n=r[i],-1!==t.indexOf(n))throw Error("Duplicating resolution `"+n+"`");t.push(n)}return o.supported_resolutions=t,o},f.prototype.supportedResolutions=function(){return this._datafeedConfiguration.supported_resolutions},f.prototype.supportedSymbolsTypes=function(){return this._datafeedConfiguration.symbols_types||[]},f.prototype.supportedExchangesList=function(){return this._datafeedConfiguration.exchanges||[]},f.prototype.futuresRegex=function(){return this._datafeedConfiguration.futures_regex||/$a/},f.prototype._findStudyObject=function(e){
var t=e.split("@")[0],i=JSServer.studyLibrary.filter(function(i){return i.metainfo.id===e||i.metainfo.shortDescription===t});if(0===i.length)throw Error("Study `"+e+"` not found");return i[0]},f.prototype.getMarks=function(e,t,i,n,o){var r,s={red:6,green:5,blue:4,yellow:3};this._externalDatafeed.getMarks&&this._datafeedConfiguration.supports_marks&&(this._logMessage("Requesting bars marks: symbol {0}, resolution {1}, range [{2} ... {3}]".format(e.full_name,o,new Date(1e3*t).toUTCString(),new Date(1e3*i).toUTCString())),r=this,this._externalDatafeed.getMarks(e,t,i,function(t){var i,a,l=t.map(function(e){return e.time=parseInt(e.time),e});r._logMessage("Received bars marks: symbol {0}, resolution {1}, marks {2}".format(e.full_name,o,JSON.stringify(l))),i=f.createDWMAligner(o,e.timezone,e.session),a=l.map(function(e){return e.tickmark=null!==i?i.tradingDayToSessionStart(1e3*e.time)/1e3:e.time,e.direction=s[e.color],e.onClicked=function(){P.emit("onMarkClick",e.id)},e.label=!!e.label&&e.label[0],e}),n(a)},o))},f.prototype.getTimescaleMarks=function(e,t,i,n,o){if(this._externalDatafeed.getTimescaleMarks&&this._datafeedConfiguration.supports_timescale_marks){this._logMessage("Requesting timescale marks: symbol {0}, resolution {1}, range [{2} ... {3}]".format(e.full_name,o,new Date(1e3*t).toUTCString(),new Date(1e3*i).toUTCString()));var r=this;this._externalDatafeed.getTimescaleMarks(e,t,i,function(t){var i,s;r._logMessage("Received timescale marks: symbol {0}, resolution {1}, marks {2}".format(e.full_name,o,JSON.stringify(t))),i=f.createDWMAligner(o,e.timezone,e.session),s=t.map(function(e){return e.tickmark=null!==i?i.tradingDayToSessionStart(1e3*e.time)/1e3:e.time,e}),n(s)},o)}},f.prototype._computeStudy=function(e,t,i,n,o,r,s,a,l,c,h,u){function d(e){var t,i;return e<a()?_:0===(t=g.length)?0:(i=g[t-1].index,i===_?0:i+1)}function p(e,t,i){var n,o,r,s,a=e.time,l="number"==typeof t?[t]:t;for(n=0;n<l.length;++n)o=l[n],o&&"object"==typeof o&&(v["plot_"+n]=o.offset,o=o.value,S++),"number"==typeof o&&isNaN(o)&&(o=void 0),l[n]=o;r=g.length-1,s=r<0||a>g[r].value[0],s?g.push({index:d(a),value:[a].concat(l)}):g[r].value=[a].concat(l),f||c([g[g.length-1]],s,g.length,v,i)}var f=!0,m=this._computeStudyCounter++,g=[],v={},S=0,b=!1,w=!1,P=this,T=function(a){var c;if(y.Symbol.parsePeriod(n).isIntraday&&!a.has_intraday)return void h("Unsupported resolution. Did you forget to set has_intraday to true?");try{if(c=new y.StudyEngine({tickerid:i,symbolInfo:a,period:n,body:t,sessionId:e,onErrorCallback:h,rangeExtension:s,input:function(e){return r[e]},out:function(e,t){p(e,t,a)},nonseriesOut:function(e,t){w=!0,u(t,a)},setNoMoreData:function(){b=!0},recalc:function(e,i){f=!1,g.endOfData=b,w&&!(g.length>0)||t.error&&null!==t.error()||l(g,S>0?v:void 0,a,i)}}),!P._studiesCache[e]||!P._studiesCache[e][o])throw Error("This should never happen");P._studiesCache[e][o].engine=c}catch(e){if(!e.studyError)throw e;h(e.message)}},x=function(e){h(e)},C=function(){return P._studiesCache[e]&&P._studiesCache[e][o]&&P._studiesCache[e][o].activeResolve===m}
;P._studiesCache[e][o].activeResolve=m,this.resolveSymbol(i,function(){C()&&T.apply(P,arguments)},function(){C()&&x.apply(P,arguments)})},f.prototype._createStudy=function(e,t,i,n,r,s,a){function l(e){var t,i,o;if(Array.isArray(e))return e;for(t=[],i=p._studiesCache[n][r].metainfo.inputs,o=0;o<i.length;o++)t[o]=e[i[o].id];return t}function c(i,a,l){i=o(i),TradingView.ChartapiMessagerInstances[n].onDataUpdate(r,s,p._convertBarsTimeToUnix(i),a,l,p._extendedRange(e,t)),TradingView.ChartapiMessagerInstances[n].onStudyCompleted(r,s)}var d,p=this;a=l(a),TradingView.ChartapiMessagerInstances[n].onStudyLoading(r,s),d=null,p._computeStudy(n,i,e,t,r,a,{getRangeExtensionCount:p._extendedRangeForStudy.bind(this,n),getRangeExtensionTime:p._extendedTime.bind(this,n)},function(){if(null===d){var e=p._sessionsLastDataCache[n][0];if(void 0===e)return 1/0;d=e.value[0]}return d},function(e,t,i){c(e,t?{data:{offsets:t}}:null,i)},function(i,a,l,c,h){i=o(i);var u=c?{data:{offsets:c}}:null;TradingView.ChartapiMessagerInstances[n].onDataUpdate(r,s,p._convertBarsTimeToUnix(i),u,h,p._extendedRange(e,t))},function(e){TradingView.ChartapiMessagerInstances[n].onStudyError(r,s,e)},function(e,t){var i;switch(e.type){case"projection":this._updateProjectionData(n,r,s,e);break;case"study_graphics":i={data:e.data,indexes:[]},u(i,p._sessionsLastDataCache[n]),c([],i,t);break;case"non_series_data":i={data:e.data,indexes:[]},h(i,p._sessionsLastDataCache[n]),c([],i,t);break;default:console.warn("unsupported non-series data type for study "+e.type)}}.bind(this))},f.prototype.stopSources=function(e){var t,i;for(t in this._studiesCache[e])(i=this._studiesCache[e][t])&&(i.engine&&i.engine.stop(),i.activeResolve=-1);g.unsubscribeUnused()},f.prototype.recreateSources=function(e,t,i,n){var o,r;this.stopSources(i);for(o in this._studiesCache[i])(r=this._studiesCache[i][o])&&(r.symbol=e,r.resolution=t,"series"===r.type&&this.createSeries(e,t,i,o,r.turnaround,n));for(o in this._studiesCache[i])(r=this._studiesCache[i][o])&&"study"===r.type&&this._createStudy(e,t,r.studyObject,i,o,r.turnaround,r.inputs)},f.prototype.removeStudy=function(e,t){this._studiesCache[e]&&this._studiesCache[e][t]&&this._studiesCache[e][t].engine&&(this._studiesCache[e][t].engine.stop(),g.unsubscribeUnused()),this._studiesCache[e][t]=null},f.prototype.removeSeries=function(e,t){this.removeStudy(e,t)},f.prototype.recomputeStudy=function(e,t,i,n){var o=this._studiesCache[i][e];if(!o)throw Error("This should never happen");o.inputs=t,o.turnaround=n,o.engine&&o.engine.stop(),this._createStudy(o.symbol,o.resolution,o.studyObject,i,e,n,t)},f.prototype._convertBarsTimeToUnix=function(e){var t,i,n=[];for(t=0;t<e.length;++t)i={index:e[t].index,value:[].concat(e[t].value)},i.value[0]/=1e3,n.push(i);return n.endOfData=e.endOfData,n},f.prototype.createStudy=function(e,t,i,n,o,r,s){var a=this._findStudyObject(r),l=new a.constructor;this._studiesCache[i]=this._studiesCache[i]||{},this._studiesCache[i][n]={studyObject:l,symbol:e,resolution:t,guid:n,type:"study",inputs:s,metainfo:a.metainfo,turnaround:o},
this._createStudy(e,t,l,i,n,o,s)},f.prototype.purgeRangeExtensionData=function(e){e?this._rangeExtensionData[e]={summary:0,realtimeBarsCount:0}:this._rangeExtensionData={}},f.prototype.ensureExtendedTo=function(e,t,i){var n,o=this._studiesCache[t][e];if(!o)throw Error("This should never happen");this.purgeRangeExtensionData(t),this._rangeExtensionData[t]||(this._rangeExtensionData[t]={}),this._rangeExtensionData[t].time=i,n=this,setTimeout(function(){n.recreateSources(o.symbol,o.resolution,t,!0)},0)},f.prototype.extendSeriesRange=function(e,t,i){var n,o,r,s,a=this._studiesCache[t][e];if(!a)throw Error("This should never happen");if(this._isEndOfData(t,e,a.turnaround))return n=a.engine.runner.host.symbolInfo.data_status,void setTimeout(function(){TradingView.ChartapiMessagerInstances[t].onSeriesCompleted(e,a.turnaround,n)},0);i+=10,o=this._barsCoefficients(a.symbol,a.resolution),r=o.barsCoefficient||1,this._extendRange(t,i*r),o.barsCoefficient||(o.expectedBarsCount=this._extendedRange(t)),s=this,setTimeout(function(){s.recreateSources(a.symbol,a.resolution,t,!0)},0)},f.prototype._updateProjectionData=function(e,t,i,n){var o=n.barsetSize?this._convertBarsTimeToUnix([{index:n.barsetSize-1,exTime:n.lastBar?n.lastBar[0]/1e3:0,value:n.lastBar}]):null;TradingView.ChartapiMessagerInstances[e].onProjectionUpdate(t,i,n,o)},f.prototype.updateSeriesTurnaround=function(e,t,i){this._studiesCache[e]||(this._studiesCache[e]={}),this._studiesCache[e][t]||(this._studiesCache[e][t]={}),this._studiesCache[e][t].type="series",this._studiesCache[e][t].turnaround=i},f.prototype.seriesTurnaround=function(e,t){return this._studiesCache[e]&&this._studiesCache[e][t]&&this._studiesCache[e][t].turnaround},f.prototype.createSeries=function(e,t,i,o,r,s){function a(e,n,o){l._extrapolationManager.storage(i,e.full_name,t).setLastBarTime(n,o)}var l,c=e,h=new y.OHLCV;this._studiesCache[i]=this._studiesCache[i]||{},this._sessionsLastDataCache[i]=null,this._studiesCache[i][o]={symbol:e,resolution:t,studyObject:h,guid:o,type:"series",turnaround:r},TradingView.ChartapiMessagerInstances[i].onSeriesLoading(o,r),l=this,this._computeStudy(i,h,c,t,o,[],{getRangeExtensionCount:l._extendedRange.bind(this,i),getRangeExtensionTime:l._extendedTime.bind(this,i)},function(){return-1/0},function(n,c,h,u){var d,p,_,f,m,y;if(!l._studiesCache[i][o])throw Error("This should never happen");if(l._sessionsLastDataCache[i]=n,d=l._convertBarsTimeToUnix(n),p=d.length>0?1e3*d[0].value[0]:void 0,u.nextTime&&(!p||u.nextTime<p/1e3))return void l.ensureExtendedTo(o,i,u.nextTime);0!==d.length&&(_=l._barsCoefficients(e,t),_.expectedBarsCount&&_.barsCount&&(_.barsCoefficient=Math.min(Math.max(_.barsCoefficient||1,parseInt(_.expectedBarsCount/(d.length-_.barsCount)+.5)),100)),_.barsCount=d.length,f=d[d.length-1],a(h,d.length-1,1e3*f.value[0]),l.rebuildExtrapolatedData(i,e.name,t,h,1e3*f.value[0]),s&&TradingView.ChartapiMessagerInstances[i].onSeriesClearData(o,r),TradingView.ChartapiMessagerInstances[i].onTimescaleUpdate(o,r,d,h,0),m=l._extrapolationManager.storage(i,h.full_name,t),
Promise.resolve().then(function(){l._pointsetsManager.broadcastPointsetsUpdates(h.full_name,t,n,m,h,function(e,t){TradingView.ChartapiMessagerInstances[i].onPointsetDataUpdate(e,r,t,h)})})),y=0===d.length||u&&u.endOfData,y&&(l._logMessage("Series has no more data on server: {0}".format(h.full_name)),l._setEndOfData(i,o,r),0===d.length&&TradingView.ChartapiMessagerInstances[i].onSeriesClearData(o,r)),TradingView.ChartapiMessagerInstances[i].onSeriesCompleted(o,r,h.data_status)},function(e,n,s,c,h){var u,d=l._convertBarsTimeToUnix(e),p=d[d.length-1];if(n){if(l._rangeExtensionData[i]||l.purgeRangeExtensionData(i),l._rangeExtensionData[i].realtimeBarsCount+=1,!l._studiesCache[i][o])throw Error("This should never happen");u=s-1,l._logMessage("New bar arrived: symbol {0}, bar {1}".format(h.full_name,JSON.stringify(p))),TradingView.ChartapiMessagerInstances[i].onTimescaleUpdate(o,r,[p],h,u),a(h,u,1e3*p.value[0]),l.rebuildExtrapolatedData(i,h.full_name,t,h,1e3*p.value[0])}else l._logMessage("Last bar update: symbol {0}, bar {1}".format(h.full_name,JSON.stringify(p))),TradingView.ChartapiMessagerInstances[i].onDataUpdate(o,r,d,null,h);l._fireEvent("realtime_tick",e[e.length-1],!0)},function(e){l._logMessage("Series error: {0}".format(e)),TradingView.ChartapiMessagerInstances[i].onSeriesError(o,e),n.enabled("clear_bars_on_series_error")&&TradingView.ChartapiMessagerInstances[i].onSeriesClearData(o,r)},function(e,n){var s,c,h,u,d,p,_,f;if("projection"!==e.type)throw Error("unexpected non-series data type for series "+e.type);if(s=e.projectionTime/1e3,c=-1,(e.data||[]).forEach(function(e){c=Math.max(c,e[0]||0)}),c=Math.min(c,100),h=e.barsetSize,s&&c>=0&&h&&e.lastBar){for(u=[],d=0;d<=c;d++)u.push(s+.001*d);p=e.lastBar.slice(0),p[0]=p[0]/1e3,TradingView.ChartapiMessagerInstances[i].onTimescaleUpdate(o,r,[{index:h-1,value:p}],n,h-1,u),_=h+c,f=1e3*Math.trunc(u[c]),a(n,_,f),l.rebuildExtrapolatedData(i,n.full_name,t,n,f)}l._updateProjectionData(i,o,r,e)})},f.prototype.onMoreTickmarksRequested=function(e,t,i,n,o){this._extrapolationManager.storage(e,i.full_name,n).onTickmarksNeeded(i,o)},f.prototype.removePointset=function(e){this._pointsetsManager.removePointset(e)},f.prototype.rebuildExtrapolatedData=function(e,t,i,n,o){this._extrapolationManager.storage(e,n.full_name,i).rebuild(o,n)},f.prototype.createPointset=function(e,t,i,n,o,r){var s=this._extrapolationManager.storage(e,n.full_name,o);this._pointsetsManager.createPointset(t,i,o,r,s,n)},f.prototype.studiesMetadata=function(){return 0===this._metainfoCache.length&&(this._metainfoCache=JSServer.studyLibrary.map(function(e){return e.metainfo})),this._metainfoCache},f.prototype.searchSymbols=function(e,t,i,n){function o(e){r._logMessage("Symbol search response: {0}".format(JSON.stringify(e))),n(e)}this._logMessage("Symbol search requested: search string `{0}`, exchange: `{1}`, type `{2}`".format(e,t,i));var r=this;this._externalDatafeed.searchSymbols(e,t,i,o)},f.prototype.resolveSymbol=function(e,t,i){var n,o=g.parseSymbol(e).symbol
;this._resolveRequests[o]?n=this._resolveRequests[o]:(n=this.resolveSymbolInternal(o),this._resolveRequests[o]=n),n.done(t).fail(i)},f.prototype.resolveSymbolInternal=function(e){var t,i=this,n=$.Deferred();return this._logMessage("Symbol resolve requested: `{0}` ".format(e)),t=!0,this._externalDatafeed.resolveSymbol(e,function(o){t&&console.warn("`resolveSymbol` should return result asynchronously. Use `setTimeout` with 0 interval to execute the callback function."),i._logMessage("Symbol resolved: `{0}`, SymbolInfo in server response {1}".format(e,JSON.stringify(o))),a(o),s(o),i._logMessage("Symbol info after post-processing: `{0}`, SymbolInfo {1}".format(e,JSON.stringify(o))),i._fullNameSymbolInfoMap[o.full_name]=o,n.resolve(o)},function(t){i._logMessage("Symbol resolve failed: `{0}`, reason: `{1}`".format(e,t)),n.reject(t)}),t=!1,n.promise()},f.prototype._createMarketStatusWatchers=function(e,t){void 0===this._marketStatusWatchers[e]&&(this._marketStatusWatchers[e]={});var i=this;t.forEach(function(t){void 0===i._marketStatusWatchers[e][t]&&(i._marketStatusWatchers[e][t]=new m(i,e,t))})},f.prototype._removeMarketStatusWatchers=function(e){var t=this;Object.keys(this._marketStatusWatchers[e]||{}).forEach(function(i){t._marketStatusWatchers[e][i].stop()}),this._marketStatusWatchers[e]={}},f.prototype._stopQuotesSubscription=function(e){this._quotesInfo[e].listenerGUID&&(this._externalDatafeed.unsubscribeQuotes(this._quotesInfo[e].listenerGUID),this._quotesInfo[e].listenerGUID=void 0),this._removeMarketStatusWatchers(e)},f.prototype._startQuotesSubscription=function(e){function t(t,i){var n=r._marketStatusWatchers[e][t.n];t.symbolname=t.n,t.status=t.s,t.values=t.v,t.values.change=t.v.ch,t.values.last_price=t.v.lp,t.values.change_percent=t.v.chp,t.values.current_session=t.v.cs||n&&n.marketStatus(),t.values.pricescale=i.pricescale,t.values.minmov=i.minmov,t.values.minmove2=i.minmove2||0,t.values.fractional=i.fractional||!1,n&&t.v.cs&&n.stop(),TradingView.ChartapiMessagerInstances[e].onQuotesData([e].concat([t]))}function i(e){e.forEach(function(e){void 0!==o[e.n]?null!==o[e.n]&&t(e,o[e.n]):r.resolveSymbol(e.n,function(i){o[e.n]=i,t(e,i)},function(){o[e.n]=null})})}var o={},r=this,s=this._quotesInfo[e].symbols;0!==s.length&&(this._externalDatafeed.getQuotes&&!n.enabled("charting_library")?this._externalDatafeed.getQuotes(s,function(t){r._quotesInfo[e]&&(i(t),r._quotesInfo[e].listenerGUID=e,r._externalDatafeed.subscribeQuotes(s,r._quotesInfo[e].fastSymbols,i,r._quotesInfo[e].listenerGUID))},function(e){}):!this._externalDatafeed.getQuotes&&n.enabled("trading_terminal")&&setTimeout(function(){i(s.map(function(e){return{n:e,s:"ok",v:{}}}))}),this._createMarketStatusWatchers(e,s))},f.prototype._restartQuotesSubscription=function(e){this._stopQuotesSubscription(e),this._startQuotesSubscription(e)},f.prototype.quoteCreateSession=function(e){this._quotesInfo[e]={symbols:[],fastSymbols:[],listenerGUID:void 0}},f.prototype.quoteDeleteSession=function(e){this._stopQuotesSubscription(e),this._quotesInfo[e]=null},
f.prototype.quoteSetFields=function(e,t){},f.prototype.quoteAddSymbols=function(e,t){this._quotesInfo[e].symbols=this._filteredSymbols(this._quotesInfo[e].symbols.concat(t)),this._restartQuotesSubscription(e)},f.prototype.quoteRemoveSymbols=function(e,t){this._quotesInfo[e].symbols=this._quotesInfo[e].symbols.filter(function(e){return t.indexOf(e)<0}),this._restartQuotesSubscription(e)},f.prototype.quoteFastSymbols=function(e,t){this._quotesInfo[e].fastSymbols=this._filteredSymbols(t),this._restartQuotesSubscription(e)},f.prototype.quoteHibernateAll=function(e){},f.prototype._stopDepthSubscription=function(e){this._depthInfo[e].listenerGUID&&(this._externalDatafeed.unsubscribeDepth(this._depthInfo[e].listenerGUID),this._depthInfo[e].listenerGUID=void 0)},f.prototype._startDepthSubscription=function(e){function t(e){return e.map(function(e){return{p:e.price,v:e.volume}})}function i(e){var i={};return i.s=r,i.bids=t(e.bids),i.asks=t(e.asks),i}function n(t){t.snapshot?TradingView.ChartapiMessagerInstances[e].onDepthData([e].concat([i(t)])):TradingView.ChartapiMessagerInstances[e].onDepthUpdate([e].concat([i(t)]))}var o=this,r=this._depthInfo[e].symbol;r&&this._fullNameSymbolInfoMap[r]&&this._externalDatafeed.subscribeDepth&&(o._depthInfo[e].listenerGUID=this._externalDatafeed.subscribeDepth(r,function(t){o._depthInfo[e]&&n(t)}))},f.prototype._restartDepthSubscription=function(e){this._stopDepthSubscription(e),this._startDepthSubscription(e)},f.prototype.depthCreateSession=function(e){this._depthInfo[e]={symbol:null,listenerGUID:void 0}},f.prototype.depthDeleteSession=function(e){this._depthInfo[e].symbol=null,this._stopDepthSubscription(e),delete this._depthInfo[e]},f.prototype.depthSetSymbol=function(e,t){this._depthInfo[e].symbol=t,this._restartDepthSubscription(e)},f.prototype._filteredSymbols=function(e){var t=[];return e.forEach(function(e){e instanceof Object||t.indexOf(e)<0&&t.push(e)}),t},f.prototype._isEndOfData=function(e,t,i){var n=e+"!"+t+"@"+i;return!!this._endOfData[n]},f.prototype._setEndOfData=function(e,t,i){var n=e+"!"+t+"@"+i;this._endOfData[n]=!0},f.prototype.alignTimePoint=function(e,t,i){return n.enabled("disable_resolution_rebuild")?e:r(t,i).alignTimeIfPossible(1e3*e)/1e3},f.prototype.serverTimeOffset=function(){return this._serverTimeOffset},f.prototype.getCurrentUTCTime=function(){return(new Date).valueOf()/1e3+this._serverTimeOffset},e.exports=f}).call(t,i(35),i(5))},function(e,t,i){"use strict";(function(t){var n=i(37),o={},r=function(e,i,r){function s(){var e={};e.symbolname=_,e.status="ok",e.values={},e.values.current_session=d,o[_]=d,TradingView.ChartapiMessagerInstances[f].onQuotesData([f].concat([e]))}function a(e,i,o){var r=t.get_timezone(i);c=(new n.Session).init(r,e),h=o,m=setInterval(l,6e4),l(),s()}function l(){var e,t;if(c){if(h)return void(d="out_of_session");e=n.isTradingNow(new Date,c),t=e?"market":"out_of_session",t!==d&&(d=t,s())}}var c,h,u={},d=o[r]||"out_of_session",p=!1,_=r,f=i,m=null;return e.resolveSymbol(r,function(e){p||a(e.session,e.timezone,e.expired)},function(){}),
u.stop=function(){p=!0,m&&clearInterval(m)},u.marketStatus=function(){return d},u};e.exports=r}).call(t,i(35))},function(e,t,i){"use strict";(function(t){var n=i(673).HeikenAshi,o=i(15).Interval,r=function(){function e(e){this.host=e,this.cache={}}function r(e){var t=e.indexOf(",");return-1===t?e:e.slice(0,t)}function s(e,t,i,n,o,r,s){return o+e+t+i+(a(n)?"_":"")+r+"_"+s}function a(e){return e.has_empty_bars||e.force_session_rebuild}function l(e){if(0!==e.indexOf("="))return{symbol:e};var t;try{t=JSON.parse(e.slice(1))}catch(t){return{symbol:e}}return t.type&&(0===t.type.indexOf("BarSetHeikenAshi@tv-basicstudies-")?t.builder=new n:console.error("unknown builder type: "+t.type)),"string"!=typeof t.symbol&&(t.session=t.symbol.session||t.session,t.symbol=t.symbol.symbol),t}function c(t){e.instance=new e(t),p.setupFeed(e.instance)}var h,u,d,p=i(25),_=i(37),f=p.Symbol,m=p.StudyEngine,y=p.BarBuilder,g=p.BarSet;return e.prototype.getCache=function(e){return this.cache[e]},e.prototype.putCache=function(e,t){this.cache[e]=t},e.prototype.subscribe=function(e,t,i,n,o,r,a,l,c,h){var u=s(e,t,i,a,l,n,h),d=this.getCache(u);return d||(d=this.createItem(e,t,i,a,c,l,n,h),this.putCache(u,d)),d.listeners.addListener(o,r),{key:u,listener:o}},e.prototype.unsubscribe=function(e){var t=this.getCache(e.key);t&&t.listeners.removeListener(e.listener)},e.prototype.removeUnused=function(){var e,t,i,n,o,r=[];for(e in this.cache)this.cache[e]&&(t=this.cache[e],0===t.listeners.listenersCount()&&r.push(e));if(0!==r.length){for(i=0;i<r.length;i++)n=r[i],o=this.cache[n],this.cache[n]=null,o.stop();this.removeUnused()}},e.prototype.rebuildFrom=function(e,t,i){var n,o,r,s,a=f.parsePeriod(e),l=f.parsePeriod(t);if(""!==a.resolution&&!a.isSeconds){if(i.has_weekly_and_monthly)return a.resolution;if(void 0===i.has_daily||i.has_daily)return"D";""!==l.resolution&&(l.resolution="",l.interval=i.intraday_multipliers?i.intraday_multipliers[0]:1)}if(a.isIntraday&&void 0!==i.has_intraday&&!i.has_intraday)return"";if(a.isSeconds&&!i.has_seconds)return"";if(n=""!==a.resolution?l.interval:""===l.resolution?Math.min(a.interval,l.interval):a.interval,(o=a.isIntraday?i.intraday_multipliers:i.seconds_multipliers)&&-1===o.indexOf(n)){for(r=o.length-1;r>=0;r--)if(s=+o[r],n%s==0)return s+(a.isSeconds?"S":"");return""}return n+(a.isSeconds?"S":"")},e.prototype.createItem=function(e,t,i,n,s,c,p,_){var f,m,g,v,S,b,w,P=new d,T=l(e);return T.builder?new u(P,T.symbol,t,i,T.builder,n,s,c):(f=r(t),m=this.rebuildFrom(f,r(i),n),g=a(n),!o.isEqual(f,m)||g?(v=n.has_empty_bars,S=$.extend({},n),g&&(S.has_empty_bars=!1,S.force_session_rebuild=!1),void 0!==_&&(b=o.parse(f).inMilliseconds()/o.parse(m).inMilliseconds(),_*=Math.ceil(b)),new u(P,T.symbol,t,m,new y(t,v),S,s,c,p,_)):(w=T.session&&"extended"!==T.session,new h(P,T.symbol,t,i,w,this.host,n,s,p,_)))},h=function(e,t,i,n,o,s,a,l,c,h){this.listeners=e,this.host=s;var u=this;this.host.resolve(t,function(e){o&&e.regular_session&&(e.session=e.regular_session);var s=u.calculateFromTo(e,c||n||i,t,l,h)
;u.subs=u.host.subscribe(e,r(i),s,function(e){u.listeners.fire(e)},function(e){u.listeners.onError(e)})},function(e){u.listeners.onError(e)})},h.prototype._createDWMAligner=function(e,i){var n=t.get_timezone(i.timezone),o=new _.Session;return o.init(n,i.session),f.newBarBuilder(e,o,o)},h.prototype.stop=function(){this.subs&&this.host.unsubscribe(this.subs)},h.prototype.calculateFromTo=function(e,i,n,o,r){var s,a,l,c,h,u,d,p,m=f.parsePeriod(i),y=(new Date).valueOf(),g=e.expired?t.cal_to_utc(t.get_timezone(e.timezone),new Date(1e3*e.expiration_date))||y:y;return""===m.resolution?(a=m.interval,l="D"):"S"===m.resolution?(a=10*m.interval,l=""):(c="D"===m.resolution?1:"W"===m.resolution?5:30,a=12*c*m.interval,l="M"),m.range?(a=m.range.interval,l=m.range.resolution):this.host.calculateHistoryDepth&&(h=this.host.calculateHistoryDepth(i,l,a))&&(a=h.intervalBack||a,l=void 0===h.resolutionBack?l:h.resolutionBack),u=e.sessionString||e.session,s=_.alignPeriodsBack(u,l,a,1,g),o&&o.getRangeExtensionTime&&(d=o.getRangeExtensionTime())&&(s=Math.min(1e3*d,s)),p=Math.ceil(1.5*r),o&&o.getRangeExtensionCount&&(p+=o.getRangeExtensionCount()),p>0&&(s=_.alignPeriodsBack(u,m.resolution,m.interval,p,s)),{from:s,to:g+6e4}},u=function(e,t,i,n,o,r,s,a,l,c){if(this.listeners=e,this.isRecalculated=!1,""===n)return console.error("unsupported resolution for rebuild: "+i),void this.listeners.onError("unsupported resolution for rebuild: "+i);this.symbolInfo=r;var h=this;this.engine=new m({tickerid:t,period:n,periodBase:i,body:o,sessionId:a,symbolInfo:r,rangeExtension:s,periodForInitialRange:l,additionalBarsCount:c,recalc:function(e,t){h._recalc(t)},out:function(e,t){h._out(e,t)},nonseriesOut:function(e,t){h._nonseriesOut(e,t)},setNoMoreData:function(){h.barset&&(h.barset.endOfData=!0)},onErrorCallback:function(e){h.listeners.onError(e)}})},u.prototype.stop=function(){this.engine?this.engine.stop():console.error("Internal library error 0x1")},u.prototype._recalc=function(e){this.isRecalculated&&console.error("recalc called twice!"),this.barset||(this.barset=new g(this.symbolInfo)),e&&(this.barset.nextTime=e.nextTime,this.barset.endOfData=e.endOfData),this.listeners.fire(this.barset),this.isRecalculated=!0},u.prototype._nonseriesOut=function(e,t){var i=Object.assign({},t);i.nonseries=!0,i.data=t.bars,delete i.bars,i.barsetSize=this.barset?this.barset.count():0,i.lastBar=this.barset?this.barset.bar(this.barset.count()-1):null,this.listeners.fire(i,!0)},u.prototype._out=function(e,t){var i,n,o,r,s,a,l,c=t[0];if(!isNaN(c)){if(i={time:c,open:t[1],high:t[2],low:t[3],close:t[4],volume:t[5],updatetime:t[6]},n=t[7],this.barset||(this.barset=new g(e.info)),(o=t[8])instanceof Array)for(r=0;r<o.length;r++)s=t[9],a=o[r],l={time:a,open:s,high:s,low:s,close:s,volume:0,updatetime:a},this.barset.add(l,!0),this.isRecalculated&&this.listeners.fire(this.barset);this.barset.add(i,n),this.barset.isBarClosed=n,this.isRecalculated&&this.listeners.fire(this.barset)}},d=function(){this.listeners=[]},d.prototype.listenersCount=function(){
return this.listeners.reduce(function(e,t){return e+(t?1:0)},0)},d.prototype.addListener=function(e,t){this.listeners.push({dataListener:e,onErrorCallback:t}),this.barset&&e(this.barset),this.errorMsg&&t(this.errorMsg)},d.prototype.removeListener=function(e){var t,i=this.listeners.filter(function(t){return t.dataListener===e});0!==i.length&&(t=this.listeners.indexOf(i[0]),delete this.listeners[t])},d.prototype.onError=function(e){var t,i,n,o;for(this.errorMsg=e||"unspecified error",t=this.listeners,i=t.length,n=0;n<i;n++)(o=t[n])&&o.onErrorCallback&&o.onErrorCallback(e)},d.prototype.fire=function(e,t){var i,n,o,r;for(t||(this.barset=e),i=this.listeners,n=i.length,o=0;o<n;o++)(r=i[o])&&r.dataListener(e)},{setupFeed:c,parseSymbol:l,unsubscribeUnused:function(){e.instance.removeUnused()}}}();e.exports=r}).call(t,i(35))},function(e,t,i){"use strict";var n,o;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"HeikenAshi",function(){return o}),n=i(25),i.n(n),o=function(){function e(){}return e.prototype.main=function(e){var t,i,o,r,s=e.new_var(n.Std.open(e)),a=e.new_var(n.Std.close(e)),l=s.get(1),c=a.get(1),h=n.Std.ohlc4(e),u=n.Std.na(s.get(1))?(n.Std.open(e)+n.Std.close(e))/2:(l+c)/2;return s.set(u),a.set(h),t=n.Std.max(n.Std.high(e),n.Std.max(u,h)),i=n.Std.min(n.Std.low(e),n.Std.min(u,h)),o=n.Std.volume(e),r=e.symbol,[r.time,u,t,i,h,o,r.updatetime,r.isBarClosed]},e}()},function(e,t,i){"use strict";var n=function(){function e(e,t,i){return e+","+t+","+i}function t(t,i,n){delete o[e(t,i,n)]}function n(t,i,n){function s(e){return"undefined"!=typeof TradingView&&TradingView.ChartapiMessagerInstances?o[e]=new a(TradingView.ChartapiMessagerInstances[t],l.pureResolution):o[e]=new a(null,l.pureResolution),o[e]}var l=r.Symbol.parsePeriod(n),c=e(t,i,l.pureResolution);return o[c]?o[c]:s(c)}var o={},r=i(25),s=i(37),a=function(e,t,i){this._chartApiMessager=e,this._lastRealBarTime=null,this._lastRealBarIndex=null,this._resolution=t,this._extrapolatedBarsCache=[],this._onReadyCallbacks=[],this._requestedAmountOfBars=0,this._maxDepth=i||100};return a.prototype.ready=function(){return null!==this._lastRealBarIndex},a.prototype.rebuild=function(e,t){this._lastRealBarTime=e;var i=Math.max(this._extrapolatedBarsCache.length,this._requestedAmountOfBars);this._extrapolatedBarsCache=[],this.ensureExtrapolatedToBar(t,i)},a.prototype.historyExtrapolator=function(){return void 0===this._historyExtrapolator&&(this._historyExtrapolator=new a(null,this._resolution,Math.max(this._maxDepth,1500))),this._historyExtrapolator},a.prototype.getPointTimeUTC=function(e,t,i){var n,o;return 0===t?e:!this.ready()||e<this._lastRealBarTime/1e3?(this.historyExtrapolator().setLastBarTime(0,1e3*e),this.historyExtrapolator().getPointTimeUTC(e,t,i)):(n=0===this._extrapolatedBarsCache.length||e===this._lastRealBarTime/1e3,o=n?-1:this.indexOfBar(e,i)-this._lastRealBarIndex-1,this.ensureExtrapolatedToBar(i,o+t+1),this._extrapolatedBarsCache[o+t])},a.prototype.findDistanceInBars=function(e,t,i){return e===t?0:(this.historyExtrapolator().setLastBarTime(0,1e3*e),
this.historyExtrapolator().indexOfBar(t,i))},a.prototype.indexOfBar=function(e,t){this._ensureExtrapolatedToTime(t,1e3*e);var i=s.lower_bound(this._extrapolatedBarsCache,e,function(e,t){return e>t?1:e<t?-1:0});return-1===i?i:this._lastRealBarIndex+i+1},a.prototype._extrapolateData=function(e,t){var i,n,o;if(!this._lastRealBarTime)throw Error("No real bars known, so cannot extrapolate anything");if(!(i=t(this._lastRealBarTime))||0===i.length)return void(null!==this._lastRealBarIndex&&null!==this._chartApiMessager&&this._chartApiMessager.onTickmarksUpdated(this._lastRealBarIndex+1,this._extrapolatedBarsCache,e,this._resolution));for(n=0;n<i.length;++n)i[n]=i[n]/1e3;for(i[0]===this._lastRealBarTime/1e3&&(i=i.slice(1)),this._extrapolatedBarsCache=i,o=i.slice(0),o.sort(),n=0;n<o.length-1;++n)o[n]===o[n+1]&&console.error("Duplicating extrapolated bars: duplicated "+new Date(1e3*o[n]));null!==this._lastRealBarIndex&&null!==this._chartApiMessager&&this._chartApiMessager.onTickmarksUpdated(this._lastRealBarIndex+1,i,e,this._resolution)},a.prototype.onTickmarksNeeded=function(e,t){if(this.ready())this.ensureExtrapolatedToBar(e,t);else{var i=this;this._onReadyCallbacks.push(function(){i.ensureExtrapolatedToBar(e,t)})}},a.prototype.ensureExtrapolatedToBar=function(e,t){var i=this;return this._requestedAmountOfBars=t,this._extrapolateData(e,function(n){return i._extrapolatedBarsCache.length>=t||!i._shouldExtrapolateMore()?null:s.extrapolateBarsFrontByCount(i.newBarBuilder(e),n,t)})},a.prototype._ensureExtrapolatedToTime=function(e,t){var i=this;return this._extrapolateData(e,function(n){var o,r;return n>=t||!i._shouldExtrapolateMore()?null:(o=2e3,r=s.extrapolateBarsFrontToTime(i.newBarBuilder(e),n,t,o),r[r.length-1]<t&&console.warn("Extrapolation error: not enough data created"),r)})},a.prototype.newBarBuilder=function(e){var t=r.Symbol.newSession(e.timezone,e.session);return r.Symbol.newBarBuilder(this._resolution,t)},a.prototype._shouldExtrapolateMore=function(){return this._extrapolatedBarsCache.length<this._maxDepth},a.prototype.setLastBarTime=function(e,t){(null===this._lastRealBarIndex||this._lastRealBarIndex===e&&this._lastRealBarTime!==t)&&(this._extrapolatedBarsCache=[]),this._extrapolatedBarsCache&&this._extrapolatedBarsCache.length&&this._lastRealBarIndex!==e&&(this._lastRealBarIndex>e?this._extrapolatedBarsCache=[]:this._lastRealBarTime!==t&&this._extrapolatedBarsCache.shift(e-this._lastRealBarIndex)),this._lastRealBarIndex=e,this._lastRealBarTime=t;for(var i=0;i<this._onReadyCallbacks.length;++i)this._onReadyCallbacks[i]();this._onReadyCallbacks=[]},{remove:t,storage:n}}();e.exports=n},function(e,t,i){"use strict";(function(t){var n=i(37),o=i(15).Interval,r=function(){function e(e,t){return e}function r(e,t){var i=m.get_timezone(e.timezone),o=new n.Session;return o.init(i,e.session),f.Symbol.newBarBuilder(t,o,o)}function s(t,i,n,o,r,s){var a,l,c,h,u=e(i,n);for(p.hasOwnProperty(u)||(p[u]=[]),a=[],l=0;l<o.length;++l)o[l][1]<0&&(o[l][1]=0),0!==o[l][1]?(c=r.getPointTimeUTC(o[l][0],o[l][1],s),
a.push(c)):o[l][0]&&a.push(o[l][0]);h={guid:t,points:a},p[u].push(h)}function a(e){var t,i,n;for(t in p)for(i=p[t],n=0;n<i.length;++n)if(i[n].guid===e)return void i.splice(n,1)}function l(e,t,i,n,o){var r,s,a,l=[];for(r=0;r<e.points.length;++r){if(null==(s=e.points[r]))return null;if(null===(a=h(t,s,i,n,o)))return null;l.push({index:r,value:[a,s]})}return l}function c(t,i,n,o,r,s){var a,c,h,u,d=e(t,i);if(p.hasOwnProperty(d))for(a=p[d].length,c=0;c<a;++c)h=p[d][c],null!==(u=l(h,n,o,r,i))&&s(h.guid,u)}function h(e,t,i,o,s){var a,l;return 1e3*(t=r(o,s).alignTimeIfPossible(1e3*t)/1e3)<e[0].value[0]?-d(o,s,t,e[0].value[0]/1e3,i):(a=n.lower_bound(e,1e3*t,function(e,t){return e.value[0]>t?1:e.value[0]<t?-1:0}))>=0&&t<e[e.length-1].value[0]?(e[a].value[0]/1e3!==t&&0!==a&&a--,e[a].index):(l=i.indexOfBar(t,o),-1===l?null:l)}function u(e,t,i,n,o){function r(e,t){var i=new Date(1e3*e),n=new Date(1e3*t),o=12*(n.getFullYear()-i.getFullYear());return o-=i.getMonth()+1,o+=n.getMonth(),o<=0?0:o}var s,a,l,c,h,u,d,p,_,f,y,g,v,S,b;if(t.isMonths())s=r(n,o)/t.multiplier();else if(t.isWeeks())a=Math.ceil((o-n)/604800),s=Math.ceil(a/t.multiplier());else{if(l=m.utc_to_cal(i.timezone,+new Date(1e3*n)),c=m.utc_to_cal(i.timezone,+new Date(1e3*o)),(h=(o-n)/86400)>4*(7-i.spec.weekEndsCount()))d=h/7,u=d*(7-i.spec.weekEndsCount());else{for(p=0,_={},f=l;f.valueOf()<=c.valueOf();f=m.add_days_considering_dst(i.timezone,f,1))y=m.get_day_of_week(f),void 0===_[y]&&(_[y]=i.spec.isWeekEnd(y)),_[y]&&p++;u=h-p}if(t.isDays())s=Math.ceil(u/t.multiplier());else{if(g=t.isHours()?60*t.multiplier()*60:t.isSeconds()?t.multiplier():60*t.multiplier(),h<1&&(v=i.spec.findSessionEntry(m.get_day_of_week(l),m.get_minutes_from_midnight(l)),S=i.spec.findSessionEntry(m.get_day_of_week(c),m.get_minutes_from_midnight(c)),v===S))return Math.ceil((o-n)/g);y=i.spec.entries()[0].dayOfWeek(),b=60*i.spec.entries().reduce(function(e,t){return e+(t.dayOfWeek()===y?t.length():0)},0),s=Math.ceil(u*b/g)}}return s}function d(e,t,i,s,a){var l,c,h=new o(t),d=m.get_timezone(e.timezone),p=new n.Session;return p.init(d,e.session),l=r(e,t),i=l.alignTimeIfPossible(1e3*i)/1e3,s=l.alignTimeIfPossible(1e3*s)/1e3,i>=s?0:(c=u(e,h,p,i,s),c>=1e3?c:a.findDistanceInBars(i,s,e))}var p={},_="undefined"!=typeof window?window:t,f=i(25),m=_.PineJsCalendar?_.PineJsCalendar:i(35);return{createPointset:s,removePointset:a,broadcastPointsetsUpdates:c,tests:{approxBarsInterval:u,indexOfTime:h}}}();e.exports=r}).call(t,i(99))},function(e,t,i){"use strict";function n(e,t,i){return Object(a.isArray)(e)?o(e,t,i):Object(a.isObject)(e)&&(Object(a.isHashObject)(e)||i&&i.visitInstances)?r(e,t,i):e}function o(e,t,i){return e.map(function(e){var o=n(e,t,i),r=t(o);return void 0!==r?r:o})}function r(e,t,i){var o={};return Object.keys(e).forEach(function(r){var s=n(e[r],t,i),a=t(s);o[r]=void 0!==a?a:s}),o}function s(e,t,i){var o=n(e,t,i),r=t(o);return void 0!==r?r:o}var a;Object.defineProperty(t,"__esModule",{value:!0}),t.visitObject=s,a=i(12),i.n(a)},function(e,t,i){"use strict";function n(e,t){return e.ticker+"_"+t}
function o(e){return new Date(e).toISOString()}var r,s,a,l,c,h;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"DatafeedRequestsCachedProcessor",function(){return h}),r=i(15),s=i(78),a=i(25),i.n(a),l=i(5),i.n(l),i(86),c=function(){function e(e,t,i,n){this._cache={bars:[]},this._nextSubscriptionId=0,this._pendingSubscribers=[],this._subscribers=[],this._requesting=!1,this._leftDate=null,this._gaps=[],this._needPurgeCache=!1,this._realtimeOn=!1,this._endOfData=!1,this._resetCacheTimeout=null,this._errorMessage=null,this._datafeed=e,this._symbolInfo=t,this._resolution=i,this._dwmAligner=n}return e.prototype.destroy=function(){0!==this._subscribers.length&&console.warn("Destroying with not-empty state"),this._clearResetCacheTimeout(),this._unsubscribeRealtime(),this._purgeCache(),delete this._datafeed},e.prototype.addSubscription=function(e,t,i){var n=this,o=this._getNextSubscriptionId(),r=Math.floor(e.from/1e3),s=Math.floor(e.to/1e3);return this._pendingSubscribers.push({key:o,range:{from:r,to:s},onHistoryCallback:t,onErrorCallback:i}),this._clearResetCacheTimeout(),setTimeout(function(){return n._processPendingSubscribers()},0),o},e.prototype.removeSubscription=function(e){var t,i=this,n=this._pendingSubscribers.find(function(t){return t.key===e});return n?void this._pendingSubscribers.splice(this._pendingSubscribers.indexOf(n),1):(t=this._subscribers.find(function(t){return t.key===e}))?(this._subscribers.splice(this._subscribers.indexOf(t),1),void(this._subscribers.length||(this._symbolInfo.expired||this._symbolInfo.expiration_date?this._unsubscribeRealtime():this._resetCacheTimeout=setTimeout(function(){i._purgeCacheDelayed(),i._unsubscribeRealtime()})))):void console.warn("Unknown subscription symbol={0}, resolution={1}, key={2}".format(this._symbolInfo.name,this._resolution,e))},e.prototype._purgeCacheDelayed=function(){this._logMessage("Reset cache"),this._needPurgeCache=!0,this._clearResetCacheTimeout()},e.prototype._logMessage=function(e,t){(l.enabled("charting_library_debug_mode")||t)&&console.log("FEED [{0}|{1}]: {2}".format(this._symbolInfo.name,this._resolution,e))},e.prototype._clearResetCacheTimeout=function(){null!==this._resetCacheTimeout&&(clearTimeout(this._resetCacheTimeout),this._resetCacheTimeout=null)},e.prototype._purgeCache=function(){this._cache={bars:[]},this._gaps=[],this._errorMessage=null,this._needPurgeCache=!1,this._leftDate=null,this._endOfData=!1},e.prototype._processPendingSubscribers=function(){var e,t,i,n,s,a,l=this,c=this._pendingSubscribers;if(c.length){if(this._requesting)return void this._logMessage("Processing is skipped due active request");if(this._logMessage("Processing pending subscribers, count="+c.length),this._needPurgeCache&&this._purgeCache(),this._errorMessage)return e=this._errorMessage,this._logMessage("Return error: "+e),this._pendingSubscribers=[],void c.forEach(function(t){t.onErrorCallback(e)});if(t=c.reduce(function(e,t){return Math.min(t.range.from,e)},1/0),this._logMessage('Leftmost requested "from" is '+o(1e3*t)),
(!this._leftDate||t<this._leftDate)&&(i=new r.Interval(this._resolution),n=(i.inMilliseconds(Date.now())||0)/1e3,s=!this._leftDate,a=!s&&!!this._cache.bars.length&&this._cache.bars[0].time/1e3-t<n,(s||!a)&&!this._endOfData))return void this._ensureRequestedTo(t);this._pendingSubscribers=[],c.forEach(function(e){var t=l._moveSubscriberToRealtime(e);l._returnHistoryDataToSubscriber(e,t)}),this._subscribeRealtimeIfNeeded()}},e.prototype._moveSubscriberToRealtime=function(e){var t={key:e.key,onHistoryCallback:e.onHistoryCallback,barset:null};return this._subscribers.push(t),t},e.prototype._subscribeRealtimeIfNeeded=function(){!this._subscribers.length||this._realtimeOn||this._symbolInfo.expired||this._symbolInfo.expiration_date||this._subscribeRealtime()},e.prototype._subscribeRealtime=function(){var e,t,i=this;this._symbolInfo.expired||this._realtimeOn||(e=function(e){i._dwmAligner&&(e.time=i._dwmAligner.tradingDayToSessionStart(e.time)),i._putToCacheNewBar(e),i._subscribers.forEach(function(t){var i=t.barset;if(null===i)throw Error("subscirber.barset is null");i.add(e),t.onHistoryCallback(i)})},t=function(){i._unsubscribeRealtime();var e=i._leftDate;i._purgeCache(),e&&i._ensureRequestedTo(e)},this._realtimeOn=!0,this._datafeed.subscribeBars(this._symbolInfo,this._resolution,e,n(this._symbolInfo,this._resolution),t),this._logMessage("Subscribed to realtime"))},e.prototype._unsubscribeRealtime=function(){!this._symbolInfo.expired&&this._realtimeOn&&(this._datafeed.unsubscribeBars(n(this._symbolInfo,this._resolution)),this._logMessage("Unsubscribed from realtime"),this._realtimeOn=!1)},e.prototype._returnHistoryDataToSubscriber=function(e,t){var i,n,r=e.range,s=l.enabled("cl_feed_return_all_data")?this._createBarset(this._leftDate||r.from):this._createBarset(r.from);s.count()>0?this._logMessage("Bars to return for request {0}: total {1} bars in [{2} ... {3}] ".format(e.key,s.count(),o(s.bars[0].time),o(s.bars[s.count()-1].time))):this._logMessage("Request {0}. Nothing to return.".format(e.key)),t.barset=s,i=this._inGapNextTime(r.from),i?(this._logMessage("Request {0} is in gap, nextTime = {1}".format(e.key,o(1e3*i))),s.nextTime=i):0===s.count()&&(n=this._cache.bars.length&&this._cache.bars[this._cache.bars.length-1].time/1e3)&&r.from>n&&(this._logMessage("Request {0} is in gap, nextTime = {1}".format(e.key,o(1e3*n))),s.nextTime=n||void 0),this._endOfData&&null!==this._leftDate&&e.range.from<=this._leftDate&&(s.endOfData=!0),e.onHistoryCallback(s)},e.prototype._createBarset=function(e){var t=Object(s.lowerbound)(this._cache.bars,1e3*e,function(e,t){return e.time<t});return new a.BarSet(this._symbolInfo,this._cache.bars.slice(t))},e.prototype._ensureRequestedTo=function(t){var i,n,r,s=this;if(this._leftDate&&this._leftDate<t)return void this._processPendingSubscribers();i=!this._leftDate,this._requesting=!0,n=t,r=this._leftDate?this._leftDate-1:this._symbolInfo.expiration_date||Math.floor(e._now()/1e3),this._leftDate=t,this._logMessage("Requesting data: [{0} ... {1}] ".format(o(1e3*n),o(1e3*r))),
this._datafeed.getBars(this._symbolInfo,this._resolution,n,r,function(e,t){s._requesting=!1,s._processBars(e,t)},function(e){s._requesting=!1,s._errorMessage=e||null,s._processPendingSubscribers()},i)},e.prototype._processBars=function(e,t){this._checkBars(e),this._alignBarsTime(e),e.length>0?this._processFullBarset(e,t):this._processEmptyBarset(t),this._processPendingSubscribers()},e.prototype._processEmptyBarset=function(t){this._logMessage("Receiving bars: barset is empty"),t&&t.nextTime?(this._logMessage("Next time received: `{0}`".format(o(1e3*t.nextTime))),this._addGap(t.nextTime),this._leftDate=Math.min(this._leftDate||e._now()/1e3,t.nextTime+1)):t&&t.noData?(this._logMessage("EOD received"),this._endOfData=!0,this._cache.bars.length&&(this._leftDate=this._cache.bars[0].time/1e3)):this._logMessage("nextTime or noData should present in metainfo when empty barset is returned")},e.prototype._processFullBarset=function(e,t){var i=e[0].time,n=e[e.length-1].time;this._logMessage("Receiving bars: total {0} bars in [{1} ... {2}] ".format(e.length,o(i),o(n))),null!==this._leftDate&&i<1e3*this._leftDate&&!l.enabled("cl_feed_return_all_data")&&this._logMessage("Returned more data than needed"),this._putToCache(e)?null!==this._leftDate&&this._cache.bars.length&&this._leftDate>this._cache.bars[0].time/1e3&&(this._leftDate=this._cache.bars[0].time/1e3):this._logMessage("Incremental update failed. Starting full update. Returned data should be in the requested range.",!0),t&&t.nextTime?console.warn("nextTime should be set when there is no data in the requested period only"):t&&t.noData&&console.warn("noData should be set when there is no data in the requested period and earlier only")},e.prototype._addGap=function(t){var i;this._gaps.find(function(e){return e.from===t})||(i=(this._cache.bars.length?this._cache.bars[0].time:e._now())/1e3,this._gaps.push({from:t,to:i}))},e.prototype._inGapNextTime=function(e){var t=this._gaps.find(function(t){return t.from<e&&t.to>e});return t?t.from:null},e.prototype._getNextSubscriptionId=function(){return this._nextSubscriptionId++},e.prototype._checkBars=function(e,t){var i,n;if(void 0===t&&(t=!1),l.enabled("charting_library_debug_mode"))for(i=1;i<e.length;i++)e[i].time<=e[i-1].time&&(n="Wrong bars time: time {0} of bar {1} should be more than time {2} of bar {3}".format(e[i].time,i,e[i-1].time,i-1),t&&this._dwmAligner&&(n+="\nCheck that you provide DWM bars without time part, i.e. 00:00 GMT"),console.error(n))},e.prototype._putToCache=function(e){if(0===e.length)return!0;if(this._cache.bars.length===e.length&&this._cache.bars[0].time===e[0].time&&this._cache.bars[this._cache.bars.length-1].time===e[e.length-1].time)return this._logMessage("Time range of received data is the same as cached one. Skip the update."),!0;if(0!==this._cache.bars.length&&e[e.length-1].time===this._cache.bars[0].time&&this._cache.bars.splice(0,1),0!==this._cache.bars.length&&e[e.length-1].time>=this._cache.bars[0].time){var t=this._cache.bars[this._cache.bars.length-1].time===e[e.length-1].time
;if(this._cache.bars=[],!t)return this._leftDate=null,!1;this._logMessage("Received history up to now instead of incremental update. Return exactly what is requested.")}return this._cache.bars=e.concat(this._cache.bars),this._checkBars(this._cache.bars,!0),!0},e.prototype._putToCacheNewBar=function(e){var t=this._cache.bars.length,i=e.time,n=0===t?NaN:this._cache.bars[t-1].time;0===t||n<i?this._cache.bars.push(e):n===i?this._cache.bars[t-1]=e:console.error("putToCacheNewBar: time violation, previous bar time: "+o(n)+" should be less or equal to new time: "+o(i))},e.prototype._alignBarsTime=function(e){if(this._dwmAligner)for(var t=0;t<e.length;t++)e[t].time=this._dwmAligner.tradingDayToSessionStart(e[t].time)},e._now=function(){return Date.now()+6e4},e}(),h=function(){function e(e,t){this._threads={},this._datafeed=e,this._dwmAlignerCreator=t}return e.prototype.destroy=function(){this._forEachThread(function(e,t){return t.destroy()}),this._threads={},delete this._datafeed},e.prototype.purgeCache=function(){this._forEachThread(function(e,t){return t.destroy()}),this._threads={}},e.prototype.subscribe=function(e,t,i,o,r){var s,a=n(e,t);return this._threads[a]||(this._threads[a]=this._createThread(e,t)),s=this._threads[a].addSubscription(i,o,r),a+'"'+s},e.prototype.unsubscribe=function(e){var t,i,n=e.split('"');if(2!==n.length)return void console.warn("Wrong guid format");t=n[0],i=parseInt(n[1]),this._threads.hasOwnProperty(t)?this._threads[t].removeSubscription(i):console.warn("Data thread doesnt exist: "+e)},e.prototype._createThread=function(e,t){return new c(this._datafeed,e,t,this._dwmAlignerCreator(t,e.timezone,e.session))},e.prototype._forEachThread=function(e){var t=this;Object.keys(this._threads).forEach(function(i){return e(i,t._threads[i])})},e}()},function(e,t,i){"use strict";(function(t,n){function o(e,i,n,o){this._chartWidgetCollection=e,this._chartApiInstance=i,this._saveChartService=n,this._loadChartService=o,this._proxyWatchListChangedDelegate=null,this._lockDrawingsWatchedValue=null,this._hideDrawingsWatchedValue=null,this._activeChangedChangedDelegate=new t,this._chartWidgetCollection.activeChartWidget.subscribe(function(){this._activeChangedChangedDelegate.fire()}.bind(this)),this._chartWidgets=new WeakMap}var r=i(62).linking,s=i(679),a=i(109).layouts,l=i(31),c=i(89),h=i(32),u=i(61),d=i(67),p=i(4),_=i(209).createNoticeDialog,f=i(83).createConfirmDialog,m=i(298),y=i(685).ThemesApi;o.prototype.subscribe=function(e,t){l.subscribe(e,t)},o.prototype.unsubscribe=function(e,t){l.unsubscribe(e,t)},o.prototype.onContextMenu=function(e){l.subscribe("onContextMenu",function(t){t.callback(e(t.unixtime,t.price))})},o.prototype.onGrayedObjectClicked=function(e){l.subscribe("onGrayedObjectClicked",e)},o.prototype.activeChart=function(){return this._getChartWidgetApi(this._chartWidgetCollection.activeChartWidget.value())},o.prototype._getChartWidgetApi=function(e){var t=this._chartWidgets.get(e);return void 0===t&&(t=new s(e),this._chartWidgets.set(e,t)),t},o.prototype.onActiveChartChanged=function(){
return this._activeChangedChangedDelegate},o.prototype.changeSymbol=function(e,t,i){r.interval.setValue(t),r.symbol.setValue(e),i&&this.activeChart().onDataLoaded().subscribe(null,i,!0)},o.prototype.setLayout=function(e){this._chartWidgetCollection.layout.setValue(e)},o.prototype.layout=function(){return this._chartWidgetCollection.layout.value()},o.prototype.layoutName=function(){return this._chartWidgetCollection.metaInfo.name.value()},o.prototype.chartsCount=function(){return a[this.layout()].count},o.prototype.chart=function(e){if(void 0===e&&(e=0),e<0||e>=this.chartsCount())throw Error("Incorrect index: "+e);return this._getChartWidgetApi(this._chartWidgetCollection.getAll()[e])},o.prototype.getSymbolInterval=function(e){var t={symbol:r.symbol.value(),interval:r.interval.value()};return e&&e(t),t},o.prototype.saveChart=function(e){var t=this;this._saveChartService.whenReadyToSave(function(){var i=t._saveChartService.saveToJSON();return e&&e(JSON.parse(i.content))})},o.prototype.loadChart=function(e){this._chartApiInstance.purgeCache(),this._chartApiInstance._studyEngine.stopSources(),this._chartWidgetCollection.loadContent(e.json),this._chartWidgetCollection.purgeUnusedWidgets(),e.extendedData&&(this._chartWidgetCollection.metaInfo.id.setValue(e.extendedData.uid),this._chartWidgetCollection.metaInfo.uid.setValue(e.extendedData.uid),this._chartWidgetCollection.metaInfo.name.setValue(e.extendedData.name)),r.symbol.setValue(this.activeChart().symbol()),l.emit("chart_loaded")},o.prototype.getStudiesList=function(){return this._chartApiInstance.allStudiesMetadata().filter(function(e){return!e.is_hidden_study}).map(function(e){return e.name||e.description})},o.prototype.getSavedCharts=function(e){d.getCharts(e)},o.prototype.loadChartFromServer=function(e){d.loadChart(e)},o.prototype.saveChartToServer=function(e,t,i,n){this._saveChartService.saveChartSilently(e,i,t,n)},o.prototype.removeChartFromServer=function(e,t){d.removeChart(e,t)},o.prototype.getIntervals=function(){var e=[],t=u.getCustomResolutions();return null!==this._chartApiInstance&&(e=this._chartApiInstance.defaultResolutions()),u.mergeResolutions(e,t)},o.prototype.closePopupsAndDialogs=function(){var e,t,n=document.querySelectorAll("._tv-dialog-title-close");for(e=0;e<n.length;e++)n[e].click();t=i.c[690],t&&t.exports.closeAllDialogs(),c.hideAll()},o.prototype.selectLineTool=function(e){m.supportedLineTools[e]&&(e=m.supportedLineTools[e].name,h.tool.value()!==e&&h.tool.setValue(e))},o.prototype.selectedLineTool=function(){var e,t=Object.keys(m.supportedLineTools),i=h.tool.value();for(e=0;e<t.length;++e)if(m.supportedLineTools[t[e]].name===i)return t[e];return""},o.prototype.lockAllDrawingTools=function(){return null===this._lockDrawingsWatchedValue&&(this._lockDrawingsWatchedValue=new n(h.lockDrawings().value()),this._lockDrawingsWatchedValue.subscribe(function(e){h.lockDrawings().setValue(e)}),h.lockDrawings().subscribe(this,function(){this._lockDrawingsWatchedValue.setValue(h.lockDrawings().value())})),this._lockDrawingsWatchedValue},
o.prototype.hideAllDrawingTools=function(){return null===this._hideDrawingsWatchedValue&&(this._hideDrawingsWatchedValue=new n(h.hideAllDrawings().value()),this._hideDrawingsWatchedValue.subscribe(function(e){h.hideAllDrawings().setValue(e)}),h.hideAllDrawings().subscribe(this,function(){this._hideDrawingsWatchedValue.setValue(h.hideAllDrawings().value())})),this._hideDrawingsWatchedValue},o.prototype.mainSeriesPriceFormatter=function(){return this._chartWidgetCollection.activeChartWidget.value().model().mainSeries().priceScale().formatter()},o.prototype.showNoticeDialog=function(e){function t(){i&&(i(),i=null)}e=e||{};var i=e.callback;_({title:e.title,content:e.body||""}).then(function(e){e.on("action:ok",t),e.on("afterClose",t),e.open()})},o.prototype.showConfirmDialog=function(e){function t(e){i&&(i(e),i=null)}if(e=e||{},!e.callback)throw Error("callback must be exist");var i=e.callback;f({title:e.title,content:e.body||""}).then(function(e){e.on("action:yes",t.bind(null,!0)),e.on("action:no",t.bind(null,!1)),e.on("afterClose",t.bind(null,!1)),e.open()})},o.prototype.logs=function(){return{getLogHistory:p.getLogHistory,enable:p.loggingOn,disable:p.loggingOff}},o.prototype.showLoadChartDialog=function(){var e=this._loadChartService;e&&e.showLoadDialog()},o.prototype.showSaveAsChartDialog=function(){var e=this._saveChartService;e&&window.runOrSignIn(function(){e.saveChartAs()})},o.prototype.themes=function(){return new y({chartWidgetCollection:this._chartWidgetCollection})},o.prototype.undoRedoState=function(){return this._chartWidgetCollection.undoHistory.state()},o.prototype.takeScreenshot=function(){this._chartWidgetCollection.takeScreenshot()},e.exports=o}).call(t,i(8),i(16))},function(e,t,i){"use strict";(function(t){function n(e){var t,i,n=Object.keys(y),o=n.length;for(t=0;t<o;++t)if(i=n[t],y[i].name===e)return i;return null}function o(e){return"LineToolRiskRewardLong"===e||"LineToolRiskRewardShort"===e}var r=i(7).ensureNotNull,s=i(680),a=i(162).applyOverridesToStudy,l=i(26),c=i(681).LineDataSourceApi,h=i(682).StudyApi,u=i(683).PaneApi,d=i(3).DefaultProperty,p=i(335).availableIcons,_=i(37),f=i(15).Interval,m=i(35),y=i(298).supportedLineTools,g=i(292).showTooManyStudiesNotice,v=i(12).isNumber,S=i(684).onSeriesCompletedOrErrorReceived,b=function(e){this._chartWidget=e,this._panes=new WeakMap,this._studies=new WeakMap,this._lineDataSources=new WeakMap};b.prototype._getPaneApi=function(e){var t=this._panes.get(e);return void 0===t&&(t=new u(e),this._panes.set(e,t)),t},b.prototype._getStudyApi=function(e){var t=this._studies.get(e);return void 0===t&&(t=new h(e,this._chartWidget.model().model()),this._studies.set(e,t)),t},b.prototype._getLineDataSourceApi=function(e){var t=this._lineDataSources.get(e);return void 0===t&&(t=new c(e,this._chartWidget.model().model(),{apiPointsToDataSource:this._convertUserPointsToDataSource.bind(this),dataSourcePointsToPriced:function(e){var t=this._chartWidget.model().mainSeries().syncModel(),i=this._chartWidget.model().timeScale();return e.map(function(e){
var n=i.normalizeBarIndex(e.index);return{price:e.price,time:t.projectTime(n.time_t,n.offset)}})}.bind(this)}),this._lineDataSources.set(e,t)),t},b.prototype._makeSubscriptionFromDelegate=function(e){var t=$.extend({},e);return delete t.fire,t},b.prototype.executeActionById=function(e){this._chartWidget.executeActionById(e)},b.prototype.getCheckableActionState=function(e){return this._chartWidget.getCheckableActionState(e)},b.prototype.refreshMarks=function(){this._chartWidget.refreshMarks()},b.prototype.clearMarks=function(){this._chartWidget.clearMarks()},b.prototype.symbol=function(){return this._chartWidget.getSymbol()},b.prototype.symbolExt=function(){var e=this._chartWidget.model().mainSeries().symbolInfo();return e?{symbol:e.name,full_name:e.full_name,exchange:e.exchange,description:e.description,type:e.type}:null},b.prototype.resolution=function(){return this._chartWidget.model().mainSeries().properties().interval.value()},b.prototype.setSymbol=function(e,i){function n(e){e||i()}if(e!==this.symbol()||t.enabled("same_data_requery")){var o=this._chartWidget.model().mainSeries().dataEvents();return i&&S(o,n),this._chartWidget.setSymbol(e)}},b.prototype.resetData=function(){this._chartWidget.model().mainSeries().rerequestData()},b.prototype.setResolution=function(e,t){function i(e){e||t()}if((e=e.toUpperCase())!==this.resolution()){var n=this._chartWidget.model().mainSeries().dataEvents();return t&&S(n,i),this._chartWidget.setResolution(e)}},b.prototype.setEntityVisibility=function(e,t){var i,n;console.warn("`setEntityVisibility` is deprecated. Use shape/study API instead"),(i=this._chartWidget.model().model().dataSourceForId(e))&&(n=i.properties())&&n.visible&&n.visible.setValue(t)},b.prototype.getAllStudies=function(){return this._chartWidget.model().model().allStudies().map(function(e){return{id:e.id(),name:e._metaInfo.description}})},b.prototype.getAllShapes=function(){return this._chartWidget.model().model().allLineTools().map(function(e){return{id:e.id(),name:n(e.toolname)}}).filter(function(e){return null!==e.name})},b.prototype.removeAllShapes=function(){this._chartWidget.removeAllDrawingTools()},b.prototype.removeAllStudies=function(){this._chartWidget.removeAllStudies()},b.prototype.removeEntity=function(e){var t=this._chartWidget.model().chartModel().dataSourceForId(e);if(!t)return void console.warn("Can't find a source with id: "+e);this._chartWidget.model().chartModel().removeSource(t,!0)},b.prototype.createStudyTemplate=function(e){return this._chartWidget.model().model().studyTemplate(e.saveInterval)},b.prototype.applyStudyTemplate=function(e){this._chartWidget.model().model().restoreStudyTemplate(e,""+1e3*Math.random())},b.prototype.setVisibleRange=function(e,i){var n,o,r,s;if(void 0===e||!e.from||!e.to||isNaN(e.from)||isNaN(e.to))return void console.warn("Wrong time range: "+JSON.stringify(e)+'. Expected an object with "from" and "to" numeric values.');n=this._chartWidget.model().model(),o=n.mainSeries(),r=[parseInt(e.from),parseInt(e.to)],
s=f.isDWM(o.interval())&&!t.enabled("disable_resolution_rebuild")?this._alignPoints(r):r,e.from=s[0],e.to=s[1],this._chartWidget.setVisibleTimeRange(e.from,e.to,i)},b.prototype.getVisibleRange=function(){var e,t,i,n,o,r,s={from:0,to:0},a=this._chartWidget.model().timeScale(),l=a.visibleBars();return null===l?s:(e=this._chartWidget.model().mainSeries(),null===(t=e.syncModel())?s:null===e.data().last()?s:(i=e.data().last(),n=l.lastBar()-i.index,o=n<=0,r=o?a.indexToTimePoint(l.lastBar()):t.projectTime(i.value[TradingView.TIME_PLOT],n),s.from=+a.indexToTimePoint(Math.max(0,l.firstBar()))||0,s.to=+r||0,s))},b.prototype.getVisiblePriceRange=function(){return this._chartWidget.model().mainSeries()?this._chartWidget.model().mainSeries().priceScale().priceRangeInPrice():null},b.prototype._createTradingPrimitive=function(e,t){function i(){var e=TradingView.CLOSE_PLOT,t=r(n._chartWidget.model().mainSeries().bars().last());return{index:t.index,price:t.value[e]}}var n=this,o=this._chartWidget.model().model(),s=o.paneForSource(o.mainSeries());return(t?o:this._chartWidget.model()).createLineTool(s,i(),e)._adapter},b.prototype.createOrderLine=function(e){var e=e||{};return this._createTradingPrimitive("LineToolOrder",e.disableUndo)},b.prototype.createPositionLine=function(e){var e=e||{};return this._createTradingPrimitive("LineToolPosition",e.disableUndo)},b.prototype.createExecutionShape=function(e){var e=e||{};return this._createTradingPrimitive("LineToolExecution",e.disableUndo)},b.prototype.createShape=function(e,t){return this.createMultipointShape([e],t)},b.prototype._alignPoints=function(e){var t,i,n=this._chartWidget.model().model(),o=n.mainSeries(),r=o.symbolInfo(),s=m.get_timezone(r.timezone);return n.timeScale().isEmpty()?e:(t=(new _.Session).init(s,r.session),i=_.createDWMAligner(o.interval(),t),null===i?e:e.map(function(e){return e?(i.moveTo(1e3*e),i.startOfBar(0)/1e3):e}))},b.prototype._convertUserPointsToDataSource=function(e){function i(e,t,i){var n,o,r,s=h.closestIndexLeft(e)||0,a={index:s},l=h.valueAt(s);return e>l&&(n=c.syncModel().distance(l,e),n.success&&(a.index=a.index+n.result)),v(t)?a.price=t:(o=["open","high","low","close"],r=i?o.indexOf(i)+1:1,r<=0&&(r=1),a.price=u.valueAt(s)[r]),a}var n,o,r,s,a,l=this._chartWidget.model().model(),c=l.mainSeries(),h=l.timeScale().points(),u=c.data();if(l.timeScale().isEmpty())return null;for(n=e.map(function(e){return e.time}),o=f.isDWM(c.interval())&&!t.enabled("disable_resolution_rebuild")?this._alignPoints(n):n,r=[],s=0;s<e.length;s++)a=e[s],r.push(i(o[s],a.price,a.channel));return r},b.prototype.createMultipointShape=function(e,t,i){var n,r,s,a,l,c,h,u=t.disableUndo?this._chartWidget.model().model():this._chartWidget.model(),_=this._chartWidget.model().model(),f=_.mainSeries();if(!_.timeScale().isEmpty()){if(n=_.paneForSource(f),r=this._convertUserPointsToDataSource(e),s=y[t.shape]||y.flag,s.onlySelectable)throw Error('Cannot create "'+t.shape+'" shape')
;if("LineToolPolyline"===s.name)r[0].price===r[r.length-1].price&&r[0].index===r[r.length-1].index||r.push(r[0]);else if("LineToolIcon"===s.name){if(t.icon=t.icon||t.overrides&&t.overrides.icon,!t.hasOwnProperty("icon"))throw Error("icon must be specified in options");if(-1===p.indexOf(t.icon))throw Error("icon value must be valid");t.overrides=t.overrides||{},t.overrides.icon=t.icon}if(a=new d(s.name.toLowerCase()),t.overrides)for(l in t.overrides)a[l]?a[l].setValue(t.overrides[l]):o(s.name)&&-1!==["profitLevel","stopLevel"].indexOf(l)&&a.addProperty(l,t.overrides[l]);if(s.supportsText&&t.text&&a.text.setValue(t.text),c=u.createLineTool(n,r[0],s.name,a),c.pointsCount()!==r.length&&-1!==c.pointsCount())throw Error("Wrong points count for "+t.shape+". Required "+c.pointsCount());for(h=1;h<r.length&&this._chartWidget.model().lineBeingCreated();h++)u.coninueCreatingLine(r[h],{},h<r.length-1);return t.lock&&c.setUserEditEnabled(!1),t.disableSelection&&(c.customization.disableSelection=!0),t.disableSave&&(c.customization.disableSave=!0),t.hasOwnProperty("showInObjectsTree")&&(c.customization.showInObjectsTree=t.showInObjectsTree),t.zOrder&&("top"===t.zOrder?u.bringToFront(c):"bottom"===t.zOrder&&u.sendToBack(c)),c.id()}},b.prototype.getShapeById=function(e){var t=this._chartWidget.model().model().getLineToolById(e);if(null===t)throw Error("There is no such shape");return this._getLineDataSourceApi(t)},b.prototype.createStudy=function(e,t,i,n,o,c,h){var u,d,p,_,f,m;return h=h||{},h.checkLimit&&!this._chartWidget.model().canCreateStudy()?(g(),null):(e=e.toLowerCase(),u=this._chartWidget.model().chartModel(),d=l.findStudyMetaInfoByDescription(u.studiesMetaData(),e),d=$.extend({},d),delete d.state,d?(p={},n&&(p.inputs=s.getStudyRecordFromArray([e].concat(n),this._chartWidget).inputs),_=u.insertStudy(d,p,t,null,h.priceScale),c&&a(_,c),f=r(u.paneForSource(_)),m=f.priceScaleName(_.priceScale()),u.setPriceScaleVisibility(m,!0),i&&_.setUserEditEnabled(!1),o&&o(_.id()),_.id()):(console.warn("Study `"+e+"` not found."),null))},b.prototype.getStudyById=function(e){var t=this._chartWidget.model().model().getStudyById(e);if(null===t)throw Error("There is no such study");return this._getStudyApi(t)},b.prototype.chartType=function(){return this._chartWidget.model().mainSeries().properties().style.value()},b.prototype.setChartType=function(e){this._chartWidget.model().mainSeries().properties().style.setValue(e)},b.prototype.priceFormatter=function(){return this._chartWidget.model().mainSeries().priceScale().formatter()},b.prototype.onDataLoaded=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().dataEvents().completed())},b.prototype.onSymbolChanged=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().dataEvents().symbolResolved())},b.prototype.onIntervalChanged=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().onIntervalChanged())},b.prototype.onVisibleRangeChanged=function(){
return this._makeSubscriptionFromDelegate(this._chartWidget.model().timeScale().visibleBarsChanged())},b.prototype.dataReady=function(e){var t=!this._chartWidget.model()||!this._chartWidget.model().mainSeries()||this._chartWidget.model().mainSeries().data().isEmpty();return e&&(t?this.onDataLoaded().subscribe(null,e,!0):e()),!t},b.prototype.crossHairMoved=function(e){this._makeSubscriptionFromDelegate(this._chartWidget.model().chartModel().crossHairMoved()).subscribe(null,e)},b.prototype.setTimezone=function(e){this._chartWidget.setTimezone(e)},b.prototype.getPanes=function(){return this._chartWidget.model().chartModel().panes().map(function(e){return this._getPaneApi(e)},this)},b.prototype.exportData=function(e){var t=this._chartWidget;return new Promise(function(n){i.e(26).then(function(o){var r=i(821).exportData;n(r(t.model().chartModel(),e))}.bind(null,i)).catch(i.oe)})},b.prototype.canZoomOut=function(){return!this._chartWidget.model().zoomStack().isEmpty()},b.prototype.zoomOut=function(){this.canZoomOut()&&this._chartWidget.model().zoomFromViewport()},e.exports=b}).call(t,i(5))},function(e,t,i){"use strict";var n=function(){function e(e){return e.is_price_study}function t(e,t){var i,n=t.slice(0).toLowerCase();if(e){for(i=0;i<e.length;++i)if(e[i].description.toLowerCase()===n||e[i].shortDescription.toLowerCase()===n)return e[i];throw Error("Can't find metainfo for `"+t+"`")}throw Error("There is no studies metainfo at all")}function i(e){return e.inputs.map(function(e){return{id:e.id,type:e.type,name:e.name}})}function n(n,o){var r,a,l,c,h,u,d,p,_;if(!Array.isArray(n))return r=t(o.model().studiesMetaData(),n),{id:r.id,overlay:e(r)};for(a=n.slice(0),l=a[0],r=t(o.model().studiesMetaData(),l),c=e(r),h=i(r),d=a.splice(1),p=0;p<d.length;++p)u||(u={}),_=s[h[p].type]||s.string,u[h[p].id]=_(d[p]);return{id:r.id,name:l,overlay:c,inputs:u}}function o(e,n,o){function r(e){return e.name.toLowerCase()===a}var s,a,l,c=t(o.model().studiesMetaData(),e),h=i(c),u={};for(s in n)a=s.toLowerCase(),l=h.filter(r),0!==l.length?(l=l[0],u[l.id]=n[s]):console.warn("Uknown input `"+s+"` of `"+e+"`");return{id:c.id,name:e,inputs:u}}var r={},s={bool:function(e){return!!e},integer:function(e){return parseInt(e)},float:function(e){return parseFloat(e)},string:function(e){return e}};return r.getStudyRecordFromArray=function(e,t){return t=t||chartWidget,n(e,t)},r.getStudyRecordFromObject=function(e,t,i){return i=i||chartWidget,o(e,t,i)},r}();e.exports=n},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"LineDataSourceApi",function(){return r}),n=i(12),i.n(n),o=["alwaysShowStats","clonable","entryPrice","interval","lastUpdateTime","points","singleChartOnly","snapTo45Degrees","stopPrice","symbol","targetPrice"],r=function(){function e(e,t,i){this._source=e,this._model=t,this._pointsConverter=i}return e.prototype.isSelectionEnabled=function(){return this._source.isSelectionEnabled()},e.prototype.setSelectionEnabled=function(e){this._source.setSelectionEnabled(e)},e.prototype.isSavingEnabled=function(){
return this._source.isSavedInChart()},e.prototype.setSavingEnabled=function(e){this._source.setSavingInChartEnabled(e)},e.prototype.isShowInObjectsTreeEnabled=function(){return this._source.showInObjectTree()},e.prototype.setShowInObjectsTreeEnabled=function(e){this._source.setShowInObjectsTreeEnabled(e)},e.prototype.isUserEditEnabled=function(){return this._source.userEditEnabled()},e.prototype.setUserEditEnabled=function(e){this._source.setUserEditEnabled(e)},e.prototype.bringToFront=function(){this._model.bringToFront(this._source)},e.prototype.sendToBack=function(){this._model.sendToBack(this._source)},e.prototype.getProperties=function(){return this._source.properties().state(o,!0)},e.prototype.setProperties=function(e){this._setProps(this._source.properties(),e,"")},e.prototype.getPoints=function(){return this._pointsConverter.dataSourcePointsToPriced(this._source.points())},e.prototype.setPoints=function(e){var t,i,n=this._source.pointsCount(),o=-1===n?this._source.points().length:n;if(o!==e.length)throw Error("Wrong points count. Required="+o);for(t=this._pointsConverter.apiPointsToDataSource(e),i=0;i<t.length;++i)this._source.setPoint(i,t[i])},e.prototype._setProps=function(e,t,i){var o,r,s;for(o in t)t.hasOwnProperty(o)&&(r=0===i.length?o:i+"."+o,e.hasOwnProperty(o)?(s=t[o],Object(n.isHashObject)(s)?this._setProps(e[o],s,r):e[o].setValue(s)):console.warn('Unknown property "'+r+'"'))},e}()},function(e,t,i){"use strict";var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"StudyApi",function(){return s}),n=i(1),i(11),o=i(7),i.n(o),r=i(162),s=function(){function e(e,t){this._study=e,this._model=t}return e.prototype.isUserEditEnabled=function(){return this._study.userEditEnabled()},e.prototype.setUserEditEnabled=function(e){this._study.setUserEditEnabled(e)},e.prototype.getInputsInfo=function(){return this._study.metaInfo().inputs.map(function(e){return n.a({},e,{localizedName:void 0!==e.name?window.t(e.name,{context:"input"}):""})})},e.prototype.getInputValues=function(){var e=this._study.inputs();return Object.keys(e).map(function(t){return{id:t,value:e[t]}})},e.prototype.setInputValues=function(e){var t,i,n,o=this.getInputValues(),r=function(e){void 0!==o.find(function(t){return t.id===e.id})?s._study.properties().inputs[e.id].setValue(e.value):console.warn('There is no such input: "'+e.id+'"')},s=this;for(t=0,i=e;t<i.length;t++)n=i[t],r(n)},e.prototype.mergeUp=function(){this._model.mergeSourceUp(this._study),this._showStudyPriceScale()},e.prototype.mergeDown=function(){this._model.mergeSourceDown(this._study),this._showStudyPriceScale()},e.prototype.unmergeUp=function(){this._model.unmergeSourceUp(this._study),this._showStudyPriceScale()},e.prototype.unmergeDown=function(){this._model.unmergeSourceDown(this._study),this._showStudyPriceScale()},e.prototype.changePriceScale=function(e){var t,i,n,r=Object(o.ensureNotNull)(this._model.paneForSource(this._study)),s=null;switch(e){case"left":s=r.priceScaleByName("left");break;case"right":s=r.priceScaleByName("right");break;case"no-scale":
s=r.priceScaleByName("");break;case"as-series":if(t=this._model.mainSeries(),(i=Object(o.ensureNotNull)(this._model.paneForSource(t)))!==r)return void console.warn('BEWARE: Attempt to change price scale to "as-series", but series and study are on different panes');n=i.priceScaleName(i.priceScaleForSource(t)),s=r.priceScaleByName(n);break;default:throw Error("Cannot change study's price scale to unknown price scale (\""+e+'")')}this._model.move(this._study,r,s),this._showStudyPriceScale()},e.prototype.isVisible=function(){return this._study.properties().visible.value()},e.prototype.setVisible=function(e){this._study.properties().visible.setValue(e)},e.prototype.bringToFront=function(){this._model.bringToFront(this._study)},e.prototype.sendToBack=function(){this._model.sendToBack(this._study)},e.prototype.applyOverrides=function(e){Object(r.applyOverridesToStudy)(this._study,e)},e.prototype._showStudyPriceScale=function(){var e=Object(o.ensureNotNull)(this._model.paneForSource(this._study)),t=e.priceScaleName(this._study.priceScale());this._model.setPriceScaleVisibility(t,!0)},e}()},function(e,t,i){"use strict";var n,o;Object.defineProperty(t,"__esModule",{value:!0}),n=function(){function e(e){this._priceScale=e}return e.prototype.getMode=function(){var e=this._priceScale.properties();return e.percentage.value()?2:e.indexedTo100.value()?3:e.log.value()?1:0},e.prototype.setMode=function(e){this._priceScale.setMode({percentage:2===e,log:1===e,indexedTo100:3===e})},e}(),i.d(t,"PaneApi",function(){return o}),o=function(){function e(e){this._priceScales=new WeakMap,this._pane=e}return e.prototype.hasMainSeries=function(){return this._pane.containsMainSeries()},e.prototype.getLeftPriceScale=function(){return this._getPriceScaleApi(this._pane.leftPriceScale())},e.prototype.getRightPriceScale=function(){return this._getPriceScaleApi(this._pane.rightPriceScale())},e.prototype.getMainSourcePriceScale=function(){var e,t=this._pane.mainDataSource();return null===t?null:(e=this._pane.priceScaleForSource(t),null===e?null:this._getPriceScaleApi(e))},e.prototype._getPriceScaleApi=function(e){var t=this._priceScales.get(e);return void 0===t&&(t=new n(e),this._priceScales.set(e,t)),t},e}()},function(e,t,i){"use strict";function n(e,t){var i=function(){e.completed().unsubscribe(null,n),t(!1)},n=function(){e.error().unsubscribe(null,i),t(!0)};e.completed().subscribe(null,i,!0),e.error().subscribe(null,n,!0)}Object.defineProperty(t,"__esModule",{value:!0}),t.onSeriesCompletedOrErrorReceived=n},function(e,t,i){"use strict";var n,o;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"ThemesApi",function(){return o}),n=i(251),o=function(){function e(e){this._opts=e}return e.prototype.isStdTheme=function(){return Object(n.isStdTheme)(Object(n.extractThemeFromModel)(this._getActiveChartModel()))},e.prototype.setStdTheme=function(e){var t=this;return Object(n.getStdTheme)(e).then(function(i){t._opts.chartWidgetCollection.applyTheme(i.content),Object(n.setTheme)(e),Object(n.syncTheme)()})},e.prototype.setStdThemeForLayout=function(e){
Object(n.setTheme)(e),Object(n.syncTheme)()},e.prototype.getCurrentThemeName=function(){return Object(n.getCurrentTheme)().name},e.prototype._getActiveChartModel=function(){return this._getActiveChartWidget().model()},e.prototype._getActiveChartWidget=function(){return this._opts.chartWidgetCollection.activeChartWidget.value()},e}()},function(e,t,i){"use strict";var n,o,r,s=i(25);i(183),n=i(687).pivotPointsStandardStudyItem,o=i(688).spreadStudyItem,r=i(689).ratioStudyItem,JSServer.studyLibrary=JSServer.studyLibrary.concat([{name:"Compare",metainfo:{_metainfoVersion:15,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!0,defaults:{styles:{compare:{linestyle:0,linewidth:2,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800080"}},precision:4,inputs:{source:"close",symbol:""}},plots:[{id:"compare",type:"line"}],styles:{compare:{title:"Plot",histogramBase:0}},description:"Compare",shortDescription:"Compare",is_price_study:!0,inputs:[{defval:"close",id:"source",name:"Source",options:["open","high","low","close","hl2","hlc3","ohlc4"],type:"text"},{id:"symbol",name:"Symbol",type:"symbol",isHidden:!0}],id:"Compare@tv-basicstudies-1"},constructor:function(){this.init=function(e,t){this._context=e,this._context.new_sym(t(1),s.Std.period(this._context),s.Std.period(this._context))},this.main=function(e,t){var i,n,o,r,a;return this._context=e,i=this._context.new_unlimited_var(this._context.symbol.time),this._context.select_sym(1),n=this._context.new_unlimited_var(this._context.symbol.time),o=s.Std[t(0)](this._context),r=this._context.new_unlimited_var(o),this._context.select_sym(0),a=r.adopt(n,i,0),[a]}}},{name:"Overlay",metainfo:{_metainfoVersion:15,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!0,defaults:{styles:{},precision:4,inputs:{symbol:""}},plots:[{id:"open",type:"line"},{id:"high",type:"line"},{id:"low",type:"line"},{id:"close",type:"line"}],styles:{open:{title:"Open"},high:{title:"High"},low:{title:"Low"},close:{title:"Close"}},description:"Overlay",shortDescription:"Overlay",is_price_study:!1,inputs:[{id:"symbol",name:"symbol",defval:"",type:"symbol",isHidden:!0}],id:"Overlay@tv-basicstudies-1"},constructor:function(){this.init=function(e,t){this._context=e,this._context.new_sym(t(0),s.Std.period(this._context),s.Std.period(this._context))},this.main=function(e,t){var i,n,o,r,a,l;return this._context=e,i=this._context.new_unlimited_var(this._context.symbol.time),this._context.select_sym(1),n=this._context.new_unlimited_var(this._context.symbol.time),o=this._context.new_unlimited_var(s.Std.open(this._context)),r=this._context.new_unlimited_var(s.Std.high(this._context)),a=this._context.new_unlimited_var(s.Std.low(this._context)),l=this._context.new_unlimited_var(s.Std.close(this._context)),this._context.select_sym(0),[o.adopt(n,i,1),r.adopt(n,i,1),a.adopt(n,i,1),l.adopt(n,i,1)]}}},{name:"Volume",metainfo:{_metainfoVersion:15,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,transparency:65,defaults:{styles:{vol:{linestyle:0,linewidth:1,plottype:5,trackPrice:!1,transparency:65,visible:!0,color:"#000080"},
vol_ma:{linestyle:0,linewidth:1,plottype:4,trackPrice:!1,transparency:65,visible:!0,color:"#0496FF"}},precision:0,palettes:{volumePalette:{colors:{0:{color:"#eb4d5c",width:1,style:0},1:{color:"#53b987",width:1,style:0}}}},inputs:{showMA:!1,maLength:20}},plots:[{id:"vol",type:"line"},{id:"volumePalette",palette:"volumePalette",target:"vol",type:"colorer"},{id:"vol_ma",type:"line"}],styles:{vol:{title:"Volume",histogramBase:0},vol_ma:{title:"Volume MA",histogramBase:0}},description:"Volume",shortDescription:"Volume",is_price_study:!1,palettes:{volumePalette:{colors:{0:{name:"Falling"},1:{name:"Growing"}}}},inputs:[{id:"showMA",name:"show MA",defval:!1,type:"bool"},{id:"maLength",name:"MA Length",defval:20,type:"integer",min:1,max:2e3}],id:"Volume@tv-basicstudies-1"},constructor:function(){this.f_0=function(e,t){return s.Std.gt(e,t)?0:1},this.f_1=function(e,t){return e?t:s.Std.na()},this.main=function(e,t){var i,n,o,r,a,l,c;return this._context=e,this._input=t,i=this._input(0),n=s.Std.volume(this._context),o=this.f_0(s.Std.open(this._context),s.Std.close(this._context)),r=s.Std.volume(this._context),a=this._context.new_var(r),l=s.Std.sma(a,this._input(1),this._context),c=this.f_1(i,l),[n,o,c]}}},{name:"ZigZag",metainfo:{_metainfoVersion:23,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:2,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,inputs:{in_0:5,in_1:10}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",target:"plot_0",type:"dataoffset"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Zig Zag",shortDescription:"ZigZag",is_price_study:!0,classId:"ScriptWithDataOffset",inputs:[{id:"in_0",name:"deviation",defval:5,type:"integer",min:1,max:100},{id:"in_1",name:"depth",defval:10,type:"integer",min:2,max:1e3}],id:"ZigZag@tv-basicstudies-1"},constructor:function(){this.main=function(e,t){var i,n,o,r,a,l,c,h;return this._context=e,this._input=t,i=this._input(0),n=this._input(1),o=i/100,r=n/2,a=s.Std.zigzag(o,r,this._context),l=s.Std.zigzagbars(o,r,this._context),c=a,h=l,[c,h]}}},{name:"Sessions",metainfo:{_metainfoVersion:44,defaults:{graphics:{vertlines:{sessBreaks:{color:"#4985e7",style:2,visible:!1,width:1}}},linkedToSeries:!0,precision:4},description:"Sessions",graphics:{vertlines:{sessBreaks:{name:"Session Break"}}},id:"Sessions@tv-basicstudies-1",inputs:[],is_hidden_study:!0,is_price_study:!0,name:"Sessions@tv-basicstudies",palettes:{},plots:[],shortDescription:"Sessions"},constructor:function(){function e(e,t){return{id:e,time:e,extendBottom:!0,extendTop:!0}}this.init=function(){this._times=[]},this._getVerticalLineData=function(t){return s.Std.selectSessionBreaks(t,this._times).map(e)},this.main=function(e,t){var i,n,o;return s.Std.isdwm(e)?null:(i=s.Std.time(e),isNaN(i)?null:(n=this._times.length,0!==n&&this._times[n-1]===i||this._times.push(i),e.symbol.isLastBar&&e.symbol.isNewBar?(o=this._getVerticalLineData(e),0===o.length?null:{nonseries:!0,type:"study_graphics",data:{graphicsCmds:{create:{vertlines:[{
styleId:"sessBreaks",data:o}]},erase:[{action:"all"}]}}}):null))}}},{name:"SuperTrend",metainfo:{_metainfoVersion:39,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:3,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"},plot_2:{linestyle:0,linewidth:3,plottype:"shape_arrow_up",trackPrice:!1,location:"BelowBar",transparency:35,visible:!0,color:"#00FF00"},plot_3:{linestyle:0,linewidth:3,plottype:"shape_arrow_down",trackPrice:!1,location:"AboveBar",transparency:35,visible:!0,color:"#FF0000"}},precision:4,palettes:{palette_0:{colors:{0:{color:"#008000",width:3,style:0},1:{color:"#800000",width:3,style:0}}}},inputs:{in_0:10,in_1:3}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",palette:"palette_0",target:"plot_0",type:"colorer"},{id:"plot_2",type:"shapes"},{id:"plot_3",type:"shapes"}],styles:{plot_0:{title:"SuperTrend",histogramBase:0,joinPoints:!1,isHidden:!1},plot_2:{title:"Up Arrow",histogramBase:0,joinPoints:!1,isHidden:!1},plot_3:{title:"Down Arrow",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"SuperTrend",shortDescription:"SuperTrend",is_price_study:!0,palettes:{palette_0:{colors:{0:{name:"Color 0"},1:{name:"Color 1"}},valToIndex:{0:0,1:1}}},inputs:[{id:"in_0",name:"Length",defval:10,type:"integer",min:1,max:100},{id:"in_1",name:"Factor",defval:3,type:"float",min:1,max:100}],id:"SuperTrend@tv-basicstudies-1",scriptIdPart:"",name:"SuperTrend",isCustomIndicator:!0},constructor:function(){this.f_0=function(){var e,t,i,n,o,r=this._input(0),a=this._input(1),l=s.Std.atr(r,this._context);return r=s.Std.hl2(this._context)+l*a,l=s.Std.hl2(this._context)-l*a,e=this._context.new_var(s.Std.close(this._context)),a=this._context.new_var(),t=s.Std.max(l,a.get(1)),a.set(s.Std.gt(e.get(1),a.get(1))?t:l),l=this._context.new_var(),t=s.Std.min(r,l.get(1)),l.set(s.Std.lt(e.get(1),l.get(1))?t:r),r=this._context.new_var(),e=s.Std.nz(r.get(1),1),e=s.Std.lt(s.Std.close(this._context),a.get(1))?-1:e,r.set(s.Std.gt(s.Std.close(this._context),l.get(1))?1:e),a=s.Std.eq(r.get(0),1)?a.get(0):l.get(0),i=s.Std.eq(r.get(0),1)?0:1,n=1===r.get(0)&&-1===r.get(1),o=-1===r.get(0)&&1===r.get(1),[a,i,n,o]},this.main=function(e,t){this._context=e,this._input=t;var i=this.f_0();return[i[0],i[1],i[2],i[3]]}}},n,o,r])},function(e,t,i){"use strict";function n(e){switch(e){case"Traditional":return 0;case"Fibonacci":return 1;case"Woodie":return 2;case"Classic":return 3;case"DeMark":return 4;case"Camarilla":return 5;default:throw Error("Unknown kind "+e)}}function o(e,t){e.setUTCMonth(e.getUTCMonth()+t)}function r(e,t){return new Date(t,e,0).getDate()}function s(e,t){var i,n,s;return u.Std.ismonthly(e)?(i=new Date(t),n=i.getUTCDay(),s=r(i.getUTCMonth(),i.getUTCFullYear()),n<s?(o(i,u.Std.interval(e)),i=u.Std.add_days_considering_dst("Etc/UTC",i,1-i.getUTCDay())):(i=u.Std.add_days_considering_dst("Etc/UTC",i,1),o(i,u.Std.interval(e))),i.valueOf()):t+d.Interval.parse(e.symbol.resolution).inMilliseconds(t)}function a(e,t,i,n,o,r,s,a){var l,c=new p,h=NaN,d=i-n;switch(a){case 0:h=(i+n+o)/3,
c.p=h,c.r1=2*h-n,c.s1=2*h-i,c.r2=h+(i-n),c.s2=h-(i-n),c.r3=2*h+(i-2*n),c.s3=2*h-(2*i-n),c.r4=3*h+(i-3*n),c.s4=3*h-(3*i-n),c.r5=4*h+(i-4*n),c.s5=4*h-(4*i-n);break;case 1:h=(i+n+o)/3,c.p=h,c.r1=h+.382*d,c.s1=h-.382*d,c.r2=h+.618*d,c.s2=h-.618*d,c.r3=h+d,c.s3=h-d;break;case 2:h=(i+n+2*e)/4,c.p=h,c.r1=2*h-n,c.s1=2*h-i,c.r2=h+d,c.s2=h-d,c.r3=i+2*(h-n),c.s3=n-2*(i-h),c.r4=c.r3+d,c.s4=c.s3-d;break;case 3:h=(i+n+o)/3,c.p=h,c.r1=2*h-n,c.s1=2*h-i,c.r2=h+d,c.s2=h-d,c.r3=h+2*d,c.s3=h-2*d,c.r4=h+3*d,c.s4=h-3*d;break;case 4:l=NaN,l=u.Std.equal(t,o)?i+n+2*o:u.Std.greater(o,t)?2*i+n+o:2*n+i+o,h=l/4,c.p=h,c.r1=l/2-n,c.s1=l/2-i;break;case 5:h=(i+n+o)/3,c.p=h,c.r1=o+1.1*d/12,c.s1=o-1.1*d/12,c.r2=o+1.1*d/6,c.s2=o-1.1*d/6,c.r3=o+1.1*d/4,c.s3=o-1.1*d/4,c.r4=o+1.1*d/2,c.s4=o-1.1*d/2;break;default:throw Error("Unknown kind")}return c.startIndex__t=r,c.endIndex__t=s,c}function l(e,t){return(!u.Std.isdaily(e)||"Daily"!==t)&&((!u.Std.isweekly(e)||"Daily"!==t&&"Weekly"!==t)&&(!u.Std.ismonthly(e)||"Daily"!==t&&"Weekly"!==t&&"Monthly"!==t))}function c(e){if(u.Std.isweekly(e)||u.Std.ismonthly(e))return"12M";if(u.Std.isdaily(e))return"1M";if(u.Std.isintraday(e)){var t=u.Std.interval(e);return t>=1&&t<=15?"1D":"1W"}throw Error("Unexpected resolution type: "+e.symbol.resolution)}function h(e,t){switch(t){case"Auto":return c(e);case"Daily":return"1D";case"Weekly":return"1W";case"Monthly":return"1M";case"Yearly":return"12M";default:throw Error("No such pivTimeFrame: "+t)}}var u,d,p,_,f,m;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"pivotPointsStandardStudyItem",function(){return m}),u=i(25),i.n(u),d=i(15),p=function(){function e(){this.p=NaN,this.r1=NaN,this.s1=NaN,this.r2=NaN,this.s2=NaN,this.r3=NaN,this.s3=NaN,this.r4=NaN,this.s4=NaN,this.r5=NaN,this.s5=NaN,this.startIndex__t=NaN,this.endIndex__t=NaN}return e}(),_=function(){function e(){this.pivots=[]}return e}(),f=function(){function e(){this._secondaryRes="1D",this._firstMainSeriesBarTime=NaN}return e.prototype.init=function(e,t){var i,o=t(0),r=t(1),s=t(2),a=t(3);this._data=new _,this._firstMainSeriesBarTime=NaN,this._kindPP=n(o),this._showHistoricalPivots=r,this._historicalPivotsToKeep=a,this._pivTimeFrame=s,this._isValidResolution=l(e,this._pivTimeFrame),this._isValidResolution||u.Std.error("You cannot see this pivot timeframe on this resolution"),this._isValidResolution&&(this._secondaryRes=h(e,this._pivTimeFrame)),i=""===e.symbol.resolution?Math.max(30,2*parseInt(e.symbol.interval))+"":e.symbol.period,e.new_sym(e.symbol.tickerid,this._secondaryRes,this._secondaryRes,i)},e.prototype.main=function(e){var t,i,n,o,r,l,c,h,d,p,_,f,m,y,g;return this._isValidResolution?e.symbol.time?(isNaN(this._firstMainSeriesBarTime)&&(this._firstMainSeriesBarTime=e.symbol.time,this._removeUnusedPivots()),e.symbol.isLastBar&&e.symbol.isNewBar?this._createResponse():null):(e.select_sym(1),t=e.new_var(u.Std.open(e)),i=e.new_var(u.Std.high(e)),n=e.new_var(u.Std.low(e)),o=e.new_var(u.Std.close(e)),r=e.new_var(u.Std.time(e)),l=this._data,c=t.get(0),h=r.get(0),d=t.get(1),p=i.get(1),_=n.get(1),f=o.get(1),
m=e.symbol.isLastBar,0!==l.pivots.length&&e.symbol.isNewBar&&(y=l.pivots[l.pivots.length-1],y.endIndex__t!==h&&(y.endIndex__t=h)),0!==e.symbol.index&&e.symbol.isNewBar?(g=a(c,d,p,_,f,h,s(e,h),this._kindPP),e.select_sym(0),this._showHistoricalPivots||(l.pivots=[]),l.pivots.push(g),l.pivots.length>this._historicalPivotsToKeep&&l.pivots.shift(),m?this._createResponse():null):(e.select_sym(0),null)):null},e.prototype._createResponse=function(){return 0===this._data.pivots.length?null:{nonseries:!0,type:"non_series_data",data:{data:this._data}}},e.prototype._removeUnusedPivots=function(){var e=this,t=Math.max(this._data.pivots.findIndex(function(t){return t.startIndex__t>e._firstMainSeriesBarTime})-1,0);t>0&&this._data.pivots.splice(0,t)},e}(),m={name:"Pivot Points Standard",metainfo:{_metainfoVersion:44,defaults:{inputs:{kind:"Traditional",lookBack:15,pivTimeFrame:"Auto",showHistoricalPivots:!0},precision:"4"},description:"Pivot Points Standard",id:"PivotPointsStandard@tv-basicstudies-80",inputs:[{defval:"Traditional",id:"kind",name:"Type",options:["Traditional","Fibonacci","Woodie","Classic","DeMark","Camarilla"],type:"text"},{defval:!0,id:"showHistoricalPivots",name:"Show historical pivots",type:"bool"},{defval:"Auto",id:"pivTimeFrame",name:"Pivots Timeframe",options:["Auto","Daily","Weekly","Monthly","Yearly"],type:"text"},{defval:15,id:"lookBack",max:5e3,min:2,name:"Number of Pivots Back",type:"integer"}],is_price_study:!0,linkedToSeries:!0,shortDescription:"Pivots"},constructor:f}},function(e,t,i){"use strict";var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"spreadStudyItem",function(){return s}),n=i(1),o=i(299),r=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.c(t,e),t.prototype._doCalculation=function(e,t,i,n){return e*t-i*n},t}(o.a),s={name:"Spread",metainfo:{_metainfoVersion:15,defaults:o.b,plots:o.d,styles:o.e,description:"Spread",shortDescription:"Spread",is_price_study:!1,inputs:o.c,id:"Spread@tv-basicstudies-1"},constructor:r}},function(e,t,i){"use strict";var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"ratioStudyItem",function(){return s}),n=i(1),o=i(299),r=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.c(t,e),t.prototype._doCalculation=function(e,t,i,n){return e*t/(i*n)},t}(o.a),s={name:"Ratio",metainfo:{_metainfoVersion:15,defaults:o.b,plots:o.d,styles:o.e,description:"Ratio",shortDescription:"Ratio",is_price_study:!1,inputs:o.c,id:"Ratio@tv-basicstudies-1"},constructor:r}}],[462]);

View File

@@ -1,4 +1,4 @@
!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n,r,o=window.webpackJsonp;window.webpackJsonp=function(n,i,a){for(var s,u,l,c=0,f=[];c<n.length;c++)u=n[c],r[u]&&f.push(r[u][0]),r[u]=0;for(s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s]);for(o&&o(n,i,a);f.length;)f.shift()();if(a)for(c=0;c<a.length;c++)l=t(t.s=a[c]);return l},n={},r={34:0},t.e=function(e){function n(){a.onerror=a.onload=null,clearTimeout(s);var t=r[e];0!==t&&(t&&t[1](Error("Loading chunk "+e+" failed.")),r[e]=void 0)}var o,i,a,s,u=r[e];return 0===u?new Promise(function(e){e()}):u?u[2]:(o=new Promise(function(t,n){u=r[e]=[t,n]}),u[2]=o,i=document.getElementsByTagName("head")[0],a=document.createElement("script"),a.type="text/javascript",a.charset="utf-8",a.async=!0,a.timeout=12e4,t.nc&&a.setAttribute("nonce",t.nc),a.src=t.p+""+({0:"lt-pane-views",1:"chart-widget-gui",2:"create-dialog",3:"floating-toolbars",4:"take-chart-image-dialog-impl",5:"drawing-toolbar",6:"ds-property-pages",7:"restricted-toolset",8:"objecttreedialog",9:"go-to-date-dialog-impl",10:"load-chart-layout-dialog",11:"ie-fallback-logos",12:"chart-bottom-toolbar",13:"symbol-info-dialog-impl",14:"add-compare-dialog",15:"study-market",16:"confirm-inputs-dialog",17:"editobjectdialog",18:"header-toolbar",19:"confirm-symbol-input-dialog",20:"symbolsearch",21:"change-interval-dialog",23:"lazy-velocity",24:"study-pane-views",25:"series-pane-views",26:"export-data",27:"propertypagesfactory",28:"hammerjs",29:"library",30:"line-tools-icons",31:"lazy-jquery-ui",32:"series-icons-map"}[e]||e)+"."+{0:"92236c4fd18131ce41f4",1:"67de12c05d134554ff1c",2:"b388c187425e521c5a70",3:"348bec38a5b37a3f388f",4:"8581642b95a39228d178",5:"b5c7b558d29b0ded0e45",6:"0ec3f0e39331586d5be1",7:"a0f7780efd28528934ba",8:"b9fa79f3c22b36c514bf",9:"193ed211cd4f2c07f45e",10:"7bca15b478667d4a383c",11:"ecdc2f1255ecbff1dc5f",12:"7bbb5f176039f7d3dc2b",13:"6812ea9f986a1db1a6a9",14:"99e6e22e5d6b137269e9",15:"c4fcdd9f755d64995795",16:"acb4dc0e002888e741f5",17:"6741e8ad1a77a4388d0f",18:"95cfaecb949c7e2261e3",19:"741858b9ef54b3611d31",20:"e22809c43539f903c28a",21:"90d98fd5c50c9ae968da",22:"d344a511955b43dbefcc",23:"b369bcf3fef7b3d24234",24:"a750dba6fc5340758064",25:"9ee45674170ad7836ba4",26:"c8730af5d9a5f56fecc4",27:"42f63d141baef6e836f7",28:"9f017652d0f77438961c",29:"7caf3f24f35b9ce9c726",30:"d4bcd6d038b2fea6feed",31:"d97968c821f676a52e9b",32:"359d3b9b312cf5f56733",33:"bf2a2fc98cda3004cc87"}[e]+".js",s=setTimeout(n,12e4),a.onerror=a.onload=n,i.appendChild(a),o)},t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="bundles/",t.p=window.WEBPACK_PUBLIC_PATH||t.p,t.oe=function(e){throw console.error(e),e},t(t.s=360)}([,,,,,,,,,,function(e,t,n){
!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n,r,o=window.webpackJsonp;window.webpackJsonp=function(n,i,a){for(var s,u,l,c=0,f=[];c<n.length;c++)u=n[c],r[u]&&f.push(r[u][0]),r[u]=0;for(s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s]);for(o&&o(n,i,a);f.length;)f.shift()();if(a)for(c=0;c<a.length;c++)l=t(t.s=a[c]);return l},n={},r={34:0},t.e=function(e){function n(){a.onerror=a.onload=null,clearTimeout(s);var t=r[e];0!==t&&(t&&t[1](Error("Loading chunk "+e+" failed.")),r[e]=void 0)}var o,i,a,s,u=r[e];return 0===u?new Promise(function(e){e()}):u?u[2]:(o=new Promise(function(t,n){u=r[e]=[t,n]}),u[2]=o,i=document.getElementsByTagName("head")[0],a=document.createElement("script"),a.type="text/javascript",a.charset="utf-8",a.async=!0,a.timeout=12e4,t.nc&&a.setAttribute("nonce",t.nc),a.src=t.p+""+({0:"lt-pane-views",1:"chart-widget-gui",2:"create-dialog",3:"floating-toolbars",4:"take-chart-image-dialog-impl",5:"drawing-toolbar",6:"ds-property-pages",7:"restricted-toolset",8:"objecttreedialog",9:"go-to-date-dialog-impl",10:"load-chart-layout-dialog",11:"ie-fallback-logos",12:"chart-bottom-toolbar",13:"symbol-info-dialog-impl",14:"add-compare-dialog",15:"study-market",16:"confirm-inputs-dialog",17:"editobjectdialog",18:"header-toolbar",19:"confirm-symbol-input-dialog",20:"symbolsearch",21:"change-interval-dialog",23:"lazy-velocity",24:"study-pane-views",25:"series-pane-views",26:"export-data",27:"propertypagesfactory",28:"hammerjs",29:"library",30:"line-tools-icons",31:"lazy-jquery-ui",32:"series-icons-map"}[e]||e)+"."+{0:"92236c4fd18131ce41f4",1:"67de12c05d134554ff1c",2:"b388c187425e521c5a70",3:"348bec38a5b37a3f388f",4:"8581642b95a39228d178",5:"b5c7b558d29b0ded0e45",6:"0ec3f0e39331586d5be1",7:"a0f7780efd28528934ba",8:"b9fa79f3c22b36c514bf",9:"193ed211cd4f2c07f45e",10:"7bca15b478667d4a383c",11:"ecdc2f1255ecbff1dc5f",12:"7bbb5f176039f7d3dc2b",13:"6812ea9f986a1db1a6a9",14:"99e6e22e5d6b137269e9",15:"c4fcdd9f755d64995795",16:"acb4dc0e002888e741f5",17:"6741e8ad1a77a4388d0f",18:"95cfaecb949c7e2261e3",19:"741858b9ef54b3611d31",20:"e22809c43539f903c28a",21:"90d98fd5c50c9ae968da",22:"d344a511955b43dbefcc",23:"b369bcf3fef7b3d24234",24:"a750dba6fc5340758064",25:"9ee45674170ad7836ba4",26:"c8730af5d9a5f56fecc4",27:"42f63d141baef6e836f7",28:"9f017652d0f77438961c",29:"11e673c7c583dd935841",30:"d4bcd6d038b2fea6feed",31:"d97968c821f676a52e9b",32:"359d3b9b312cf5f56733",33:"bf2a2fc98cda3004cc87"}[e]+".js",s=setTimeout(n,12e4),a.onerror=a.onload=n,i.appendChild(a),o)},t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="bundles/",t.p=window.WEBPACK_PUBLIC_PATH||t.p,t.oe=function(e){throw console.error(e),e},t(t.s=360)}([,,,,,,,,,,function(e,t,n){
var r=n(22),o=n(90),i=n(74),a=n(75),s=n(55),u="prototype",l=function(e,t,n){var c,f,p,d,h=e&l.F,g=e&l.G,m=e&l.S,y=e&l.P,v=e&l.B,b=g?r:m?r[t]||(r[t]={}):(r[t]||{})[u],w=g?o:o[t]||(o[t]={}),x=w[u]||(w[u]={});g&&(n=t);for(c in n)f=!h&&b&&void 0!==b[c],p=(f?b:n)[c],d=v&&f?s(p,r):y&&"function"==typeof p?s(Function.call,p):p,b&&a(b,c,p,e&l.U),w[c]!=p&&i(w,c,d),y&&x[c]!=p&&(x[c]=p)};r.core=o,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,e.exports=l},function(e,t,n){"use strict";function r(e){window.t=e}function o(e){s.$||(s.$={}),s.$.t=e}function i(e){return e?(window._tv_languages||{})[e]||null:null}function a(){document.body&&document.body.dispatchEvent(new c.CustomEvent("tradingview-i18next-initialized"))}var s,u,l,c,f,p,d,h,g;Object.defineProperty(t,"__esModule",{value:!0}),s=window,u=function(e,t){return e},r(u),o(u),l=n(237),c=n(240),n.d(t,"translate",function(){return u}),p={translate:u},window.__tradingviewI18nextInited||(d=window.language||null,h=i(d),d&&h||(console.error("No translation data"),d="en",h=i("en")),d&&h?(g={interpolation:{prefix:"__",suffix:"__"},keySeparator:":::",lng:d,nsSeparator:":::",resources:(f={},f[d]={translation:h},f)},l.init(g,a),p.translate=l.t.bind(l),r(p.translate),o(p.translate)):a(),window.__tradingviewI18nextInited=!0)},,,function(e,t){function n(e){var t,n,r=kt[e]={};for(e=e.split(/\s+/),t=0,n=e.length;t<n;t++)r[e[t]]=!0;return r}function r(e,t,n){if(void 0===n&&1===e.nodeType){var r="data-"+t.replace(D,"-$1").toLowerCase();if("string"==typeof(n=e.getAttribute(r))){try{n="true"===n||"false"!==n&&("null"===n?null:_t.isNumeric(n)?+n:M.test(n)?_t.parseJSON(n):n)}catch(e){}_t.data(e,t,n)}else n=void 0}return n}function o(e){for(var t in e)if(("data"!==t||!_t.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function i(e,t,n){var r=t+"defer",o=t+"queue",i=t+"mark",a=_t._data(e,r);!a||"queue"!==n&&_t._data(e,o)||"mark"!==n&&_t._data(e,i)||setTimeout(function(){_t._data(e,o)||_t._data(e,i)||(_t.removeData(e,r,!0),a.fire())},0)}function a(){return!1}function s(){return!0}function u(e){return!e||!e.parentNode||11===e.parentNode.nodeType}function l(e,t,n){if(t=t||0,_t.isFunction(t))return _t.grep(e,function(e,r){return!!t.call(e,r,e)===n});if(t.nodeType)return _t.grep(e,function(e,r){return e===t===n});if("string"==typeof t){var r=_t.grep(e,function(e){return 1===e.nodeType});if(ie.test(t))return _t.filter(t,r,!n);t=_t.filter(t,r)}return _t.grep(e,function(e,r){return _t.inArray(e,t)>=0===n})}function c(e){var t=le.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function f(e,t){return _t.nodeName(e,"table")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function p(e,t){if(1===t.nodeType&&_t.hasData(e)){var n,r,o,i=_t._data(e),a=_t._data(t,i),s=i.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,o=s[n].length;r<o;r++)_t.event.add(t,n,s[n][r])}a.data&&(a.data=_t.extend({},a.data))}}function d(e,t){var n;1===t.nodeType&&(t.clearAttributes&&t.clearAttributes(),
t.mergeAttributes&&t.mergeAttributes(e),n=t.nodeName.toLowerCase(),"object"===n?t.outerHTML=e.outerHTML:"input"!==n||"checkbox"!==e.type&&"radio"!==e.type?"option"===n?t.selected=e.defaultSelected:"input"===n||"textarea"===n?t.defaultValue=e.defaultValue:"script"===n&&t.text!==e.text&&(t.text=e.text):(e.checked&&(t.defaultChecked=t.checked=e.checked),t.value!==e.value&&(t.value=e.value)),t.removeAttribute(_t.expando),t.removeAttribute("_submit_attached"),t.removeAttribute("_change_attached"))}function h(e){return void 0!==e.getElementsByTagName?e.getElementsByTagName("*"):void 0!==e.querySelectorAll?e.querySelectorAll("*"):[]}function g(e){"checkbox"!==e.type&&"radio"!==e.type||(e.defaultChecked=e.checked)}function m(e){var t=(e.nodeName||"").toLowerCase();"input"===t?g(e):"script"!==t&&void 0!==e.getElementsByTagName&&_t.grep(e.getElementsByTagName("input"),g)}function y(e){var t=bt.createElement("div");return ke.appendChild(t),t.innerHTML=e.outerHTML,t.firstChild}function v(e,t,n){var r="width"===t?e.offsetWidth:e.offsetHeight,o="width"===t?1:0,i=4;if(r>0){if("border"!==n)for(;o<i;o+=2)n||(r-=parseFloat(_t.css(e,"padding"+Ae[o]))||0),"margin"===n?r+=parseFloat(_t.css(e,n+Ae[o]))||0:r-=parseFloat(_t.css(e,"border"+Ae[o]+"Width"))||0;return r+"px"}if(r=Me(e,t),(r<0||null==r)&&(r=e.style[t]),Oe.test(r))return r;if(r=parseFloat(r)||0,n)for(;o<i;o+=2)r+=parseFloat(_t.css(e,"padding"+Ae[o]))||0,"padding"!==n&&(r+=parseFloat(_t.css(e,"border"+Ae[o]+"Width"))||0),"margin"===n&&(r+=parseFloat(_t.css(e,n+Ae[o]))||0);return r+"px"}function b(e){return function(t,n){if("string"!=typeof t&&(n=t,t="*"),_t.isFunction(n))for(var r,o,i,a=t.toLowerCase().split(Xe),s=0,u=a.length;s<u;s++)r=a[s],i=/^\+/.test(r),i&&(r=r.substr(1)||"*"),o=e[r]=e[r]||[],o[i?"unshift":"push"](n)}}function w(e,t,n,r,o,i){o=o||t.dataTypes[0],i=i||{},i[o]=!0;for(var a,s=e[o],u=0,l=s?s.length:0,c=e===Je;u<l&&(c||!a);u++)"string"==typeof(a=s[u](t,n,r))&&(!c||i[a]?a=void 0:(t.dataTypes.unshift(a),a=w(e,t,n,r,a,i)));return!c&&a||i["*"]||(a=w(e,t,n,r,"*",i)),a}function x(e,t){var n,r,o=_t.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((o[n]?e:r||(r={}))[n]=t[n]);r&&_t.extend(!0,e,r)}function _(e,t,n,r){if(_t.isArray(t))_t.each(t,function(t,o){n||Fe.test(e)?r(e,o):_(e+"["+("object"==typeof o?t:"")+"]",o,n,r)});else if(n||"object"!==_t.type(t))r(e,t);else for(var o in t)_(e+"["+o+"]",t[o],n,r)}function k(e,t,n){var r,o,i,a,s=e.contents,u=e.dataTypes,l=e.responseFields;for(o in l)o in n&&(t[l[o]]=n[o]);for(;"*"===u[0];)u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("content-type"));if(r)for(o in s)if(s[o]&&s[o].test(r)){u.unshift(o);break}if(u[0]in n)i=u[0];else{for(o in n){if(!u[0]||e.converters[o+" "+u[0]]){i=o;break}a||(a=o)}i=i||a}if(i)return i!==u[0]&&u.unshift(i),n[i]}function T(e,t){e.dataFilter&&(t=e.dataFilter(t,e.dataType));var n,r,o,i,a,s,u,l,c=e.dataTypes,f={},p=c.length,d=c[0];for(n=1;n<p;n++){if(1===n)for(r in e.converters)"string"==typeof r&&(f[r.toLowerCase()]=e.converters[r]);if(i=d,"*"===(d=c[n]))d=i;else if("*"!==i&&i!==d){
if(a=i+" "+d,!(s=f[a]||f["* "+d])){l=void 0;for(u in f)if(o=u.split(" "),(o[0]===i||"*"===o[0])&&(l=f[o[1]+" "+d])){u=f[u],!0===u?s=l:!0===l&&(s=u);break}}s||l||_t.error("No conversion from "+a.replace(" "," to ")),!0!==s&&(t=s?s(t):l(u(t)))}}return t}function E(){try{return new window.XMLHttpRequest}catch(e){}}function C(){try{return new window.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}function S(){return setTimeout(O,0),gt=_t.now()}function O(){gt=void 0}function N(e,t){var n={};return _t.each(ht.concat.apply([],ht.slice(0,t)),function(){n[this]=e}),n}function P(e){if(!ut[e]){var t=bt.body,n=_t("<"+e+">").appendTo(t),r=n.css("display");n.remove(),"none"!==r&&""!==r||(lt||(lt=bt.createElement("iframe"),lt.frameBorder=lt.width=lt.height=0),t.appendChild(lt),ct&&lt.createElement||(ct=(lt.contentWindow||lt.contentDocument).document,ct.write((_t.support.boxModel?"<!doctype html>":"")+"<html><body>"),ct.close()),n=ct.createElement(e),ct.body.appendChild(n),r=_t.css(n,"display"),t.removeChild(lt)),ut[e]=r}return ut[e]}function j(e){return _t.isWindow(e)?e:9===e.nodeType&&(e.defaultView||e.parentWindow)}var A,M,D,L,R,F,I,H,U,W,B,z,q,$,V,K,X,G,Q,Y,J,Z,ee,te,ne,re,oe,ie,ae,se,ue,le,ce,fe,pe,de,he,ge,me,ye,ve,be,we,xe,_e,ke,Te,Ee,Ce,Se,Oe,Ne,Pe,je,Ae,Me,De,Le,Re,Fe,Ie,He,Ue,We,Be,ze,qe,$e,Ve,Ke,Xe,Ge,Qe,Ye,Je,Ze,et,tt,nt,rt,ot,it,at,st,ut,lt,ct,ft,pt,dt,ht,gt,mt,yt,vt,bt=window.document,wt=window.navigator,xt=window.location,_t=function(){function e(){if(!i.isReady){try{bt.documentElement.doScroll("left")}catch(t){return void setTimeout(e,1)}i.ready()}}var t,n,r,o,i=function(e,n){return new i.fn.init(e,n,t)},a=window.jQuery,s=window.$,u=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,l=/\S/,c=/^\s+/,f=/\s+$/,p=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,d=/^[\],:{}\s]*$/,h=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,g=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,m=/(?:^|:|,)(?:\s*\[)+/g,y=/(webkit)[ \/]([\w.]+)/,v=/(opera)(?:.*version)?[ \/]([\w.]+)/,b=/(msie) ([\w.]+)/,w=/(mozilla)(?:.*? rv:([\w.]+))?/,x=/-([a-z]|[0-9])/gi,_=/^-ms-/,k=function(e,t){return(t+"").toUpperCase()},T=wt.userAgent,E=Object.prototype.toString,C=Object.prototype.hasOwnProperty,S=Array.prototype.push,O=Array.prototype.slice,N=String.prototype.trim,P=Array.prototype.indexOf,j={};return i.fn=i.prototype={constructor:i,init:function(e,t,n){var r,o,a,s;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if("body"===e&&!t&&bt.body)return this.context=bt,this[0]=bt.body,this.selector=e,this.length=1,this;if("string"==typeof e){if(!(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:u.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1])return t=t instanceof i?t[0]:t,s=t?t.ownerDocument||t:bt,a=p.exec(e),a?i.isPlainObject(t)?(e=[bt.createElement(a[1])],i.fn.attr.call(e,t,!0)):e=[s.createElement(a[1])]:(a=i.buildFragment([r[1]],[s]),e=(a.cacheable?i.clone(a.fragment):a.fragment).childNodes),i.merge(this,e);if((o=bt.getElementById(r[2]))&&o.parentNode){