marketmyna 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (344) hide show
  1. marketmyna/__init__.py +14 -0
  2. marketmyna/agent/__init__.py +8 -0
  3. marketmyna/agent/agents.py +543 -0
  4. marketmyna/agent/context.py +69 -0
  5. marketmyna/agent/dashboard.py +55 -0
  6. marketmyna/agent/orchestrator.py +153 -0
  7. marketmyna/agent/sentiment.py +150 -0
  8. marketmyna/agent/skills.py +119 -0
  9. marketmyna/ai/__init__.py +1 -0
  10. marketmyna/ai/portfolio_optimizer.py +330 -0
  11. marketmyna/analysis/__init__.py +6 -0
  12. marketmyna/analysis/fundamental.py +329 -0
  13. marketmyna/analysis/sip_optimizer.py +81 -0
  14. marketmyna/analysis/technical.py +321 -0
  15. marketmyna/api/__init__.py +1 -0
  16. marketmyna/api/app.py +209 -0
  17. marketmyna/api/deps.py +63 -0
  18. marketmyna/api/middlewares/__init__.py +0 -0
  19. marketmyna/api/middlewares/auth.py +116 -0
  20. marketmyna/api/middlewares/csrf.py +66 -0
  21. marketmyna/api/middlewares/error_handler.py +38 -0
  22. marketmyna/api/middlewares/slashes.py +27 -0
  23. marketmyna/api/v1/__init__.py +0 -0
  24. marketmyna/api/v1/endpoints/__init__.py +0 -0
  25. marketmyna/api/v1/endpoints/account.py +166 -0
  26. marketmyna/api/v1/endpoints/agent.py +114 -0
  27. marketmyna/api/v1/endpoints/bot.py +38 -0
  28. marketmyna/api/v1/endpoints/calendar.py +269 -0
  29. marketmyna/api/v1/endpoints/data_sources.py +174 -0
  30. marketmyna/api/v1/endpoints/health.py +10 -0
  31. marketmyna/api/v1/endpoints/listings.py +564 -0
  32. marketmyna/api/v1/endpoints/macro.py +163 -0
  33. marketmyna/api/v1/endpoints/portfolio.py +530 -0
  34. marketmyna/api/v1/endpoints/push.py +119 -0
  35. marketmyna/api/v1/endpoints/reports.py +49 -0
  36. marketmyna/api/v1/endpoints/scheduler.py +219 -0
  37. marketmyna/api/v1/endpoints/stocks.py +400 -0
  38. marketmyna/api/v1/endpoints/system_config.py +157 -0
  39. marketmyna/api/v1/endpoints/thesis.py +112 -0
  40. marketmyna/api/v1/endpoints/trade.py +709 -0
  41. marketmyna/api/v1/endpoints/updates.py +394 -0
  42. marketmyna/api/v1/endpoints/watchlists.py +179 -0
  43. marketmyna/api/v1/router.py +43 -0
  44. marketmyna/bot/__init__.py +14 -0
  45. marketmyna/bot/commands/__init__.py +0 -0
  46. marketmyna/bot/commands/analyze.py +40 -0
  47. marketmyna/bot/commands/ask.py +51 -0
  48. marketmyna/bot/commands/base.py +35 -0
  49. marketmyna/bot/commands/batch.py +53 -0
  50. marketmyna/bot/commands/common.py +84 -0
  51. marketmyna/bot/commands/help.py +43 -0
  52. marketmyna/bot/commands/markets.py +153 -0
  53. marketmyna/bot/commands/portfolio.py +145 -0
  54. marketmyna/bot/commands/research.py +323 -0
  55. marketmyna/bot/commands/status.py +48 -0
  56. marketmyna/bot/commands/trade.py +176 -0
  57. marketmyna/bot/dispatcher.py +95 -0
  58. marketmyna/bot/formatting.py +25 -0
  59. marketmyna/bot/models.py +27 -0
  60. marketmyna/bot/registry.py +50 -0
  61. marketmyna/bot/telegram_listener.py +227 -0
  62. marketmyna/cli/__init__.py +1 -0
  63. marketmyna/cli/scheduled_run.py +292 -0
  64. marketmyna/core/__init__.py +6 -0
  65. marketmyna/core/compliance.py +53 -0
  66. marketmyna/core/config.py +377 -0
  67. marketmyna/core/constants.py +69 -0
  68. marketmyna/core/home.py +22 -0
  69. marketmyna/core/numbers.py +28 -0
  70. marketmyna/core/secret_store.py +104 -0
  71. marketmyna/core/tenant.py +130 -0
  72. marketmyna/data/__init__.py +8 -0
  73. marketmyna/data/base.py +36 -0
  74. marketmyna/data/categories.py +272 -0
  75. marketmyna/data/china.py +360 -0
  76. marketmyna/data/crypto.py +200 -0
  77. marketmyna/data/ecb_fx.py +131 -0
  78. marketmyna/data/extra_sources.py +569 -0
  79. marketmyna/data/india.py +241 -0
  80. marketmyna/data/india_filings.py +343 -0
  81. marketmyna/data/listings.py +1314 -0
  82. marketmyna/data/mutual_funds.py +34 -0
  83. marketmyna/data/news.py +98 -0
  84. marketmyna/data/news_search.py +346 -0
  85. marketmyna/data/nse_deals.py +138 -0
  86. marketmyna/data/resilience.py +173 -0
  87. marketmyna/data/sec_facts.py +252 -0
  88. marketmyna/data/shariah.py +283 -0
  89. marketmyna/data/social/__init__.py +9 -0
  90. marketmyna/data/social/base.py +100 -0
  91. marketmyna/data/social/browser.py +92 -0
  92. marketmyna/data/social/hackernews.py +53 -0
  93. marketmyna/data/social/reddit.py +397 -0
  94. marketmyna/data/social/stocktwits.py +63 -0
  95. marketmyna/data/social/valuepickr.py +53 -0
  96. marketmyna/data/stocks.py +197 -0
  97. marketmyna/data/yahoo_price.py +48 -0
  98. marketmyna/launcher.py +71 -0
  99. marketmyna/llm/__init__.py +33 -0
  100. marketmyna/llm/backend_factory.py +51 -0
  101. marketmyna/llm/backend_registry.py +19 -0
  102. marketmyna/llm/channels.py +447 -0
  103. marketmyna/llm/json_reply.py +63 -0
  104. marketmyna/llm/litellm_backend.py +197 -0
  105. marketmyna/llm/model_catalog.py +166 -0
  106. marketmyna/llm/model_health.py +193 -0
  107. marketmyna/llm/protocol.py +111 -0
  108. marketmyna/llm/providers.py +128 -0
  109. marketmyna/llm/store.py +128 -0
  110. marketmyna/notifiers/__init__.py +35 -0
  111. marketmyna/notifiers/apprise_sender.py +43 -0
  112. marketmyna/notifiers/astrbot.py +47 -0
  113. marketmyna/notifiers/bark.py +24 -0
  114. marketmyna/notifiers/base.py +80 -0
  115. marketmyna/notifiers/dingtalk.py +54 -0
  116. marketmyna/notifiers/discord.py +39 -0
  117. marketmyna/notifiers/dispatcher.py +153 -0
  118. marketmyna/notifiers/email.py +99 -0
  119. marketmyna/notifiers/feishu.py +57 -0
  120. marketmyna/notifiers/googlechat.py +24 -0
  121. marketmyna/notifiers/gotify.py +36 -0
  122. marketmyna/notifiers/matrix.py +28 -0
  123. marketmyna/notifiers/ntfy.py +36 -0
  124. marketmyna/notifiers/pushbullet.py +24 -0
  125. marketmyna/notifiers/pushover.py +41 -0
  126. marketmyna/notifiers/pushplus.py +41 -0
  127. marketmyna/notifiers/serverchan3.py +40 -0
  128. marketmyna/notifiers/settings_schema.py +119 -0
  129. marketmyna/notifiers/signal_messenger.py +25 -0
  130. marketmyna/notifiers/slack.py +36 -0
  131. marketmyna/notifiers/teams.py +37 -0
  132. marketmyna/notifiers/telegram.py +81 -0
  133. marketmyna/notifiers/twilio.py +33 -0
  134. marketmyna/notifiers/webhook.py +44 -0
  135. marketmyna/notifiers/webpush.py +222 -0
  136. marketmyna/notifiers/wechat.py +40 -0
  137. marketmyna/notifiers/whatsapp.py +27 -0
  138. marketmyna/portfolio/__init__.py +6 -0
  139. marketmyna/portfolio/analytics.py +336 -0
  140. marketmyna/portfolio/manager.py +383 -0
  141. marketmyna/portfolio/models.py +155 -0
  142. marketmyna/portfolio/optimizers.py +88 -0
  143. marketmyna/portfolio/review.py +411 -0
  144. marketmyna/services/__init__.py +1 -0
  145. marketmyna/services/accounts.py +278 -0
  146. marketmyna/services/ai_access.py +94 -0
  147. marketmyna/services/analysis_run.py +491 -0
  148. marketmyna/services/big_trades.py +335 -0
  149. marketmyna/services/brokers/__init__.py +0 -0
  150. marketmyna/services/brokers/angel.py +271 -0
  151. marketmyna/services/brokers/finnhub.py +209 -0
  152. marketmyna/services/byok_detect.py +196 -0
  153. marketmyna/services/calendar.py +748 -0
  154. marketmyna/services/central_banks.py +202 -0
  155. marketmyna/services/commodities.py +134 -0
  156. marketmyna/services/compare.py +307 -0
  157. marketmyna/services/cot.py +148 -0
  158. marketmyna/services/country_macro.py +135 -0
  159. marketmyna/services/crude_sensitivity.py +239 -0
  160. marketmyna/services/crypto_mood.py +135 -0
  161. marketmyna/services/crypto_screens.py +226 -0
  162. marketmyna/services/data_export.py +91 -0
  163. marketmyna/services/dcf.py +220 -0
  164. marketmyna/services/dcf_model.py +194 -0
  165. marketmyna/services/delivery.py +142 -0
  166. marketmyna/services/discovery.py +146 -0
  167. marketmyna/services/dividends.py +95 -0
  168. marketmyna/services/earnings.py +305 -0
  169. marketmyna/services/econ_calendar.py +495 -0
  170. marketmyna/services/eia_stocks.py +115 -0
  171. marketmyna/services/estimates.py +109 -0
  172. marketmyna/services/etf.py +236 -0
  173. marketmyna/services/etf_rotation.py +193 -0
  174. marketmyna/services/etf_screens.py +196 -0
  175. marketmyna/services/financials.py +639 -0
  176. marketmyna/services/fund_ai.py +181 -0
  177. marketmyna/services/fund_analytics.py +371 -0
  178. marketmyna/services/fund_cost.py +147 -0
  179. marketmyna/services/fund_holdings.py +664 -0
  180. marketmyna/services/fund_peers.py +247 -0
  181. marketmyna/services/fund_rotation.py +206 -0
  182. marketmyna/services/fund_style.py +179 -0
  183. marketmyna/services/funds.py +70 -0
  184. marketmyna/services/hot_stocks.py +358 -0
  185. marketmyna/services/india_flows.py +263 -0
  186. marketmyna/services/india_rates.py +258 -0
  187. marketmyna/services/investor_lenses.py +271 -0
  188. marketmyna/services/leadership.py +165 -0
  189. marketmyna/services/live_market.py +497 -0
  190. marketmyna/services/live_quotes.py +295 -0
  191. marketmyna/services/macro.py +182 -0
  192. marketmyna/services/market_calendar.py +399 -0
  193. marketmyna/services/market_mood.py +168 -0
  194. marketmyna/services/market_valuation.py +231 -0
  195. marketmyna/services/mf_holdings.py +199 -0
  196. marketmyna/services/mf_insights.py +132 -0
  197. marketmyna/services/mf_lumpsum.py +587 -0
  198. marketmyna/services/mf_portfolio_ai.py +195 -0
  199. marketmyna/services/nse_events.py +98 -0
  200. marketmyna/services/overview.py +366 -0
  201. marketmyna/services/ownership.py +143 -0
  202. marketmyna/services/quality_scores.py +199 -0
  203. marketmyna/services/rates.py +335 -0
  204. marketmyna/services/reconcile.py +343 -0
  205. marketmyna/services/report.py +584 -0
  206. marketmyna/services/report_i18n.py +678 -0
  207. marketmyna/services/rotation.py +224 -0
  208. marketmyna/services/runtime_scheduler.py +548 -0
  209. marketmyna/services/schedule_config.py +251 -0
  210. marketmyna/services/schedule_time.py +39 -0
  211. marketmyna/services/screens.py +398 -0
  212. marketmyna/services/sec_mdna.py +173 -0
  213. marketmyna/services/shariah.py +246 -0
  214. marketmyna/services/sip.py +148 -0
  215. marketmyna/services/sip_days.py +362 -0
  216. marketmyna/services/smart_file.py +595 -0
  217. marketmyna/services/smart_pdf.py +425 -0
  218. marketmyna/services/smart_report.py +370 -0
  219. marketmyna/services/social_sentiment.py +511 -0
  220. marketmyna/services/thesis.py +328 -0
  221. marketmyna/services/translate.py +146 -0
  222. marketmyna/services/valuation.py +173 -0
  223. marketmyna/services/worker_pool.py +149 -0
  224. marketmyna/services/world_markets.py +208 -0
  225. marketmyna/storage.py +722 -0
  226. marketmyna/strategies/README.md +51 -0
  227. marketmyna/strategies/bottom_volume.yaml +49 -0
  228. marketmyna/strategies/box_oscillation.yaml +69 -0
  229. marketmyna/strategies/bull_trend.yaml +49 -0
  230. marketmyna/strategies/chan_theory.yaml +58 -0
  231. marketmyna/strategies/dragon_head.yaml +44 -0
  232. marketmyna/strategies/emotion_cycle.yaml +79 -0
  233. marketmyna/strategies/event_driven.yaml +54 -0
  234. marketmyna/strategies/expectation_repricing.yaml +54 -0
  235. marketmyna/strategies/growth_quality.yaml +54 -0
  236. marketmyna/strategies/hot_theme.yaml +54 -0
  237. marketmyna/strategies/ma_golden_cross.yaml +46 -0
  238. marketmyna/strategies/one_yang_three_yin.yaml +37 -0
  239. marketmyna/strategies/shrink_pullback.yaml +46 -0
  240. marketmyna/strategies/volume_breakout.yaml +47 -0
  241. marketmyna/strategies/wave_theory.yaml +64 -0
  242. marketmyna/trading/__init__.py +2 -0
  243. marketmyna/trading/alerts.py +356 -0
  244. marketmyna/trading/backtest.py +317 -0
  245. marketmyna/trading/charges.py +82 -0
  246. marketmyna/trading/chart.py +197 -0
  247. marketmyna/trading/indicators.py +303 -0
  248. marketmyna/trading/journal.py +74 -0
  249. marketmyna/trading/knn.py +164 -0
  250. marketmyna/trading/lots.py +109 -0
  251. marketmyna/trading/market_hours.py +66 -0
  252. marketmyna/trading/options.py +554 -0
  253. marketmyna/trading/pairs.py +94 -0
  254. marketmyna/trading/risk.py +170 -0
  255. marketmyna/trading/scanner.py +500 -0
  256. marketmyna/trading/volatility.py +163 -0
  257. marketmyna/utils/__init__.py +1 -0
  258. marketmyna/utils/deadline.py +36 -0
  259. marketmyna/utils/log_redact.py +52 -0
  260. marketmyna/utils/yahoo_gate.py +183 -0
  261. marketmyna/utils/yf_lock.py +12 -0
  262. marketmyna/web/apple-touch-icon.png +0 -0
  263. marketmyna/web/assets/Account-CA9NFDKO.js +1 -0
  264. marketmyna/web/assets/Analyze-uM0srB_U.js +7 -0
  265. marketmyna/web/assets/AreaChart-2i67V6Jf.js +1 -0
  266. marketmyna/web/assets/BarChart-_yngarVl.js +3 -0
  267. marketmyna/web/assets/Bot-E4gpf1qZ.js +1 -0
  268. marketmyna/web/assets/CandleChart-CioqTqMV.js +1 -0
  269. marketmyna/web/assets/Compare-D6_2CPl4.js +1 -0
  270. marketmyna/web/assets/ExportMenu-DaZ1xVmW.js +1 -0
  271. marketmyna/web/assets/LineChart-BaOkD1Ta.js +57 -0
  272. marketmyna/web/assets/Markets-BMw_M1sJ.js +1 -0
  273. marketmyna/web/assets/Portfolio-DQEdHVc2.js +1 -0
  274. marketmyna/web/assets/ReportView-BzhdcqSh.js +1 -0
  275. marketmyna/web/assets/Scheduler-I9PDKxTd.js +1 -0
  276. marketmyna/web/assets/Settings-DpXfHolW.js +3 -0
  277. marketmyna/web/assets/SipDays-C9q3bNSx.js +1 -0
  278. marketmyna/web/assets/SymbolSearch-CBOVPEk1.js +1 -0
  279. marketmyna/web/assets/Trade-_CM7HC4H.js +2 -0
  280. marketmyna/web/assets/TradeChart-ZjsycacC.js +1 -0
  281. marketmyna/web/assets/WatchButton-ComYW56_.js +1 -0
  282. marketmyna/web/assets/Watchlist-DAjLb0jd.js +1 -0
  283. marketmyna/web/assets/app-BP1o7WZS.js +1 -0
  284. marketmyna/web/assets/app-BkIUKdld.js +1 -0
  285. marketmyna/web/assets/app-CKeSYhEt.js +1 -0
  286. marketmyna/web/assets/app-CN1OERYX.js +1 -0
  287. marketmyna/web/assets/app-DIQllha5.js +1 -0
  288. marketmyna/web/assets/app-DeiAW0tX.js +1 -0
  289. marketmyna/web/assets/br-Cu5YU29T.svg +45 -0
  290. marketmyna/web/assets/browser-CR-ks2Fp.js +19 -0
  291. marketmyna/web/assets/browser-D5K_K_gj.js +1 -0
  292. marketmyna/web/assets/common-0wvpAVpd.js +1 -0
  293. marketmyna/web/assets/common-3ghy53Us.js +1 -0
  294. marketmyna/web/assets/common-Bib2unjX.js +1 -0
  295. marketmyna/web/assets/common-BvSJP0w_.js +1 -0
  296. marketmyna/web/assets/common-CSfyC0Sp.js +1 -0
  297. marketmyna/web/assets/common-C_t-iZPf.js +1 -0
  298. marketmyna/web/assets/compare-DMcsx70H.js +1 -0
  299. marketmyna/web/assets/es-d5m8M5h8.svg +544 -0
  300. marketmyna/web/assets/exporter-DiMg2O5d.js +3 -0
  301. marketmyna/web/assets/files-CpgiZRbN.js +1 -0
  302. marketmyna/web/assets/format-d8InM0Zw.js +9 -0
  303. marketmyna/web/assets/html2canvas-Bw0OShmD.js +5 -0
  304. marketmyna/web/assets/index-CKAnq-Or.js +12 -0
  305. marketmyna/web/assets/index-D4U8E6LH.css +2 -0
  306. marketmyna/web/assets/index.es-iBEw7jOv.js +5 -0
  307. marketmyna/web/assets/ir-cCIgaNf6.svg +219 -0
  308. marketmyna/web/assets/jspdf.es.min-C4285IdL.js +79 -0
  309. marketmyna/web/assets/jspdf.plugin.autotable-2eOJeXl-.js +2 -0
  310. marketmyna/web/assets/lightweight-charts.production-BF2noug5.js +1 -0
  311. marketmyna/web/assets/listings-BefgXpb1.js +1 -0
  312. marketmyna/web/assets/liveQuotes-CtSmCUFA.js +1 -0
  313. marketmyna/web/assets/markets-BI4AhI9W.js +1 -0
  314. marketmyna/web/assets/markets-BUHUdYpT.js +1 -0
  315. marketmyna/web/assets/markets-BqvN1Bvf.js +1 -0
  316. marketmyna/web/assets/markets-DPO40TTe.js +1 -0
  317. marketmyna/web/assets/markets-bsiPo-Tk.js +1 -0
  318. marketmyna/web/assets/markets-ff1e792u.js +1 -0
  319. marketmyna/web/assets/montecarlo-BsNlH2qe.js +1 -0
  320. marketmyna/web/assets/options-BYAZnwzW.js +1 -0
  321. marketmyna/web/assets/preload-helper-BLdHbfdN.js +1 -0
  322. marketmyna/web/assets/purify.es-Dqk5qvad.js +3 -0
  323. marketmyna/web/assets/rolldown-runtime-XKyaHtl9.js +1 -0
  324. marketmyna/web/assets/sa-Dh79zbT9.svg +25 -0
  325. marketmyna/web/assets/toast-DDradTZw.js +1 -0
  326. marketmyna/web/assets/trade-fndw1Ql3.js +1 -0
  327. marketmyna/web/assets/ui-gsFb8B2m.js +1 -0
  328. marketmyna/web/assets/watchlists-B6YqwUIk.js +1 -0
  329. marketmyna/web/brand/logo-mark.webp +0 -0
  330. marketmyna/web/favicon.png +0 -0
  331. marketmyna/web/icon-192.png +0 -0
  332. marketmyna/web/icon-512.png +0 -0
  333. marketmyna/web/index.html +34 -0
  334. marketmyna/web/manifest.webmanifest +28 -0
  335. marketmyna/web/robots.txt +2 -0
  336. marketmyna/web/sw.js +40 -0
  337. marketmyna/web/theme-init.js +37 -0
  338. marketmyna-0.2.0.dist-info/METADATA +345 -0
  339. marketmyna-0.2.0.dist-info/RECORD +344 -0
  340. marketmyna-0.2.0.dist-info/WHEEL +5 -0
  341. marketmyna-0.2.0.dist-info/entry_points.txt +2 -0
  342. marketmyna-0.2.0.dist-info/licenses/LICENSE +202 -0
  343. marketmyna-0.2.0.dist-info/licenses/NOTICE +22 -0
  344. marketmyna-0.2.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,2 @@
1
+ var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};function t(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}var n=function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};function r(e,t,r,i,a){i||={};var o=1.15,s=a.internal.scaleFactor,c=a.internal.getFontSize()/s,l=c*(a.getLineHeightFactor?a.getLineHeightFactor():o),u=/\r\n|\r|\n/g,d=``,f=1;if((i.valign===`middle`||i.valign===`bottom`||i.halign===`center`||i.halign===`right`)&&(d=typeof e==`string`?e.split(u):e,f=d.length||1),r+=c*(2-o),i.valign===`middle`?r-=f/2*l:i.valign===`bottom`&&(r-=f*l),i.halign===`center`||i.halign===`right`){var p=c;if(i.halign===`center`&&(p*=.5),d&&f>=1){for(var m=0;m<d.length;m++)a.text(d[m],t-a.getStringUnitWidth(d[m])*p,r,i.textOptions),r+=l;return a}t-=a.getStringUnitWidth(e)*p}return i.halign===`justify`?a.text(e,t,r,n({maxWidth:i.maxWidth||100,align:`justify`},i.textOptions)):a.text(e,t,r,i.textOptions),a}var i={},a=function(){function e(e){this.jsPDFDocument=e,this.userStyles={textColor:e.getTextColor?this.jsPDFDocument.getTextColor():0,fontSize:e.internal.getFontSize(),fontStyle:e.internal.getFont().fontStyle,font:e.internal.getFont().fontName,lineWidth:e.getLineWidth?this.jsPDFDocument.getLineWidth():0,lineColor:e.getDrawColor?this.jsPDFDocument.getDrawColor():0}}return e.setDefaults=function(e,t){t===void 0&&(t=null),t?t.__autoTableDocumentDefaults=e:i=e},e.unifyColor=function(e){return Array.isArray(e)?e:typeof e==`number`?[e,e,e]:typeof e==`string`?[e]:null},e.prototype.applyStyles=function(t,n){var r,i,a;n===void 0&&(n=!1),t.fontStyle&&this.jsPDFDocument.setFontStyle&&this.jsPDFDocument.setFontStyle(t.fontStyle);var o=this.jsPDFDocument.internal.getFont(),s=o.fontStyle,c=o.fontName;if(t.font&&(c=t.font),t.fontStyle){s=t.fontStyle;var l=this.getFontList()[c];l&&l.indexOf(s)===-1&&this.jsPDFDocument.setFontStyle&&(this.jsPDFDocument.setFontStyle(l[0]),s=l[0])}if(this.jsPDFDocument.setFont(c,s),t.fontSize&&this.jsPDFDocument.setFontSize(t.fontSize),!n){var u=e.unifyColor(t.fillColor);u&&(r=this.jsPDFDocument).setFillColor.apply(r,u),u=e.unifyColor(t.textColor),u&&(i=this.jsPDFDocument).setTextColor.apply(i,u),u=e.unifyColor(t.lineColor),u&&(a=this.jsPDFDocument).setDrawColor.apply(a,u),typeof t.lineWidth==`number`&&this.jsPDFDocument.setLineWidth(t.lineWidth)}},e.prototype.splitTextToSize=function(e,t,n){return this.jsPDFDocument.splitTextToSize(e,t,n)},e.prototype.rect=function(e,t,n,r,i){return this.jsPDFDocument.rect(e,t,n,r,i)},e.prototype.getLastAutoTable=function(){return this.jsPDFDocument.lastAutoTable||null},e.prototype.getTextWidth=function(e){return this.jsPDFDocument.getTextWidth(e)},e.prototype.getDocument=function(){return this.jsPDFDocument},e.prototype.setPage=function(e){this.jsPDFDocument.setPage(e)},e.prototype.addPage=function(){return this.jsPDFDocument.addPage()},e.prototype.getFontList=function(){return this.jsPDFDocument.getFontList()},e.prototype.getGlobalOptions=function(){return i||{}},e.prototype.getDocumentOptions=function(){return this.jsPDFDocument.__autoTableDocumentDefaults||{}},e.prototype.pageSize=function(){var e=this.jsPDFDocument.internal.pageSize;return e.width??(e={width:e.getWidth(),height:e.getHeight()}),e},e.prototype.scaleFactor=function(){return this.jsPDFDocument.internal.scaleFactor},e.prototype.getLineHeightFactor=function(){var e=this.jsPDFDocument;return e.getLineHeightFactor?e.getLineHeightFactor():1.15},e.prototype.getLineHeight=function(e){return e/this.scaleFactor()*this.getLineHeightFactor()},e.prototype.pageNumber=function(){var e=this.jsPDFDocument.internal.getCurrentPageInfo();return e?e.pageNumber:this.jsPDFDocument.internal.getNumberOfPages()},e}(),o=function(e){t(n,e);function n(t){var n=e.call(this)||this;return n._element=t,n}return n}(Array);function s(e){return{font:`helvetica`,fontStyle:`normal`,overflow:`linebreak`,fillColor:!1,textColor:20,halign:`left`,valign:`top`,fontSize:10,cellPadding:5/e,lineColor:200,lineWidth:0,cellWidth:`auto`,minCellHeight:0,minCellWidth:0,textOptions:{isInputVisual:!1,isOutputVisual:void 0,isInputRtl:!1,isOutputRtl:void 0,isSymmetricSwapping:!1}}}function c(e){return{striped:{table:{fillColor:255,textColor:80,fontStyle:`normal`},head:{textColor:255,fillColor:[41,128,185],fontStyle:`bold`},body:{},foot:{textColor:255,fillColor:[41,128,185],fontStyle:`bold`},alternateRow:{fillColor:245}},grid:{table:{fillColor:255,textColor:80,fontStyle:`normal`,lineWidth:.1},head:{textColor:255,fillColor:[26,188,156],fontStyle:`bold`,lineWidth:0},body:{},foot:{textColor:255,fillColor:[26,188,156],fontStyle:`bold`,lineWidth:0},alternateRow:{}},plain:{head:{fontStyle:`bold`},foot:{fontStyle:`bold`}}}[e]}function l(e,t,n){return n.applyStyles(t,!0),(Array.isArray(e)?e:[e]).map(function(e){return n.getTextWidth(e)}).reduce(function(e,t){return Math.max(e,t)},0)}function u(e,t,n,r){var i=t.settings.tableLineWidth,a=t.settings.tableLineColor;e.applyStyles({lineWidth:i,lineColor:a});var o=d(i,!1);o&&e.rect(n.x,n.y,t.getWidth(e.pageSize().width),r.y-n.y,o)}function d(e,t){var n=e>0,r=t||t===0;return n&&r?`DF`:n?`S`:r?`F`:null}function f(e,t){if(e||=t,Array.isArray(e)){if(e.length>=4)return{top:e[0],right:e[1],bottom:e[2],left:e[3]};if(e.length===3)return{top:e[0],right:e[1],bottom:e[2],left:e[1]};if(e.length===2)return{top:e[0],right:e[1],bottom:e[0],left:e[1]};e=e.length===1?e[0]:t}return typeof e==`object`?(typeof e.vertical==`number`&&(e.top=e.vertical,e.bottom=e.vertical),typeof e.horizontal==`number`&&(e.right=e.horizontal,e.left=e.horizontal),{left:e.left??t,top:e.top??t,right:e.right??t,bottom:e.bottom??t}):(typeof e!=`number`&&(e=t),{top:e,right:e,bottom:e,left:e})}function p(e,t){var n=f(t.settings.margin,0);return e.pageSize().width-(n.left+n.right)}function m(e,t,n,r,i){var a={},o=96/72,s=g(t,function(e){return i.getComputedStyle(e).backgroundColor});s!=null&&(a.fillColor=s);var c=g(t,function(e){return i.getComputedStyle(e).color});c!=null&&(a.textColor=c);var l=v(r,n);l&&(a.cellPadding=l);var u=`borderTopColor`,d=o*n,f=r.borderTopWidth;if(r.borderBottomWidth===f&&r.borderRightWidth===f&&r.borderLeftWidth===f){var p=(parseFloat(f)||0)/d;p&&(a.lineWidth=p)}else a.lineWidth={top:(parseFloat(r.borderTopWidth)||0)/d,right:(parseFloat(r.borderRightWidth)||0)/d,bottom:(parseFloat(r.borderBottomWidth)||0)/d,left:(parseFloat(r.borderLeftWidth)||0)/d},a.lineWidth.top||(a.lineWidth.right?u=`borderRightColor`:a.lineWidth.bottom?u=`borderBottomColor`:a.lineWidth.left&&(u=`borderLeftColor`));var m=g(t,function(e){return i.getComputedStyle(e)[u]});m!=null&&(a.lineColor=m);var _=[`left`,`right`,`center`,`justify`];_.indexOf(r.textAlign)!==-1&&(a.halign=r.textAlign),_=[`middle`,`bottom`,`top`],_.indexOf(r.verticalAlign)!==-1&&(a.valign=r.verticalAlign);var y=parseInt(r.fontSize||``);isNaN(y)||(a.fontSize=y/o);var b=h(r);b&&(a.fontStyle=b);var x=(r.fontFamily||``).toLowerCase();return e.indexOf(x)!==-1&&(a.font=x),a}function h(e){var t=``;return(e.fontWeight===`bold`||e.fontWeight===`bolder`||parseInt(e.fontWeight)>=700)&&(t=`bold`),(e.fontStyle===`italic`||e.fontStyle===`oblique`)&&(t+=`italic`),t}function g(e,t){var n=_(e,t);if(!n)return null;var r=n.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d*))?\)$/);if(!r||!Array.isArray(r))return null;var i=[parseInt(r[1]),parseInt(r[2]),parseInt(r[3])];return parseInt(r[4])===0||isNaN(i[0])||isNaN(i[1])||isNaN(i[2])?null:i}function _(e,t){var n=t(e);return n===`rgba(0, 0, 0, 0)`||n===`transparent`||n===`initial`||n===`inherit`?e.parentElement==null?null:_(e.parentElement,t):n}function v(e,t){var n=[e.paddingTop,e.paddingRight,e.paddingBottom,e.paddingLeft],r=96/(72/t),i=(parseInt(e.lineHeight)-parseInt(e.fontSize))/t/2,a=f(n.map(function(e){return parseInt(e||`0`)/r}),0);return i>a.top&&(a.top=i),i>a.bottom&&(a.bottom=i),a}function y(e,t,n,r,i){r===void 0&&(r=!1),i===void 0&&(i=!1);var a=typeof t==`string`?n.document.querySelector(t):t,o=Object.keys(e.getFontList()),s=e.scaleFactor(),c=[],l=[],u=[];if(!a)return console.error(`Html table could not be found with input: `,t),{head:c,body:l,foot:u};for(var d=0;d<a.rows.length;d++){var f=a.rows[d],p=(f?.parentElement?.tagName)?.toLowerCase(),m=b(o,s,n,f,r,i);m&&(p===`thead`?c.push(m):p===`tfoot`?u.push(m):l.push(m))}return{head:c,body:l,foot:u}}function b(e,t,n,r,i,a){for(var s=new o(r),c=0;c<r.cells.length;c++){var l=r.cells[c],u=n.getComputedStyle(l);if(i||u.display!==`none`){var d=void 0;a&&(d=m(e,l,t,u,n)),s.push({rowSpan:l.rowSpan,colSpan:l.colSpan,styles:d,_element:l,content:x(l)})}}var f=n.getComputedStyle(r);if(s.length>0&&(i||f.display!==`none`))return s}function x(e){var t=e.cloneNode(!0);return t.innerHTML=t.innerHTML.replace(/\n/g,``).replace(/ +/g,` `),t.innerHTML=t.innerHTML.split(/<br.*?>/).map(function(e){return e.trim()}).join(`
2
+ `),t.innerText||t.textContent||``}function ee(e,t,n){for(var r=0,i=[e,t,n];r<i.length;r++){var a=i[r];a&&typeof a!=`object`&&console.error(`The options parameter should be of type object, is: `+typeof a),a.startY&&typeof a.startY!=`number`&&(console.error(`Invalid value for startY option`,a.startY),delete a.startY)}}function S(e,t,n,r,i){if(e==null)throw TypeError(`Cannot convert undefined or null to object`);for(var a=Object(e),o=1;o<arguments.length;o++){var s=arguments[o];if(s!=null)for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&(a[c]=s[c])}return a}function C(e,t){var n=new a(e),r=n.getDocumentOptions(),i=n.getGlobalOptions();ee(i,r,t);var o=S({},i,r,t),s;typeof window<`u`&&(s=window);var c=te(i,r,t),l=ne(i,r,t),u=re(n,o),d=ae(n,o,s);return{id:t.tableId,content:d,hooks:l,styles:c,settings:u}}function te(e,t,n){for(var r={styles:{},headStyles:{},bodyStyles:{},footStyles:{},alternateRowStyles:{},columnStyles:{}},i=function(i){if(i===`columnStyles`){var a=e[i],o=t[i],s=n[i];r.columnStyles=S({},a,o,s)}else{var c=[e,t,n].map(function(e){return e[i]||{}});r[i]=S({},c[0],c[1],c[2])}},a=0,o=Object.keys(r);a<o.length;a++){var s=o[a];i(s)}return r}function ne(e,t,n){for(var r=[e,t,n],i={didParseCell:[],willDrawCell:[],didDrawCell:[],willDrawPage:[],didDrawPage:[]},a=0,o=r;a<o.length;a++){var s=o[a];s.didParseCell&&i.didParseCell.push(s.didParseCell),s.willDrawCell&&i.willDrawCell.push(s.willDrawCell),s.didDrawCell&&i.didDrawCell.push(s.didDrawCell),s.willDrawPage&&i.willDrawPage.push(s.willDrawPage),s.didDrawPage&&i.didDrawPage.push(s.didDrawPage)}return i}function re(e,t){var n=f(t.margin,40/e.scaleFactor()),r=ie(e,t.startY)??n.top,i=t.showFoot===!0?`everyPage`:t.showFoot===!1?`never`:t.showFoot??`everyPage`,a=t.showHead===!0?`everyPage`:t.showHead===!1?`never`:t.showHead??`everyPage`,o=t.useCss??!1,s=t.theme||(o?`plain`:`striped`),c=!!t.horizontalPageBreak,l=t.horizontalPageBreakRepeat??null;return{includeHiddenHtml:t.includeHiddenHtml??!1,useCss:o,theme:s,startY:r,margin:n,pageBreak:t.pageBreak??`auto`,rowPageBreak:t.rowPageBreak??`auto`,tableWidth:t.tableWidth??`auto`,showHead:a,showFoot:i,tableLineWidth:t.tableLineWidth??0,tableLineColor:t.tableLineColor??200,horizontalPageBreak:c,horizontalPageBreakRepeat:l,horizontalPageBreakBehaviour:t.horizontalPageBreakBehaviour??`afterAllRows`}}function ie(e,t){var n=e.getLastAutoTable(),r=e.scaleFactor(),i=e.pageNumber(),a=!1;return n&&n.startPageNumber&&(a=n.startPageNumber+n.pageNumber-1===i),typeof t==`number`?t:(t==null||t===!1)&&a&&n?.finalY!=null?n.finalY+20/r:null}function ae(e,t,n){var r=t.head||[],i=t.body||[],a=t.foot||[];if(t.html){var o=t.includeHiddenHtml;if(n){var s=y(e,t.html,n,o,t.useCss)||{};r=s.head||r,i=s.body||r,a=s.foot||r}else console.error(`Cannot parse html in non browser environment`)}return{columns:t.columns||oe(r,i,a),head:r,body:i,foot:a}}function oe(e,t,n){var r=e[0]||t[0]||n[0]||[],i=[];return Object.keys(r).filter(function(e){return e!==`_element`}).forEach(function(e){var t=1,n=Array.isArray(r)?r[parseInt(e)]:r[e];typeof n==`object`&&!Array.isArray(n)&&(t=n?.colSpan||1);for(var a=0;a<t;a++){var o=void 0;o=Array.isArray(r)?i.length:e+(a>0?`_${a}`:``);var s={dataKey:o};i.push(s)}}),i}var w=function(){function e(e,t,n){this.table=t,this.pageNumber=t.pageNumber,this.settings=t.settings,this.cursor=n,this.doc=e.getDocument()}return e}(),T=function(e){t(n,e);function n(t,n,r,i,a,o){var s=e.call(this,t,n,o)||this;return s.cell=r,s.row=i,s.column=a,s.section=i.section,s}return n}(w),E=function(){function e(e,t){this.pageNumber=1,this.id=e.id,this.settings=e.settings,this.styles=e.styles,this.hooks=e.hooks,this.columns=t.columns,this.head=t.head,this.body=t.body,this.foot=t.foot}return e.prototype.getHeadHeight=function(e){return this.head.reduce(function(t,n){return t+n.getMaxCellHeight(e)},0)},e.prototype.getFootHeight=function(e){return this.foot.reduce(function(t,n){return t+n.getMaxCellHeight(e)},0)},e.prototype.allRows=function(){return this.head.concat(this.body).concat(this.foot)},e.prototype.callCellHooks=function(e,t,n,r,i,a){for(var o=0,s=t;o<s.length;o++){var c=s[o],l=c(new T(e,this,n,r,i,a))===!1;if(n.text=Array.isArray(n.text)?n.text:[n.text],l)return!1}return!0},e.prototype.callEndPageHooks=function(e,t){e.applyStyles(e.userStyles);for(var n=0,r=this.hooks.didDrawPage;n<r.length;n++){var i=r[n];i(new w(e,this,t))}},e.prototype.callWillDrawPageHooks=function(e,t){for(var n=0,r=this.hooks.willDrawPage;n<r.length;n++){var i=r[n];i(new w(e,this,t))}},e.prototype.getWidth=function(e){if(typeof this.settings.tableWidth==`number`)return this.settings.tableWidth;if(this.settings.tableWidth===`wrap`)return this.columns.reduce(function(e,t){return e+t.wrappedWidth},0);var t=this.settings.margin;return e-t.left-t.right},e}(),D=function(){function e(e,t,n,r,i){i===void 0&&(i=!1),this.height=0,this.raw=e,e instanceof o&&(this.raw=e._element,this.element=e._element),this.index=t,this.section=n,this.cells=r,this.spansMultiplePages=i}return e.prototype.getMaxCellHeight=function(e){var t=this;return e.reduce(function(e,n){return Math.max(e,t.cells[n.index]?.height||0)},0)},e.prototype.hasRowSpan=function(e){var t=this;return e.filter(function(e){var n=t.cells[e.index];return n?n.rowSpan>1:!1}).length>0},e.prototype.canEntireRowFit=function(e,t){return this.getMaxCellHeight(t)<=e},e.prototype.getMinimumRowHeight=function(e,t){var n=this;return e.reduce(function(e,r){var i=n.cells[r.index];if(!i)return 0;var a=t.getLineHeight(i.styles.fontSize),o=i.padding(`vertical`)+a;return o>e?o:e},0)},e}(),O=function(){function e(e,t,n){this.contentHeight=0,this.contentWidth=0,this.wrappedWidth=0,this.minReadableWidth=0,this.minWidth=0,this.width=0,this.height=0,this.x=0,this.y=0,this.styles=t,this.section=n,this.raw=e;var r=e;typeof e==`object`&&e&&!Array.isArray(e)?(this.rowSpan=e.rowSpan||1,this.colSpan=e.colSpan||1,r=e.content??e,e._element&&(this.raw=e._element)):(this.rowSpan=1,this.colSpan=1);var i=r==null?``:``+r,a=/\r\n|\r|\n/g;this.text=i.split(a)}return e.prototype.getTextPos=function(){var e;if(this.styles.valign===`top`)e=this.y+this.padding(`top`);else if(this.styles.valign===`bottom`)e=this.y+this.height-this.padding(`bottom`);else{var t=this.height-this.padding(`vertical`);e=this.y+t/2+this.padding(`top`)}var n;if(this.styles.halign===`right`)n=this.x+this.width-this.padding(`right`);else if(this.styles.halign===`center`){var r=this.width-this.padding(`horizontal`);n=this.x+r/2+this.padding(`left`)}else n=this.x+this.padding(`left`);return{x:n,y:e}},e.prototype.getContentHeight=function(e,t){t===void 0&&(t=1.15);var n=(Array.isArray(this.text)?this.text.length:1)*(this.styles.fontSize/e*t)+this.padding(`vertical`);return Math.max(n,this.styles.minCellHeight)},e.prototype.padding=function(e){var t=f(this.styles.cellPadding,0);return e===`vertical`?t.top+t.bottom:e===`horizontal`?t.left+t.right:t[e]},e}(),k=function(){function e(e,t,n){this.wrappedWidth=0,this.minReadableWidth=0,this.minWidth=0,this.width=0,this.dataKey=e,this.raw=t,this.index=n}return e.prototype.getMaxCustomCellWidth=function(e){for(var t=0,n=0,r=e.allRows();n<r.length;n++){var i=r[n].cells[this.index];i&&typeof i.styles.cellWidth==`number`&&(t=Math.max(t,i.styles.cellWidth))}return t},e}();function A(e,t){se(e,t);var n=[],r=0;t.columns.forEach(function(e){var i=e.getMaxCustomCellWidth(t);i?e.width=i:(e.width=e.wrappedWidth,n.push(e)),r+=e.width});var i=t.getWidth(e.pageSize().width)-r;i&&=j(n,i,function(e){return Math.max(e.minReadableWidth,e.minWidth)}),i&&=j(n,i,function(e){return e.minWidth}),i=Math.abs(i),!t.settings.horizontalPageBreak&&i>.1/e.scaleFactor()&&(i=i<1?i:Math.round(i),console.log(`Of the table content, ${i} units width could not fit page`)),le(t),ue(t,e),ce(t)}function se(e,t){var n=e.scaleFactor(),r=t.settings.horizontalPageBreak,i=p(e,t);t.allRows().forEach(function(a){for(var o=0,s=t.columns;o<s.length;o++){var c=s[o],u=a.cells[c.index];if(u){var d=t.hooks.didParseCell;t.callCellHooks(e,d,u,a,c,null);var f=u.padding(`horizontal`);if(u.contentWidth=l(u.text,u.styles,e)+f,u.minReadableWidth=l(u.text.join(` `).split(/[^\S\u00A0]+/),u.styles,e)+u.padding(`horizontal`),typeof u.styles.cellWidth==`number`)u.minWidth=u.styles.cellWidth,u.wrappedWidth=u.styles.cellWidth;else if(u.styles.cellWidth===`wrap`||r===!0)u.contentWidth>i?(u.minWidth=i,u.wrappedWidth=i):(u.minWidth=u.contentWidth,u.wrappedWidth=u.contentWidth);else{var p=10/n;u.minWidth=u.styles.minCellWidth||p,u.wrappedWidth=u.contentWidth,u.minWidth>u.wrappedWidth&&(u.wrappedWidth=u.minWidth)}}}}),t.allRows().forEach(function(e){for(var n=0,r=t.columns;n<r.length;n++){var i=r[n],a=e.cells[i.index];if(a&&a.colSpan===1)i.wrappedWidth=Math.max(i.wrappedWidth,a.wrappedWidth),i.minWidth=Math.max(i.minWidth,a.minWidth),i.minReadableWidth=Math.max(i.minReadableWidth,a.minReadableWidth);else{var o=t.styles.columnStyles[i.dataKey]||t.styles.columnStyles[i.index]||{},s=o.cellWidth||o.minCellWidth;s&&typeof s==`number`&&(i.minWidth=s,i.wrappedWidth=s)}a&&(a.colSpan>1&&!i.minWidth&&(i.minWidth=a.minWidth),a.colSpan>1&&!i.wrappedWidth&&(i.wrappedWidth=a.minWidth))}})}function j(e,t,n){for(var r=t,i=e.reduce(function(e,t){return e+t.wrappedWidth},0),a=0;a<e.length;a++){var o=e[a],s=r*(o.wrappedWidth/i),c=o.width+s,l=n(o),u=c<l?l:c;t-=u-o.width,o.width=u}if(t=Math.round(t*1e10)/1e10,t){var d=e.filter(function(e){return t<0?e.width>n(e):!0});d.length&&(t=j(d,t,n))}return t}function ce(e){for(var t={},n=1,r=e.allRows(),i=0;i<r.length;i++)for(var a=r[i],o=0,s=e.columns;o<s.length;o++){var c=s[o],l=t[c.index];if(n>1)n--,delete a.cells[c.index];else if(l)l.cell.height+=a.height,n=l.cell.colSpan,delete a.cells[c.index],l.left--,l.left<=1&&delete t[c.index];else{var u=a.cells[c.index];if(!u)continue;if(u.height=a.height,u.rowSpan>1){var d=r.length-i,f=u.rowSpan>d?d:u.rowSpan;t[c.index]={cell:u,left:f,row:a}}}}}function le(e){for(var t=e.allRows(),n=0;n<t.length;n++)for(var r=t[n],i=null,a=0,o=0,s=0;s<e.columns.length;s++){var c=e.columns[s];if(--o,o>1&&e.columns[s+1])a+=c.width,delete r.cells[c.index];else if(i){var l=i;delete r.cells[c.index],i=null,l.width=c.width+a}else{var l=r.cells[c.index];if(!l)continue;if(o=l.colSpan,a=0,l.colSpan>1){i=l,a+=c.width;continue}l.width=c.width+a}}}function ue(e,t){for(var n={count:0,height:0},r=0,i=e.allRows();r<i.length;r++){for(var a=i[r],o=0,s=e.columns;o<s.length;o++){var c=s[o],l=a.cells[c.index];if(l){t.applyStyles(l.styles,!0);var u=l.width-l.padding(`horizontal`);if(l.styles.overflow===`linebreak`)l.text=t.splitTextToSize(l.text,u+1/t.scaleFactor(),{fontSize:l.styles.fontSize});else if(l.styles.overflow===`ellipsize`)l.text=M(l.text,u,l.styles,t,`...`);else if(l.styles.overflow===`hidden`)l.text=M(l.text,u,l.styles,t,``);else if(typeof l.styles.overflow==`function`){var d=l.styles.overflow(l.text,u);l.text=typeof d==`string`?[d]:d}l.contentHeight=l.getContentHeight(t.scaleFactor(),t.getLineHeightFactor());var f=l.contentHeight/l.rowSpan;l.rowSpan>1&&n.count*n.height<f*l.rowSpan?n={height:f,count:l.rowSpan}:n&&n.count>0&&n.height>f&&(f=n.height),f>a.height&&(a.height=f)}}n.count--}}function M(e,t,n,r,i){return e.map(function(e){return de(e,t,n,r,i)})}function de(e,t,n,r,i){var a=1e4*r.scaleFactor();if(t=Math.ceil(t*a)/a,t>=l(e,n,r))return e;for(;t<l(e+i,n,r)&&!(e.length<=1);)e=e.substring(0,e.length-1);return e.trim()+i}function N(e,t){var n=new a(e),r=new E(t,fe(t,n.scaleFactor()));return A(n,r),n.applyStyles(n.userStyles),r}function fe(e,t){var n=e.content,r=L(n.columns);if(n.head.length===0){var i=F(r,`head`);i&&n.head.push(i)}if(n.foot.length===0){var i=F(r,`foot`);i&&n.foot.push(i)}var a=e.settings.theme,o=e.styles;return{columns:r,head:P(`head`,n.head,r,o,a,t),body:P(`body`,n.body,r,o,a,t),foot:P(`foot`,n.foot,r,o,a,t)}}function P(e,t,n,r,i,a){var o={};return t.map(function(t,s){for(var c=0,l={},u=0,d=0,f=0,p=n;f<p.length;f++){var m=p[f];if(o[m.index]==null||o[m.index].left===0){if(d===0){var h=void 0;h=Array.isArray(t)?t[m.index-u-c]:t[m.dataKey];var g={};typeof h==`object`&&!Array.isArray(h)&&(g=h?.styles||{});var _=R(e,m,s,i,r,a,g),v=new O(h,_,e);l[m.dataKey]=v,l[m.index]=v,d=v.colSpan-1,o[m.index]={left:v.rowSpan-1,times:d}}else d--,u++}else o[m.index].left--,d=o[m.index].times,c++}return new D(t,s,e,l)})}function F(e,t){var n={};return e.forEach(function(e){if(e.raw!=null){var r=I(t,e.raw);r!=null&&(n[e.dataKey]=r)}}),Object.keys(n).length>0?n:null}function I(e,t){if(e===`head`){if(typeof t==`object`)return t.header||null;if(typeof t==`string`||typeof t==`number`)return t}else if(e===`foot`&&typeof t==`object`)return t.footer;return null}function L(e){return e.map(function(e,t){return new k(typeof e==`object`?e.dataKey??t:t,e,t)})}function R(e,t,n,r,i,a,o){var l=c(r),u;e===`head`?u=i.headStyles:e===`body`?u=i.bodyStyles:e===`foot`&&(u=i.footStyles);var d=S({},l.table,l[e],i.styles,u),f=i.columnStyles[t.dataKey]||i.columnStyles[t.index]||{},p=e===`body`?f:{},m=e===`body`&&n%2==0?S({},l.alternateRow,i.alternateRowStyles):{};return S(S({},s(a),d,m,p),o)}function z(e,t,n){n===void 0&&(n={});var r=p(e,t),i=new Map,a=[],o=[],s=[];Array.isArray(t.settings.horizontalPageBreakRepeat)?s=t.settings.horizontalPageBreakRepeat:(typeof t.settings.horizontalPageBreakRepeat==`string`||typeof t.settings.horizontalPageBreakRepeat==`number`)&&(s=[t.settings.horizontalPageBreakRepeat]),s.forEach(function(e){var n=t.columns.find(function(t){return t.dataKey===e||t.index===e});n&&!i.has(n.index)&&(i.set(n.index,!0),a.push(n.index),o.push(t.columns[n.index]),r-=n.wrappedWidth)});for(var c=!0,l=n?.start??0;l<t.columns.length;)if(i.has(l))l++;else{var u=t.columns[l].wrappedWidth;if(c||r>=u)c=!1,a.push(l),o.push(t.columns[l]),r-=u;else break;l++}return{colIndexes:a,columns:o,lastIndex:l-1}}function B(e,t){for(var n=[],r=0;r<t.columns.length;r++){var i=z(e,t,{start:r});i.columns.length&&(n.push(i),r=i.lastIndex)}return n}function V(e,t){var n=t.settings,r=n.startY,i=n.margin,o={x:i.left,y:r},s=t.getHeadHeight(t.columns)+t.getFootHeight(t.columns),c=r+i.bottom+s;if(n.pageBreak===`avoid`){var l=t.body.reduce(function(e,t){return e+t.height},0);c+=l}var d=new a(e);(n.pageBreak===`always`||n.startY!=null&&c>d.pageSize().height)&&(Y(d),o.y=i.top),t.callWillDrawPageHooks(d,o);var f=S({},o);t.startPageNumber=d.pageNumber(),n.horizontalPageBreak?pe(d,t,f,o):(d.applyStyles(d.userStyles),(n.showHead===`firstPage`||n.showHead===`everyPage`)&&t.head.forEach(function(e){return K(d,t,e,o,t.columns)}),d.applyStyles(d.userStyles),t.body.forEach(function(e,n){G(d,t,e,n===t.body.length-1,f,o,t.columns)}),d.applyStyles(d.userStyles),(n.showFoot===`lastPage`||n.showFoot===`everyPage`)&&t.foot.forEach(function(e){return K(d,t,e,o,t.columns)})),u(d,t,f,o),t.callEndPageHooks(d,o),t.finalY=o.y,e.lastAutoTable=t,d.applyStyles(d.userStyles)}function pe(e,t,n,r){var i=B(e,t);if(t.settings.horizontalPageBreakBehaviour===`afterAllRows`)i.forEach(function(i,a){e.applyStyles(e.userStyles),a>0?J(e,t,n,r,i.columns,!0):H(e,t,r,i.columns),me(e,t,n,r,i.columns),W(e,t,r,i.columns)});else for(var a=-1,o=i[0],s=function(){var s=a;if(o){e.applyStyles(e.userStyles);var c=o.columns;a>=0?J(e,t,n,r,c,!0):H(e,t,r,c),s=U(e,t,a+1,r,c),W(e,t,r,c)}var l=s-a;i.slice(1).forEach(function(i){e.applyStyles(e.userStyles),J(e,t,n,r,i.columns,!0),U(e,t,a+1,r,i.columns,l),W(e,t,r,i.columns)}),a=s};a<t.body.length-1;)s()}function H(e,t,n,r){var i=t.settings;e.applyStyles(e.userStyles),(i.showHead===`firstPage`||i.showHead===`everyPage`)&&t.head.forEach(function(i){return K(e,t,i,n,r)})}function me(e,t,n,r,i){e.applyStyles(e.userStyles),t.body.forEach(function(a,o){G(e,t,a,o===t.body.length-1,n,r,i)})}function U(e,t,n,r,i,a){e.applyStyles(e.userStyles),a??=t.body.length;for(var o=Math.min(n+a,t.body.length),s=-1,c=t.body.slice(n,o),l=0;l<c.length;l++){var u=c[l],d=q(e,t,n+l===t.body.length-1,r);if(u.canEntireRowFit(d,i))K(e,t,u,r,i),s=n+l;else break}return s}function W(e,t,n,r){var i=t.settings;e.applyStyles(e.userStyles),(i.showFoot===`lastPage`||i.showFoot===`everyPage`)&&t.foot.forEach(function(i){return K(e,t,i,n,r)})}function he(e,t,n){var r=n.getLineHeight(e.styles.fontSize),i=e.padding(`vertical`),a=Math.floor((t-i)/r);return Math.max(0,a)}function ge(e,t,n,r){var i={};e.spansMultiplePages=!0,e.height=0;for(var a=0,o=0,s=n.columns;o<s.length;o++){var c=s[o],l=e.cells[c.index];if(l){Array.isArray(l.text)||(l.text=[l.text]);var u=new O(l.raw,l.styles,l.section);u=S(u,l),u.text=[];var d=he(l,t,r);l.text.length>d&&(u.text=l.text.splice(d,l.text.length));var f=r.scaleFactor(),p=r.getLineHeightFactor();l.contentHeight=l.getContentHeight(f,p),l.contentHeight>=t&&(l.contentHeight=t,u.styles.minCellHeight-=t),l.contentHeight>e.height&&(e.height=l.contentHeight),u.contentHeight=u.getContentHeight(f,p),u.contentHeight>a&&(a=u.contentHeight),i[c.index]=u}}var m=new D(e.raw,-1,e.section,i,!0);m.height=a;for(var h=0,g=n.columns;h<g.length;h++){var c=g[h],u=m.cells[c.index];u&&(u.height=m.height);var l=e.cells[c.index];l&&(l.height=e.height)}return m}function _e(e,t,n,r){var i=e.pageSize().height,a=r.settings.margin,o=i-(a.top+a.bottom);t.section===`body`&&(o-=r.getHeadHeight(r.columns)+r.getFootHeight(r.columns));var s=t.getMinimumRowHeight(r.columns,e),c=s<n;if(s>o)return console.log(`Will not be able to print row ${t.index} correctly since it's minimum height is larger than page height`),!0;if(!c)return!1;var l=t.hasRowSpan(r.columns);return t.getMaxCellHeight(r.columns)>o?(l&&console.log(`The content of row ${t.index} will not be drawn correctly since drawing rows with a height larger than the page height and has cells with rowspans is not supported.`),!0):!(l||r.settings.rowPageBreak===`avoid`)}function G(e,t,n,r,i,a,o){var s=q(e,t,r,a);if(n.canEntireRowFit(s,o))K(e,t,n,a,o);else if(_e(e,n,s,t)){var c=ge(n,s,t,e);K(e,t,n,a,o),J(e,t,i,a,o),G(e,t,c,r,i,a,o)}else J(e,t,i,a,o),G(e,t,n,r,i,a,o)}function K(e,t,n,i,a){i.x=t.settings.margin.left;for(var o=0,s=a;o<s.length;o++){var c=s[o],l=n.cells[c.index];if(!l)i.x+=c.width;else if(e.applyStyles(l.styles),l.x=i.x,l.y=i.y,t.callCellHooks(e,t.hooks.willDrawCell,l,n,c,i)===!1)i.x+=c.width;else{ve(e,l,i);var u=l.getTextPos();r(l.text,u.x,u.y,{halign:l.styles.halign,valign:l.styles.valign,maxWidth:Math.ceil(l.width-l.padding(`left`)-l.padding(`right`)),textOptions:l.styles.textOptions},e.getDocument()),t.callCellHooks(e,t.hooks.didDrawCell,l,n,c,i),i.x+=c.width}}i.y+=n.height}function ve(e,t,n){var r=t.styles;if(e.getDocument().setFillColor(e.getDocument().getFillColor()),typeof r.lineWidth==`number`){var i=d(r.lineWidth,r.fillColor);i&&e.rect(t.x,n.y,t.width,t.height,i)}else typeof r.lineWidth==`object`&&(r.fillColor&&e.rect(t.x,n.y,t.width,t.height,`F`),ye(e,t,n,r.lineWidth))}function ye(e,t,n,r){var i,a,o,s;r.top&&(i=n.x,a=n.y,o=n.x+t.width,s=n.y,r.right&&(o+=.5*r.right),r.left&&(i-=.5*r.left),c(r.top,i,a,o,s)),r.bottom&&(i=n.x,a=n.y+t.height,o=n.x+t.width,s=n.y+t.height,r.right&&(o+=.5*r.right),r.left&&(i-=.5*r.left),c(r.bottom,i,a,o,s)),r.left&&(i=n.x,a=n.y,o=n.x,s=n.y+t.height,r.top&&(a-=.5*r.top),r.bottom&&(s+=.5*r.bottom),c(r.left,i,a,o,s)),r.right&&(i=n.x+t.width,a=n.y,o=n.x+t.width,s=n.y+t.height,r.top&&(a-=.5*r.top),r.bottom&&(s+=.5*r.bottom),c(r.right,i,a,o,s));function c(t,n,r,i,a){e.getDocument().setLineWidth(t),e.getDocument().line(n,r,i,a,`S`)}}function q(e,t,n,r){var i=t.settings.margin.bottom,a=t.settings.showFoot;return(a===`everyPage`||a===`lastPage`&&n)&&(i+=t.getFootHeight(t.columns)),e.pageSize().height-r.y-i}function J(e,t,n,r,i,a){i===void 0&&(i=[]),a===void 0&&(a=!1),e.applyStyles(e.userStyles),t.settings.showFoot===`everyPage`&&!a&&t.foot.forEach(function(n){return K(e,t,n,r,i)}),t.callEndPageHooks(e,r);var o=t.settings.margin;u(e,t,n,r),Y(e),t.pageNumber++,r.x=o.left,r.y=o.top,n.y=o.top,t.callWillDrawPageHooks(e,r),t.settings.showHead===`everyPage`&&(t.head.forEach(function(n){return K(e,t,n,r,i)}),e.applyStyles(e.userStyles))}function Y(e){var t=e.pageNumber();return e.setPage(t+1),e.pageNumber()===t&&(e.addPage(),!0)}function X(e){e.API.autoTable=function(){var e=[...arguments][0],t=C(this,e),n=N(this,t);return V(this,n),this},e.API.lastAutoTable=!1,e.API.autoTableText=function(e,t,n,i){r(e,t,n,i,this)},e.API.autoTableSetDefaults=function(e){return a.setDefaults(e,this),this},e.autoTableSetDefaults=function(e,t){a.setDefaults(e,t)},e.API.autoTableHtmlToJson=function(e,t){if(t===void 0&&(t=!1),typeof window>`u`)return console.error(`Cannot run autoTableHtmlToJson in non browser environment`),null;var n=y(new a(this),e,window,t,!1),r=n.head,i=n.body;return{columns:r[0]?.map(function(e){return e.content})||[],rows:i,data:i}}}function Z(e,t){V(e,N(e,C(e,t)))}function be(e,t){return N(e,C(e,t))}function xe(e,t){V(e,t)}try{if(typeof window<`u`&&window){var Q=window,$=Q.jsPDF||Q.jspdf?.jsPDF;$&&X($)}}catch(e){console.error(`Could not apply autoTable plugin`,e)}export{O as Cell,T as CellHookData,k as Column,w as HookData,D as Row,E as Table,be as __createTable,xe as __drawTable,X as applyPlugin,Z as autoTable,Z as default};
@@ -0,0 +1 @@
1
+ function e(e){var t=e.width,n=e.height;if(t<0)throw Error(`Negative width is not allowed for Size`);if(n<0)throw Error(`Negative height is not allowed for Size`);return{width:t,height:n}}function t(e,t){return e.width===t.width&&e.height===t.height}var n=function(){function e(e){var t=this;this._resolutionListener=function(){return t._onResolutionChanged()},this._resolutionMediaQueryList=null,this._observers=[],this._window=e,this._installResolutionListener()}return e.prototype.dispose=function(){this._uninstallResolutionListener(),this._window=null},Object.defineProperty(e.prototype,"value",{get:function(){return this._window.devicePixelRatio},enumerable:!1,configurable:!0}),e.prototype.subscribe=function(e){var t=this,n={next:e};return this._observers.push(n),{unsubscribe:function(){t._observers=t._observers.filter(function(e){return e!==n})}}},e.prototype._installResolutionListener=function(){if(this._resolutionMediaQueryList!==null)throw Error(`Resolution listener is already installed`);var e=this._window.devicePixelRatio;this._resolutionMediaQueryList=this._window.matchMedia(`all and (resolution: ${e}dppx)`),this._resolutionMediaQueryList.addListener(this._resolutionListener)},e.prototype._uninstallResolutionListener=function(){this._resolutionMediaQueryList!==null&&(this._resolutionMediaQueryList.removeListener(this._resolutionListener),this._resolutionMediaQueryList=null)},e.prototype._reinstallResolutionListener=function(){this._uninstallResolutionListener(),this._installResolutionListener()},e.prototype._onResolutionChanged=function(){var e=this;this._observers.forEach(function(t){return t.next(e._window.devicePixelRatio)}),this._reinstallResolutionListener()},e}();function r(e){return new n(e)}var i=function(){function n(t,n,r){this._canvasElement=null,this._bitmapSizeChangedListeners=[],this._suggestedBitmapSize=null,this._suggestedBitmapSizeChangedListeners=[],this._devicePixelRatioObservable=null,this._canvasElementResizeObserver=null,this._canvasElement=t,this._canvasElementClientSize=e({width:this._canvasElement.clientWidth,height:this._canvasElement.clientHeight}),this._transformBitmapSize=n??(function(e){return e}),this._allowResizeObserver=r?.allowResizeObserver??!0,this._chooseAndInitObserver()}return n.prototype.dispose=function(){var e,t;if(this._canvasElement===null)throw Error(`Object is disposed`);(e=this._canvasElementResizeObserver)==null||e.disconnect(),this._canvasElementResizeObserver=null,(t=this._devicePixelRatioObservable)==null||t.dispose(),this._devicePixelRatioObservable=null,this._suggestedBitmapSizeChangedListeners.length=0,this._bitmapSizeChangedListeners.length=0,this._canvasElement=null},Object.defineProperty(n.prototype,"canvasElement",{get:function(){if(this._canvasElement===null)throw Error(`Object is disposed`);return this._canvasElement},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"canvasElementClientSize",{get:function(){return this._canvasElementClientSize},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"bitmapSize",{get:function(){return e({width:this.canvasElement.width,height:this.canvasElement.height})},enumerable:!1,configurable:!0}),n.prototype.resizeCanvasElement=function(t){this._canvasElementClientSize=e(t),this.canvasElement.style.width=`${this._canvasElementClientSize.width}px`,this.canvasElement.style.height=`${this._canvasElementClientSize.height}px`,this._invalidateBitmapSize()},n.prototype.subscribeBitmapSizeChanged=function(e){this._bitmapSizeChangedListeners.push(e)},n.prototype.unsubscribeBitmapSizeChanged=function(e){this._bitmapSizeChangedListeners=this._bitmapSizeChangedListeners.filter(function(t){return t!==e})},Object.defineProperty(n.prototype,"suggestedBitmapSize",{get:function(){return this._suggestedBitmapSize},enumerable:!1,configurable:!0}),n.prototype.subscribeSuggestedBitmapSizeChanged=function(e){this._suggestedBitmapSizeChangedListeners.push(e)},n.prototype.unsubscribeSuggestedBitmapSizeChanged=function(e){this._suggestedBitmapSizeChangedListeners=this._suggestedBitmapSizeChangedListeners.filter(function(t){return t!==e})},n.prototype.applySuggestedBitmapSize=function(){if(this._suggestedBitmapSize!==null){var e=this._suggestedBitmapSize;this._suggestedBitmapSize=null,this._resizeBitmap(e),this._emitSuggestedBitmapSizeChanged(e,this._suggestedBitmapSize)}},n.prototype._resizeBitmap=function(e){var n=this.bitmapSize;t(n,e)||(this.canvasElement.width=e.width,this.canvasElement.height=e.height,this._emitBitmapSizeChanged(n,e))},n.prototype._emitBitmapSizeChanged=function(e,t){var n=this;this._bitmapSizeChangedListeners.forEach(function(r){return r.call(n,e,t)})},n.prototype._suggestNewBitmapSize=function(n){var r=this._suggestedBitmapSize,i=e(this._transformBitmapSize(n,this._canvasElementClientSize)),a=t(this.bitmapSize,i)?null:i;r===null&&a===null||r!==null&&a!==null&&t(r,a)||(this._suggestedBitmapSize=a,this._emitSuggestedBitmapSizeChanged(r,a))},n.prototype._emitSuggestedBitmapSizeChanged=function(e,t){var n=this;this._suggestedBitmapSizeChangedListeners.forEach(function(r){return r.call(n,e,t)})},n.prototype._chooseAndInitObserver=function(){var e=this;this._allowResizeObserver?s().then(function(t){return t?e._initResizeObserver():e._initDevicePixelRatioObservable()}):this._initDevicePixelRatioObservable()},n.prototype._initDevicePixelRatioObservable=function(){var e=this;if(this._canvasElement!==null){var t=o(this._canvasElement);if(t===null)throw Error(`No window is associated with the canvas`);this._devicePixelRatioObservable=r(t),this._devicePixelRatioObservable.subscribe(function(){return e._invalidateBitmapSize()}),this._invalidateBitmapSize()}},n.prototype._invalidateBitmapSize=function(){if(this._canvasElement!==null){var t=o(this._canvasElement);if(t!==null){var n=this._devicePixelRatioObservable?.value??t.devicePixelRatio,r=this._canvasElement.getClientRects(),i=r[0]===void 0?e({width:this._canvasElementClientSize.width*n,height:this._canvasElementClientSize.height*n}):c(r[0],n);this._suggestNewBitmapSize(i)}}},n.prototype._initResizeObserver=function(){var t=this;this._canvasElement!==null&&(this._canvasElementResizeObserver=new ResizeObserver(function(n){var r=n.find(function(e){return e.target===t._canvasElement});if(r&&r.devicePixelContentBoxSize&&r.devicePixelContentBoxSize[0]){var i=r.devicePixelContentBoxSize[0],a=e({width:i.inlineSize,height:i.blockSize});t._suggestNewBitmapSize(a)}}),this._canvasElementResizeObserver.observe(this._canvasElement,{box:`device-pixel-content-box`}))},n}();function a(e,t){if(t.type===`device-pixel-content-box`)return new i(e,t.transform,t.options);throw Error(`Unsupported binding target`)}function o(e){return e.ownerDocument.defaultView}function s(){return new Promise(function(e){var t=new ResizeObserver(function(n){e(n.every(function(e){return`devicePixelContentBoxSize`in e})),t.disconnect()});t.observe(document.body,{box:`device-pixel-content-box`})}).catch(function(){return!1})}function c(t,n){return e({width:Math.round(t.left*n+t.width*n)-Math.round(t.left*n),height:Math.round(t.top*n+t.height*n)-Math.round(t.top*n)})}var l=function(){function e(e,t,n){if(t.width===0||t.height===0)throw TypeError(`Rendering target could only be created on a media with positive width and height`);if(this._mediaSize=t,n.width===0||n.height===0)throw TypeError(`Rendering target could only be created using a bitmap with positive integer width and height`);this._bitmapSize=n,this._context=e}return e.prototype.useMediaCoordinateSpace=function(e){try{return this._context.save(),this._context.setTransform(1,0,0,1,0,0),this._context.scale(this._horizontalPixelRatio,this._verticalPixelRatio),e({context:this._context,mediaSize:this._mediaSize})}finally{this._context.restore()}},e.prototype.useBitmapCoordinateSpace=function(e){try{return this._context.save(),this._context.setTransform(1,0,0,1,0,0),e({context:this._context,mediaSize:this._mediaSize,bitmapSize:this._bitmapSize,horizontalPixelRatio:this._horizontalPixelRatio,verticalPixelRatio:this._verticalPixelRatio})}finally{this._context.restore()}},Object.defineProperty(e.prototype,"_horizontalPixelRatio",{get:function(){return this._bitmapSize.width/this._mediaSize.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_verticalPixelRatio",{get:function(){return this._bitmapSize.height/this._mediaSize.height},enumerable:!1,configurable:!0}),e}();function u(e,t){var n=e.canvasElementClientSize;if(n.width===0||n.height===0)return null;var r=e.bitmapSize;if(r.width===0||r.height===0)return null;var i=e.canvasElement.getContext(`2d`,t);return i===null?null:new l(i,n,r)}var d={title:``,visible:!0,hitTestTolerance:3,lastValueVisible:!0,priceLineVisible:!0,priceLineSource:0,priceLineWidth:1,priceLineColor:``,priceLineStyle:2,baseLineVisible:!0,baseLineWidth:1,baseLineColor:`#B2B5BE`,baseLineStyle:0,priceFormat:{type:`price`,precision:2,minMove:.01}},f,p;function m(e,t){let n=function(e,t){switch(e){case 0:default:return[];case 1:return[t,t];case 2:return[2*t,2*t];case 3:return[6*t,6*t];case 4:return[t,4*t]}}(t,e.lineWidth);return e.setLineDash(n),n}function h(e,t,n,r){e.beginPath();let i=e.lineWidth%2?.5:0;e.moveTo(n,t+i),e.lineTo(r,t+i),e.stroke()}function g(e,t){if(!e)throw Error(`Assertion failed`+(t?`: `+t:``))}function _(e){if(e===void 0)throw Error(`Value is undefined`);return e}function v(e){if(e===null)throw Error(`Value is null`);return e}function y(e){return v(_(e))}(function(e){e[e.Simple=0]=`Simple`,e[e.WithSteps=1]=`WithSteps`,e[e.Curved=2]=`Curved`})(f||={}),function(e){e[e.Solid=0]=`Solid`,e[e.Dotted=1]=`Dotted`,e[e.Dashed=2]=`Dashed`,e[e.LargeDashed=3]=`LargeDashed`,e[e.SparseDotted=4]=`SparseDotted`}(p||={});var b=class{constructor(){this.t=[]}i(e,t,n){let r={h:e,l:t,o:!0===n};this.t.push(r)}_(e){let t=this.t.findIndex((t=>e===t.h));t>-1&&this.t.splice(t,1)}u(e){this.t=this.t.filter((t=>t.l!==e))}p(e,t,n){let r=[...this.t];this.t=this.t.filter((e=>!e.o)),r.forEach((r=>r.h(e,t,n)))}v(){return this.t.length>0}m(){this.t=[]}};function x(e,...t){for(let n of t)for(let t in n)n[t]!==void 0&&Object.prototype.hasOwnProperty.call(n,t)&&![`__proto__`,`constructor`,`prototype`].includes(t)&&(typeof n[t]!=`object`||e[t]===void 0||Array.isArray(n[t])?e[t]=n[t]:x(e[t],n[t]));return e}function S(e){return typeof e==`number`&&isFinite(e)}function C(e){return typeof e==`number`&&e%1==0}function w(e){return typeof e==`string`}function T(e){return typeof e==`boolean`}function E(e){let t=e;if(!t||typeof t!=`object`)return t;let n,r,i;for(r in n=Array.isArray(t)?[]:{},t)t.hasOwnProperty(r)&&(i=t[r],n[r]=i&&typeof i==`object`?E(i):i);return n}function ee(e){return e!==null}function D(e){return e===null?void 0:e}var te=`-apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif`;function O(e,t,n){return t===void 0&&(t=te),`${n=n===void 0?``:`${n} `}${e}px ${t}`}var ne=class{constructor(e){this.M={S:1,C:5,P:NaN,k:``,T:``,R:``,D:``,I:0,V:0,B:0,A:0,L:0},this.O=e}N(){let e=this.M,t=this.F(),n=this.W();return e.P===t&&e.T===n||(e.P=t,e.T=n,e.k=O(t,n),e.A=2.5/12*t,e.I=e.A,e.V=t/12*e.C,e.B=t/12*e.C,e.L=0),e.R=this.H(),e.D=this.U(),this.M}H(){return this.O.N().layout.textColor}U(){return this.O.$()}F(){return this.O.N().layout.fontSize}W(){return this.O.N().layout.fontFamily}};function k(e){return e<0?0:e>255?255:Math.round(e)||0}function A(e){return .199*e[0]+.687*e[1]+.114*e[2]}var re=class{constructor(e,t){this.j=new Map,this.q=e,t&&(this.j=t)}Y(e,t){if(e===`transparent`)return e;let n=this.K(e),r=n[3];return`rgba(${n[0]}, ${n[1]}, ${n[2]}, ${t*r})`}G(e){let t=this.K(e);return{Z:`rgb(${t[0]}, ${t[1]}, ${t[2]})`,X:A(t)>160?`black`:`white`}}J(e){return A(this.K(e))}tt(e,t,n){let[r,i,a,o]=this.K(e),[s,c,l,u]=this.K(t),d=[k(r+n*(s-r)),k(i+n*(c-i)),k(a+n*(l-a)),(f=o+n*(u-o),f<=0||f>1?Math.min(Math.max(f,0),1):Math.round(1e4*f)/1e4)];var f;return`rgba(${d[0]}, ${d[1]}, ${d[2]}, ${d[3]})`}K(e){let t=this.j.get(e);if(t)return t;let n=function(e){let t=document.createElement(`div`);t.style.display=`none`,document.body.appendChild(t),t.style.color=e;let n=window.getComputedStyle(t).color;return document.body.removeChild(t),n}(e).match(/^rgba?\s*\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d+))?\)$/);if(!n){if(this.q.length)for(let t of this.q){let n=t(e);if(n)return this.j.set(e,n),n}throw Error(`Failed to parse color: ${e}`)}let r=[parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10),n[4]?parseFloat(n[4]):1];return this.j.set(e,r),r}},ie=class{constructor(){this.it=[]}nt(e){this.it=e}st(e,t,n){this.it.forEach((r=>{r.st(e,t,n)}))}},j=class{st(e,t,n){e.useBitmapCoordinateSpace((e=>this.et(e,t,n)))}},ae=class extends j{constructor(){super(...arguments),this.rt=null}ht(e){this.rt=e}et({context:e,horizontalPixelRatio:t,verticalPixelRatio:n}){if(this.rt===null||this.rt.lt===null)return;let r=this.rt.lt,i=this.rt,a=Math.max(1,Math.floor(t))%2/2,o=o=>{e.beginPath();for(let s=r.to-1;s>=r.from;--s){let r=i.ot[s],c=Math.round(r._t*t)+a,l=r.ut*n,u=o*n+a;e.moveTo(c,l),e.arc(c,l,u,0,2*Math.PI)}e.fill()};i.ct>0&&(e.fillStyle=i.dt,o(i.ft+i.ct)),e.fillStyle=i.vt,o(i.ft)}};function oe(){return{ot:[{_t:0,ut:0,wt:0,Mt:0}],vt:``,dt:``,ft:0,ct:0,lt:null}}var se={from:0,to:1},ce=class{constructor(e,t,n){this.gt=new ie,this.bt=[],this.St=[],this.xt=!0,this.O=e,this.Ct=t,this.yt=n,this.gt.nt(this.bt)}Pt(e){this.kt(),this.xt=!0}Tt(){return this.xt&&=(this.Rt(),!1),this.gt}kt(){let e=this.yt.Dt();e.length!==this.bt.length&&(this.St=e.map(oe),this.bt=this.St.map((e=>{let t=new ae;return t.ht(e),t})),this.gt.nt(this.bt))}Rt(){let e=this.Ct.N().mode===2||!this.Ct.It(),t=this.yt.Vt(),n=this.Ct.Bt(),r=this.O.Et();this.kt(),t.forEach(((t,i)=>{let a=this.St[i],o=t.At(n),s=t.Lt();!e&&o!==null&&t.It()&&s!==null?(a.vt=o.zt,a.ft=o.ft,a.ct=o.Ot,a.ot[0].Mt=o.Mt,a.ot[0].ut=t.Ft().Nt(o.Mt,s.Wt),a.dt=o.Ht??this.O.Ut(a.ot[0].ut/t.Ft().$t()),a.ot[0].wt=n,a.ot[0]._t=r.jt(n),a.lt=se):a.lt=null}))}},le=class extends j{constructor(e){super(),this.qt=e}et({context:e,bitmapSize:t,horizontalPixelRatio:n,verticalPixelRatio:r}){if(this.qt===null)return;let i=this.qt.Yt.It,a=this.qt.Kt.It;if(!i&&!a)return;let o=Math.round(this.qt._t*n),s=Math.round(this.qt.ut*r);e.lineCap=`butt`,i&&o>=0&&(e.lineWidth=Math.floor(this.qt.Yt.ct*n),e.strokeStyle=this.qt.Yt.R,e.fillStyle=this.qt.Yt.R,m(e,this.qt.Yt.Gt),function(e,t,n,r){e.beginPath();let i=e.lineWidth%2?.5:0;e.moveTo(t+i,n),e.lineTo(t+i,r),e.stroke()}(e,o,0,t.height)),a&&s>=0&&(e.lineWidth=Math.floor(this.qt.Kt.ct*r),e.strokeStyle=this.qt.Kt.R,e.fillStyle=this.qt.Kt.R,m(e,this.qt.Kt.Gt),h(e,s,0,t.width))}},ue=class{constructor(e,t){this.xt=!0,this.Zt={Yt:{ct:1,Gt:0,R:``,It:!1},Kt:{ct:1,Gt:0,R:``,It:!1},_t:0,ut:0},this.Xt=new le(this.Zt),this.Jt=e,this.yt=t}Pt(){this.xt=!0}Tt(e){return this.xt&&=(this.Rt(),!1),this.Xt}Rt(){let e=this.Jt.It(),t=this.yt.Qt().N().crosshair,n=this.Zt;if(t.mode===2)return n.Kt.It=!1,void(n.Yt.It=!1);n.Kt.It=e&&this.Jt.ti(this.yt),n.Yt.It=e&&this.Jt.ii(),n.Kt.ct=t.horzLine.width,n.Kt.Gt=t.horzLine.style,n.Kt.R=t.horzLine.color,n.Yt.ct=t.vertLine.width,n.Yt.Gt=t.vertLine.style,n.Yt.R=t.vertLine.color,n._t=this.Jt.ni(),n.ut=this.Jt.si()}};function de(e,t,n,r,i,a){e.fillRect(t+a,n,r-2*a,a),e.fillRect(t+a,n+i-a,r-2*a,a),e.fillRect(t,n,a,i),e.fillRect(t+r-a,n,a,i)}function fe(e,t,n,r,i,a){e.save(),e.globalCompositeOperation=`copy`,e.fillStyle=a,e.fillRect(t,n,r,i),e.restore()}function pe(e,t,n,r,i,a){e.beginPath(),e.roundRect?e.roundRect(t,n,r,i,a):(e.lineTo(t+r-a[1],n),a[1]!==0&&e.arcTo(t+r,n,t+r,n+a[1],a[1]),e.lineTo(t+r,n+i-a[2]),a[2]!==0&&e.arcTo(t+r,n+i,t+r-a[2],n+i,a[2]),e.lineTo(t+a[3],n+i),a[3]!==0&&e.arcTo(t,n+i,t,n+i-a[3],a[3]),e.lineTo(t,n+a[0]),a[0]!==0&&e.arcTo(t,n,t+a[0],n,a[0]))}function me(e,t,n,r,i,a,o=0,s=[0,0,0,0],c=``){if(e.save(),!o||!c||c===a)return pe(e,t,n,r,i,s),e.fillStyle=a,e.fill(),void e.restore();let l=o/2;var u;pe(e,t+l,n+l,r-o,i-o,(u=-l,s.map((e=>e===0?e:e+u)))),a!==`transparent`&&(e.fillStyle=a,e.fill()),c!==`transparent`&&(e.lineWidth=o,e.strokeStyle=c,e.closePath(),e.stroke()),e.restore()}function he(e,t,n,r,i,a,o){e.save(),e.globalCompositeOperation=`copy`;let s=e.createLinearGradient(0,0,0,i);s.addColorStop(0,a),s.addColorStop(1,o),e.fillStyle=s,e.fillRect(t,n,r,i),e.restore()}var ge=class{constructor(e,t){this.ht(e,t)}ht(e,t){this.qt=e,this.ei=t}$t(e,t){return this.qt.It?e.P+e.A+e.I:0}st(e,t,n,r){if(!this.qt.It||this.qt.ri.length===0)return;let i=this.qt.R,a=this.ei.Z,o=e.useBitmapCoordinateSpace((e=>{let o=e.context;o.font=t.k;let s=this.hi(e,t,n,r),c=s.ai;return s.li?me(o,c.oi,c._i,c.ui,c.ci,a,c.di,[c.ft,0,0,c.ft],a):me(o,c.fi,c._i,c.ui,c.ci,a,c.di,[0,c.ft,c.ft,0],a),this.qt.pi&&(o.fillStyle=i,o.fillRect(c.fi,c.mi,c.wi-c.fi,c.Mi)),this.qt.gi&&(o.fillStyle=t.D,o.fillRect(s.li?c.bi-c.di:0,c._i,c.di,c.Si-c._i)),s}));e.useMediaCoordinateSpace((({context:e})=>{let n=o.xi;e.font=t.k,e.textAlign=o.li?`right`:`left`,e.textBaseline=`middle`,e.fillStyle=i,e.fillText(this.qt.ri,n.Ci,(n._i+n.Si)/2+n.yi)}))}hi(e,t,n,r){let{context:i,bitmapSize:a,mediaSize:o,horizontalPixelRatio:s,verticalPixelRatio:c}=e,l=this.qt.pi||!this.qt.Pi?t.C:0,u=this.qt.ki?t.S:0,d=t.A+this.ei.Ti,f=t.I+this.ei.Ri,p=t.V,m=t.B,h=this.qt.ri,g=t.P,_=n.Di(i,h),v=Math.ceil(n.Ii(i,h)),y=g+d+f,b=t.S+p+m+v+l,x=Math.max(1,Math.floor(c)),S=Math.round(y*c);S%2!=x%2&&(S+=1);let C=u>0?Math.max(1,Math.floor(u*s)):0,w=Math.round(b*s),T=Math.round(l*s),E=this.ei.Vi??this.ei.Bi??this.ei.Ei,ee=Math.round(E*c)-Math.floor(.5*c),D=Math.floor(ee+x/2-S/2),te=D+S,O=r===`right`,ne=O?o.width-u:u,k=O?a.width-C:C,A,re,ie;return O?(A=k-w,re=k-T,ie=ne-l-p-u):(A=k+w,re=k+T,ie=ne+l+p),{li:O,ai:{_i:D,mi:ee,Si:te,ui:w,ci:S,ft:2*s,di:C,oi:A,fi:k,wi:re,Mi:x,bi:a.width},xi:{_i:D/c,Si:te/c,Ci:ie,yi:_}}}},_e=class{constructor(e){this.Ai={Ei:0,Z:`#000`,Ri:0,Ti:0},this.Li={ri:``,It:!1,pi:!0,Pi:!1,Ht:``,R:`#FFF`,gi:!1,ki:!1},this.zi={ri:``,It:!1,pi:!1,Pi:!0,Ht:``,R:`#FFF`,gi:!0,ki:!0},this.xt=!0,this.Oi=new(e||ge)(this.Li,this.Ai),this.Ni=new(e||ge)(this.zi,this.Ai)}ri(){return this.Fi(),this.Li.ri}Ei(){return this.Fi(),this.Ai.Ei}Pt(){this.xt=!0}$t(e,t=!1){return Math.max(this.Oi.$t(e,t),this.Ni.$t(e,t))}Wi(){return this.Ai.Vi??null}Hi(){return this.Ai.Vi??this.Ai.Bi??this.Ei()}Ui(e){this.Ai.Bi=e??void 0}$i(){return this.Fi(),this.Li.It||this.zi.It}ji(){return this.Fi(),this.Li.It}Tt(e){return this.Fi(),this.Li.pi=this.Li.pi&&e.N().ticksVisible,this.zi.pi=this.zi.pi&&e.N().ticksVisible,this.Oi.ht(this.Li,this.Ai),this.Ni.ht(this.zi,this.Ai),this.Oi}qi(){return this.Fi(),this.Oi.ht(this.Li,this.Ai),this.Ni.ht(this.zi,this.Ai),this.Ni}Fi(){this.xt&&(this.Li.pi=!0,this.zi.pi=!1,this.Yi(this.Li,this.zi,this.Ai))}},ve=class extends _e{constructor(e,t,n){super(),this.Jt=e,this.Ki=t,this.Gi=n}Yi(e,t,n){if(e.It=!1,this.Jt.N().mode===2)return;let r=this.Jt.N().horzLine;if(!r.labelVisible)return;let i=this.Ki.Lt();if(!this.Jt.It()||this.Ki.Zi()||i===null)return;let a=this.Ki.Xi().G(r.labelBackgroundColor);n.Z=a.Z,e.R=a.X;let o=2/12*this.Ki.P();n.Ti=o,n.Ri=o;let s=this.Gi(this.Ki);n.Ei=s.Ei,e.ri=this.Ki.Ji(s.Mt,i),e.It=!0}},ye=/[1-9]/g,be=class{constructor(){this.qt=null}ht(e){this.qt=e}st(e,t){if(this.qt===null||!1===this.qt.It||this.qt.ri.length===0)return;let n=e.useMediaCoordinateSpace((({context:e})=>(e.font=t.k,Math.round(t.Qi.Ii(e,v(this.qt).ri,ye)))));if(n<=0)return;let r=t.tn,i=n+2*r,a=i/2,o=this.qt.nn,s=this.qt.Ei,c=Math.floor(s-a)+.5;c<0?(s+=Math.abs(0-c),c=Math.floor(s-a)+.5):c+i>o&&(s-=Math.abs(o-(c+i)),c=Math.floor(s-a)+.5);let l=c+i,u=Math.ceil(0+t.S+t.C+t.A+t.P+t.I);e.useBitmapCoordinateSpace((({context:e,horizontalPixelRatio:n,verticalPixelRatio:r})=>{let i=v(this.qt);e.fillStyle=i.Z;let a=Math.round(c*n),o=Math.round(0*r),s=Math.round(l*n),d=Math.round(u*r),f=Math.round(2*n);if(e.beginPath(),e.moveTo(a,o),e.lineTo(a,d-f),e.arcTo(a,d,a+f,d,f),e.lineTo(s-f,d),e.arcTo(s,d,s,d-f,f),e.lineTo(s,o),e.fill(),i.pi){let a=Math.round(i.Ei*n),s=o,c=Math.round((s+t.C)*r);e.fillStyle=i.R;let l=Math.max(1,Math.floor(n)),u=Math.floor(.5*n);e.fillRect(a-u,s,l,c-s)}})),e.useMediaCoordinateSpace((({context:e})=>{let n=v(this.qt),i=0+t.S+t.C+t.A+t.P/2;e.font=t.k,e.textAlign=`left`,e.textBaseline=`middle`,e.fillStyle=n.R;let a=t.Qi.Di(e,`Apr0`);e.translate(c+r,i+a),e.fillText(n.ri,0,0)}))}},xe=class{constructor(e,t,n){this.xt=!0,this.Xt=new be,this.Zt={It:!1,Z:`#4c525e`,R:`white`,ri:``,nn:0,Ei:NaN,pi:!0},this.Ct=e,this.sn=t,this.Gi=n}Pt(){this.xt=!0}Tt(){return this.xt&&=(this.Rt(),!1),this.Xt.ht(this.Zt),this.Xt}Rt(){let e=this.Zt;if(e.It=!1,this.Ct.N().mode===2)return;let t=this.Ct.N().vertLine;if(!t.labelVisible)return;let n=this.sn.Et();if(n.Zi())return;e.nn=n.nn();let r=this.Gi();if(r===null)return;e.Ei=r.Ei;let i=n.en(this.Ct.Bt());e.ri=n.rn(v(i)),e.It=!0;let a=this.sn.Xi().G(t.labelBackgroundColor);e.Z=a.Z,e.R=a.X,e.pi=n.N().ticksVisible}},Se=class{constructor(){this.hn=null,this.an=0}ln(){return this.an}_n(e){this.an=e}Ft(){return this.hn}un(e){this.hn=e}cn(e){return[]}dn(){return[]}It(){return!0}},Ce;(function(e){e[e.Normal=0]=`Normal`,e[e.Magnet=1]=`Magnet`,e[e.Hidden=2]=`Hidden`,e[e.MagnetOHLC=3]=`MagnetOHLC`})(Ce||={});var we=class extends Se{constructor(e,t){super(),this.yt=null,this.fn=NaN,this.pn=0,this.vn=!1,this.mn=new Map,this.wn=!1,this.Mn=new WeakMap,this.gn=new WeakMap,this.bn=NaN,this.Sn=NaN,this.xn=NaN,this.Cn=NaN,this.sn=e,this.yn=t,this.Pn=((e,t)=>n=>{let r=t(),i=e();if(n===v(this.yt).kn())return{Mt:i,Ei:r};{let e=v(n.Lt());return{Mt:n.Tn(r,e),Ei:r}}})((()=>this.fn),(()=>this.Sn));let n=((e,t)=>()=>{let n=this.sn.Et().Rn(e()),r=t();return n&&Number.isFinite(r)?{wt:n,Ei:r}:null})((()=>this.pn),(()=>this.ni()));this.Dn=new xe(this,e,n)}N(){return this.yn}In(e,t){this.xn=e,this.Cn=t}Vn(){this.xn=NaN,this.Cn=NaN}Bn(){return this.xn}En(){return this.Cn}An(e,t,n){this.wn||=!0,this.vn=!0,this.Ln(e,t,n)}Bt(){return this.pn}ni(){return this.bn}si(){return this.Sn}It(){return this.vn}zn(){this.vn=!1,this.On(),this.fn=NaN,this.bn=NaN,this.Sn=NaN,this.yt=null,this.Vn(),this.Nn()}Fn(e){if(!this.yn.doNotSnapToHiddenSeriesIndices)return e;let t=this.sn,n=t.Et(),r=null,i=null;for(let n of t.Wn()){let t=n.Un().Hn(e,-1);if(t){if(t.$n===e)return e;(r===null||t.$n>r)&&(r=t.$n)}let a=n.Un().Hn(e,1);if(a){if(a.$n===e)return e;(i===null||a.$n<i)&&(i=a.$n)}}let a=[r,i].filter(ee);if(a.length===0)return e;let o=n.jt(e),s=a.map((e=>Math.abs(o-n.jt(e))));return a[s.indexOf(Math.min(...s))]}jn(e){let t=this.Mn.get(e);t||(t=new ue(this,e),this.Mn.set(e,t));let n=this.gn.get(e);return n||(n=new ce(this.sn,this,e),this.gn.set(e,n)),[t,n]}ti(e){return e===this.yt&&this.yn.horzLine.visible}ii(){return this.yn.vertLine.visible}qn(e,t){this.vn&&this.yt===e||this.mn.clear();let n=[];return this.yt===e&&n.push(this.Yn(this.mn,t,this.Pn)),n}dn(){return this.vn?[this.Dn]:[]}Kn(){return this.yt}Nn(){this.sn.Gn().forEach((e=>{this.Mn.get(e)?.Pt(),this.gn.get(e)?.Pt()})),this.mn.forEach((e=>e.Pt())),this.Dn.Pt()}Zn(e){return e&&!e.kn().Zi()?e.kn():null}Ln(e,t,n){this.Xn(e,t,n)&&this.Nn()}Xn(e,t,n){let r=this.bn,i=this.Sn,a=this.fn,o=this.pn,s=this.yt,c=this.Zn(n);this.pn=e,this.bn=isNaN(e)?NaN:this.sn.Et().jt(e),this.yt=n;let l=c===null?null:c.Lt();return c!==null&&l!==null?(this.fn=t,this.Sn=c.Nt(t,l)):(this.fn=NaN,this.Sn=NaN),r!==this.bn||i!==this.Sn||o!==this.pn||a!==this.fn||s!==this.yt}On(){let e=this.sn.Jn().map((e=>e.Un().Qn())).filter(ee),t=e.length===0?null:Math.max(...e);this.pn=t===null?NaN:t}Yn(e,t,n){let r=e.get(t);return r===void 0&&(r=new ve(this,t,n),e.set(t,r)),r}};function Te(e){return e===`left`||e===`right`}var M=class e{constructor(e){this.ts=new Map,this.ns=[],this.ss=e}es(e,t){let n=function(e,t){return e===void 0?t:{rs:Math.max(e.rs,t.rs),hs:e.hs||t.hs}}(this.ts.get(e),t);this.ts.set(e,n)}ls(){return this.ss}_s(e){let t=this.ts.get(e);return t===void 0?{rs:this.ss}:{rs:Math.max(this.ss,t.rs),hs:t.hs}}us(){this.cs(),this.ns=[{ds:0}]}fs(e){this.cs(),this.ns=[{ds:1,Wt:e}]}ps(e){this.vs(),this.ns.push({ds:5,Wt:e})}cs(){this.vs(),this.ns.push({ds:6})}ws(){this.cs(),this.ns=[{ds:4}]}Ms(e){this.cs(),this.ns.push({ds:2,Wt:e})}gs(e){this.cs(),this.ns.push({ds:3,Wt:e})}bs(){return this.ns}Ss(e){for(let t of e.ns)this.xs(t);this.ss=Math.max(this.ss,e.ss),e.ts.forEach(((e,t)=>{this.es(t,e)}))}static Cs(){return new e(2)}static ys(){return new e(3)}xs(e){switch(e.ds){case 0:this.us();break;case 1:this.fs(e.Wt);break;case 2:this.Ms(e.Wt);break;case 3:this.gs(e.Wt);break;case 4:this.ws();break;case 5:this.ps(e.Wt);break;case 6:this.vs()}}vs(){let e=this.ns.findIndex((e=>e.ds===5));e!==-1&&this.ns.splice(e,1)}},Ee=class{formatTickmarks(e){return e.map((e=>this.format(e)))}},De=`.`;function N(e,t){if(!S(e))return`n/a`;if(!C(t)||t<0||t>16)throw TypeError(`invalid length`);return t===0?e.toString():(`0000000000000000`+e.toString()).slice(-t)}var Oe=class extends Ee{constructor(e,t){if(super(),t||=1,S(e)&&C(e)||(e=100),e<0)throw TypeError(`invalid base`);this.Ki=e,this.Ps=t,this.ks()}format(e){let t=e<0?`−`:``;return e=Math.abs(e),t+this.Ts(e)}ks(){if(this.Rs=0,this.Ki>0&&this.Ps>0){let e=this.Ki;for(;e>1;)e/=10,this.Rs++}}Ts(e){let t=this.Ki/this.Ps,n=Math.floor(e),r=``,i=this.Rs===void 0?NaN:this.Rs;if(t>1){let a=+(Math.round(e*t)-n*t).toFixed(this.Rs);a>=t&&(a-=t,n+=1),r=De+N(+a.toFixed(this.Rs)*this.Ps,i)}else n=Math.round(n*t)/t,i>0&&(r=De+N(0,i));return n.toFixed(0)+r}},ke=class extends Oe{constructor(e=100){super(e)}format(e){return`${super.format(e)}%`}},Ae=class extends Ee{constructor(e){super(),this.Ds=e}format(e){let t=``;return e<0&&(t=`-`,e=-e),e<995?t+this.Is(e):e<999995?t+this.Is(e/1e3)+`K`:e<999999995?(e=1e3*Math.round(e/1e3),t+this.Is(e/1e6)+`M`):(e=1e6*Math.round(e/1e6),t+this.Is(e/1e9)+`B`)}Is(e){let t,n=10**this.Ds;return t=(e=Math.round(e*n)/n)>=1e-15&&e<1?e.toFixed(this.Ds).replace(/\.?0+$/,``):String(e),t.replace(/(\.[1-9]*)0+$/,((e,t)=>t))}},je=/[2-9]/g,P=class{constructor(e=50){this.Vs=0,this.Bs=1,this.Es=1,this.As={},this.Ls=new Map,this.zs=e}Os(){this.Vs=0,this.Ls.clear(),this.Bs=1,this.Es=1,this.As={}}Ii(e,t,n){return this.Ns(e,t,n).width}Di(e,t,n){let r=this.Ns(e,t,n);return((r.actualBoundingBoxAscent||0)-(r.actualBoundingBoxDescent||0))/2}Ns(e,t,n){let r=n||je,i=String(t).replace(r,`0`);if(this.Ls.has(i))return _(this.Ls.get(i)).Fs;if(this.Vs===this.zs){let e=this.As[this.Es];delete this.As[this.Es],this.Ls.delete(e),this.Es++,this.Vs--}e.save(),e.textBaseline=`middle`;let a=e.measureText(i);return e.restore(),a.width===0&&t.length||(this.Ls.set(i,{Fs:a,Ws:this.Bs}),this.As[this.Bs]=i,this.Vs++,this.Bs++),a}},Me=class{constructor(e){this.Hs=null,this.M=null,this.Us=`right`,this.$s=e}js(e,t,n){this.Hs=e,this.M=t,this.Us=n}st(e){this.M!==null&&this.Hs!==null&&this.Hs.st(e,this.M,this.$s,this.Us)}},Ne=class{constructor(e,t,n){this.qs=e,this.$s=new P(50),this.Ys=t,this.O=n,this.F=-1,this.Xt=new Me(this.$s)}Tt(){let e=this.O.Ks(this.Ys);if(e===null)return null;let t=e.Gs(this.Ys)?e.Zs():this.Ys.Ft();if(t===null)return null;let n=e.Xs(t);if(n===`overlay`)return null;let r=this.O.Js();return r.P!==this.F&&(this.F=r.P,this.$s.Os()),this.Xt.js(this.qs.qi(),r,n),this.Xt}},Pe=class extends j{constructor(){super(...arguments),this.qt=null}ht(e){this.qt=e}Qs(e,t){if(!this.qt?.It)return null;let{ut:n,ct:r,te:i}=this.qt;return t>=n-r-7&&t<=n+r+7?{ie:this.qt,ne:Math.abs(t-n),se:2,ee:`price-line`,te:i}:null}et({context:e,bitmapSize:t,horizontalPixelRatio:n,verticalPixelRatio:r}){if(this.qt===null||!1===this.qt.It)return;let i=Math.round(this.qt.ut*r);i<0||i>t.height||(e.lineCap=`butt`,e.strokeStyle=this.qt.R,e.lineWidth=Math.floor(this.qt.ct*n),m(e,this.qt.Gt),h(e,i,0,t.width))}},Fe=class{constructor(e){this.re={ut:0,R:`rgba(0, 0, 0, 0)`,ct:1,Gt:0,It:!1},this.he=new Pe,this.xt=!0,this.ae=e,this.le=e.Qt(),this.he.ht(this.re)}Pt(){this.xt=!0}Tt(){return this.ae.It()?(this.xt&&=(this.oe(),!1),this.he):null}},Ie=class extends Fe{constructor(e){super(e)}oe(){this.re.It=!1;let e=this.ae.Ft(),t=e._e()._e;if(t!==2&&t!==3)return;let n=this.ae.N();if(!n.baseLineVisible||!this.ae.It())return;let r=this.ae.Lt();r!==null&&(this.re.It=!0,this.re.ut=e.Nt(r.Wt,r.Wt),this.re.R=n.baseLineColor,this.re.ct=n.baseLineWidth,this.re.Gt=n.baseLineStyle)}},Le=class extends j{constructor(){super(...arguments),this.qt=null}ht(e){this.qt=e}ue(){return this.qt}et({context:e,horizontalPixelRatio:t,verticalPixelRatio:n}){let r=this.qt;if(r===null)return;let i=Math.max(1,Math.floor(t)),a=i%2/2,o=Math.round(r.ce.x*t)+a,s=r.ce.y*n;e.fillStyle=r.de,e.beginPath();let c=Math.max(2,1.5*r.fe)*t;e.arc(o,s,c,0,2*Math.PI,!1),e.fill(),e.fillStyle=r.pe,e.beginPath(),e.arc(o,s,r.ft*t,0,2*Math.PI,!1),e.fill(),e.lineWidth=i,e.strokeStyle=r.ve,e.beginPath(),e.arc(o,s,r.ft*t+i/2,0,2*Math.PI,!1),e.stroke()}},Re=[{me:0,we:.25,Me:4,ge:10,be:.25,Se:0,xe:.4,Ce:.8},{me:.25,we:.525,Me:10,ge:14,be:0,Se:0,xe:.8,Ce:0},{me:.525,we:1,Me:14,ge:14,be:0,Se:0,xe:0,Ce:0}],ze=class{constructor(e){this.Xt=new Le,this.xt=!0,this.ye=!0,this.Pe=performance.now(),this.ke=this.Pe-1,this.Te=e}Re(){this.ke=this.Pe-1,this.Pt()}De(){if(this.Pt(),this.Te.N().lastPriceAnimation===2){let e=performance.now(),t=this.ke-e;if(t>0)return void(t<650&&(this.ke+=2600));this.Pe=e,this.ke=e+2600}}Pt(){this.xt=!0}Ie(){this.ye=!0}It(){return this.Te.N().lastPriceAnimation!==0}Ve(){switch(this.Te.N().lastPriceAnimation){case 0:return!1;case 1:return!0;case 2:return performance.now()<=this.ke}}Tt(){return this.xt?(this.Rt(),this.xt=!1,this.ye=!1):this.ye&&=(this.Be(),!1),this.Xt}Rt(){this.Xt.ht(null);let e=this.Te.Qt().Et(),t=e.Ee(),n=this.Te.Lt();if(t===null||n===null)return;let r=this.Te.Ae(!0);if(r.Le||!t.ze(r.$n))return;let i={x:e.jt(r.$n),y:this.Te.Ft().Nt(r.Mt,n.Wt)},a=r.R,o=this.Te.N().lineWidth,s=this.Oe(this.Ne(),a);this.Xt.ht({de:a,fe:o,pe:s.pe,ve:s.ve,ft:s.ft,ce:i})}Be(){let e=this.Xt.ue();if(e!==null){let t=this.Oe(this.Ne(),e.de);e.pe=t.pe,e.ve=t.ve,e.ft=t.ft}}Ne(){return this.Ve()?performance.now()-this.Pe:2599}Fe(e,t,n,r){let i=n+(r-n)*t;return this.Te.Qt().Xi().Y(e,i)}Oe(e,t){let n=e%2600/2600,r;for(let e of Re)if(n>=e.me&&n<=e.we){r=e;break}g(r!==void 0,`Last price animation internal logic error`);let i=(n-r.me)/(r.we-r.me);return{pe:this.Fe(t,i,r.be,r.Se),ve:this.Fe(t,i,r.xe,r.Ce),ft:(a=i,o=r.Me,s=r.ge,o+(s-o)*a)};var a,o,s}},Be=class extends Fe{constructor(e){super(e)}oe(){let e=this.re;e.It=!1;let t=this.ae.N();if(!t.priceLineVisible||!this.ae.It())return;let n=this.ae.Ae(t.priceLineSource===0);n.Le||(e.It=!0,e.ut=n.Ei,e.R=this.ae.We(n.R),e.ct=t.priceLineWidth,e.Gt=t.priceLineStyle)}},Ve=class extends _e{constructor(e){super(),this.Jt=e}Yi(e,t,n){e.It=!1,t.It=!1;let r=this.Jt;if(!r.It())return;let i=r.N(),a=i.lastValueVisible,o=r.He()!==``,s=i.seriesLastValueMode===0,c=r.Ae(!1);if(c.Le)return;a&&(e.ri=this.Ue(c,a,s),e.It=e.ri.length!==0),(o||s)&&(t.ri=this.$e(c,a,o,s),t.It=t.ri.length>0);let l=r.We(c.R),u=this.Jt.Qt().Xi().G(l);n.Z=u.Z,n.Ei=c.Ei,t.Ht=r.Qt().Ut(c.Ei/r.Ft().$t()),e.Ht=l,e.R=u.X,t.R=u.X}$e(e,t,n,r){let i=``,a=this.Jt.He();return n&&a.length!==0&&(i+=`${a} `),t&&r&&(i+=this.Jt.Ft().je()?e.qe:e.Ye),i.trim()}Ue(e,t,n){return t?n?this.Jt.Ft().je()?e.Ye:e.qe:e.ri:``}};function He(e,t,n,r){let i=Number.isFinite(t),a=Number.isFinite(n);return i&&a?e(t,n):i||a?i?t:n:r}var F=class e{constructor(e,t){this.Ke=e,this.Ge=t}Ze(e){return e!==null&&this.Ke===e.Ke&&this.Ge===e.Ge}Xe(){return new e(this.Ke,this.Ge)}Je(){return this.Ke}Qe(){return this.Ge}tr(){return this.Ge-this.Ke}Zi(){return this.Ge===this.Ke||Number.isNaN(this.Ge)||Number.isNaN(this.Ke)}Ss(t){return t===null?this:new e(He(Math.min,this.Je(),t.Je(),-1/0),He(Math.max,this.Qe(),t.Qe(),1/0))}ir(e){if(!S(e)||this.Ge-this.Ke===0)return;let t=.5*(this.Ge+this.Ke),n=this.Ge-t,r=this.Ke-t;n*=e,r*=e,this.Ge=t+n,this.Ke=t+r}nr(e){S(e)&&(this.Ge+=e,this.Ke+=e)}sr(){return{minValue:this.Ke,maxValue:this.Ge}}static er(t){return t===null?null:new e(t.minValue,t.maxValue)}},Ue=class e{constructor(e,t){this.rr=e,this.hr=t||null}ar(){return this.rr}lr(){return this.hr}sr(){return{priceRange:this.rr===null?null:this.rr.sr(),margins:this.hr||void 0}}static er(t){return t===null?null:new e(F.er(t.priceRange),t.margins)}},We=[2,4,8,16,32,64,128,256,512],Ge=`Custom series with conflation reducer must have a priceValueBuilder method`,Ke=class extends Fe{constructor(e,t){super(e),this._r=t}oe(){let e=this.re;e.It=!1;let t=this._r.N();if(!this.ae.It()||!t.lineVisible)return;let n=this._r.ur();n!==null&&(e.It=!0,e.ut=n,e.R=t.color,e.ct=t.lineWidth,e.Gt=t.lineStyle,e.te=this._r.N().id)}},qe=class extends _e{constructor(e,t){super(),this.Te=e,this._r=t}Yi(e,t,n){e.It=!1,t.It=!1;let r=this._r.N(),i=r.axisLabelVisible,a=r.title!==``,o=this.Te;if(!i||!o.It())return;let s=this._r.ur();if(s===null)return;a&&(t.ri=r.title,t.It=!0),t.Ht=o.Qt().Ut(s/o.Ft().$t()),e.ri=this.cr(r.price),e.It=!0;let c=this.Te.Qt().Xi().G(r.axisLabelColor||r.color);n.Z=c.Z;let l=r.axisLabelTextColor||c.X;e.R=l,t.R=l,n.Ei=s}cr(e){let t=this.Te.Lt();return t===null?``:this.Te.Ft().Ji(e,t.Wt)}},Je=class{constructor(e,t){this.Te=e,this.yn=t,this.dr=new Ke(e,this),this.qs=new qe(e,this),this.pr=new Ne(this.qs,e,e.Qt())}vr(e){x(this.yn,e),this.Pt(),this.Te.Qt().mr()}N(){return this.yn}wr(){return this.dr}Mr(){return this.pr}gr(){return this.qs}Pt(){this.dr.Pt(),this.qs.Pt()}ur(){let e=this.Te,t=e.Ft();if(e.Qt().Et().Zi()||t.Zi())return null;let n=e.Lt();return n===null?null:t.Nt(this.yn.price,n.Wt)}},Ye=class{constructor(){this.br=new WeakMap}Sr(e,t,n){let r=1/t*n;if(e>=r)return 1;let i=r/e;return Math.min(2**Math.floor(Math.log2(i)),512)}Cr(e,t,n,r=!1,i){if(e.length===0||t<=1)return e;let a=this.yr(t);if(a<=1)return e;let o=this.Pr(e),s=o.kr.get(a);return s!==void 0||(s=this.Tr(e,a,n,r,i,o.kr),o.kr.set(a,s)),s}Rr(e,t,n,r,i=!1,a){if(n<1||e.length===0)return e;let o=this.Pr(e),s=o.kr.get(n);if(!s)return this.Cr(e,n,r,i,a);let c=this.Dr(e,t,n,s,i,r,a);return o.kr.set(n,c),c}yr(e){if(e<=2)return 2;for(let t of We)if(e<=t)return t;return 512}Ir(e){if(e.length===0)return 0;let t=e[0],n=e[e.length-1];return 31*e.length+17*t.$n+13*n.$n}Tr(e,t,n,r=!1,i,a=new Map){if(t===2)return this.Vr(e,2,n,r,i);let o=t/2,s=a.get(o);return s||(s=this.Tr(e,o,n,r,i,a),a.set(o,s)),this.Br(s,n,r,i)}Vr(e,t,n,r=!1,i){let a=this.Er(e,t,n,r,i);return this.Ar(a,r)}Br(e,t,n=!1,r){let i=this.Er(e,2,t,n,r);return this.Ar(i,n)}Er(e,t,n,r=!1,i){let a=[];for(let o=0;o<e.length;o+=t)if(e.length-o>=t){let t=this.Lr(e[o],e[o+1],n,r,i);t.zr=!1,a.push(t)}else if(a.length===0)a.push(this.Or(e[o],!0));else{let t=a[a.length-1];a[a.length-1]=this.Nr(t,e[o],n,r,i)}return a}Fr(e,t){return(e??1)+(t??1)}Lr(e,t,n,r=!1,i){if(!r||!n||!i){let n=e.Wt[1]>t.Wt[1]?e.Wt[1]:t.Wt[1],r=e.Wt[2]<t.Wt[2]?e.Wt[2]:t.Wt[2];return{Wr:e.$n,Hr:t.$n,Ur:e.wt,$r:t.wt,jr:e.Wt[0],qr:n,Yr:r,Kr:t.Wt[3],Gr:this.Fr(e.Gr,t.Gr),Zr:void 0,zr:!1}}let a=n(this.Xr(e,i),this.Xr(t,i)),o=i(a),s=o.length?o[o.length-1]:0;return{Wr:e.$n,Hr:t.$n,Ur:e.wt,$r:t.wt,jr:e.Wt[0],qr:Math.max(e.Wt[1],s),Yr:Math.min(e.Wt[2],s),Kr:s,Gr:this.Fr(e.Gr,t.Gr),Zr:a,zr:!1}}Nr(e,t,n,r=!1,i){if(!r||!n||!i)return{Wr:e.Wr,Hr:t.$n,Ur:e.Ur,$r:t.wt,jr:e.jr,qr:e.qr>t.Wt[1]?e.qr:t.Wt[1],Yr:e.Yr<t.Wt[2]?e.Yr:t.Wt[2],Kr:t.Wt[3],Gr:e.Gr+(t.Gr??1),Zr:e.Zr,zr:!1};let a=e.Zr,o=this.Xr(t,i),s=a?{data:a,index:e.Wr,originalTime:e.Ur,time:e.Ur,priceValues:i(a)}:null,c=s?n(s,o):o.data,l=s?i(c):o.priceValues,u=l.length?l[l.length-1]:0;return{Wr:e.Wr,Hr:t.$n,Ur:e.Ur,$r:t.wt,jr:e.jr,qr:Math.max(e.qr,u),Yr:Math.min(e.Yr,u),Kr:u,Gr:e.Gr+(t.Gr??1),Zr:c,zr:!1}}Jr(e,t,n,r,i,a,o=!1,s){let c=t===r?i:e[t];if(n-t==1)return this.Or(c,!0);let l=t+1===r?i:e[t+1],u=this.Lr(c,l,a,o,s);for(let c=t+2;c<n;c++){let t=c===r?i:e[c];u=this.Nr(u,t,a,o,s)}return u}Xr(e,t){let n=e.ue??{};return{data:e.ue,index:e.$n,originalTime:e.Qr,time:e.wt,priceValues:t(n)}}th(e,t=!1){let n=!0===t,r=!!e.Zr;return{$n:e.Wr,wt:e.Ur,Qr:e.Ur,Wt:[n?e.Kr:e.jr,e.qr,e.Yr,e.Kr],Gr:e.Gr,ue:n?r?e.Zr:{wt:e.Ur}:void 0}}Ar(e,t=!1){return e.map((e=>this.th(e,t)))}Dr(e,t,n,r,i=!1,a,o){if(r.length===0)return r;let s=e.length-1,c=Math.floor(s/n)*n;if(Math.min(c+n,e.length)-c<n&&e.length>n){let r=e.slice();return r[r.length-1]=t,this.Cr(r,n,a,i,o)}if(Math.floor((s-1)/n)===Math.floor(s/n)||r.length===1){let l=Math.min(c+n,e.length),u=l-c;if(u<=0)return r;let d=u===1?this.Or(c===s?t:e[c],!0):this.Jr(e,c,l,s,t,a,i,o);return r[r.length-1]=this.th(d,i),r}{let r=e.slice();return r[r.length-1]=t,this.Cr(r,n,a,i,o)}}Or(e,t=!1){return{Wr:e.$n,Hr:e.$n,Ur:e.wt,$r:e.wt,jr:e.Wt[0],qr:e.Wt[1],Yr:e.Wt[2],Kr:e.Wt[3],Gr:e.Gr??1,Zr:e.ue,zr:t}}Pr(e){let t=this.ih(e),n=this.Ir(e);return t.nh!==n&&(t.kr.clear(),t.nh=n),t}ih(e){let t=this.br.get(e);return t===void 0&&(t={nh:this.Ir(e),kr:new Map},this.br.set(e,t)),t}},Xe=class extends Se{constructor(e){super(),this.sn=e}Qt(){return this.sn}},Ze={Bar:(e,t,n,r)=>{let i=t.upColor,a=t.downColor,o=v(e(n,r)),s=y(o.Wt[0])<=y(o.Wt[3]);return{sh:o.R??(s?i:a)}},Candlestick:(e,t,n,r)=>{let i=t.upColor,a=t.downColor,o=t.borderUpColor,s=t.borderDownColor,c=t.wickUpColor,l=t.wickDownColor,u=v(e(n,r)),d=y(u.Wt[0])<=y(u.Wt[3]);return{sh:u.R??(d?i:a),eh:u.Ht??(d?o:s),rh:u.hh??(d?c:l)}},Custom:(e,t,n,r)=>({sh:v(e(n,r)).R??t.color}),Area:(e,t,n,r)=>{let i=v(e(n,r));return{sh:i.vt??t.lineColor,vt:i.vt??t.lineColor,ah:i.ah??t.topColor,oh:i.oh??t.bottomColor}},Baseline:(e,t,n,r)=>{let i=v(e(n,r));return{sh:i.Wt[3]>=t.baseValue.price?t.topLineColor:t.bottomLineColor,_h:i._h??t.topLineColor,uh:i.uh??t.bottomLineColor,dh:i.dh??t.topFillColor1,fh:i.fh??t.topFillColor2,ph:i.ph??t.bottomFillColor1,mh:i.mh??t.bottomFillColor2}},Line:(e,t,n,r)=>{let i=v(e(n,r));return{sh:i.R??t.color,vt:i.R??t.color}},Histogram:(e,t,n,r)=>({sh:v(e(n,r)).R??t.color})},Qe=class{constructor(e){this.wh=(e,t)=>t===void 0?this.Te.Un().Mh(e):t.Wt,this.Te=e,this.gh=Ze[e.bh()]}Sh(e,t){return this.gh(this.wh,this.Te.N(),e,t)}};function $e(e,t,n,r,i=0,a=t.length){let o=a-i;for(;0<o;){let a=o>>1,s=i+a;r(t[s],n)===e?(i=s+1,o-=a+1):o=a}return i}var I=$e.bind(null,!0),et=$e.bind(null,!1),tt;(function(e){e[e.NearestLeft=-1]=`NearestLeft`,e[e.None=0]=`None`,e[e.NearestRight=1]=`NearestRight`})(tt||={});var L=30,nt=class{constructor(){this.xh=[],this.Ch=new Map,this.yh=new Map,this.Ph=[]}kh(){return this.Th()>0?this.xh[this.xh.length-1]:null}Rh(){return this.Th()>0?this.Dh(0):null}Qn(){return this.Th()>0?this.Dh(this.xh.length-1):null}Th(){return this.xh.length}Zi(){return this.Th()===0}ze(e){return this.Ih(e,0)!==null}Mh(e){return this.Hn(e)}Hn(e,t=0){let n=this.Ih(e,t);return n===null?null:{...this.Vh(n),$n:this.Dh(n)}}Bh(){return this.xh}Eh(e,t,n){if(this.Zi())return null;let r=null;for(let i of n)r=rt(r,this.Ah(e,t,i));return r}ht(e){this.yh.clear(),this.Ch.clear(),this.xh=e,this.Ph=e.map((e=>e.$n))}Lh(){return this.Ph}Dh(e){return this.xh[e].$n}Vh(e){return this.xh[e]}Ih(e,t){let n=this.zh(e);if(n===null&&t!==0)switch(t){case-1:return this.Oh(e);case 1:return this.Nh(e);default:throw TypeError(`Unknown search mode`)}return n}Oh(e){let t=this.Fh(e);return t>0&&--t,t!==this.xh.length&&this.Dh(t)<e?t:null}Nh(e){let t=this.Wh(e);return t!==this.xh.length&&e<this.Dh(t)?t:null}zh(e){let t=this.Fh(e);return t===this.xh.length||e<this.xh[t].$n?null:t}Fh(e){return I(this.xh,e,((e,t)=>e.$n<t))}Wh(e){return et(this.xh,e,((e,t)=>e.$n>t))}Hh(e,t,n){let r=null;for(let i=e;i<t;i++){let e=this.xh[i].Wt[n];Number.isNaN(e)||(r===null?r={Uh:e,$h:e}:(e<r.Uh&&(r.Uh=e),e>r.$h&&(r.$h=e)))}return r}Ah(e,t,n){if(this.Zi())return null;let r=null,i=v(this.Rh()),a=v(this.Qn()),o=Math.max(e,i),s=Math.min(t,a),c=Math.ceil(o/L)*L,l=Math.max(c,Math.floor(s/L)*L);{let e=this.Fh(o),i=this.Wh(Math.min(s,c,t));r=rt(r,this.Hh(e,i,n))}let u=this.Ch.get(n);u===void 0&&(u=new Map,this.Ch.set(n,u));for(let e=Math.max(c+1,o);e<l;e+=L){let t=Math.floor(e/L),i=u.get(t);if(i===void 0){let e=this.Fh(t*L),r=this.Wh((t+1)*L-1);i=this.Hh(e,r,n),u.set(t,i)}r=rt(r,i)}{let e=this.Fh(l),t=this.Wh(s);r=rt(r,this.Hh(e,t,n))}return r}};function rt(e,t){return e===null?t:t===null?e:{Uh:Math.min(e.Uh,t.Uh),$h:Math.max(e.$h,t.$h)}}function it(){return new nt}var at={setLineStyle:m},ot=class{constructor(e){this.jh=e}st(e,t,n){this.jh.draw(e,at)}qh(e,t,n){this.jh.drawBackground?.(e,at)}},st=class{constructor(e){this.Ls=null,this.Yh=e}Tt(){let e=this.Yh.renderer();if(e===null)return null;if(this.Ls?.Kh===e)return this.Ls.Gh;let t=new ot(e);return this.Ls={Kh:e,Gh:t},t}Zh(){return this.Yh.zOrder?.()??`normal`}},ct=class{constructor(e){this.Xh=null,this.Jh=e}Qh(){return this.Jh}Nn(){this.Jh.updateAllViews?.()}jn(){let e=this.Jh.paneViews?.()??[];if(this.Xh?.Kh===e)return this.Xh.Gh;let t=e.map((e=>new st(e)));return this.Xh={Kh:e,Gh:t},t}Qs(e,t){return this.Jh.hitTest?.(e,t)??null}},lt=class extends ct{cn(){return[]}},ut=class{constructor(e){this.jh=e}st(e,t,n){this.jh.draw(e,at)}qh(e,t,n){this.jh.drawBackground?.(e,at)}},dt=class{constructor(e){this.Ls=null,this.Yh=e}Tt(){let e=this.Yh.renderer();if(e===null)return null;if(this.Ls?.Kh===e)return this.Ls.Gh;let t=new ut(e);return this.Ls={Kh:e,Gh:t},t}Zh(){return this.Yh.zOrder?.()??`normal`}};function ft(e){return{ri:e.text(),Ei:e.coordinate(),Vi:e.fixedCoordinate?.(),R:e.textColor(),Z:e.backColor(),It:e.visible?.()??!0,pi:e.tickVisible?.()??!0}}var pt=class{constructor(e,t){this.Xt=new be,this.ta=e,this.ia=t}Tt(){return this.Xt.ht({nn:this.ia.nn(),...ft(this.ta)}),this.Xt}},mt=class extends _e{constructor(e,t){super(),this.ta=e,this.Ki=t}Yi(e,t,n){let r=ft(this.ta);n.Z=r.Z,e.R=r.R;let i=2/12*this.Ki.P();n.Ti=i,n.Ri=i,n.Ei=r.Ei,n.Vi=r.Vi,e.ri=r.ri,e.It=r.It,e.pi=r.pi}},ht=class extends ct{constructor(e,t){super(e),this.na=null,this.sa=null,this.ea=null,this.ra=null,this.Te=t}dn(){let e=this.Jh.timeAxisViews?.()??[];if(this.na?.Kh===e)return this.na.Gh;let t=this.Te.Qt().Et(),n=e.map((e=>new pt(e,t)));return this.na={Kh:e,Gh:n},n}qn(){let e=this.Jh.priceAxisViews?.()??[];if(this.sa?.Kh===e)return this.sa.Gh;let t=this.Te.Ft(),n=e.map((e=>new mt(e,t)));return this.sa={Kh:e,Gh:n},n}ha(){let e=this.Jh.priceAxisPaneViews?.()??[];if(this.ea?.Kh===e)return this.ea.Gh;let t=e.map((e=>new dt(e)));return this.ea={Kh:e,Gh:t},t}aa(){let e=this.Jh.timeAxisPaneViews?.()??[];if(this.ra?.Kh===e)return this.ra.Gh;let t=e.map((e=>new dt(e)));return this.ra={Kh:e,Gh:t},t}la(e,t){return this.Jh.autoscaleInfo?.(e,t)??null}};function gt(e,t,n,r){e.forEach((e=>{t(e).forEach((e=>{e.Zh()===n&&r.push(e)}))}))}function _t(e){return e.jn()}function vt(e){return e.ha()}function yt(e){return e.aa()}var bt=[`Area`,`Line`,`Baseline`],xt=class extends Xe{constructor(e,t,n,r,i){super(e),this.qt=it(),this.dr=new Be(this),this.oa=[],this._a=new Ie(this),this.ua=null,this.ca=null,this.da=null,this.fa=[],this.pa=new Ye,this.va=new Map,this.ma=null,this.yn=n,this.wa=t;let a=new Ve(this);if(this.mn=[a],this.pr=new Ne(a,this,e),bt.includes(this.wa)&&(this.ua=new ze(this)),this.Ma(),this.Yh=r(this,this.Qt(),i),this.wa===`Custom`){let e=this.Yh;e.ga&&this.ba(e.ga)}}m(){this.da!==null&&clearTimeout(this.da)}We(e){return this.yn.priceLineColor||e}Ae(e){let t={Le:!0},n=this.Ft();if(this.Qt().Et().Zi()||n.Zi()||this.qt.Zi())return t;let r=this.Qt().Et().Ee(),i=this.Lt();if(r===null||i===null)return t;let a,o;if(e){let e=this.qt.kh();if(e===null)return t;a=e,o=e.$n}else{let e=this.qt.Hn(r.bi(),-1);if(e===null||(a=this.qt.Mh(e.$n),a===null))return t;o=e.$n}let s=a.Wt[3],c=this.Sa().Sh(o,{Wt:a}),l=n.Nt(s,i.Wt);return{Le:!1,Mt:s,ri:n.Ji(s,i.Wt),qe:n.xa(s),Ye:n.Ca(s,i.Wt),R:c.sh,Ei:l,$n:o}}Sa(){return this.ca!==null||(this.ca=new Qe(this)),this.ca}N(){return this.yn}vr(e){let t=this.Qt(),{priceScaleId:n,visible:r,priceFormat:i}=e;n!==void 0&&n!==this.yn.priceScaleId&&t.ya(this,n),r!==void 0&&r!==this.yn.visible&&t.Pa();let a=e.conflationThresholdFactor!==void 0;x(this.yn,e),Object.prototype.hasOwnProperty.call(e,`autoscaleInfoProvider`)&&e.autoscaleInfoProvider===void 0&&(this.yn.autoscaleInfoProvider=void 0),a&&(this.va.clear(),this.Qt().mr()),i!==void 0&&(this.Ma(),t.ka()),t.Ta(this),t.Ra(),this.Yh.Pt(`options`)}ht(e,t){this.qt.ht(e),this.va.clear();let n=this.Qt().Et().N();n.enableConflation&&n.precomputeConflationOnInit&&this.Da(n.precomputeConflationPriority),this.Ia(),this.ua!==null&&(t&&t.Va?this.ua.De():e.length===0&&this.ua.Re());let r=this.Qt().Ks(this);this.Qt().Ba(r),this.Qt().Ta(this),this.Qt().Ra(),this.Qt().mr()}Ia(){this.Yh.Pt(`data`)}Ea(e){let t=new Je(this,e);return this.oa.push(t),this.Qt().Ta(this),t}Aa(e){let t=this.oa.indexOf(e);t!==-1&&this.oa.splice(t,1),this.Qt().Ta(this)}La(){return this.oa}bh(){return this.wa}Lt(){let e=this.za();return e===null?null:{Wt:e.Wt[3],Oa:e.wt}}za(){let e=this.Qt().Et().Ee();if(e===null)return null;let t=e.Na();return this.qt.Hn(t,1)}Un(){return this.qt}ba(e){this.ma=e,this.va.clear()}Fa(){return!!this.Qt().Et().N().enableConflation&&this.Wa()>1}Rr(e){if(!this.Fa())return;let t=this.Wa();if(!this.va.has(t))return;let n=this.wa===`Custom`,r=n&&this.ma||void 0,i=n&&this.Yh.Ha?e=>{let t=e,n=this.Yh.Ha(t);return Array.isArray(n)?n:[typeof n==`number`?n:0]}:void 0,a=this.pa.Rr(this.qt.Bh(),e,t,r,n,i),o=it();o.ht(a),this.va.set(t,o)}Ua(){let e=this.Qt().Et().N().enableConflation;if(this.wa===`Custom`&&this.ma===null||!e)return this.qt;let t=this.Wa();return this.va.get(t)||(this.$a(t),this.va.get(t)??this.qt)}ja(e){let t=this.qt.Mh(e);return t===null?null:this.wa===`Bar`||this.wa===`Candlestick`||this.wa===`Custom`?{jr:t.Wt[0],qr:t.Wt[1],Yr:t.Wt[2],Kr:t.Wt[3]}:t.Wt[3]}qa(e){let t=[];gt(this.fa,_t,`top`,t);let n=this.ua;return n!==null&&n.It()&&(this.da===null&&n.Ve()&&(this.da=setTimeout((()=>{this.da=null,this.Qt().Ya()}),0)),n.Ie(),t.unshift(n)),t}jn(){let e=[];this.Ka()||e.push(this._a),e.push(this.Yh,this.dr);let t=this.oa.map((e=>e.wr()));return e.push(...t),gt(this.fa,_t,`normal`,e),e}Ga(){let e=this.Yh.Ga?.()??null;if(e===null)return null;let t=[];this.Ka()||t.push(this._a),t.push(...e.Za),gt(this.fa,_t,`normal`,t);let n=[];n.push(...e.qa,this.dr);let r=this.oa.map((e=>e.wr()));return n.push(...r),{Za:t,qa:n}}Xa(){return this.Ja(_t,`bottom`)}Qa(e){return this.Ja(vt,e)}tl(e){return this.Ja(yt,e)}il(e,t){return this.fa.map((n=>n.Qs(e,t))).filter((e=>e!==null))}cn(){return[this.pr,...this.oa.map((e=>e.Mr()))]}qn(e,t){if(t!==this.hn&&!this.Ka())return[];let n=[...this.mn];for(let e of this.oa)n.push(e.gr());return this.fa.forEach((e=>{n.push(...e.qn())})),n}dn(){let e=[];return this.fa.forEach((t=>{e.push(...t.dn())})),e}la(e,t){if(this.yn.autoscaleInfoProvider!==void 0){let n=this.yn.autoscaleInfoProvider((()=>{let n=this.nl(e,t);return n===null?null:n.sr()}));return Ue.er(n)}return this.nl(e,t)}Kh(){let e=this.yn.priceFormat;return e.base??1/e.minMove}sl(){return this.el}Nn(){this.Yh.Pt();for(let e of this.mn)e.Pt();for(let e of this.oa)e.Pt();this.dr.Pt(),this._a.Pt(),this.ua?.Pt(),this.fa.forEach((e=>e.Nn()))}Ft(){return v(super.Ft())}At(e){if(this.wa!==`Line`&&this.wa!==`Area`&&this.wa!==`Baseline`||!this.yn.crosshairMarkerVisible)return null;let t=this.qt.Mh(e);return t===null?null:{Mt:t.Wt[3],ft:this.rl(),Ht:this.hl(),Ot:this.al(),zt:this.ll(e)}}He(){return this.yn.title}It(){return this.yn.visible}ol(e){this.fa.push(new ht(e,this))}_l(e){this.fa=this.fa.filter((t=>t.Qh()!==e))}ul(){if(this.wa===`Custom`)return e=>this.Yh.Ha(e)}cl(){if(this.wa===`Custom`)return e=>this.Yh.dl(e)}fl(){return this.qt.Lh()}Ka(){return!Te(this.Ft().pl())}nl(e,t){if(!C(e)||!C(t)||this.qt.Zi())return null;let n=this.wa===`Line`||this.wa===`Area`||this.wa===`Baseline`||this.wa===`Histogram`?[3]:[2,1],r=this.qt.Eh(e,t,n),i=r===null?null:new F(r.Uh,r.$h),a=null;if(this.bh()===`Histogram`){let e=this.yn.base,t=new F(e,e);i=i===null?t:i.Ss(t)}return this.fa.forEach((n=>{let r=n.la(e,t);if(r?.priceRange){let e=new F(r.priceRange.minValue,r.priceRange.maxValue);i=i===null?e:i.Ss(e)}r?.margins&&(a=r.margins)})),new Ue(i,a)}rl(){switch(this.wa){case`Line`:case`Area`:case`Baseline`:return this.yn.crosshairMarkerRadius}return 0}hl(){switch(this.wa){case`Line`:case`Area`:case`Baseline`:{let e=this.yn.crosshairMarkerBorderColor;if(e.length!==0)return e}}return null}al(){switch(this.wa){case`Line`:case`Area`:case`Baseline`:return this.yn.crosshairMarkerBorderWidth}return 0}ll(e){switch(this.wa){case`Line`:case`Area`:case`Baseline`:{let e=this.yn.crosshairMarkerBackgroundColor;if(e.length!==0)return e}}return this.Sa().Sh(e).sh}Ma(){switch(this.yn.priceFormat.type){case`custom`:{let e=this.yn.priceFormat.formatter;this.el={format:e,formatTickmarks:this.yn.priceFormat.tickmarksFormatter??(t=>t.map(e))};break}case`volume`:this.el=new Ae(this.yn.priceFormat.precision);break;case`percent`:this.el=new ke(this.yn.priceFormat.precision);break;default:{let e=10**this.yn.priceFormat.precision;this.el=new Oe(e,this.yn.priceFormat.minMove*e)}}this.hn!==null&&this.hn.vl()}Ja(e,t){let n=[];return gt(this.fa,e,t,n),n}Wa(){let{ml:e,wl:t,Ml:n}=this.gl();return this.pa.Sr(e,t,n)}gl(){let e=this.Qt().Et(),t=e.ml(),n=window.devicePixelRatio||1,r=e.N().conflationThresholdFactor;return{ml:t,wl:n,Ml:this.yn.conflationThresholdFactor??r??1}}bl(e){let t=this.qt.Bh(),n;if(this.wa===`Custom`&&this.ma!==null){let r=this.ul();if(!r)throw Error(Ge);n=this.pa.Cr(t,e,this.ma,!0,(e=>r(e)))}else n=this.pa.Cr(t,e);let r=it();return r.ht(n),r}$a(e){let t=this.bl(e);this.va.set(e,t)}Da(e){if(this.wa===`Custom`&&(this.ma===null||!this.ul()))return;this.va.clear();let t=this.Qt().Et().Sl();for(let n of t){let t=()=>{this.xl(n)},r=typeof window==`object`&&window||typeof self==`object`&&self;r?.yl?.Cl?r.yl.Cl((()=>{t()}),{se:e}):Promise.resolve().then((()=>t()))}}xl(e){if(this.va.has(e)||this.qt.Bh().length===0)return;let t=this.bl(e);this.va.set(e,t)}},St=[3],Ct=[0,1,2,3],wt=class{constructor(e){this.yn=e}Pl(e,t,n){let r=e;if(this.yn.mode===0)return r;let i=n.kn(),a=i.Lt();if(a===null)return r;let o=i.Nt(e,a),s=n.kl().filter((e=>e instanceof xt)).reduce(((e,r)=>{if(n.Gs(r)||!r.It())return e;let i=r.Ft(),a=r.Un();if(i.Zi()||!a.ze(t))return e;let o=a.Mh(t);if(o===null)return e;let s=y(r.Lt()),c=this.yn.mode===3?Ct:St;return e.concat(c.map((e=>i.Nt(o.Wt[e],s.Wt))))}),[]);if(s.length===0)return r;s.sort(((e,t)=>Math.abs(e-o)-Math.abs(t-o)));let c=s[0];return r=i.Tn(c,a),r}};function R(e,t,n){return Math.min(Math.max(e,t),n)}function Tt(e,t,n){return t-e<=n}function Et(e){let t=Math.ceil(e);return t%2==0?t-1:t}var Dt=class extends j{constructor(){super(...arguments),this.qt=null}ht(e){this.qt=e}et({context:e,bitmapSize:t,horizontalPixelRatio:n,verticalPixelRatio:r}){if(this.qt===null)return;let i=Math.max(1,Math.floor(n));e.lineWidth=i,function(e,t){e.save(),e.lineWidth%2&&e.translate(.5,.5),t(),e.restore()}(e,(()=>{let a=v(this.qt);if(a.Tl){e.strokeStyle=a.Rl,m(e,a.Dl),e.beginPath();for(let r of a.Il){let a=Math.round(r.Vl*n);e.moveTo(a,-i),e.lineTo(a,t.height+i)}e.stroke()}if(a.Bl){e.strokeStyle=a.El,m(e,a.Al),e.beginPath();for(let n of a.Ll){let a=Math.round(n.Vl*r);e.moveTo(-i,a),e.lineTo(t.width+i,a)}e.stroke()}}))}},Ot=class{constructor(e){this.Xt=new Dt,this.xt=!0,this.yt=e}Pt(){this.xt=!0}Tt(){if(this.xt){let e=this.yt.Qt().N().grid,t={Bl:e.horzLines.visible,Tl:e.vertLines.visible,El:e.horzLines.color,Rl:e.vertLines.color,Al:e.horzLines.style,Dl:e.vertLines.style,Ll:this.yt.kn().zl(),Il:(this.yt.Qt().Et().zl()||[]).map((e=>({Vl:e.coord})))};this.Xt.ht(t),this.xt=!1}return this.Xt}},kt=class{constructor(e){this.Yh=new Ot(e)}wr(){return this.Yh}},At={Ol:4,Nl:1e-4};function z(e,t){let n=100*(e-t)/t;return t<0?-n:n}function jt(e,t){return new F(z(e.Je(),t),z(e.Qe(),t))}function B(e,t){let n=100*(e-t)/t+100;return t<0?-n:n}function Mt(e,t){return new F(B(e.Je(),t),B(e.Qe(),t))}function Nt(e,t){let n=Math.abs(e);if(n<1e-15)return 0;let r=Math.log10(n+t.Nl)+t.Ol;return e<0?-r:r}function Pt(e,t){let n=Math.abs(e);if(n<1e-15)return 0;let r=10**(n-t.Ol)-t.Nl;return e<0?-r:r}function V(e,t){return e===null?null:new F(Nt(e.Je(),t),Nt(e.Qe(),t))}function H(e,t){return e===null?null:new F(Pt(e.Je(),t),Pt(e.Qe(),t))}function Ft(e){if(e===null)return At;let t=Math.abs(e.Qe()-e.Je());if(t>=1||t<1e-15)return At;let n=Math.ceil(Math.abs(Math.log10(t))),r=At.Ol+n;return{Ol:r,Nl:1/10**r}}var It=class{constructor(e,t){if(this.Fl=e,this.Wl=t,function(e){if(e<0)return!1;if(e>0xde0b6b3a7640000)return!0;for(let t=e;t>1;t/=10)if(t%10!=0)return!1;return!0}(this.Fl))this.Hl=[2,2.5,2];else{this.Hl=[];for(let e=this.Fl;e!==1;){if(e%2==0)this.Hl.push(2),e/=2;else{if(e%5!=0)throw Error(`unexpected base`);this.Hl.push(2,2.5),e/=5}if(this.Hl.length>100)throw Error(`something wrong with base`)}}}Ul(e,t,n){let r=this.Fl===0?0:1/this.Fl,i=10**Math.max(0,Math.ceil(Math.log10(e-t))),a=0,o=this.Wl[0];for(;;){let e=Tt(i,r,1e-14)&&i>r+1e-14,t=Tt(i,n*o,1e-14),s=Tt(i,1,1e-14);if(!(e&&t&&s))break;i/=o,o=this.Wl[++a%this.Wl.length]}if(i<=r+1e-14&&(i=r),i=Math.max(1,i),this.Hl.length>0&&(s=i,c=1,l=1e-14,Math.abs(s-c)<l))for(a=0,o=this.Hl[0];Tt(i,n*o,1e-14)&&i>r+1e-14;)i/=o,o=this.Hl[++a%this.Hl.length];var s,c,l;return i}},Lt=class{constructor(e,t,n,r){this.$l=[],this.Ki=e,this.Fl=t,this.jl=n,this.ql=r}Ul(e,t){if(e<t)throw Error(`high < low`);let n=this.Ki.$t(),r=(e-t)*this.Yl()/n,i=new It(this.Fl,[2,2.5,2]),a=new It(this.Fl,[2,2,2.5]),o=new It(this.Fl,[2.5,2,2]),s=[];return s.push(i.Ul(e,t,r),a.Ul(e,t,r),o.Ul(e,t,r)),function(e){if(e.length<1)throw Error(`array is empty`);let t=e[0];for(let n=1;n<e.length;++n)e[n]<t&&(t=e[n]);return t}(s)}Kl(){let e=this.Ki,t=e.Lt();if(t===null)return void(this.$l=[]);let n=e.$t(),r=this.jl(n-1,t),i=this.jl(0,t),a=this.Ki.N().entireTextOnly?this.Gl()/2:0,o=a,s=n-1-a,c=Math.max(r,i),l=Math.min(r,i);if(c===l)return void(this.$l=[]);let u=this.Ul(c,l);if(this.Zl(t,u,c,l,o,s),e.Xl()&&this.Jl(u,l,c)){let e=this.Ki.Ql();this.io(t,u,o,s,e,2*e)}let d=this.$l.map((e=>e.no)),f=this.Ki.so(d);for(let e=0;e<this.$l.length;e++)this.$l[e].eo=f[e]}zl(){return this.$l}Gl(){return this.Ki.P()}Yl(){return Math.ceil(this.Gl()*this.Ki.N().tickMarkDensity)}Zl(e,t,n,r,i,a){let o=this.$l,s=this.Ki,c=n%t;c+=c<0?t:0;let l=n>=r?1:-1,u=null,d=0;for(let f=n-c;f>r;f-=t){let n=this.ql(f,e,!0);u!==null&&Math.abs(n-u)<this.Yl()||n<i||n>a||(d<o.length?(o[d].Vl=n,o[d].eo=s.ro(f),o[d].no=f):o.push({Vl:n,eo:s.ro(f),no:f}),d++,u=n,s.ho()&&(t=this.Ul(f*l,r)))}o.length=d}io(e,t,n,r,i,a){let o=this.$l,s=this.ao(e,n,i,a),c=this.ao(e,r,-a,-i),l=this.ql(0,e,!0)-this.ql(t,e,!0);o.length>0&&o[0].Vl-s.Vl<l/2&&o.shift(),o.length>0&&c.Vl-o[o.length-1].Vl<l/2&&o.pop(),o.unshift(s),o.push(c)}ao(e,t,n,r){let i=(n+r)/2,a=this.jl(t+n,e),o=this.jl(t+r,e),s=Math.min(a,o),c=Math.max(a,o),l=Math.max(.1,this.Ul(c,s)),u=this.jl(t+i,e),d=u-u%l,f=this.ql(d,e,!0);return{eo:this.Ki.ro(d),Vl:f,no:d}}Jl(e,t,n){let r=y(this.Ki.ar());return this.Ki.ho()&&(r=H(r,this.Ki.lo())),r.Je()-t<e&&n-r.Qe()<e}};function Rt(e){return e.slice().sort(((e,t)=>v(e.ln())-v(t.ln())))}var zt;(function(e){e[e.Normal=0]=`Normal`,e[e.Logarithmic=1]=`Logarithmic`,e[e.Percentage=2]=`Percentage`,e[e.IndexedTo100=3]=`IndexedTo100`})(zt||={});var Bt=new ke,Vt=new Oe(100,1),Ht=class{constructor(e,t,n,r,i){this.oo=0,this._o=null,this.rr=null,this.uo=null,this.co={do:!1,fo:null},this.po=!1,this.vo=0,this.mo=0,this.wo=new b,this.Mo=new b,this.bo=[],this.So=null,this.xo=null,this.Co=null,this.yo=null,this.Po=null,this.el=Vt,this.ko=Ft(null),this.To=e,this.yn=t,this.Ro=n,this.Do=r,this.Io=i,this.Vo=new Lt(this,100,this.Bo.bind(this),this.Eo.bind(this))}pl(){return this.To}N(){return this.yn}vr(e){if(x(this.yn,e),this.vl(),e.mode!==void 0&&this.Ao({_e:e.mode}),e.scaleMargins!==void 0){let t=_(e.scaleMargins.top),n=_(e.scaleMargins.bottom);if(t<0||t>1)throw Error(`Invalid top margin - expect value between 0 and 1, given=${t}`);if(n<0||n>1)throw Error(`Invalid bottom margin - expect value between 0 and 1, given=${n}`);if(t+n>1)throw Error(`Invalid margins - sum of margins must be less than 1, given=${t+n}`);this.Lo(),this.Co=null}}zo(){return this.yn.autoScale}Oo(){return this.po}ho(){return this.yn.mode===1}je(){return this.yn.mode===2}No(){return this.yn.mode===3}lo(){return this.ko}_e(){return{hs:this.yn.autoScale,Fo:this.yn.invertScale,_e:this.yn.mode}}Ao(e){let t=this._e(),n=null;e.hs!==void 0&&(this.yn.autoScale=e.hs),e._e!==void 0&&(this.yn.mode=e._e,e._e!==2&&e._e!==3||(this.yn.autoScale=!0),this.co.do=!1),t._e===1&&e._e!==t._e&&(function(e,t){if(e===null)return!1;let n=Pt(e.Je(),t),r=Pt(e.Qe(),t);return isFinite(n)&&isFinite(r)}(this.rr,this.ko)?(n=H(this.rr,this.ko),n!==null&&this.Wo(n)):this.yn.autoScale=!0),e._e===1&&e._e!==t._e&&(n=V(this.rr,this.ko),n!==null&&this.Wo(n));let r=t._e!==this.yn.mode;r&&(t._e===2||this.je())&&this.vl(),r&&(t._e===3||this.No())&&this.vl(),e.Fo!==void 0&&t.Fo!==e.Fo&&(this.yn.invertScale=e.Fo,this.Ho()),this.Mo.p(t,this._e())}Uo(){return this.Mo}P(){return this.Ro.fontSize}$t(){return this.oo}$o(e){this.oo!==e&&(this.oo=e,this.Lo(),this.Co=null)}jo(){if(this._o)return this._o;let e=this.$t()-this.qo()-this.Yo();return this._o=e,e}ar(){return this.Ko(),this.rr}Wo(e,t){let n=this.rr;(t||n===null&&e!==null||n!==null&&!n.Ze(e))&&(this.Co=null,this.rr=e)}Go(e){this.Wo(e),this.Zo(e!==null)}Zi(){return this.Ko(),this.oo===0||!this.rr||this.rr.Zi()}Xo(e){return this.Fo()?e:this.$t()-1-e}Nt(e,t){return this.je()?e=z(e,t):this.No()&&(e=B(e,t)),this.Eo(e,t)}Jo(e,t,n){this.Ko();let r=this.Yo(),i=v(this.ar()),a=i.Je(),o=i.Qe(),s=this.jo()-1,c=this.Fo(),l=s/(o-a),u=n===void 0?0:n.from,d=n===void 0?e.length:n.to,f=this.Qo();for(let n=u;n<d;n++){let i=e[n],o=i.Mt;if(isNaN(o))continue;let s=o;f!==null&&(s=f(i.Mt,t));let u=r+l*(s-a);i.ut=c?u:this.oo-1-u}}t_(e,t,n){this.Ko();let r=this.Yo(),i=v(this.ar()),a=i.Je(),o=i.Qe(),s=this.jo()-1,c=this.Fo(),l=s/(o-a),u=n===void 0?0:n.from,d=n===void 0?e.length:n.to,f=this.Qo();for(let n=u;n<d;n++){let i=e[n],o=i.jr,s=i.qr,u=i.Yr,d=i.Kr;f!==null&&(o=f(i.jr,t),s=f(i.qr,t),u=f(i.Yr,t),d=f(i.Kr,t));let p=r+l*(o-a),m=c?p:this.oo-1-p;i.i_=m,p=r+l*(s-a),m=c?p:this.oo-1-p,i.n_=m,p=r+l*(u-a),m=c?p:this.oo-1-p,i.s_=m,p=r+l*(d-a),m=c?p:this.oo-1-p,i.e_=m}}Tn(e,t){let n=this.Bo(e,t);return this.r_(n,t)}r_(e,t){let n=e;return this.je()?n=function(e,t){return t<0&&(e=-e),e/100*t+t}(n,t):this.No()&&(n=function(e,t){return e-=100,t<0&&(e=-e),e/100*t+t}(n,t)),n}kl(){return this.bo}Dt(){return this.xo||=Rt(this.bo),this.xo}h_(e){this.bo.indexOf(e)===-1&&(this.bo.push(e),this.vl(),this.a_())}l_(e){let t=this.bo.indexOf(e);if(t===-1)throw Error(`source is not attached to scale`);this.bo.splice(t,1),this.bo.length===0&&(this.Ao({hs:!0}),this.Wo(null)),this.vl(),this.a_()}Lt(){let e=null;for(let t of this.bo){let n=t.Lt();n!==null&&(e===null||n.Oa<e.Oa)&&(e=n)}return e===null?null:e.Wt}Fo(){return this.yn.invertScale}zl(){let e=this.Lt()===null;if(this.Co!==null&&(e||this.Co.o_===e))return this.Co.zl;this.Vo.Kl();let t=this.Vo.zl();return this.Co={zl:t,o_:e},this.wo.p(),t}__(){return this.wo}u_(e){this.je()||this.No()||this.yo===null&&this.uo===null&&(this.Zi()||(this.yo=this.oo-e,this.uo=v(this.ar()).Xe()))}c_(e){if(this.je()||this.No()||this.yo===null)return;this.Ao({hs:!1}),(e=this.oo-e)<0&&(e=0);let t=(this.yo+.2*(this.oo-1))/(e+.2*(this.oo-1)),n=v(this.uo).Xe();t=Math.max(t,.1),n.ir(t),this.Wo(n)}d_(){this.je()||this.No()||(this.yo=null,this.uo=null)}f_(e){this.zo()||this.Po===null&&this.uo===null&&(this.Zi()||(this.Po=e,this.uo=v(this.ar()).Xe()))}p_(e){if(this.zo()||this.Po===null)return;let t=v(this.ar()).tr()/(this.jo()-1),n=e-this.Po;this.Fo()&&(n*=-1);let r=n*t,i=v(this.uo).Xe();i.nr(r),this.Wo(i,!0),this.Co=null}v_(){this.zo()||this.Po!==null&&(this.Po=null,this.uo=null)}sl(){return this.el||this.vl(),this.el}Ji(e,t){switch(this.yn.mode){case 2:return this.m_(z(e,t));case 3:return this.sl().format(B(e,t));default:return this.cr(e)}}ro(e){switch(this.yn.mode){case 2:return this.m_(e);case 3:return this.sl().format(e);default:return this.cr(e)}}so(e){switch(this.yn.mode){case 2:return this.w_(e);case 3:return this.sl().formatTickmarks(e);default:return this.M_(e)}}xa(e){return this.cr(e,v(this.So).sl())}Ca(e,t){return e=z(e,t),this.m_(e,Bt)}g_(){return this.bo}b_(e){this.co={fo:e,do:!1}}Nn(){this.bo.forEach((e=>e.Nn()))}Xl(){return this.yn.ensureEdgeTickMarksVisible&&this.zo()}Ql(){return this.P()/2}vl(){this.Co=null;let e=1/0;this.So=null;for(let t of this.bo)t.ln()<e&&(e=t.ln(),this.So=t);let t=100;this.So!==null&&(t=Math.round(this.So.Kh())),this.el=Vt,this.je()?(this.el=Bt,t=100):this.No()?(this.el=new Oe(100,1),t=100):this.So!==null&&(this.el=this.So.sl()),this.Vo=new Lt(this,t,this.Bo.bind(this),this.Eo.bind(this)),this.Vo.Kl()}a_(){this.xo=null}S_(){return this.So===null||this.je()||this.No()?1:1/this.So.Kh()}Xi(){return this.Io}Zo(e){this.po=e}qo(){return this.Fo()?this.yn.scaleMargins.bottom*this.$t()+this.mo:this.yn.scaleMargins.top*this.$t()+this.vo}Yo(){return this.Fo()?this.yn.scaleMargins.top*this.$t()+this.vo:this.yn.scaleMargins.bottom*this.$t()+this.mo}Ko(){this.co.do||(this.co.do=!0,this.x_())}Lo(){this._o=null}Eo(e,t){if(this.Ko(),this.Zi())return 0;e=this.ho()&&e?Nt(e,this.ko):e;let n=v(this.ar()),r=this.Yo()+(this.jo()-1)*(e-n.Je())/n.tr();return this.Xo(r)}Bo(e,t){if(this.Ko(),this.Zi())return 0;let n=this.Xo(e),r=v(this.ar()),i=r.Je()+r.tr()*((n-this.Yo())/(this.jo()-1));return this.ho()?Pt(i,this.ko):i}Ho(){this.Co=null,this.Vo.Kl()}x_(){if(this.Oo()&&!this.zo())return;let e=this.co.fo;if(e===null)return;let t=null,n=this.g_(),r=0,i=0;for(let a of n){if(!a.It())continue;let n=a.Lt();if(n===null)continue;let o=a.la(e.Na(),e.bi()),s=o&&o.ar();if(s!==null){switch(this.yn.mode){case 1:s=V(s,this.ko);break;case 2:s=jt(s,n.Wt);break;case 3:s=Mt(s,n.Wt)}if(t=t===null?s:t.Ss(v(s)),o!==null){let e=o.lr();e!==null&&(r=Math.max(r,e.above),i=Math.max(i,e.below))}}}if(this.Xl()&&(r=Math.max(r,this.Ql()),i=Math.max(i,this.Ql())),r===this.vo&&i===this.mo||(this.vo=r,this.mo=i,this.Co=null,this.Lo()),t!==null){if(t.Je()===t.Qe()){let e=5*this.S_();this.ho()&&(t=H(t,this.ko)),t=new F(t.Je()-e,t.Qe()+e),this.ho()&&(t=V(t,this.ko))}if(this.ho()){let e=H(t,this.ko),n=Ft(e);if(a=n,o=this.ko,a.Ol!==o.Ol||a.Nl!==o.Nl){let r=this.uo===null?null:H(this.uo,this.ko);this.ko=n,t=V(e,n),r!==null&&(this.uo=V(r,n))}}this.Wo(t)}else this.rr===null&&(this.Wo(new F(-.5,.5)),this.ko=Ft(null));var a,o}Qo(){return this.je()?z:this.No()?B:this.ho()?e=>Nt(e,this.ko):null}C_(e,t,n){return t===void 0?(n===void 0&&(n=this.sl()),n.format(e)):t(e)}y_(e,t,n){return t===void 0?(n===void 0&&(n=this.sl()),n.formatTickmarks(e)):t(e)}cr(e,t){return this.C_(e,this.Do.priceFormatter,t)}M_(e,t){let n=this.Do.priceFormatter;return this.y_(e,this.Do.tickmarksPriceFormatter??(n?e=>e.map(n):void 0),t)}m_(e,t){return this.C_(e,this.Do.percentageFormatter,t)}w_(e,t){let n=this.Do.percentageFormatter;return this.y_(e,this.Do.tickmarksPercentageFormatter??(n?e=>e.map(n):void 0),t)}};function Ut(e){return e instanceof xt}var Wt=class{constructor(e,t){this.bo=[],this.P_=new Map,this.oo=0,this.k_=0,this.T_=1,this.xo=null,this.R_=null,this.D_=!1,this.I_=new b,this.fa=[],this.ia=e,this.sn=t,this.V_=new kt(this);let n=t.N();this.B_=this.E_(`left`,n.leftPriceScale),this.A_=this.E_(`right`,n.rightPriceScale),this.B_.Uo().i(this.L_.bind(this,this.B_),this),this.A_.Uo().i(this.L_.bind(this,this.A_),this),this.z_(n)}z_(e){if(e.leftPriceScale&&this.B_.vr(e.leftPriceScale),e.rightPriceScale&&this.A_.vr(e.rightPriceScale),e.localization&&(this.B_.vl(),this.A_.vl()),e.overlayPriceScales){let t=Array.from(this.P_.values());for(let n of t){let t=v(n[0].Ft());t.vr(e.overlayPriceScales),e.localization&&t.vl()}}}O_(e){switch(e){case`left`:return this.B_;case`right`:return this.A_}return this.P_.has(e)?_(this.P_.get(e))[0].Ft():null}m(){this.Qt().N_().u(this),this.B_.Uo().u(this),this.A_.Uo().u(this),this.bo.forEach((e=>{e.m&&e.m()})),this.fa=this.fa.filter((e=>{let t=e.Qh();return t.detached&&t.detached(),!1})),this.I_.p()}F_(){return this.T_}W_(e){this.T_=e}Qt(){return this.sn}nn(){return this.k_}$t(){return this.oo}H_(e){this.k_=e,this.U_()}$o(e){this.oo=e,this.B_.$o(e),this.A_.$o(e),this.bo.forEach((t=>{if(this.Gs(t)){let n=t.Ft();n!==null&&n.$o(e)}})),this.U_()}j_(e){this.D_=e}q_(){return this.D_}Y_(){return this.bo.filter(Ut)}kl(){return this.bo}Gs(e){let t=e.Ft();return t===null||this.B_!==t&&this.A_!==t}h_(e,t,n){this.K_(e,t,n?e.ln():this.bo.length)}l_(e,t){let n=this.bo.indexOf(e);g(n!==-1,`removeDataSource: invalid data source`),this.bo.splice(n,1),t||this.bo.forEach(((e,t)=>e._n(t)));let r=v(e.Ft()).pl();if(this.P_.has(r)){let t=_(this.P_.get(r)),n=t.indexOf(e);n!==-1&&(t.splice(n,1),t.length===0&&this.P_.delete(r))}let i=e.Ft();i&&i.kl().indexOf(e)>=0&&(i.l_(e),this.G_(i)),this.Z_()}Xs(e){return e===this.B_?`left`:e===this.A_?`right`:`overlay`}X_(){return this.B_}J_(){return this.A_}Q_(e,t){e.u_(t)}tu(e,t){e.c_(t),this.U_()}iu(e){e.d_()}nu(e,t){e.f_(t)}su(e,t){e.p_(t),this.U_()}eu(e){e.v_()}U_(){this.bo.forEach((e=>{e.Nn()}))}kn(){let[e,t]=this.ru(),n=null;return e.N().visible&&e.kl().length!==0?n=e:t.N().visible&&t.kl().length!==0?n=t:this.bo.length!==0&&(n=this.bo[0].Ft()),n===null&&(n=this.Zs()??e),n}Zs(){let[e,t]=this.ru();return e.N().visible?e:t.N().visible?t:null}G_(e){e!==null&&e.zo()&&this.hu(e)}au(e){let t=this.ia.Ee();e.Ao({hs:!0}),t!==null&&e.b_(t),this.U_()}lu(){this.hu(this.B_),this.hu(this.A_)}ou(){this.G_(this.B_),this.G_(this.A_),this.bo.forEach((e=>{this.Gs(e)&&this.G_(e.Ft())})),this.U_(),this.sn.mr()}Dt(){return this.xo===null&&(this.xo=Rt(this.bo)),this.xo}_u(){let e=this.Dt(),t=this.sn.cu()?.uu,n=this.sn.N().hoveredSeriesOnTop,r=this.R_;if(r!==null&&r.Kh===e&&r.du===t&&r.fu===n)return r.pu;let i=function(e,t,n){if(!n)return e;let r=e.indexOf(t);if(r===-1||r===e.length-1)return e;let i=[];for(let t=0;t<e.length;t++)t!==r&&i.push(e[t]);return i.push(e[r]),i}(e,t,n);return this.R_={Kh:e,du:t,fu:n,pu:i},i}vu(e,t){t=R(t,0,this.bo.length-1);let n=this.bo.indexOf(e);g(n!==-1,`setSeriesOrder: invalid data source`),this.bo.splice(n,1),this.bo.splice(t,0,e),this.bo.forEach(((e,t)=>e._n(t))),this.Z_();for(let e of[this.B_,this.A_])e.a_(),e.vl();this.sn.mr()}Vt(){return this.Dt().filter(Ut)}mu(){return this.I_}wu(){return this.V_}ol(e){this.fa.push(new lt(e))}_l(e){this.fa=this.fa.filter((t=>t.Qh()!==e)),e.detached&&e.detached(),this.sn.mr()}Mu(){return this.fa}il(e,t){return this.fa.map((n=>n.Qs(e,t))).filter((e=>e!==null))}hu(e){let t=e.g_();if(t&&t.length>0&&!this.ia.Zi()){let t=this.ia.Ee();t!==null&&e.b_(t)}e.Nn()}K_(e,t,n){let r=this.O_(t);if(r===null&&(r=this.E_(t,this.sn.N().overlayPriceScales)),this.bo.splice(n,0,e),!Te(t)){let n=this.P_.get(t)||[];n.push(e),this.P_.set(t,n)}e._n(n),r.h_(e),e.un(r),this.G_(r),this.Z_()}Z_(){this.xo=null,this.R_=null}ru(){return this.sn.N().defaultVisiblePriceScaleId===`left`?[this.B_,this.A_]:[this.A_,this.B_]}L_(e,t,n){t._e!==n._e&&this.hu(e)}E_(e,t){let n=new Ht(e,{visible:!0,autoScale:!0,...E(t)},this.sn.N().layout,this.sn.N().localization,this.sn.Xi());return n.$o(this.$t()),n}};function Gt(e,t){return t===null||e.se===2&&t.se!==2||(t.se!==2||e.se===2)&&e.ne!==t.ne&&e.ne<t.ne}function Kt(e){return{te:e.te,ie:e.ie}}function qt(e){return{ne:e.distance??0,se:e.hitTestPriority??(e.itemType===`marker`?2:0),ee:e.itemType??`primitive`,gu:e.cursorStyle,te:e.externalId}}function Jt(e){return{uu:e.uu,bu:Kt(e.Su),gu:e.Su.gu,ee:e.Su.ee??`primitive`}}function Yt(e,t,n,r){let i=null;for(let a of e){let e=a.Qs?.(t,n,r)??null;if(e===null){let i=a.Tt(r);e=i!==null&&i.Qs?i.Qs(t,n):null}if(e!==null){let t={xu:a,Su:e};(i===null||Gt(t.Su,i.Su))&&(i=t)}}return i}function Xt(e){return e.jn!==void 0}function Zt(e,t,n){let r=[e,...e.Dt()].reverse(),i=function(e,t,n){let r,i,a;for(let c of e){let e=c.il?.(t,n)??[];for(let t of e){let e=qt(t);o=t.zOrder,s=r?.zOrder,(!s||o===`top`&&s!==`top`||o===`normal`&&s===`bottom`||t.zOrder===r?.zOrder&&i!==void 0&&Gt(e,i)||t.zOrder===r?.zOrder&&i===void 0)&&(r=t,i=e,a=c)}}var o,s;return r&&a&&i?{Su:i,Cu:r,uu:a}:null}(r,t,n);if(i?.Cu.zOrder===`top`)return Jt(i);let a=null,o=null;for(let s of r){if(i&&i.uu===s&&i.Cu.zOrder!==`bottom`&&!i.Cu.isBackground)return a??Jt(i);if(Xt(s)){let r=Yt(s.jn(e),t,n,e);if(r!==null){let e={uu:s,xu:r.xu,bu:Kt(r.Su),gu:r.Su.gu,ee:r.Su.ee??`primitive`};(a===null||Gt(r.Su,o))&&(a=e,o=r.Su)}}if(i&&i.uu===s&&i.Cu.zOrder!==`bottom`&&i.Cu.isBackground)return a??Jt(i)}return a===null?i?.Cu?Jt(i):null:a}var Qt=class{constructor(e,t,n=50){this.Vs=0,this.Bs=1,this.Es=1,this.Ls=new Map,this.As=new Map,this.yu=e,this.Pu=t,this.zs=n}ku(e){let t=e.time,n=this.Pu.cacheKey(t),r=this.Ls.get(n);if(r!==void 0)return r.Tu;if(this.Vs===this.zs){let e=this.As.get(this.Es);this.As.delete(this.Es),this.Ls.delete(_(e)),this.Es++,this.Vs--}let i=this.yu(e);return this.Ls.set(n,{Tu:i,Ws:this.Bs}),this.As.set(this.Bs,n),this.Vs++,this.Bs++,i}},U=class{constructor(e,t){g(e<=t,`right should be >= left`),this.Ru=e,this.Du=t}Na(){return this.Ru}bi(){return this.Du}Iu(){return this.Du-this.Ru+1}ze(e){return this.Ru<=e&&e<=this.Du}Ze(e){return this.Ru===e.Na()&&this.Du===e.bi()}};function $t(e,t){return e===null||t===null?e===t:e.Ze(t)}var en=class{constructor(){this.Vu=new Map,this.Ls=null,this.Bu=!1}Eu(e){this.Bu=e,this.Ls=null}Au(e,t){this.Lu(t),this.Ls=null;for(let n=t;n<e.length;++n){let t=e[n],r=this.Vu.get(t.timeWeight);r===void 0&&(r=[],this.Vu.set(t.timeWeight,r)),r.push({index:n,time:t.time,weight:t.timeWeight,originalTime:t.originalTime})}}zu(e,t,n,r,i){let a=Math.ceil(t/e);return this.Ls!==null&&this.Ls.Ou===a&&i===this.Ls.Nu&&n===this.Ls.Fu||(this.Ls={Nu:i,Fu:n,zl:this.Wu(a,n,r),Ou:a}),this.Ls.zl}Lu(e){if(e===0)return void this.Vu.clear();let t=[];this.Vu.forEach(((n,r)=>{e<=n[0].index?t.push(r):n.splice(I(n,e,(t=>t.index<e)),1/0)}));for(let e of t)this.Vu.delete(e)}Wu(e,t,n){let r=[],i=e=>!t||n.has(e.index);for(let t of Array.from(this.Vu.keys()).sort(((e,t)=>t-e))){if(!this.Vu.get(t))continue;let n=r;r=[];let a=n.length,o=0,s=_(this.Vu.get(t)),c=s.length,l=1/0,u=-1/0;for(let t=0;t<c;t++){let c=s[t],d=c.index;for(;o<a;){let e=n[o],t=e.index;if(!(t<d&&i(e))){l=t;break}o++,r.push(e),u=t,l=1/0}if(l-d>=e&&d-u>=e&&i(c))r.push(c),u=d;else if(this.Bu)return n}for(;o<a;o++)i(n[o])&&r.push(n[o])}return r}},tn=class e{constructor(e){this.Hu=e}Uu(){return this.Hu===null?null:new U(Math.floor(this.Hu.Na()),Math.ceil(this.Hu.bi()))}$u(){return this.Hu}static ju(){return new e(null)}};function nn(e,t){return e.weight>t.weight?e:t}var rn=class{constructor(e,t,n,r){this.k_=0,this.qu=null,this.Yu=[],this.Po=null,this.yo=null,this.Ku=new en,this.Gu=new Map,this.Zu=tn.ju(),this.Xu=!0,this.Ju=new b,this.Qu=new b,this.tc=new b,this.nc=null,this.sc=null,this.ec=new Map,this.rc=-1,this.hc=[],this.ac=1,this.yn=t,this.Do=n,this.lc=t.rightOffset,this.oc=t.barSpacing,this.sn=e,this._c(t),this.Pu=r,this.uc(),this.Ku.Eu(t.uniformDistribution),this.cc(),this.dc()}N(){return this.yn}fc(e){x(this.Do,e),this.vc(),this.uc()}vr(e,t){x(this.yn,e),this.yn.fixLeftEdge&&this.mc(),this.yn.fixRightEdge&&this.wc(),e.barSpacing!==void 0&&this.sn.Ms(e.barSpacing),e.rightOffset!==void 0&&this.sn.gs(e.rightOffset),this._c(e),e.minBarSpacing===void 0&&e.maxBarSpacing===void 0||this.sn.Ms(e.barSpacing??this.oc),e.ignoreWhitespaceIndices!==void 0&&e.ignoreWhitespaceIndices!==this.yn.ignoreWhitespaceIndices&&this.dc(),this.vc(),this.uc(),e.enableConflation===void 0&&e.conflationThresholdFactor===void 0||this.cc(),this.tc.p()}Rn(e){return this.Yu[e]?.time??null}en(e){return this.Yu[e]??null}Mc(e,t){if(this.Yu.length<1)return null;if(this.Pu.key(e)>this.Pu.key(this.Yu[this.Yu.length-1].time))return t?this.Yu.length-1:null;let n=I(this.Yu,this.Pu.key(e),((e,t)=>this.Pu.key(e.time)<t));return this.Pu.key(e)<this.Pu.key(this.Yu[n].time)?t?n:null:n}Zi(){return this.k_===0||this.Yu.length===0||this.qu===null}gc(){return this.Yu.length>0}Ee(){return this.bc(),this.Zu.Uu()}Sc(){return this.bc(),this.Zu.$u()}xc(){let e=this.Ee();if(e===null)return null;let t={from:e.Na(),to:e.bi()};return this.Cc(t)}Cc(e){let t=Math.round(e.from),n=Math.round(e.to),r=v(this.yc()),i=v(this.Pc());return{from:v(this.en(Math.max(r,t))),to:v(this.en(Math.min(i,n)))}}kc(e){return{from:v(this.Mc(e.from,!0)),to:v(this.Mc(e.to,!0))}}nn(){return this.k_}H_(e){if(!isFinite(e)||e<=0||this.k_===e)return;let t=this.Sc(),n=this.k_;if(this.k_=e,this.Xu=!0,this.yn.lockVisibleTimeRangeOnResize&&n!==0){let t=this.oc*e/n;this.oc=t}if(this.yn.fixLeftEdge&&t!==null&&t.Na()<=0){let t=n-e;this.lc-=Math.round(t/this.oc)+1,this.Xu=!0}this.Tc(),this.Rc()}jt(e){if(this.Zi()||!C(e))return 0;let t=this.Dc()+this.lc-e;return this.k_-(t+.5)*this.oc-1}Ic(e,t){let n=this.Dc(),r=t===void 0?0:t.from,i=t===void 0?e.length:t.to;for(let t=r;t<i;t++){let r=e[t].wt,i=n+this.lc-r,a=this.k_-(i+.5)*this.oc-1;e[t]._t=a}}Vc(e,t){let n=Math.ceil(this.Bc(e));return t&&this.yn.ignoreWhitespaceIndices&&!this.Ec(n)?this.Ac(n):n}gs(e){this.Xu=!0,this.lc=e,this.Rc(),this.sn.Lc(),this.sn.mr()}ml(){return this.oc}Ms(e){let t=this.oc;if(this.zc(e),this.yn.rightOffsetPixels!==void 0&&t!==0){let e=this.lc*t/this.oc;this.lc=e}this.Rc(),this.sn.Lc(),this.sn.mr()}Oc(){return this.lc}zl(){if(this.Zi())return null;if(this.sc!==null)return this.sc;let e=this.oc,t=5*(this.sn.N().layout.fontSize+4)/8*(this.yn.tickMarkMaxCharacterLength||8),n=Math.round(t/e),r=v(this.Ee()),i=Math.max(r.Na(),r.Na()-n),a=Math.max(r.bi(),r.bi()-n),o=this.Ku.zu(e,t,this.yn.ignoreWhitespaceIndices,this.ec,this.rc),s=this.yc()+n,c=this.Pc()-n,l=this.Nc(),u=this.yn.fixLeftEdge||l,d=this.yn.fixRightEdge||l,f=0;for(let e of o){if(!(i<=e.index&&e.index<=a))continue;let n;f<this.hc.length?(n=this.hc[f],n.coord=this.jt(e.index),n.label=this.Fc(e),n.weight=e.weight):(n={needAlignCoordinate:!1,coord:this.jt(e.index),label:this.Fc(e),weight:e.weight},this.hc.push(n)),this.oc>t/2&&!l?n.needAlignCoordinate=!1:n.needAlignCoordinate=u&&e.index<=s||d&&e.index>=c,f++}return this.hc.length=f,this.sc=this.hc,this.hc}Wc(){let e;this.Xu=!0,this.Ms(this.yn.barSpacing),e=this.yn.rightOffsetPixels===void 0?this.yn.rightOffset:this.yn.rightOffsetPixels/this.ml(),this.gs(e)}Hc(e){this.Xu=!0,this.qu=e,this.Rc(),this.mc()}Uc(e,t){let n=this.Bc(e),r=this.ml(),i=r+r/10*t;this.Ms(i),this.yn.rightBarStaysOnScroll||this.gs(this.Oc()+(n-this.Bc(e)))}u_(e){this.Po&&this.v_(),this.yo===null&&this.nc===null&&(this.Zi()||(this.yo=e,this.$c()))}c_(e){if(this.nc===null)return;let t=R(this.k_-e,0,this.k_),n=R(this.k_-v(this.yo),0,this.k_);t!==0&&n!==0&&this.Ms(this.nc.ml*t/n)}d_(){this.yo!==null&&(this.yo=null,this.jc())}f_(e){this.Po===null&&this.nc===null&&(this.Zi()||(this.Po=e,this.$c()))}p_(e){if(this.Po===null)return;let t=(this.Po-e)/this.ml();this.lc=v(this.nc).Oc+t,this.Xu=!0,this.Rc()}v_(){this.Po!==null&&(this.Po=null,this.jc())}qc(){this.Yc(this.yn.rightOffset)}Yc(e,t=400){if(!isFinite(e))throw RangeError(`offset is required and must be finite number`);if(!isFinite(t)||t<=0)throw RangeError(`animationDuration (optional) must be finite positive number`);let n=this.lc,r=performance.now();this.sn.ps({Kc:e=>(e-r)/t>=1,Gc:i=>{let a=(i-r)/t;return a>=1?e:n+(e-n)*a}})}Pt(e,t){this.Xu=!0,this.Yu=e,this.Ku.Au(e,t),this.Rc()}Zc(){return this.Ju}Xc(){return this.Qu}Jc(){return this.tc}Dc(){return this.qu||0}Qc(e,t){let n=e.Iu(),r=t&&this.yn.rightOffsetPixels||0;this.zc((this.k_-r)/n),this.lc=e.bi()-this.Dc(),t&&(this.lc=r?r/this.ml():this.yn.rightOffset),this.Rc(),this.Xu=!0,this.sn.Lc(),this.sn.mr()}td(){let e=this.yc(),t=this.Pc();if(e===null||t===null)return;let n=!this.yn.rightOffsetPixels&&this.yn.rightOffset||0;this.Qc(new U(e,t+n),!0)}nd(e){let t=new U(e.from,e.to);this.Qc(t)}rn(e){return this.Do.timeFormatter===void 0?this.Pu.formatHorzItem(e.time):this.Do.timeFormatter(e.originalTime)}dc(){if(!this.yn.ignoreWhitespaceIndices)return;this.ec.clear();let e=this.sn.Jn();for(let t of e)for(let e of t.fl())this.ec.set(e,!0);this.rc++}sd(){return this.ac}Sl(){let e=1/(window.devicePixelRatio||1),t=this.yn.minBarSpacing;if(t>=e)return[1];let n=[1],r=2;for(;r<=512;)t<e/r&&n.push(r),r*=2;return n}Nc(){let e=this.sn.N().handleScroll,t=this.sn.N().handleScale;return!(e.horzTouchDrag||e.mouseWheel||e.pressedMouseMove||e.vertTouchDrag||t.axisDoubleClickReset.time||t.axisPressedMouseMove.time||t.mouseWheel||t.pinch)}yc(){return this.Yu.length===0?null:0}Pc(){return this.Yu.length===0?null:this.Yu.length-1}ed(e){return(this.k_-1-e)/this.oc}Bc(e){let t=this.ed(e),n=this.Dc()+this.lc-t;return Math.round(1e6*n)/1e6}zc(e){let t=this.oc;this.oc=e,this.Tc(),t!==this.oc&&(this.Xu=!0,this.rd(),this.cc())}bc(){if(!this.Xu)return;if(this.Xu=!1,this.Zi())return void this.hd(tn.ju());let e=this.Dc(),t=this.k_/this.oc,n=this.lc+e,r=new U(n-t+1,n);this.hd(new tn(r))}Tc(){let e=R(this.oc,this.ad(),this.ld());this.oc!==e&&(this.oc=e,this.Xu=!0)}ld(){return this.yn.maxBarSpacing>0?this.yn.maxBarSpacing:.5*this.k_}ad(){return this.yn.fixLeftEdge&&this.yn.fixRightEdge&&this.Yu.length!==0?this.k_/this.Yu.length:this.yn.minBarSpacing}cc(){if(!this.yn.enableConflation)return void(this.ac=1);let e=1/(window.devicePixelRatio||1)*(this.yn.conflationThresholdFactor??1);if(this.oc>=e)return void(this.ac=1);let t=e/this.oc,n=2**Math.floor(Math.log2(t));this.ac=Math.min(n,512)}Rc(){let e=this.od();e!==null&&this.lc<e&&(this.lc=e,this.Xu=!0);let t=this._d();this.lc>t&&(this.lc=t,this.Xu=!0)}od(){let e=this.yc(),t=this.qu;return e===null||t===null?null:e-t-1+(this.yn.fixLeftEdge?this.k_/this.oc:Math.min(2,this.Yu.length))}_d(){return this.yn.fixRightEdge?0:this.k_/this.oc-Math.min(2,this.Yu.length)}$c(){this.nc={ml:this.ml(),Oc:this.Oc()}}jc(){this.nc=null}Fc(e){let t=this.Gu.get(e.weight);return t===void 0&&(t=new Qt((e=>this.ud(e)),this.Pu),this.Gu.set(e.weight,t)),t.ku(e)}ud(e){return this.Pu.formatTickmark(e,this.Do)}hd(e){let t=this.Zu;this.Zu=e,$t(t.Uu(),this.Zu.Uu())||this.Ju.p(),$t(t.$u(),this.Zu.$u())||this.Qu.p(),this.rd()}rd(){this.sc=null}vc(){this.rd(),this.Gu.clear()}uc(){this.Pu.updateFormatter(this.Do)}mc(){if(!this.yn.fixLeftEdge)return;let e=this.yc();if(e===null)return;let t=this.Ee();if(t===null)return;let n=t.Na()-e;if(n<0){let e=this.lc-n-1;this.gs(e)}this.Tc()}wc(){this.Rc(),this.Tc()}Ec(e){return!this.yn.ignoreWhitespaceIndices||this.ec.get(e)||!1}Ac(e){let t=function*(e){let t=Math.round(e),n=t<e,r=1;for(;;)n?(yield t+r,yield t-r):(yield t-r,yield t+r),r++}(e),n=this.Pc();for(;n;){let e=t.next().value;if(this.ec.get(e))return e;if(e<0||e>n)break}return e}_c(e){if(e.rightOffsetPixels!==void 0){let t=e.rightOffsetPixels/(e.barSpacing||this.oc);this.sn.gs(t)}}},an,on,sn,cn,ln;(function(e){e[e.OnTouchEnd=0]=`OnTouchEnd`,e[e.OnNextTap=1]=`OnNextTap`})(an||={});var un=class{constructor(e,t,n){this.dd=[],this.fd=[],this.pd=null,this.k_=0,this.vd=null,this.md=new b,this.wd=new b,this.Md=null,this.gd=e,this.yn=t,this.Pu=n,this.Io=new re(this.yn.layout.colorParsers),this.bd=new ne(this),this.ia=new rn(this,t.timeScale,this.yn.localization,n),this.Ct=new we(this,t.crosshair),this.Sd=new wt(t.crosshair),t.addDefaultPane&&(this.xd(0),this.dd[0].W_(2)),this.Cd=this.yd(0),this.Pd=this.yd(1)}ka(){this.kd(M.ys())}mr(){this.kd(M.Cs())}Ya(){this.kd(new M(1))}Ta(e){let t=this.Td(e);this.kd(t)}cu(){return this.vd}Rd(e){if(this.vd?.uu===e?.uu&&this.vd?.bu?.te===e?.bu?.te&&this.vd?.bu?.ie===e?.bu?.ie&&this.vd?.gu===e?.gu&&this.vd?.ee===e?.ee)return;let t=this.vd;this.vd=e,t!==null&&this.Ta(t.uu),e!==null&&e.uu!==t?.uu&&this.Ta(e.uu)}N(){return this.yn}vr(e){x(this.yn,e),this.dd.forEach((t=>t.z_(e))),e.timeScale!==void 0&&this.ia.vr(e.timeScale),e.localization!==void 0&&this.ia.fc(e.localization),(e.leftPriceScale||e.rightPriceScale)&&this.md.p(),this.Cd=this.yd(0),this.Pd=this.yd(1),this.ka()}Dd(e,t,n=0){let r=this.dd[n];if(r===void 0)return;if(e===`left`)return x(this.yn,{leftPriceScale:t}),r.z_({leftPriceScale:t}),this.md.p(),void this.ka();if(e===`right`)return x(this.yn,{rightPriceScale:t}),r.z_({rightPriceScale:t}),this.md.p(),void this.ka();let i=this.Id(e,n);i!==null&&(i.Ft.vr(t),this.md.p())}Id(e,t){let n=this.dd[t];if(n===void 0)return null;let r=n.O_(e);return r===null?null:{Kn:n,Ft:r}}Et(){return this.ia}Gn(){return this.dd}Vd(){return this.Ct}Bd(){return this.wd}Ed(e,t){e.$o(t),this.Lc()}H_(e){this.k_=e,this.ia.H_(this.k_),this.dd.forEach((t=>t.H_(e))),this.Lc()}Ad(e){this.dd.length!==1&&(g(e>=0&&e<this.dd.length,`Invalid pane index`),this.dd.splice(e,1),this.ka())}Ld(e,t){if(this.dd.length<2)return;g(e>=0&&e<this.dd.length,`Invalid pane index`);let n=this.dd[e],r=this.dd.reduce(((e,t)=>e+t.F_()),0),i=this.dd.reduce(((e,t)=>e+t.$t()),0),a=i-30*(this.dd.length-1);t=Math.min(a,Math.max(30,t));let o=r/i,s=n.$t();n.W_(t*o);let c=t-s,l=this.dd.length-1;for(let e of this.dd)if(e!==n){let t=Math.min(a,Math.max(30,e.$t()-c/l));c-=e.$t()-t,--l;let n=t*o;e.W_(n)}this.ka()}zd(e,t){g(e>=0&&e<this.dd.length&&t>=0&&t<this.dd.length,`Invalid pane index`);let n=this.dd[e],r=this.dd[t];this.dd[e]=r,this.dd[t]=n,this.ka()}Od(e,t){if(g(e>=0&&e<this.dd.length&&t>=0&&t<this.dd.length,`Invalid pane index`),e===t)return;let[n]=this.dd.splice(e,1);this.dd.splice(t,0,n),this.ka()}Q_(e,t,n){e.Q_(t,n)}tu(e,t,n){e.tu(t,n),this.Ra(),this.kd(this.Nd(e,2))}iu(e,t){e.iu(t),this.kd(this.Nd(e,2))}nu(e,t,n){t.zo()||e.nu(t,n)}su(e,t,n){t.zo()||(e.su(t,n),this.Ra(),this.kd(this.Nd(e,2)))}eu(e,t){t.zo()||(e.eu(t),this.kd(this.Nd(e,2)))}au(e,t){e.au(t),this.kd(this.Nd(e,2))}Fd(e){this.ia.u_(e)}Wd(e,t){let n=this.Et();if(n.Zi()||t===0)return;let r=n.nn();e=Math.max(1,Math.min(e,r)),n.Uc(e,t),this.Lc()}Hd(e){this.Ud(0),this.$d(e),this.jd()}qd(e){this.ia.c_(e),this.Lc()}Yd(){this.ia.d_(),this.mr()}Ud(e){this.ia.f_(e)}$d(e){this.ia.p_(e),this.Lc()}jd(){this.ia.v_(),this.mr()}Jn(){return this.fd}Wn(){return this.pd===null&&(this.pd=this.fd.filter((e=>e.It()))),this.pd}Pa(){this.pd=null}Kd(e,t,n,r,i){this.Ct.In(e,t);let a=NaN,o=this.ia.Vc(e,!0),s=this.ia.Ee();s!==null&&(o=Math.min(Math.max(s.Na(),o),s.bi())),o=this.Ct.Fn(o);let c=r.kn(),l=c.Lt();if(l!==null&&(a=c.Tn(t,l)),a=this.Sd.Pl(a,o,r),this.Ct.An(o,a,r),this.Ya(),!i){let i=Zt(r,e,t);this.Rd(i&&{uu:i.uu,bu:i.bu,gu:i.gu||null,ee:i.ee}),this.wd.p(this.Ct.Bt(),{x:e,y:t},n)}}Gd(e,t,n){let r=n.kn(),i=r.Lt(),a=r.Nt(e,v(i)),o=this.ia.Mc(t,!0),s=this.ia.jt(v(o));this.Kd(s,a,null,n,!0)}Zd(e){this.Vd().zn(),this.Ya(),e||this.wd.p(null,null,null)}Ra(){let e=this.Ct.Kn();if(e!==null){let t=this.Ct.Bn(),n=this.Ct.En();this.Kd(t,n,null,e)}this.Ct.Nn()}Xd(e,t,n){let r=this.ia.Rn(0);t!==void 0&&n!==void 0&&this.ia.Pt(t,n);let i=this.ia.Rn(0),a=this.ia.Dc(),o=this.ia.Ee();if(o!==null&&r!==null&&i!==null){let t=o.ze(a),s=this.Pu.key(r)>this.Pu.key(i),c=e!==null&&e>a&&!s,l=this.ia.N().allowShiftVisibleRangeOnWhitespaceReplacement,u=t&&(n!==void 0||l)&&this.ia.N().shiftVisibleRangeOnNewBar;if(c&&!u){let t=e-a;this.ia.gs(this.ia.Oc()-t)}}this.ia.Hc(e)}Ba(e){e!==null&&e.ou()}Ks(e){if(function(e){return e instanceof Wt}(e))return e;let t=this.dd.find((t=>t.Dt().includes(e)));return t===void 0?null:t}Lc(){this.dd.forEach((e=>e.ou())),this.Ra()}m(){this.dd.forEach((e=>e.m())),this.dd.length=0,this.yn.localization.priceFormatter=void 0,this.yn.localization.percentageFormatter=void 0,this.yn.localization.timeFormatter=void 0}Jd(){return this.bd}Js(){return this.bd.N()}N_(){return this.md}Qd(e,t){let n=this.xd(t);this.tf(e,n),this.fd.push(e),this.Pa(),this.fd.length===1?this.ka():this.mr()}if(e){let t=this.Ks(e),n=this.fd.indexOf(e);g(n!==-1,`Series not found`);let r=v(t);this.fd.splice(n,1),r.l_(e),e.m&&e.m(),this.Pa(),this.ia.dc(),this.nf(r)}ya(e,t){let n=v(this.Ks(e));n.l_(e,!0),n.h_(e,t,!0)}td(){let e=M.Cs();e.us(),this.kd(e)}sf(e){let t=M.Cs();t.fs(e),this.kd(t)}ws(){let e=M.Cs();e.ws(),this.kd(e)}Ms(e){let t=M.Cs();t.Ms(e),this.kd(t)}gs(e){let t=M.Cs();t.gs(e),this.kd(t)}ps(e){let t=M.Cs();t.ps(e),this.kd(t)}cs(){let e=M.Cs();e.cs(),this.kd(e)}ef(){let e=this.yn.defaultVisiblePriceScaleId,t=this.yn.leftPriceScale.visible;return t===this.yn.rightPriceScale.visible?e:t?`left`:`right`}rf(e,t){if(g(t>=0,`Index should be greater or equal to 0`),t===this.hf(e))return;let n=v(this.Ks(e));n.l_(e);let r=this.xd(t);this.tf(e,r);let i=!1;n.kl().length===0&&(i=this.nf(n)),i||this.ka()}af(){return this.Pd}$(){return this.Cd}Ut(e){let t=this.Pd,n=this.Cd;if(t===n)return t;if(e=Math.max(0,Math.min(100,Math.round(100*e))),this.Md===null||this.Md.ah!==n||this.Md.oh!==t)this.Md={ah:n,oh:t,lf:new Map};else{let t=this.Md.lf.get(e);if(t!==void 0)return t}let r=this.Io.tt(n,t,e/100);return this.Md.lf.set(e,r),r}_f(e){return this.dd.indexOf(e)}Xi(){return this.Io}uf(){return this.cf()}cf(e){let t=new Wt(this.ia,this);this.dd.push(t);let n=e??this.dd.length-1,r=M.ys();return r.es(n,{rs:0,hs:!0}),this.kd(r),t}xd(e){return g(e>=0,`Index should be greater or equal to 0`),(e=Math.min(this.dd.length,e))<this.dd.length?this.dd[e]:this.cf(e)}hf(e){return this.dd.findIndex((t=>t.Y_().includes(e)))}Nd(e,t){let n=new M(t);if(e!==null){let r=this.dd.indexOf(e);n.es(r,{rs:t})}return n}Td(e,t){return t===void 0&&(t=2),this.Nd(this.Ks(e),t)}kd(e){this.gd&&this.gd(e),this.dd.forEach((e=>e.wu().wr().Pt()))}tf(e,t){let n=e.N().priceScaleId,r=n===void 0?this.ef():n;t.h_(e,r),Te(r)||e.vr(e.N())}yd(e){let t=this.yn.layout;return t.background.type===`gradient`?e===0?t.background.topColor:t.background.bottomColor:t.background.color}nf(e){return!e.q_()&&e.kl().length===0&&this.dd.length>1&&(this.dd.splice(this._f(e),1),this.ka(),!0)}};function dn(e){if(e>=1)return 0;let t=0;for(;t<8;t++){if(Math.abs(Math.round(e)-e)<1e-8)return t;e*=10}return t}function fn(e){return!S(e)&&!w(e)}function pn(e){return S(e)}(function(e){e[e.Disabled=0]=`Disabled`,e[e.Continuous=1]=`Continuous`,e[e.OnDataUpdate=2]=`OnDataUpdate`})(on||={}),function(e){e[e.LastBar=0]=`LastBar`,e[e.LastVisible=1]=`LastVisible`}(sn||={}),function(e){e.Solid=`solid`,e.VerticalGradient=`gradient`}(cn||={}),function(e){e[e.Year=0]=`Year`,e[e.Month=1]=`Month`,e[e.DayOfMonth=2]=`DayOfMonth`,e[e.Time=3]=`Time`,e[e.TimeWithSeconds=4]=`TimeWithSeconds`}(ln||={});var mn=e=>e.getUTCFullYear();function hn(e,t,n){return t.replace(/yyyy/g,(e=>N(mn(e),4))(e)).replace(/yy/g,(e=>N(mn(e)%100,2))(e)).replace(/MMMM/g,((e,t)=>new Date(e.getUTCFullYear(),e.getUTCMonth(),1).toLocaleString(t,{month:`long`}))(e,n)).replace(/MMM/g,((e,t)=>new Date(e.getUTCFullYear(),e.getUTCMonth(),1).toLocaleString(t,{month:`short`}))(e,n)).replace(/MM/g,(e=>N((e=>e.getUTCMonth()+1)(e),2))(e)).replace(/dd/g,(e=>N((e=>e.getUTCDate())(e),2))(e))}var gn=class{constructor(e=`yyyy-MM-dd`,t=`default`){this.df=e,this.ff=t}ku(e){return hn(e,this.df,this.ff)}},_n=class{constructor(e){this.pf=e||`%h:%m:%s`}ku(e){return this.pf.replace(`%h`,N(e.getUTCHours(),2)).replace(`%m`,N(e.getUTCMinutes(),2)).replace(`%s`,N(e.getUTCSeconds(),2))}},vn={vf:`yyyy-MM-dd`,mf:`%h:%m:%s`,wf:` `,Mf:`default`},yn=class{constructor(e={}){let t={...vn,...e};this.gf=new gn(t.vf,t.Mf),this.bf=new _n(t.mf),this.Sf=t.wf}ku(e){return`${this.gf.ku(e)}${this.Sf}${this.bf.ku(e)}`}};function bn(e){return 60*e*60*1e3}function xn(e){return 60*e*1e3}var Sn=[{xf:(Cn=1,1e3*Cn),Cf:10},{xf:xn(1),Cf:20},{xf:xn(5),Cf:21},{xf:xn(30),Cf:22},{xf:bn(1),Cf:30},{xf:bn(3),Cf:31},{xf:bn(6),Cf:32},{xf:bn(12),Cf:33}],Cn;function wn(e,t){if(e.getUTCFullYear()!==t.getUTCFullYear())return 70;if(e.getUTCMonth()!==t.getUTCMonth())return 60;if(e.getUTCDate()!==t.getUTCDate())return 50;for(let n=Sn.length-1;n>=0;--n)if(Math.floor(t.getTime()/Sn[n].xf)!==Math.floor(e.getTime()/Sn[n].xf))return Sn[n].Cf;return 0}function Tn(e){let t=e;if(w(e)&&(t=Dn(e)),!fn(t))throw Error(`time must be of type BusinessDay`);let n=new Date(Date.UTC(t.year,t.month-1,t.day,0,0,0,0));return{yf:Math.round(n.getTime()/1e3),Pf:t}}function En(e){if(!pn(e))throw Error(`time must be of type isUTCTimestamp`);return{yf:e}}function Dn(e){let t=new Date(e);if(isNaN(t.getTime()))throw Error(`Invalid date string=${e}, expected format=yyyy-mm-dd`);return{day:t.getUTCDate(),month:t.getUTCMonth()+1,year:t.getUTCFullYear()}}function On(e){w(e.time)&&(e.time=Dn(e.time))}var kn=class{options(){return this.yn}setOptions(e){this.yn=e,this.updateFormatter(e.localization)}preprocessData(e){Array.isArray(e)?function(e){e.forEach(On)}(e):On(e)}createConverterToInternalObj(e){return v(function(e){return e.length===0?null:fn(e[0].time)||w(e[0].time)?Tn:En}(e))}key(e){return typeof e==`object`&&`yf`in e?e.yf:this.key(this.convertHorzItemToInternal(e))}cacheKey(e){let t=e;return t.Pf===void 0?new Date(1e3*t.yf).getTime():new Date(Date.UTC(t.Pf.year,t.Pf.month-1,t.Pf.day)).getTime()}convertHorzItemToInternal(e){return pn(t=e)?En(t):fn(t)?Tn(t):Tn(Dn(t));var t}updateFormatter(e){if(!this.yn)return;let t=e.dateFormat;this.kf=this.yn.timeScale.timeVisible?new yn({vf:t,mf:this.yn.timeScale.secondsVisible?`%h:%m:%s`:`%h:%m`,wf:` `,Mf:e.locale}):new gn(t,e.locale)}formatHorzItem(e){let t=e;return this.kf.ku(new Date(1e3*t.yf))}formatTickmark(e,t){let n=function(e,t,n){switch(e){case 0:case 10:return t?n?4:3:2;case 20:case 21:case 22:case 30:case 31:case 32:case 33:return t?3:2;case 50:return 2;case 60:return 1;case 70:return 0}}(e.weight,this.yn.timeScale.timeVisible,this.yn.timeScale.secondsVisible),r=this.yn.timeScale;if(r.tickMarkFormatter!==void 0){let i=r.tickMarkFormatter(e.originalTime,n,t.locale);if(i!==null)return i}return function(e,t,n){let r={};switch(t){case 0:r.year=`numeric`;break;case 1:r.month=`short`;break;case 2:r.day=`numeric`;break;case 3:r.hour12=!1,r.hour=`2-digit`,r.minute=`2-digit`;break;case 4:r.hour12=!1,r.hour=`2-digit`,r.minute=`2-digit`,r.second=`2-digit`}let i=e.Pf===void 0?new Date(1e3*e.yf):new Date(Date.UTC(e.Pf.year,e.Pf.month-1,e.Pf.day));return new Date(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate(),i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds()).toLocaleString(n,r)}(e.time,n,t.locale)}maxTickMarkWeight(e){let t=e.reduce(nn,e[0]).weight;return t>30&&t<50&&(t=30),t}fillWeightsForPoints(e,t){(function(e,t=0){if(e.length===0)return;let n=t===0?null:e[t-1].time.yf,r=n===null?null:new Date(1e3*n),i=0;for(let a=t;a<e.length;++a){let t=e[a],o=new Date(1e3*t.time.yf);r!==null&&(t.timeWeight=wn(o,r)),i+=t.time.yf-(n||t.time.yf),n=t.time.yf,r=o}if(t===0&&e.length>1){let t=Math.ceil(i/(e.length-1)),n=new Date(1e3*(e[0].time.yf-t));e[0].timeWeight=wn(new Date(1e3*e[0].time.yf),n)}})(e,t)}static Tf(e){return x({localization:{dateFormat:`dd MMM 'yy`}},e??{})}},W=typeof window<`u`;function An(){return!!W&&window.navigator.userAgent.toLowerCase().indexOf(`firefox`)>-1}function jn(){return!!W&&/iPhone|iPad|iPod/.test(window.navigator.platform)}function Mn(e,t){switch(e){case`custom`:return t===void 0?`series`:`custom-object`;case`price-line`:return`custom-price-line`;case`marker`:return`series-marker`;case`primitive`:return`primitive`;default:return`series`}}function Nn(e){return e+e%2}function Pn(e){W&&window.chrome!==void 0&&e.addEventListener(`mousedown`,(e=>{if(e.button===1)return e.preventDefault(),!1}))}var Fn=class{constructor(e,t,n){this.Rf=0,this.Df=null,this.If={_t:-1/0,ut:1/0},this.Vf=0,this.Bf=null,this.Ef={_t:-1/0,ut:1/0},this.Af=null,this.Lf=!1,this.zf=null,this.Of=null,this.Nf=!1,this.Ff=!1,this.Wf=!1,this.Hf=null,this.Uf=null,this.$f=null,this.jf=null,this.qf=null,this.Yf=null,this.Kf=null,this.Gf=0,this.Zf=!1,this.Xf=!1,this.Jf=!1,this.Qf=0,this.tp=null,this.ip=!jn(),this.np=e=>{this.sp(e)},this.ep=e=>{if(this.rp(e)){let t=this.hp(e);if(++this.Vf,this.Bf&&this.Vf>1){let{ap:n}=this.lp(K(e),this.Ef);n<30&&!this.Wf&&this.op(t,this.up._p),this.cp()}}else{let t=this.hp(e);if(++this.Rf,this.Df&&this.Rf>1){let{ap:n}=this.lp(K(e),this.If);n<5&&!this.Ff&&this.dp(t,this.up.fp),this.pp()}}},this.vp=e,this.up=t,this.yn=n,this.mp()}m(){this.Hf!==null&&(this.Hf(),this.Hf=null),this.Uf!==null&&(this.Uf(),this.Uf=null),this.jf!==null&&(this.jf(),this.jf=null),this.qf!==null&&(this.qf(),this.qf=null),this.Yf!==null&&(this.Yf(),this.Yf=null),this.$f!==null&&(this.$f(),this.$f=null),this.wp(),this.pp()}Mp(e){this.jf&&this.jf();let t=this.gp.bind(this);if(this.jf=()=>{this.vp.removeEventListener(`mousemove`,t)},this.vp.addEventListener(`mousemove`,t),this.rp(e))return;let n=this.hp(e);this.dp(n,this.up.bp),this.ip=!0}pp(){this.Df!==null&&clearTimeout(this.Df),this.Rf=0,this.Df=null,this.If={_t:-1/0,ut:1/0}}cp(){this.Bf!==null&&clearTimeout(this.Bf),this.Vf=0,this.Bf=null,this.Ef={_t:-1/0,ut:1/0}}gp(e){if(this.Jf||this.Of!==null||this.rp(e))return;let t=this.hp(e);this.dp(t,this.up.Sp),this.ip=!0}xp(e){let t=Rn(e.changedTouches,v(this.tp));if(t===null||(this.Qf=Ln(e),this.Kf!==null)||this.Xf)return;this.Zf=!0;let{Cp:n,yp:r,ap:i}=this.lp(K(t),v(this.Of));if(this.Nf||!(i<5)){if(!this.Nf){let e=.5*n,t=r>=e&&!this.yn.Pp(),i=e>r&&!this.yn.kp();t||i||(this.Xf=!0),this.Nf=!0,this.Wf=!0,this.wp(),this.cp()}if(!this.Xf){let n=this.hp(e,t);this.op(n,this.up.Tp),G(e)}}}Rp(e){if(e.button!==0)return;let{ap:t}=this.lp(K(e),v(this.zf));if(t>=5&&(this.Ff=!0,this.pp()),this.Ff){let t=this.hp(e);this.dp(t,this.up.Dp)}}lp(e,t){let n=Math.abs(t._t-e._t),r=Math.abs(t.ut-e.ut);return{Cp:n,yp:r,ap:n+r}}Ip(e){let t=Rn(e.changedTouches,v(this.tp));if(t===null&&e.touches.length===0&&(t=e.changedTouches[0]),t===null)return;this.tp=null,this.Qf=Ln(e),this.wp(),this.Of=null,this.Yf&&=(this.Yf(),null);let n=this.hp(e,t);if(this.op(n,this.up.Vp),++this.Vf,this.Bf&&this.Vf>1){let{ap:e}=this.lp(K(t),this.Ef);e<30&&!this.Wf&&this.op(n,this.up._p),this.cp()}else this.Wf||(this.op(n,this.up.Bp),this.up.Bp&&G(e));this.Vf===0&&G(e),e.touches.length===0&&this.Lf&&(this.Lf=!1,G(e))}sp(e){if(e.button!==0)return;let t=this.hp(e);if(this.zf=null,this.Jf=!1,this.qf&&=(this.qf(),null),An()&&this.vp.ownerDocument.documentElement.removeEventListener(`mouseleave`,this.np),!this.rp(e)){if(this.dp(t,this.up.Ep),++this.Rf,this.Df&&this.Rf>1){let{ap:n}=this.lp(K(e),this.If);n<5&&!this.Ff&&this.dp(t,this.up.fp),this.pp()}else this.Ff||this.dp(t,this.up.Ap)}}wp(){this.Af!==null&&(clearTimeout(this.Af),this.Af=null)}Lp(e){if(this.tp!==null)return;let t=e.changedTouches[0];this.tp=t.identifier,this.Qf=Ln(e);let n=this.vp.ownerDocument.documentElement;this.Wf=!1,this.Nf=!1,this.Xf=!1,this.Of=K(t),this.Yf&&=(this.Yf(),null);{let t=this.xp.bind(this),r=this.Ip.bind(this);this.Yf=()=>{n.removeEventListener(`touchmove`,t),n.removeEventListener(`touchend`,r)},n.addEventListener(`touchmove`,t,{passive:!1}),n.addEventListener(`touchend`,r,{passive:!1}),this.wp(),this.Af=setTimeout(this.zp.bind(this,e),240)}let r=this.hp(e,t);this.op(r,this.up.Op),this.Bf||(this.Vf=0,this.Bf=setTimeout(this.cp.bind(this),500),this.Ef=K(t))}Np(e){if(e.button!==0)return;let t=this.vp.ownerDocument.documentElement;An()&&t.addEventListener(`mouseleave`,this.np),this.Ff=!1,this.zf=K(e),this.qf&&=(this.qf(),null);{let e=this.Rp.bind(this),n=this.sp.bind(this);this.qf=()=>{t.removeEventListener(`mousemove`,e),t.removeEventListener(`mouseup`,n)},t.addEventListener(`mousemove`,e),t.addEventListener(`mouseup`,n)}if(this.Jf=!0,this.rp(e))return;let n=this.hp(e);this.dp(n,this.up.Fp),this.Df||(this.Rf=0,this.Df=setTimeout(this.pp.bind(this),500),this.If=K(e))}mp(){this.vp.addEventListener(`mouseenter`,this.Mp.bind(this)),this.vp.addEventListener(`touchcancel`,this.wp.bind(this));{let e=this.vp.ownerDocument,t=e=>{this.up.Wp&&(e.composed&&this.vp.contains(e.composedPath()[0])||e.target&&this.vp.contains(e.target)||this.up.Wp())};this.Uf=()=>{e.removeEventListener(`touchstart`,t)},this.Hf=()=>{e.removeEventListener(`mousedown`,t)},e.addEventListener(`mousedown`,t),e.addEventListener(`touchstart`,t,{passive:!0})}jn()&&(this.$f=()=>{this.vp.removeEventListener(`dblclick`,this.ep)},this.vp.addEventListener(`dblclick`,this.ep)),this.vp.addEventListener(`mouseleave`,this.Hp.bind(this)),this.vp.addEventListener(`touchstart`,this.Lp.bind(this),{passive:!0}),Pn(this.vp),this.vp.addEventListener(`mousedown`,this.Np.bind(this)),this.Up(),this.vp.addEventListener(`touchmove`,(()=>{}),{passive:!1})}Up(){this.up.$p===void 0&&this.up.jp===void 0&&this.up.qp===void 0||(this.vp.addEventListener(`touchstart`,(e=>this.Yp(e.touches)),{passive:!0}),this.vp.addEventListener(`touchmove`,(e=>{if(e.touches.length===2&&this.Kf!==null&&this.up.jp!==void 0){let t=In(e.touches[0],e.touches[1])/this.Gf;this.up.jp(this.Kf,t),G(e)}}),{passive:!1}),this.vp.addEventListener(`touchend`,(e=>{this.Yp(e.touches)})))}Yp(e){e.length===1&&(this.Zf=!1),e.length!==2||this.Zf||this.Lf?this.Kp():this.Gp(e)}Gp(e){let t=this.vp.getBoundingClientRect()||{left:0,top:0};this.Kf={_t:(e[0].clientX-t.left+(e[1].clientX-t.left))/2,ut:(e[0].clientY-t.top+(e[1].clientY-t.top))/2},this.Gf=In(e[0],e[1]),this.up.$p!==void 0&&this.up.$p(),this.wp()}Kp(){this.Kf!==null&&(this.Kf=null,this.up.qp!==void 0&&this.up.qp())}Hp(e){if(this.jf&&this.jf(),this.rp(e)||!this.ip)return;let t=this.hp(e);this.dp(t,this.up.Zp),this.ip=!jn()}zp(e){let t=Rn(e.touches,v(this.tp));if(t===null)return;let n=this.hp(e,t);this.op(n,this.up.Xp),this.Wf=!0,this.Lf=!0}rp(e){return e.sourceCapabilities&&e.sourceCapabilities.firesTouchEvents!==void 0?e.sourceCapabilities.firesTouchEvents:Ln(e)<this.Qf+500}op(e,t){t&&t.call(this.up,e)}dp(e,t){t&&t.call(this.up,e)}hp(e,t){let n=t||e,r=this.vp.getBoundingClientRect()||{left:0,top:0};return{clientX:n.clientX,clientY:n.clientY,pageX:n.pageX,pageY:n.pageY,screenX:n.screenX,screenY:n.screenY,localX:n.clientX-r.left,localY:n.clientY-r.top,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,metaKey:e.metaKey,Jp:!e.type.startsWith(`mouse`)&&e.type!==`contextmenu`&&e.type!==`click`,Qp:e.type,tv:n.target,xu:e.view,iv:()=>{e.type!==`touchstart`&&G(e)}}}};function In(e,t){let n=e.clientX-t.clientX,r=e.clientY-t.clientY;return Math.sqrt(n*n+r*r)}function G(e){e.cancelable&&e.preventDefault()}function K(e){return{_t:e.pageX,ut:e.pageY}}function Ln(e){return e.timeStamp||performance.now()}function Rn(e,t){for(let n=0;n<e.length;++n)if(e[n].identifier===t)return e[n];return null}var zn=class{constructor(e,t,n){this.nv=null,this.sv=null,this.ev=!0,this.rv=null,this.hv=e,this.av=e.lv()[t],this.ov=e.lv()[n],this._v=document.createElement(`tr`),this._v.style.height=`1px`,this.uv=document.createElement(`td`),this.uv.style.position=`relative`,this.uv.style.padding=`0`,this.uv.style.margin=`0`,this.uv.setAttribute(`colspan`,`3`),this.cv(),this._v.appendChild(this.uv),this.ev=this.hv.N().layout.panes.enableResize,this.ev?this.dv():(this.nv=null,this.sv=null)}m(){this.sv!==null&&this.sv.m()}fv(){return this._v}pv(){return e({width:this.av.pv().width,height:1})}vv(){return e({width:this.av.vv().width,height:1*window.devicePixelRatio})}mv(e,t,n){let r=this.vv();e.fillStyle=this.hv.N().layout.panes.separatorColor,e.fillRect(t,n,r.width,r.height)}Pt(){this.cv(),this.hv.N().layout.panes.enableResize!==this.ev&&(this.ev=this.hv.N().layout.panes.enableResize,this.ev?this.dv():(this.nv!==null&&(this.uv.removeChild(this.nv.wv),this.uv.removeChild(this.nv.Mv),this.nv=null),this.sv!==null&&(this.sv.m(),this.sv=null)))}dv(){let e=document.createElement(`div`),t=e.style;t.position=`fixed`,t.display=`none`,t.zIndex=`49`,t.top=`0`,t.left=`0`,t.width=`100%`,t.height=`100%`,t.cursor=`row-resize`,this.uv.appendChild(e);let n=document.createElement(`div`),r=n.style;r.position=`absolute`,r.zIndex=`50`,r.top=`-4px`,r.height=`9px`,r.width=`100%`,r.backgroundColor=``,r.cursor=`row-resize`,this.uv.appendChild(n);let i={bp:this.gv.bind(this),Zp:this.bv.bind(this),Fp:this.Sv.bind(this),Op:this.Sv.bind(this),Dp:this.xv.bind(this),Tp:this.xv.bind(this),Ep:this.Cv.bind(this),Vp:this.Cv.bind(this)};this.sv=new Fn(n,i,{Pp:()=>!1,kp:()=>!0}),this.nv={Mv:n,wv:e}}cv(){this.uv.style.background=this.hv.N().layout.panes.separatorColor}gv(e){this.nv!==null&&(this.nv.Mv.style.backgroundColor=this.hv.N().layout.panes.separatorHoverColor)}bv(e){this.nv!==null&&this.rv===null&&(this.nv.Mv.style.backgroundColor=``)}Sv(e){if(this.nv===null)return;let t=this.av.yv().F_()+this.ov.yv().F_(),n=t/(this.av.pv().height+this.ov.pv().height),r=30*n;t<=2*r||(this.rv={Pv:e.pageY,kv:this.av.yv().F_(),Tv:t-r,Rv:t,Dv:n,Iv:r},this.nv.wv.style.display=`block`)}xv(e){let t=this.rv;if(t===null)return;let n=(e.pageY-t.Pv)*t.Dv,r=R(t.kv+n,t.Iv,t.Tv);this.av.yv().W_(r),this.ov.yv().W_(t.Rv-r),this.hv.Qt().ka()}Cv(e){this.rv!==null&&this.nv!==null&&(this.rv=null,this.nv.wv.style.display=`none`)}};function Bn(e,t){return e.Vv-t.Vv}function Vn(e,t,n){let r=(e.Vv-t.Vv)/(e.wt-t.wt);return Math.sign(r)*Math.min(Math.abs(r),n)}var Hn=class{constructor(e,t,n,r){this.Bv=null,this.Ev=null,this.Av=null,this.Lv=null,this.zv=null,this.Ov=0,this.Nv=0,this.Fv=e,this.Wv=t,this.Hv=n,this.Ps=r}Uv(e,t){if(this.Bv!==null){if(this.Bv.wt===t)return void(this.Bv.Vv=e);if(Math.abs(this.Bv.Vv-e)<this.Ps)return}this.Lv=this.Av,this.Av=this.Ev,this.Ev=this.Bv,this.Bv={wt:t,Vv:e}}me(e,t){if(this.Bv===null||this.Ev===null||t-this.Bv.wt>50)return;let n=0,r=Vn(this.Bv,this.Ev,this.Wv),i=Bn(this.Bv,this.Ev),a=[r],o=[i];if(n+=i,this.Av!==null){let e=Vn(this.Ev,this.Av,this.Wv);if(Math.sign(e)===Math.sign(r)){let t=Bn(this.Ev,this.Av);if(a.push(e),o.push(t),n+=t,this.Lv!==null){let e=Vn(this.Av,this.Lv,this.Wv);if(Math.sign(e)===Math.sign(r)){let t=Bn(this.Av,this.Lv);a.push(e),o.push(t),n+=t}}}}let s=0;for(let e=0;e<a.length;++e)s+=o[e]/n*a[e];Math.abs(s)<this.Fv||(this.zv={Vv:e,wt:t},this.Nv=s,this.Ov=function(e,t){let n=Math.log(t);return Math.log(1*n/-e)/n}(Math.abs(s),this.Hv))}Gc(e){let t=v(this.zv),n=e-t.wt;return t.Vv+this.Nv*(this.Hv**+n-1)/Math.log(this.Hv)}Kc(e){return this.zv===null||this.$v(e)===this.Ov}$v(e){let t=e-v(this.zv).wt;return Math.min(t,this.Ov)}},Un=class{constructor(e,t){this.jv=void 0,this.qv=void 0,this.Yv=void 0,this.vn=!1,this.Kv=e,this.Gv=t,this.Zv()}Pt(){this.Zv()}Xv(){this.jv&&this.Kv.removeChild(this.jv),this.qv&&this.Kv.removeChild(this.qv),this.jv=void 0,this.qv=void 0}Jv(){return this.vn!==this.Qv()||this.Yv!==this.tm()}tm(){return this.Gv.Qt().Xi().J(this.Gv.N().layout.textColor)>160?`dark`:`light`}Qv(){return this.Gv.N().layout.attributionLogo}im(){let e=new URL(location.href);return e.hostname?`&utm_source=`+e.hostname+e.pathname:``}Zv(){this.Jv()&&(this.Xv(),this.vn=this.Qv(),this.vn&&(this.Yv=this.tm(),this.qv=document.createElement(`style`),this.qv.innerText=`a#tv-attr-logo{--fill:#131722;--stroke:#fff;position:absolute;left:10px;bottom:10px;height:19px;width:35px;margin:0;padding:0;border:0;z-index:3;}a#tv-attr-logo[data-dark]{--fill:#D1D4DC;--stroke:#131722;}`,this.jv=document.createElement(`a`),this.jv.href=`https://www.tradingview.com/?utm_medium=lwc-link&utm_campaign=lwc-chart${this.im()}`,this.jv.title=`Charting by TradingView`,this.jv.id=`tv-attr-logo`,this.jv.target=`_blank`,this.jv.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" width="35" height="19" fill="none"><g fill-rule="evenodd" clip-path="url(#a)" clip-rule="evenodd"><path fill="var(--stroke)" d="M2 0H0v10h6v9h21.4l.5-1.3 6-15 1-2.7H23.7l-.5 1.3-.2.6a5 5 0 0 0-7-.9V0H2Zm20 17h4l5.2-13 .8-2h-7l-1 2.5-.2.5-1.5 3.8-.3.7V17Zm-.8-10a3 3 0 0 0 .7-2.7A3 3 0 1 0 16.8 7h4.4ZM14 7V2H2v6h6v9h4V7h2Z"/><path fill="var(--fill)" d="M14 2H2v6h6v9h6V2Zm12 15h-7l6-15h7l-6 15Zm-7-9a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"/></g><defs><clipPath id="a"><path fill="var(--stroke)" d="M0 0h35v19H0z"/></clipPath></defs></svg>`,this.jv.toggleAttribute(`data-dark`,this.Yv===`dark`),this.Kv.appendChild(this.qv),this.Kv.appendChild(this.jv)))}};function q(e,t){let n=v(e.ownerDocument).createElement(`canvas`);e.appendChild(n);let r=a(n,{type:`device-pixel-content-box`,options:{allowResizeObserver:!0},transform:(e,t)=>({width:Math.max(e.width,t.width),height:Math.max(e.height,t.height)})});return r.resizeCanvasElement(t),r}function J(e){e.width=1,e.height=1,e.getContext(`2d`)?.clearRect(0,0,1,1)}function Wn(e,t,n,r){e.qh&&e.qh(t,n,r)}function Y(e,t,n,r){e.st(t,n,r)}function Gn(e,t,n,r){Kn(e(n,r),t,r)}function Kn(e,t,n){for(let r of e){let e=r.Tt(n);e!==null&&t(e)}}function qn(e,t){return n=>function(e){return e.Ft!==void 0}(n)&&(n.Ft()?.pl()??``)===t?n.Qa?.(e)??[]:[]}function Jn(e,t,n,r){if(!e.length)return;let i=0,a=e[0].$t(r,!0),o=t===1?n/2-(e[0].Hi()-a/2):e[0].Hi()-a/2-n/2;o=Math.max(0,o);for(let a=1;a<e.length;a++){let s=e[a],c=e[a-1],l=c.$t(r,!1),u=s.Hi(),d=c.Hi();if(t===1?u>d-l:u<d+l){let r=d-l*t;s.Ui(r);let a=r-t*l/2;if((t===1?a<0:a>n)&&o>0){let r=t===1?-1-a:a-n,s=Math.min(r,o);for(let n=i;n<e.length;n++)e[n].Ui(e[n].Hi()+t*s);o-=s}}else i=a,o=t===1?d-l-u:u-(d+l)}}var Yn=class{constructor(t,n,r,i){this.Ki=null,this.nm=null,this.sm=!1,this.rm=new P(200),this.hm=null,this.am=0,this.lm=!1,this.om=()=>{this.lm||this.yt._m().Qt().mr()},this.um=()=>{this.lm||this.yt._m().Qt().mr()},this.yt=t,this.yn=n,this.Ro=n.layout,this.bd=r,this.dm=i===`left`,this.fm=qn(`normal`,i),this.pm=qn(`top`,i),this.vm=qn(`bottom`,i),this.uv=document.createElement(`div`),this.uv.style.height=`100%`,this.uv.style.overflow=`hidden`,this.uv.style.width=`25px`,this.uv.style.left=`0`,this.uv.style.position=`relative`,this.wm=q(this.uv,e({width:16,height:16})),this.wm.subscribeSuggestedBitmapSizeChanged(this.om);let a=this.wm.canvasElement;a.style.position=`absolute`,a.style.zIndex=`1`,a.style.left=`0`,a.style.top=`0`,this.Mm=q(this.uv,e({width:16,height:16})),this.Mm.subscribeSuggestedBitmapSizeChanged(this.um);let o=this.Mm.canvasElement;o.style.position=`absolute`,o.style.zIndex=`2`,o.style.left=`0`,o.style.top=`0`;let s={Fp:this.Sv.bind(this),Op:this.Sv.bind(this),Dp:this.xv.bind(this),Tp:this.xv.bind(this),Wp:this.gm.bind(this),Ep:this.Cv.bind(this),Vp:this.Cv.bind(this),fp:this.bm.bind(this),_p:this.bm.bind(this),bp:this.Sm.bind(this),Zp:this.bv.bind(this)};this.sv=new Fn(this.Mm.canvasElement,s,{Pp:()=>!this.yn.handleScroll.vertTouchDrag,kp:()=>!0})}m(){this.sv.m(),this.Mm.unsubscribeSuggestedBitmapSizeChanged(this.um),J(this.Mm.canvasElement),this.Mm.dispose(),this.wm.unsubscribeSuggestedBitmapSizeChanged(this.om),J(this.wm.canvasElement),this.wm.dispose(),this.Ki!==null&&this.Ki.__().u(this),this.Ki=null}fv(){return this.uv}P(){return this.Ro.fontSize}xm(){let e=this.bd.N();return this.hm!==e.k&&(this.rm.Os(),this.hm=e.k),e}Cm(){if(this.Ki===null)return 0;let e=0,t=this.xm(),n=v(this.wm.canvasElement.getContext(`2d`,{colorSpace:this.yt._m().N().layout.colorSpace}));n.save();let r=this.Ki.zl();n.font=this.ym(),r.length>0&&(e=Math.max(this.rm.Ii(n,r[0].eo),this.rm.Ii(n,r[r.length-1].eo)));let i=this.Pm();for(let t=i.length;t--;){let r=this.rm.Ii(n,i[t].ri());r>e&&(e=r)}let a=this.Ki.Lt();if(a!==null&&this.nm!==null&&(o=this.yn.crosshair).mode!==2&&o.horzLine.visible&&o.horzLine.labelVisible){let t=this.Ki.Tn(1,a),r=this.Ki.Tn(this.nm.height-2,a);e=Math.max(e,this.rm.Ii(n,this.Ki.Ji(Math.floor(Math.min(t,r))+.11111111111111,a)),this.rm.Ii(n,this.Ki.Ji(Math.ceil(Math.max(t,r))-.11111111111111,a)))}var o;n.restore();let s=e||34;return Nn(Math.ceil(t.S+t.C+t.V+t.B+5+s))}km(e){this.nm!==null&&t(this.nm,e)||(this.nm=e,this.lm=!0,this.wm.resizeCanvasElement(e),this.Mm.resizeCanvasElement(e),this.lm=!1,this.uv.style.width=`${e.width}px`,this.uv.style.height=`${e.height}px`)}Tm(){return v(this.nm).width}un(e){this.Ki!==e&&(this.Ki!==null&&this.Ki.__().u(this),this.Ki=e,e.__().i(this.wo.bind(this),this))}Ft(){return this.Ki}Os(){let e=this.yt.yv();this.yt._m().Qt().au(e,v(this.Ft()))}Rm(e){if(this.nm===null)return;let t={colorSpace:this.yt._m().N().layout.colorSpace};if(e!==1){this.Dm(),this.wm.applySuggestedBitmapSize();let e=u(this.wm,t);e!==null&&(e.useBitmapCoordinateSpace((e=>{this.Im(e),this.Vm(e)})),this.yt.Bm(e,this.vm),this.Em(e),this.yt.Bm(e,this.fm),this.Am(e))}this.Mm.applySuggestedBitmapSize();let n=u(this.Mm,t);n!==null&&(n.useBitmapCoordinateSpace((({context:e,bitmapSize:t})=>{e.clearRect(0,0,t.width,t.height)})),this.Lm(n),this.yt.Bm(n,this.pm))}vv(){return this.wm.bitmapSize}mv(e,t,n,r){let i=this.vv();if(i.width>0&&i.height>0&&(e.drawImage(this.wm.canvasElement,t,n),r)){let r=this.Mm.canvasElement;e.drawImage(r,t,n)}}Pt(){this.Ki?.zl()}Sv(e){if(this.Ki===null||this.Ki.Zi()||!this.yn.handleScale.axisPressedMouseMove.price)return;let t=this.yt._m().Qt(),n=this.yt.yv();this.sm=!0,t.Q_(n,this.Ki,e.localY)}xv(e){if(this.Ki===null||!this.yn.handleScale.axisPressedMouseMove.price)return;let t=this.yt._m().Qt(),n=this.yt.yv(),r=this.Ki;t.tu(n,r,e.localY)}gm(){if(this.Ki===null||!this.yn.handleScale.axisPressedMouseMove.price)return;let e=this.yt._m().Qt(),t=this.yt.yv(),n=this.Ki;this.sm&&(this.sm=!1,e.iu(t,n))}Cv(e){if(this.Ki===null||!this.yn.handleScale.axisPressedMouseMove.price)return;let t=this.yt._m().Qt(),n=this.yt.yv();this.sm=!1,t.iu(n,this.Ki)}bm(e){this.yn.handleScale.axisDoubleClickReset.price&&this.Os()}Sm(e){this.Ki!==null&&(!this.yt._m().Qt().N().handleScale.axisPressedMouseMove.price||this.Ki.je()||this.Ki.No()||this.zm(1))}bv(e){this.zm(0)}Pm(){let e=[],t=this.Ki===null?void 0:this.Ki;return(n=>{for(let r=0;r<n.length;++r){let i=n[r].qn(this.yt.yv(),t);for(let t=0;t<i.length;t++)e.push(i[t])}})(this.yt.yv().Dt()),e}Im({context:e,bitmapSize:t}){let{width:n,height:r}=t,i=this.yt.yv().Qt(),a=i.$(),o=i.af();a===o?fe(e,0,0,n,r,a):he(e,0,0,n,r,a,o)}Vm({context:e,bitmapSize:t,horizontalPixelRatio:n}){if(this.nm===null||this.Ki===null||!this.Ki.N().borderVisible)return;e.fillStyle=this.Ki.N().borderColor;let r=Math.max(1,Math.floor(this.xm().S*n)),i;i=this.dm?t.width-r:0,e.fillRect(i,0,r,t.height)}Em(e){if(this.nm===null||this.Ki===null)return;let t=this.Ki.zl(),n=this.Ki.N(),r=this.xm(),i=this.dm?this.nm.width-r.C:0;n.borderVisible&&n.ticksVisible&&e.useBitmapCoordinateSpace((({context:e,horizontalPixelRatio:a,verticalPixelRatio:o})=>{e.fillStyle=n.borderColor;let s=Math.max(1,Math.floor(o)),c=Math.floor(.5*o),l=Math.round(r.C*a);e.beginPath();for(let n of t)e.rect(Math.floor(i*a),Math.round(n.Vl*o)-c,l,s);e.fill()})),e.useMediaCoordinateSpace((({context:e})=>{e.font=this.ym(),e.fillStyle=n.textColor??this.Ro.textColor,e.textAlign=this.dm?`right`:`left`,e.textBaseline=`middle`;let a=this.dm?Math.round(i-r.V):Math.round(i+r.C+r.V),o=t.map((t=>this.rm.Di(e,t.eo)));for(let n=t.length;n--;){let r=t[n];e.fillText(r.eo,a,r.Vl+o[n])}}))}Dm(){if(this.nm===null||this.Ki===null)return;let e=this.nm.height/2,t=[],n=this.Ki.Dt().slice(),r=this.yt.yv(),i=this.xm();this.Ki===r.Zs()&&this.yt.yv().Dt().forEach((e=>{r.Gs(e)&&n.push(e)}));let a=this.Ki.kl()[0],o=this.Ki;n.forEach((n=>{let i=n.qn(r,o);i.forEach((e=>{e.$i()&&e.Wi()===null&&(e.Ui(null),t.push(e))})),a===n&&i.length>0&&(e=i[0].Ei())})),this.Ki.N().alignLabels&&this.Om(t,i,e)}Om(e,t,n){if(this.nm===null)return;let r=e.filter((e=>e.Ei()<=n)),i=e.filter((e=>e.Ei()>n));r.sort(((e,t)=>t.Ei()-e.Ei())),r.length&&i.length&&i.push(r[0]),i.sort(((e,t)=>e.Ei()-t.Ei()));for(let n of e){let e=Math.floor(n.$t(t)/2),r=n.Ei();r>-e&&r<e&&n.Ui(e),r>this.nm.height-e&&r<this.nm.height+e&&n.Ui(this.nm.height-e)}Jn(r,1,this.nm.height,t),Jn(i,-1,this.nm.height,t)}Am(e){if(this.nm===null)return;let t=this.Pm(),n=this.xm(),r=this.dm?`right`:`left`;t.forEach((t=>{t.ji()&&t.Tt(v(this.Ki)).st(e,n,this.rm,r)}))}Lm(e){if(this.nm===null||this.Ki===null)return;let t=this.yt._m().Qt(),n=[],r=this.yt.yv(),i=t.Vd().qn(r,this.Ki);i.length&&n.push(i);let a=this.xm(),o=this.dm?`right`:`left`;n.forEach((t=>{t.forEach((t=>{t.Tt(v(this.Ki)).st(e,a,this.rm,o)}))}))}zm(e){this.uv.style.cursor=e===1?`ns-resize`:`default`}wo(){let e=this.Cm();this.am<e&&this.yt._m().Qt().ka(),this.am=e}ym(){return O(this.Ro.fontSize,this.Ro.fontFamily)}};function Xn(e,t){return e.Xa?.(t)??[]}function Zn(e,t){return e.jn?.(t)??[]}function Qn(e,t){return e.cn?.(t)??[]}function $n(e,t){return e.qa?.(t)??[]}var er=class n{constructor(t,n){this.nm=e({width:0,height:0}),this.Nm=null,this.Fm=null,this.Wm=null,this.Hm=null,this.Um=!1,this.$m=new b,this.jm=new b,this.qm=0,this.Ym=!1,this.Km=null,this.Gm=!1,this.Zm=null,this.Xm=null,this.lm=!1,this.om=()=>{this.lm||this.Jm===null||this.sn().mr()},this.um=()=>{this.lm||this.Jm===null||this.sn().mr()},this.Gv=t,this.Jm=n,this.Jm.mu().i(this.Qm.bind(this),this,!0),this.tw=document.createElement(`td`),this.tw.style.padding=`0`,this.tw.style.position=`relative`;let r=document.createElement(`div`);r.style.width=`100%`,r.style.height=`100%`,r.style.position=`relative`,r.style.overflow=`hidden`,this.iw=document.createElement(`td`),this.iw.style.padding=`0`,this.nw=document.createElement(`td`),this.nw.style.padding=`0`,this.tw.appendChild(r),this.wm=q(r,e({width:16,height:16})),this.wm.subscribeSuggestedBitmapSizeChanged(this.om);let i=this.wm.canvasElement;i.style.position=`absolute`,i.style.zIndex=`1`,i.style.left=`0`,i.style.top=`0`,this.Mm=q(r,e({width:16,height:16})),this.Mm.subscribeSuggestedBitmapSizeChanged(this.um);let a=this.Mm.canvasElement;a.style.position=`absolute`,a.style.zIndex=`2`,a.style.left=`0`,a.style.top=`0`,this._v=document.createElement(`tr`),this._v.appendChild(this.iw),this._v.appendChild(this.tw),this._v.appendChild(this.nw),this.sw(),this.sv=new Fn(this.Mm.canvasElement,this,{Pp:()=>this.Km===null&&!this.Gv.N().handleScroll.vertTouchDrag,kp:()=>this.Km===null&&!this.Gv.N().handleScroll.horzTouchDrag})}m(){this.Nm!==null&&this.Nm.m(),this.Fm!==null&&this.Fm.m(),this.Wm=null,this.Mm.unsubscribeSuggestedBitmapSizeChanged(this.um),J(this.Mm.canvasElement),this.Mm.dispose(),this.wm.unsubscribeSuggestedBitmapSizeChanged(this.om),J(this.wm.canvasElement),this.wm.dispose(),this.Jm!==null&&(this.Jm.mu().u(this),this.Jm.m()),this.sv.m()}yv(){return v(this.Jm)}ew(e){this.Jm!==null&&this.Jm.mu().u(this),this.Jm=e,this.Jm!==null&&this.Jm.mu().i(n.prototype.Qm.bind(this),this,!0),this.sw(),this.Gv.lv().indexOf(this)===this.Gv.lv().length-1?(this.Wm=this.Wm??new Un(this.tw,this.Gv),this.Wm.Pt()):(this.Wm?.Xv(),this.Wm=null)}_m(){return this.Gv}fv(){return this._v}sw(){if(this.Jm!==null&&(this.rw(),this.sn().Jn().length!==0)){if(this.Nm!==null){let e=this.Jm.X_();this.Nm.un(v(e))}if(this.Fm!==null){let e=this.Jm.J_();this.Fm.un(v(e))}}}hw(){this.Nm!==null&&this.Nm.Pt(),this.Fm!==null&&this.Fm.Pt()}F_(){return this.Jm===null?0:this.Jm.F_()}W_(e){this.Jm&&this.Jm.W_(e)}bp(e){if(!this.Jm)return;this.aw();let t=e.localX,n=e.localY;this.lw(t,n,e)}Fp(e){this.aw(),this.ow(),this.lw(e.localX,e.localY,e)}Sp(e){if(!this.Jm)return;this.aw();let t=e.localX,n=e.localY;this.lw(t,n,e)}Ap(e){this.Jm!==null&&(this.aw(),this.lw(e.localX,e.localY,e),this._w(e))}fp(e){this.Jm!==null&&this.uw(this.jm,e)}_p(e){this.fp(e)}Dp(e){this.aw(),this.cw(e),this.lw(e.localX,e.localY,e)}Ep(e){this.Jm!==null&&(this.aw(),this.Ym=!1,this.dw(e))}Bp(e){this.Jm!==null&&this._w(e)}Xp(e){if(this.Ym=!0,this.Km===null){let t={x:e.localX,y:e.localY};this.fw(t,t,e)}}Zp(e){this.Jm!==null&&(this.aw(),this.Jm.Qt().Rd(null),this.pw())}mw(){return this.$m}ww(){return this.jm}$p(){this.qm=1,this.sn().cs()}jp(e,t){if(!this.Gv.N().handleScale.pinch)return;let n=5*(t-this.qm);this.qm=t,this.sn().Wd(e._t,n)}Op(e){this.Ym=!1,this.Gm=this.Km!==null,this.ow();let t=this.sn().Vd();this.Km!==null&&t.It()&&(this.Zm={x:t.ni(),y:t.si()},this.Km={x:e.localX,y:e.localY})}Tp(e){if(this.Jm===null)return;let t=e.localX,n=e.localY;if(this.Km===null)this.cw(e);else{this.Gm=!1;let r=v(this.Zm),i=r.x+(t-this.Km.x),a=r.y+(n-this.Km.y);this.lw(i,a,e)}}Vp(e){this._m().N().trackingMode.exitMode===0&&(this.Gm=!0),this.Mw(),this.dw(e)}Qs(e,t){let n=this.Jm;return n===null?null:Zt(n,e,t)}gw(t,n){v(n===`left`?this.Nm:this.Fm).km(e({width:t,height:this.nm.height}))}pv(){return this.nm}km(e){t(this.nm,e)||(this.nm=e,this.lm=!0,this.wm.resizeCanvasElement(e),this.Mm.resizeCanvasElement(e),this.lm=!1,this.tw.style.width=e.width+`px`,this.tw.style.height=e.height+`px`)}bw(){let e=v(this.Jm);e.G_(e.X_()),e.G_(e.J_());for(let t of e.kl())if(e.Gs(t)){let n=t.Ft();n!==null&&e.G_(n),t.Nn()}for(let t of e.Mu())t.Nn()}vv(){return this.wm.bitmapSize}mv(e,t,n,r){let i=this.vv();if(i.width>0&&i.height>0&&(e.drawImage(this.wm.canvasElement,t,n),r)){let r=this.Mm.canvasElement;e!==null&&e.drawImage(r,t,n)}}Rm(e){if(e===0||this.Jm===null)return;e>1&&this.bw(),this.Nm!==null&&this.Nm.Rm(e),this.Fm!==null&&this.Fm.Rm(e);let t={colorSpace:this.Gv.N().layout.colorSpace};if(e!==1){this.wm.applySuggestedBitmapSize();let e=u(this.wm,t);e!==null&&(e.useBitmapCoordinateSpace((e=>{this.Im(e)})),this.Jm&&(this.Sw(e,Xn),this.xw(e),this.Sw(e,Zn),this.Sw(e,Qn)))}this.Mm.applySuggestedBitmapSize();let n=u(this.Mm,t);n!==null&&(n.useBitmapCoordinateSpace((({context:e,bitmapSize:t})=>{e.clearRect(0,0,t.width,t.height)})),this.Cw(n),this.Sw(n,$n),this.Sw(n,Qn))}yw(){return this.Nm}Pw(){return this.Fm}Bm(e,t){this.Sw(e,t)}Qm(){this.Jm!==null&&this.Jm.mu().u(this),this.Jm=null}_w(e){this.uw(this.$m,e)}uw(e,t){let n=t.localX,r=t.localY;e.v()&&e.p(this.sn().Et().Vc(n),{x:n,y:r},t)}Im({context:e,bitmapSize:t}){let{width:n,height:r}=t,i=this.sn(),a=i.$(),o=i.af();a===o?fe(e,0,0,n,r,o):he(e,0,0,n,r,a,o)}xw(e){let t=v(this.Jm),n=t.wu().wr().Tt(t);n!==null&&n.st(e,!1)}Cw(e){this.kw(e,Zn,Y,this.sn().Vd())}Sw(e,t){let n=v(this.Jm),r=t===Zn?this.Tw():null,i=r===null?null:this.Rw(r,n),a=n.Mu();if(i===null||r===null){let r=n._u();this.Dw(e,t,Wn,a,r),this.Dw(e,t,Y,a,r);return}let o=n.Dt(),s=e=>e===r?i.Za:void 0;this.Dw(e,t,Wn,a,o,s),this.Dw(e,t,Y,a,o,s),this.kw(e,t,Wn,r,i.qa),this.kw(e,t,Y,r,i.qa)}Dw(e,t,n,r,i,a){for(let i of r)this.kw(e,t,n,i);if(a!==void 0)for(let r of i)this.kw(e,t,n,r,a(r));else for(let r of i)this.kw(e,t,n,r)}Tw(){let e=v(this.Jm),t=e.Qt().cu()?.uu;if(!e.Qt().N().hoveredSeriesOnTop||t===void 0)return null;for(let n of e.Dt())if(n===t)return n;return null}Rw(e,t){let n=e.Ga?.(t)??null;return n===null||n.qa.length===0?null:n}kw(e,t,n,r,i){let a=v(this.Jm),o=a.Qt().cu(),s=o!==null&&o.uu===r,c=o!==null&&s&&o.bu!==void 0?o.bu.ie:void 0,l=t=>n(t,e,s,c);i===void 0?Gn(t,l,r,a):Kn(i,l,a)}rw(){if(this.Jm===null)return;let e=this.Gv,t=this.Jm.X_().N().visible,n=this.Jm.J_().N().visible;t||this.Nm===null||(this.iw.removeChild(this.Nm.fv()),this.Nm.m(),this.Nm=null),n||this.Fm===null||(this.nw.removeChild(this.Fm.fv()),this.Fm.m(),this.Fm=null);let r=e.Qt().Jd();t&&this.Nm===null&&(this.Nm=new Yn(this,e.N(),r,`left`),this.iw.appendChild(this.Nm.fv())),n&&this.Fm===null&&(this.Fm=new Yn(this,e.N(),r,`right`),this.nw.appendChild(this.Fm.fv()))}Iw(e){return e.Jp&&this.Ym||this.Km!==null}lw(e,t,n){e=Math.max(0,Math.min(e,this.nm.width-1)),t=Math.max(0,Math.min(t,this.nm.height-1)),this.sn().Kd(e,t,n,v(this.Jm))}pw(){this.sn().Zd()}Mw(){this.Gm&&(this.Km=null,this.pw())}fw(e,t,n){this.Km=e,this.Gm=!1,this.lw(t.x,t.y,n);let r=this.sn().Vd();this.Zm={x:r.ni(),y:r.si()}}sn(){return this.Gv.Qt()}dw(e){if(!this.Um)return;let t=this.sn(),n=this.yv();if(t.eu(n,n.kn()),this.Hm=null,this.Um=!1,t.jd(),this.Xm!==null){let e=performance.now(),n=t.Et();this.Xm.me(n.Oc(),e),this.Xm.Kc(e)||t.ps(this.Xm)}}aw(){this.Km=null}ow(){if(this.Jm){if(this.sn().cs(),document.activeElement!==document.body&&document.activeElement!==document.documentElement)v(document.activeElement).blur();else{let e=document.getSelection();e!==null&&e.removeAllRanges()}!this.Jm.kn().Zi()&&this.sn().Et().Zi()}}cw(e){if(this.Jm===null)return;let t=this.sn(),n=t.Et();if(n.Zi())return;let r=this.Gv.N(),i=r.handleScroll,a=r.kineticScroll;if((!i.pressedMouseMove||e.Jp)&&(!i.horzTouchDrag&&!i.vertTouchDrag||!e.Jp))return;let o=this.Jm.kn(),s=performance.now();if(this.Hm!==null||this.Iw(e)||(this.Hm={x:e.clientX,y:e.clientY,yf:s,Vw:e.localX,Bw:e.localY}),this.Hm!==null&&!this.Um&&(this.Hm.x!==e.clientX||this.Hm.y!==e.clientY)){if(e.Jp&&a.touch||!e.Jp&&a.mouse){let e=n.ml();this.Xm=new Hn(.2/e,7/e,.997,15/e),this.Xm.Uv(n.Oc(),this.Hm.yf)}else this.Xm=null;o.Zi()||t.nu(this.Jm,o,e.localY),t.Ud(e.localX),this.Um=!0}this.Um&&(o.Zi()||t.su(this.Jm,o,e.localY),t.$d(e.localX),this.Xm!==null&&this.Xm.Uv(n.Oc(),s))}},tr=class{constructor(t,n,r,i,a){this.xt=!0,this.nm=e({width:0,height:0}),this.om=()=>this.Rm(3),this.dm=t===`left`,this.bd=r.Jd,this.yn=n,this.Ew=i,this.Aw=a,this.uv=document.createElement(`div`),this.uv.style.width=`25px`,this.uv.style.height=`100%`,this.uv.style.overflow=`hidden`,this.wm=q(this.uv,e({width:16,height:16})),this.wm.subscribeSuggestedBitmapSizeChanged(this.om)}m(){this.wm.unsubscribeSuggestedBitmapSizeChanged(this.om),J(this.wm.canvasElement),this.wm.dispose()}fv(){return this.uv}pv(){return this.nm}km(e){t(this.nm,e)||(this.nm=e,this.wm.resizeCanvasElement(e),this.uv.style.width=`${e.width}px`,this.uv.style.height=`${e.height}px`,this.xt=!0)}Rm(e){if(e<3&&!this.xt||this.nm.width===0||this.nm.height===0)return;this.xt=!1,this.wm.applySuggestedBitmapSize();let t=u(this.wm,{colorSpace:this.yn.layout.colorSpace});t!==null&&t.useBitmapCoordinateSpace((e=>{this.Im(e),this.Vm(e)}))}vv(){return this.wm.bitmapSize}mv(e,t,n){let r=this.vv();r.width>0&&r.height>0&&e.drawImage(this.wm.canvasElement,t,n)}Vm({context:e,bitmapSize:t,horizontalPixelRatio:n,verticalPixelRatio:r}){if(!this.Ew())return;e.fillStyle=this.yn.timeScale.borderColor;let i=Math.floor(this.bd.N().S*n),a=Math.floor(this.bd.N().S*r),o=this.dm?t.width-i:0;e.fillRect(o,0,i,a)}Im({context:e,bitmapSize:t}){fe(e,0,0,t.width,t.height,this.Aw())}};function nr(e){return t=>t.tl?.(e)??[]}var rr=nr(`normal`),ir=nr(`top`),ar=nr(`bottom`),or=class{constructor(t,n){this.Lw=null,this.zw=null,this.M=null,this.Ow=!1,this.nm=e({width:0,height:0}),this.Nw=new b,this.rm=new P(5),this.lm=!1,this.om=()=>{this.lm||this.Gv.Qt().mr()},this.um=()=>{this.lm||this.Gv.Qt().mr()},this.Gv=t,this.Pu=n,this.yn=t.N().layout,this.jv=document.createElement(`tr`),this.Fw=document.createElement(`td`),this.Fw.style.padding=`0`,this.Ww=document.createElement(`td`),this.Ww.style.padding=`0`,this.uv=document.createElement(`td`),this.uv.style.height=`25px`,this.uv.style.padding=`0`,this.Hw=document.createElement(`div`),this.Hw.style.width=`100%`,this.Hw.style.height=`100%`,this.Hw.style.position=`relative`,this.Hw.style.overflow=`hidden`,this.uv.appendChild(this.Hw),this.wm=q(this.Hw,e({width:16,height:16})),this.wm.subscribeSuggestedBitmapSizeChanged(this.om);let r=this.wm.canvasElement;r.style.position=`absolute`,r.style.zIndex=`1`,r.style.left=`0`,r.style.top=`0`,this.Mm=q(this.Hw,e({width:16,height:16})),this.Mm.subscribeSuggestedBitmapSizeChanged(this.um);let i=this.Mm.canvasElement;i.style.position=`absolute`,i.style.zIndex=`2`,i.style.left=`0`,i.style.top=`0`,this.jv.appendChild(this.Fw),this.jv.appendChild(this.uv),this.jv.appendChild(this.Ww),this.Uw(),this.Gv.Qt().N_().i(this.Uw.bind(this),this),this.sv=new Fn(this.Mm.canvasElement,this,{Pp:()=>!0,kp:()=>!this.Gv.N().handleScroll.horzTouchDrag})}m(){this.sv.m(),this.Lw!==null&&this.Lw.m(),this.zw!==null&&this.zw.m(),this.Mm.unsubscribeSuggestedBitmapSizeChanged(this.um),J(this.Mm.canvasElement),this.Mm.dispose(),this.wm.unsubscribeSuggestedBitmapSizeChanged(this.om),J(this.wm.canvasElement),this.wm.dispose()}fv(){return this.jv}$w(){return this.Lw}jw(){return this.zw}Fp(e){if(this.Ow)return;this.Ow=!0;let t=this.Gv.Qt();!t.Et().Zi()&&this.Gv.N().handleScale.axisPressedMouseMove.time&&t.Fd(e.localX)}Op(e){this.Fp(e)}Wp(){let e=this.Gv.Qt();!e.Et().Zi()&&this.Ow&&(this.Ow=!1,this.Gv.N().handleScale.axisPressedMouseMove.time&&e.Yd())}Dp(e){let t=this.Gv.Qt();!t.Et().Zi()&&this.Gv.N().handleScale.axisPressedMouseMove.time&&t.qd(e.localX)}Tp(e){this.Dp(e)}Ep(){this.Ow=!1;let e=this.Gv.Qt();e.Et().Zi()&&!this.Gv.N().handleScale.axisPressedMouseMove.time||e.Yd()}Vp(){this.Ep()}fp(){this.Gv.N().handleScale.axisDoubleClickReset.time&&this.Gv.Qt().ws()}_p(){this.fp()}bp(){this.Gv.Qt().N().handleScale.axisPressedMouseMove.time&&this.zm(1)}Zp(){this.zm(0)}pv(){return this.nm}qw(){return this.Nw}Yw(n,r,i){t(this.nm,n)||(this.nm=n,this.lm=!0,this.wm.resizeCanvasElement(n),this.Mm.resizeCanvasElement(n),this.lm=!1,this.uv.style.width=`${n.width}px`,this.uv.style.height=`${n.height}px`,this.Nw.p(n)),this.Lw!==null&&this.Lw.km(e({width:r,height:n.height})),this.zw!==null&&this.zw.km(e({width:i,height:n.height}))}Kw(){let e=this.Gw();return Math.ceil(e.S+e.C+e.P+e.A+e.I+e.Zw)}Pt(){this.Gv.Qt().Et().zl()}vv(){return this.wm.bitmapSize}mv(e,t,n,r){let i=this.vv();if(i.width>0&&i.height>0&&(e.drawImage(this.wm.canvasElement,t,n),r)){let r=this.Mm.canvasElement;e.drawImage(r,t,n)}}Rm(e){if(e===0)return;let t={colorSpace:this.yn.colorSpace};if(e!==1){this.wm.applySuggestedBitmapSize();let n=u(this.wm,t);n!==null&&(n.useBitmapCoordinateSpace((e=>{this.Im(e),this.Vm(e),this.Xw(n,ar)})),this.Em(n),this.Xw(n,rr)),this.Lw!==null&&this.Lw.Rm(e),this.zw!==null&&this.zw.Rm(e)}this.Mm.applySuggestedBitmapSize();let n=u(this.Mm,t);n!==null&&(n.useBitmapCoordinateSpace((({context:e,bitmapSize:t})=>{e.clearRect(0,0,t.width,t.height)})),this.Jw([...this.Gv.Qt().Jn(),this.Gv.Qt().Vd()],n),this.Xw(n,ir))}Xw(e,t){let n=this.Gv.Qt().Jn();for(let r of n)Gn(t,(t=>Wn(t,e,!1,void 0)),r,void 0);for(let r of n)Gn(t,(t=>Y(t,e,!1,void 0)),r,void 0)}Im({context:e,bitmapSize:t}){fe(e,0,0,t.width,t.height,this.Gv.Qt().af())}Vm({context:e,bitmapSize:t,verticalPixelRatio:n}){if(this.Gv.N().timeScale.borderVisible){e.fillStyle=this.Qw();let r=Math.max(1,Math.floor(this.Gw().S*n));e.fillRect(0,0,t.width,r)}}Em(e){let t=this.Gv.Qt().Et(),n=t.zl();if(!n||n.length===0)return;let r=this.Pu.maxTickMarkWeight(n),i=this.Gw(),a=t.N();a.borderVisible&&a.ticksVisible&&e.useBitmapCoordinateSpace((({context:e,horizontalPixelRatio:t,verticalPixelRatio:r})=>{e.strokeStyle=this.Qw(),e.fillStyle=this.Qw();let a=Math.max(1,Math.floor(t)),o=Math.floor(.5*t);e.beginPath();let s=Math.round(i.C*r);for(let r=n.length;r--;){let i=Math.round(n[r].coord*t);e.rect(i-o,0,a,s)}e.fill()})),e.useMediaCoordinateSpace((({context:e})=>{let t=i.S+i.C+i.A+i.P/2;e.textAlign=`center`,e.textBaseline=`middle`,e.fillStyle=this.H(),e.font=this.ym();for(let i of n)if(i.weight<r){let n=i.needAlignCoordinate?this.tM(e,i.coord,i.label):i.coord;e.fillText(i.label,n,t)}this.Gv.N().timeScale.allowBoldLabels&&(e.font=this.iM());for(let i of n)if(i.weight>=r){let n=i.needAlignCoordinate?this.tM(e,i.coord,i.label):i.coord;e.fillText(i.label,n,t)}}))}tM(e,t,n){let r=this.rm.Ii(e,n),i=r/2,a=Math.floor(t-i)+.5;return a<0?t+=Math.abs(0-a):a+r>this.nm.width&&(t-=Math.abs(this.nm.width-(a+r))),t}Jw(e,t){let n=this.Gw();for(let r of e)for(let e of r.dn())e.Tt().st(t,n)}Qw(){return this.Gv.N().timeScale.borderColor}H(){return this.yn.textColor}F(){return this.yn.fontSize}ym(){return O(this.F(),this.yn.fontFamily)}iM(){return O(this.F(),this.yn.fontFamily,`bold`)}Gw(){this.M===null&&(this.M={S:1,L:NaN,A:NaN,I:NaN,tn:NaN,C:5,P:NaN,k:``,Qi:new P,Zw:0});let e=this.M,t=this.ym();if(e.k!==t){let n=this.F();e.P=n,e.k=t,e.A=3*n/12,e.I=3*n/12,e.tn=9*n/12,e.L=0,e.Zw=4*n/12,e.Qi.Os()}return this.M}zm(e){this.uv.style.cursor=e===1?`ew-resize`:`default`}Uw(){let e=this.Gv.Qt(),t=e.N();t.leftPriceScale.visible||this.Lw===null||(this.Fw.removeChild(this.Lw.fv()),this.Lw.m(),this.Lw=null),t.rightPriceScale.visible||this.zw===null||(this.Ww.removeChild(this.zw.fv()),this.zw.m(),this.zw=null);let n={Jd:this.Gv.Qt().Jd()},r=()=>t.leftPriceScale.borderVisible&&e.Et().N().borderVisible,i=()=>e.af();t.leftPriceScale.visible&&this.Lw===null&&(this.Lw=new tr(`left`,t,n,r,i),this.Fw.appendChild(this.Lw.fv())),t.rightPriceScale.visible&&this.zw===null&&(this.zw=new tr(`right`,t,n,r,i),this.Ww.appendChild(this.zw.fv()))}},sr=!!W&&!!navigator.userAgentData&&navigator.userAgentData.brands.some((e=>e.brand.includes(`Chromium`)))&&!!W&&(navigator?.userAgentData?.platform?navigator.userAgentData.platform===`Windows`:navigator.userAgent.toLowerCase().indexOf(`win`)>=0),cr=class{constructor(e,t,n){var r;this.nM=[],this.sM=[],this.eM=0,this.oo=0,this.k_=0,this.rM=0,this.hM=0,this.aM=null,this.lM=!1,this.$m=new b,this.jm=new b,this.wd=new b,this.oM=null,this._M=null,this.Kv=e,this.yn=t,this.Pu=n,this.jv=document.createElement(`div`),this.jv.classList.add(`tv-lightweight-charts`),this.jv.style.overflow=`hidden`,this.jv.style.direction=`ltr`,this.jv.style.width=`100%`,this.jv.style.height=`100%`,(r=this.jv).style.userSelect=`none`,r.style.webkitUserSelect=`none`,r.style.msUserSelect=`none`,r.style.MozUserSelect=`none`,r.style.webkitTapHighlightColor=`transparent`,this.uM=document.createElement(`table`),this.uM.setAttribute(`cellspacing`,`0`),this.jv.appendChild(this.uM),this.cM=this.dM.bind(this),lr(this.yn)&&this.fM(!0),this.sn=new un(this.gd.bind(this),this.yn,n),this.Qt().Bd().i(this.pM.bind(this),this),this.vM=new or(this,this.Pu),this.uM.appendChild(this.vM.fv());let i=t.autoSize&&this.mM(),a=this.yn.width,o=this.yn.height;if(i||a===0||o===0){let t=e.getBoundingClientRect();a||=t.width,o||=t.height}this.wM(a,o),this.MM(),e.appendChild(this.jv),this.gM(),this.sn.Et().Jc().i(this.sn.ka.bind(this.sn),this),this.sn.N_().i(this.sn.ka.bind(this.sn),this)}Qt(){return this.sn}N(){return this.yn}lv(){return this.nM}bM(){return this.vM}m(){this.fM(!1),this.eM!==0&&window.cancelAnimationFrame(this.eM),this.sn.Bd().u(this),this.sn.Et().Jc().u(this),this.sn.N_().u(this),this.sn.m();for(let e of this.nM)this.uM.removeChild(e.fv()),e.mw().u(this),e.ww().u(this),e.m();this.nM=[];for(let e of this.sM)this.SM(e);this.sM=[],v(this.vM).m(),this.jv.parentElement!==null&&this.jv.parentElement.removeChild(this.jv),this.wd.m(),this.$m.m(),this.jm.m(),this.xM()}wM(t,n,r=!1){if(this.oo===n&&this.k_===t)return;let i=function(t){let n=Math.floor(t.width),r=Math.floor(t.height);return e({width:n-n%2,height:r-r%2})}(e({width:t,height:n}));this.oo=i.height,this.k_=i.width;let a=this.oo+`px`,o=this.k_+`px`;if(this.CM()||(v(this.jv).style.height=a,v(this.jv).style.width=o),this.uM.style.height=a,this.uM.style.width=o,r){this.eM!==0&&(window.cancelAnimationFrame(this.eM),this.eM=0),this.lM=!1;let e=M.ys();this.aM!==null&&(e.Ss(this.aM),this.aM=null),this.yM(e,performance.now())}else this.sn.ka()}Rm(e){e===void 0&&(e=M.ys());for(let t=0;t<this.nM.length;t++)this.nM[t].Rm(e._s(t).rs);this.yn.timeScale.visible&&this.vM.Rm(e.ls())}vr(e){let t=lr(this.yn);this.sn.vr(e);let n=lr(this.yn);n!==t&&this.fM(n),e.layout?.panes&&this.PM(),this.gM(),this.kM(e)}mw(){return this.$m}ww(){return this.jm}Bd(){return this.wd}TM(e=!1){this.aM!==null&&(this.yM(this.aM,performance.now()),this.aM=null);let t=this.RM(null),n=document.createElement(`canvas`);n.width=t.width,n.height=t.height;let r=v(n.getContext(`2d`));return this.RM(r,e),n}DM(e){return e===`left`&&!this.IM()||e===`right`&&!this.VM()||this.nM.length===0?0:v(e===`left`?this.nM[0].yw():this.nM[0].Pw()).Tm()}CM(){return this.yn.autoSize&&this.oM!==null}Mv(){return this.jv}BM(e){this._M=e,this._M?this.Mv().style.setProperty(`cursor`,e):this.Mv().style.removeProperty(`cursor`)}EM(){return this._M}AM(e){return _(this.nM[e]).pv()}PM(){this.sM.forEach((e=>{e.Pt()}))}kM(e){(e.autoSize!==void 0||!this.oM||e.width===void 0&&e.height===void 0)&&(e.autoSize&&!this.oM&&this.mM(),!1===e.autoSize&&this.oM!==null&&this.xM(),e.autoSize||e.width===void 0&&e.height===void 0||this.wM(e.width||this.k_,e.height||this.oo))}RM(t,n){let r=0,i=0,a=this.nM[0],o=(e,r)=>{let i=0;for(let a=0;a<this.nM.length;a++){let o=this.nM[a],s=v(e===`left`?o.yw():o.Pw()),c=s.vv();if(t!==null&&s.mv(t,r,i,n),i+=c.height,a<this.nM.length-1){let e=this.sM[a],n=e.vv();t!==null&&e.mv(t,r,i),i+=n.height}}};this.IM()&&(o(`left`,0),r+=v(a.yw()).vv().width);for(let e=0;e<this.nM.length;e++){let a=this.nM[e],o=a.vv();if(t!==null&&a.mv(t,r,i,n),i+=o.height,e<this.nM.length-1){let n=this.sM[e],a=n.vv();t!==null&&n.mv(t,r,i),i+=a.height}}r+=a.vv().width,this.VM()&&(o(`right`,r),r+=v(a.Pw()).vv().width);let s=(e,n,r)=>{v(e===`left`?this.vM.$w():this.vM.jw()).mv(v(t),n,r)};if(this.yn.timeScale.visible){let e=this.vM.vv();if(t!==null){let r=0;this.IM()&&(s(`left`,r,i),r=v(a.yw()).vv().width),this.vM.mv(t,r,i,n),r+=e.width,this.VM()&&s(`right`,r,i)}i+=e.height}return e({width:r,height:i})}LM(){let t=0,n=0,r=0;for(let e of this.nM)this.IM()&&(n=Math.max(n,v(e.yw()).Cm(),this.yn.leftPriceScale.minimumWidth)),this.VM()&&(r=Math.max(r,v(e.Pw()).Cm(),this.yn.rightPriceScale.minimumWidth)),t+=e.F_();n=Nn(n),r=Nn(r);let i=this.k_,a=this.oo,o=Math.max(i-n-r,0),s=1*this.sM.length,c=this.yn.timeScale.visible,l=c?Math.max(this.vM.Kw(),this.yn.timeScale.minimumHeight):0;var u;l=(u=l)+u%2;let d=s+l,f=a<d?0:a-d,p=f/t,m=0,h=window.devicePixelRatio||1;for(let t=0;t<this.nM.length;++t){let i=this.nM[t];i.ew(this.sn.Gn()[t]);let a=0,s=0;s=t===this.nM.length-1?Math.ceil((f-m)*h)/h:Math.round(i.F_()*p*h)/h,a=Math.max(s,2),m+=a,i.km(e({width:o,height:a})),this.IM()&&i.gw(n,`left`),this.VM()&&i.gw(r,`right`),i.yv()&&this.sn.Ed(i.yv(),a)}this.vM.Yw(e({width:c?o:0,height:l}),c?n:0,c?r:0),this.sn.H_(o),this.rM!==n&&(this.rM=n),this.hM!==r&&(this.hM=r)}fM(e){e?this.jv.addEventListener(`wheel`,this.cM,{passive:!1}):this.jv.removeEventListener(`wheel`,this.cM)}zM(e){switch(e.deltaMode){case e.DOM_DELTA_PAGE:return 120;case e.DOM_DELTA_LINE:return 32}return sr?1/window.devicePixelRatio:1}dM(e){if(!(e.deltaX!==0&&this.yn.handleScroll.mouseWheel||e.deltaY!==0&&this.yn.handleScale.mouseWheel))return;let t=this.zM(e),n=t*e.deltaX/100,r=-t*e.deltaY/100;if(e.cancelable&&e.preventDefault(),r!==0&&this.yn.handleScale.mouseWheel){let t=Math.sign(r)*Math.min(1,Math.abs(r)),n=e.clientX-this.jv.getBoundingClientRect().left;this.Qt().Wd(n,t)}n!==0&&this.yn.handleScroll.mouseWheel&&this.Qt().Hd(-80*n)}yM(e,t){let n=e.ls();n===3&&this.OM(),n!==3&&n!==2||(this.NM(e),this.FM(e,t),this.vM.Pt(),this.nM.forEach((e=>{e.hw()})),this.aM?.ls()===3&&(this.aM.Ss(e),this.OM(),this.NM(this.aM),this.FM(this.aM,t),e=this.aM,this.aM=null)),this.Rm(e)}FM(e,t){for(let n of e.bs())this.xs(n,t)}NM(e){let t=this.sn.Gn();for(let n=0;n<t.length;n++)e._s(n).hs&&t[n].lu()}xs(e,t){let n=this.sn.Et();switch(e.ds){case 0:n.td();break;case 1:n.nd(e.Wt);break;case 2:n.Ms(e.Wt);break;case 3:n.gs(e.Wt);break;case 4:n.Wc();break;case 5:e.Wt.Kc(t)||n.gs(e.Wt.Gc(t))}}gd(e){this.aM===null?this.aM=e:this.aM.Ss(e),this.lM||(this.lM=!0,this.eM=window.requestAnimationFrame((e=>{if(this.lM=!1,this.eM=0,this.aM!==null){let t=this.aM;this.aM=null,this.yM(t,e);for(let n of t.bs())if(n.ds===5&&!n.Wt.Kc(e)){this.Qt().ps(n.Wt);break}}})))}OM(){this.MM()}SM(e){this.uM.removeChild(e.fv()),e.m()}MM(){let e=this.sn.Gn(),t=e.length,n=this.nM.length;for(let e=t;e<n;e++){let e=_(this.nM.pop());this.uM.removeChild(e.fv()),e.mw().u(this),e.ww().u(this),e.m();let t=this.sM.pop();t!==void 0&&this.SM(t)}for(let r=n;r<t;r++){let t=new er(this,e[r]);if(t.mw().i(this.WM.bind(this,t),this),t.ww().i(this.HM.bind(this,t),this),this.nM.push(t),r>0){let e=new zn(this,r-1,r);this.sM.push(e),this.uM.insertBefore(e.fv(),this.vM.fv())}this.uM.insertBefore(t.fv(),this.vM.fv())}for(let n=0;n<t;n++){let t=e[n],r=this.nM[n];r.yv()===t?r.sw():r.ew(t)}this.gM(),this.LM()}UM(e,t,n,r){let i=new Map;e!==null&&this.sn.Jn().forEach((t=>{let n=t.Un().Hn(e);n!==null&&i.set(t,n)}));let a;if(e!==null){let t=this.sn.Et().en(e)?.originalTime;t!==void 0&&(a=t)}let o=this.Qt().cu(),s=this.$M(r),c=function(e,t){let n=e!==null&&e.uu instanceof xt?e.uu:void 0,r=e?.bu?.te,i=t!==void 0&&t!==-1?t:void 0;return e===null||e.ee===void 0?{jM:n,qM:r}:{jM:n,qM:r,YM:{ds:e.ee,KM:(a=e.uu,o=e.ee,a instanceof Wt?`pane-primitive`:o===`marker`||o===`primitive`?`series-primitive`:`series`),GM:Mn(e.ee,r),Y_:n,ZM:r,XM:i}};var a,o}(o,s);return{Qr:a,$n:e??void 0,JM:t??void 0,XM:s===-1?void 0:s,jM:c.jM,QM:i,qM:c.qM,YM:c.YM,tg:n??void 0}}$M(e){let t=-1;if(e)t=this.nM.indexOf(e);else{let e=this.Qt().Vd().Kn();e!==null&&(t=this.Qt().Gn().indexOf(e))}return t}WM(e,t,n,r){this.$m.p((()=>this.UM(t,n,r,e)))}HM(e,t,n,r){this.jm.p((()=>this.UM(t,n,r,e)))}pM(e,t,n){this.BM(this.Qt().cu()?.gu??null),this.wd.p((()=>this.UM(e,t,n)))}gM(){let e=this.yn.timeScale.visible?``:`none`;this.vM.fv().style.display=e}IM(){return this.nM[0].yv().X_().N().visible}VM(){return this.nM[0].yv().J_().N().visible}mM(){return`ResizeObserver`in window&&(this.oM=new ResizeObserver((e=>{let t=e[e.length-1];if(!t)return;let n=t.contentRect.width,r=t.contentRect.height;this.wM(n,r,!0)})),this.oM.observe(this.Kv,{box:`border-box`}),!0)}xM(){this.oM!==null&&this.oM.disconnect(),this.oM=null}};function lr(e){return!!(e.handleScroll.mouseWheel||e.handleScale.mouseWheel)}function ur(e){return e.open===void 0&&e.value===void 0}function dr(e){return function(e){return e.open!==void 0}(e)||function(e){return e.value!==void 0}(e)}function fr(e,t,n,r){let i=n.value,a={$n:t,wt:e,Wt:[i,i,i,i],Qr:r};return n.color!==void 0&&(a.R=n.color),a}function pr(e,t,n,r){let i=n.value,a={$n:t,wt:e,Wt:[i,i,i,i],Qr:r};return n.lineColor!==void 0&&(a.vt=n.lineColor),n.topColor!==void 0&&(a.ah=n.topColor),n.bottomColor!==void 0&&(a.oh=n.bottomColor),a}function mr(e,t,n,r){let i=n.value,a={$n:t,wt:e,Wt:[i,i,i,i],Qr:r};return n.topLineColor!==void 0&&(a._h=n.topLineColor),n.bottomLineColor!==void 0&&(a.uh=n.bottomLineColor),n.topFillColor1!==void 0&&(a.dh=n.topFillColor1),n.topFillColor2!==void 0&&(a.fh=n.topFillColor2),n.bottomFillColor1!==void 0&&(a.ph=n.bottomFillColor1),n.bottomFillColor2!==void 0&&(a.mh=n.bottomFillColor2),a}function hr(e,t,n,r){let i={$n:t,wt:e,Wt:[n.open,n.high,n.low,n.close],Qr:r};return n.color!==void 0&&(i.R=n.color),i}function gr(e,t,n,r){let i={$n:t,wt:e,Wt:[n.open,n.high,n.low,n.close],Qr:r};return n.color!==void 0&&(i.R=n.color),n.borderColor!==void 0&&(i.Ht=n.borderColor),n.wickColor!==void 0&&(i.hh=n.wickColor),i}function _r(e,t,n,r,i){let a=_(i)(n),o=Math.max(...a),s=Math.min(...a),c=a[a.length-1],l=[c,o,s,c],{time:u,color:d,...f}=n;return{$n:t,wt:e,Wt:l,Qr:r,ue:f,R:d}}function X(e){return e.Wt!==void 0}function vr(e,t){return t.customValues!==void 0&&(e.ig=t.customValues),e}function Z(e){return(t,n,r,i,a,o)=>function(e,t){return t?t(e):ur(e)}(r,o)?vr({wt:t,$n:n,Qr:i},r):vr(e(t,n,r,i,a),r)}function yr(e){return{Candlestick:Z(gr),Bar:Z(hr),Area:Z(pr),Baseline:Z(mr),Histogram:Z(fr),Line:Z(fr),Custom:Z(_r)}[e]}function br(e){return{$n:0,ng:new Map,Oa:e}}function xr(e,t){if(e!==void 0&&e.length!==0)return{sg:t.key(e[0].wt),eg:t.key(e[e.length-1].wt)}}function Sr(e){let t;return e.forEach((e=>{t===void 0&&(t=e.Qr)})),_(t)}var Cr=class{constructor(e){this.rg=new Map,this.hg=new Map,this.ag=new Map,this.lg=[],this.Pu=e}m(){this.rg.clear(),this.hg.clear(),this.ag.clear(),this.lg=[]}og(e,t){let n=this.rg.size!==0,r=!1,i=this.hg.get(e);if(i!==void 0){if(this.hg.size===1)n=!1,r=!0,this.rg.clear();else for(let t of this.lg)t.pointData.ng.delete(e)&&(r=!0)}let a=[];if(t.length!==0){let n=t.map((e=>e.time)),i=this.Pu.createConverterToInternalObj(t),o=yr(e.bh()),s=e.ul(),c=e.cl();a=t.map(((t,a)=>{let l=i(t.time),u=this.Pu.key(l),d=this.rg.get(u);d===void 0&&(d=br(l),this.rg.set(u,d),r=!0);let f=o(l,d.$n,t,n[a],s,c);return d.ng.set(e,f),f}))}n&&this._g(),this.ug(e,a);let o=-1;if(r){let e=[];this.rg.forEach((t=>{e.push({timeWeight:0,time:t.Oa,pointData:t,originalTime:Sr(t.ng)})})),e.sort(((e,t)=>this.Pu.key(e.time)-this.Pu.key(t.time))),o=this.cg(e)}return this.dg(e,o,function(e,t,n){let r=xr(e,n),i=xr(t,n);if(r!==void 0&&i!==void 0)return{fg:!1,Va:r.eg>=i.eg&&r.sg>=i.sg}}(this.hg.get(e),i,this.Pu))}if(e){return this.og(e,[])}pg(e,t,n){if(n&&e.Fa())throw Error(`Historical updates are not supported when conflation is enabled. Conflation requires data to be processed in order.`);let r=t;(function(e){e.Qr===void 0&&(e.Qr=e.time)})(r),this.Pu.preprocessData(t);let i=this.Pu.createConverterToInternalObj([t])(t.time),a=this.ag.get(e);if(!n&&a!==void 0&&this.Pu.key(i)<this.Pu.key(a))throw Error(`Cannot update oldest data, last time=${a}, new time=${i}`);let o=this.rg.get(this.Pu.key(i));if(n&&o===void 0)throw Error(`Cannot update non-existing data point when historicalUpdate is true`);let s=o===void 0;o===void 0&&(o=br(i),this.rg.set(this.Pu.key(i),o));let c=yr(e.bh()),l=e.ul(),u=e.cl(),d=c(i,o.$n,t,r.Qr,l,u),f=!n&&!s&&a!==void 0&&this.Pu.key(i)===this.Pu.key(a);o.ng.set(e,d),n?this.vg(e,d,o.$n):(f&&e.Fa()&&X(d)&&e.Rr(d),this.mg(e,d));let p={Va:X(d),fg:n};if(!s)return this.dg(e,-1,p);let m={timeWeight:0,time:o.Oa,pointData:o,originalTime:Sr(o.ng)},h=I(this.lg,this.Pu.key(m.time),((e,t)=>this.Pu.key(e.time)<t));this.lg.splice(h,0,m);for(let e=h;e<this.lg.length;++e)wr(this.lg[e].pointData,e);return this.Pu.fillWeightsForPoints(this.lg,h),this.dg(e,h,p)}wg(e,t){let n=this.hg.get(e);if(n===void 0||t<=0)return[[],this.Mg()];t=Math.min(t,n.length);let r=n.splice(-t).reverse();n.length===0?this.ag.delete(e):this.ag.set(e,n[n.length-1].wt);for(let t of r){let n=this.rg.get(this.Pu.key(t.wt));if(n&&(n.ng.delete(e),n.ng.size===0)){this.rg.delete(this.Pu.key(n.Oa)),this.lg.splice(n.$n,1);for(let e=n.$n;e<this.lg.length;++e)wr(this.lg[e].pointData,e)}}return[r,this.dg(e,this.lg.length-1,{fg:!1,Va:!1})]}mg(e,t){let n=this.hg.get(e);n===void 0&&(n=[],this.hg.set(e,n));let r=n.length===0?null:n[n.length-1];r===null||this.Pu.key(t.wt)>this.Pu.key(r.wt)?X(t)&&n.push(t):X(t)?n[n.length-1]=t:n.splice(-1,1),this.ag.set(e,t.wt)}vg(e,t,n){let r=this.hg.get(e);if(r===void 0)return;let i=I(r,n,((e,t)=>e.$n<t));X(t)?r[i]=t:r.splice(i,1)}ug(e,t){t.length===0?(this.hg.delete(e),this.ag.delete(e)):(this.hg.set(e,t.filter(X)),this.ag.set(e,t[t.length-1].wt))}_g(){for(let e of this.lg)e.pointData.ng.size===0&&this.rg.delete(this.Pu.key(e.time))}cg(e){let t=-1;for(let n=0;n<this.lg.length&&n<e.length;++n){let r=this.lg[n],i=e[n];if(this.Pu.key(r.time)!==this.Pu.key(i.time)){t=n;break}i.timeWeight=r.timeWeight,wr(i.pointData,n)}if(t===-1&&this.lg.length!==e.length&&(t=Math.min(this.lg.length,e.length)),t===-1)return-1;for(let n=t;n<e.length;++n)wr(e[n].pointData,n);return this.Pu.fillWeightsForPoints(e,t),this.lg=e,t}gg(){if(this.hg.size===0)return null;let e=0;return this.hg.forEach((t=>{t.length!==0&&(e=Math.max(e,t[t.length-1].$n))})),e}dg(e,t,n){let r=this.Mg();if(t!==-1)this.hg.forEach(((t,i)=>{r.Y_.set(i,{ue:t,bg:i===e?n:void 0})})),this.hg.has(e)||r.Y_.set(e,{ue:[],bg:n}),r.Et.Sg=this.lg,r.Et.xg=t;else{let t=this.hg.get(e);r.Y_.set(e,{ue:t||[],bg:n})}return r}Mg(){return{Y_:new Map,Et:{Dc:this.gg()}}}};function wr(e,t){e.$n=t,e.ng.forEach((e=>{e.$n=t}))}function Tr(e,t){return e._t<t}function Er(e,t){return t<e._t}function Dr(e,t,n,r){return I(e,t,Tr,n,r)}function Or(e,t,n,r){return et(e,t,Er,n,r)}function kr(e,t,n){return{ne:e,se:t,ee:n}}function Ar(e,t,n,r){return e>=t-r&&e<=n+r}function Q(e,t,n,r,i,a){let o=i-n,s=a-r;if(o===0&&s===0)return Math.hypot(e-n,t-r);let c=((e-n)*o+(t-r)*s)/(o*o+s*s),l=Math.max(0,Math.min(1,c)),u=n+o*l,d=r+s*l;return Math.hypot(e-u,t-d)}var jr=[0,0];function Mr(e,t,n){return t===void 0||t.wt!==e.wt-1?e._t-n/2:(t._t+e._t)/2}function Nr(e,t,n){return t===void 0||t.wt!==e.wt+1?e._t+n/2:(e._t+t._t)/2}function Pr(e,t,n,r,i,a,o){if(t===null||t.from>=t.to||e.length===0)return null;let s=i/2+a,c=Dr(e,n-s,t.from,t.to),l=Or(e,n+s,c,t.to);if(c>=l)return null;let u=1/0;for(let s=c;s<l;s++){let c=e[s],l=s>t.from?e[s-1]:void 0,d=s<t.to-1?e[s+1]:void 0,f=Mr(c,l,i)-a,p=Nr(c,d,i)+a;if(n<f||n>p)continue;o(c,jr);let m=jr[0],h=jr[1],g=Math.min(m,h),_=Math.max(m,h),v=g-a,y=_+a;if(r>=g&&r<=_)u=Math.min(u,0);else if(r>=v&&r<=y){let e=Math.min(Math.abs(r-g),Math.abs(_-r));u=Math.min(u,e)}}return Number.isFinite(u)?kr(u,0,`series-range`):null}function Fr(e,t){return e.wt<t}function Ir(e,t){return t<e.wt}function Lr(e,t,n){let r=t.Na(),i=t.bi(),a=I(e,r,Fr),o=et(e,i,Ir);if(!n)return{from:a,to:o};let s=a,c=o;return a>0&&a<e.length&&e[a].wt>=r&&(s=a-1),o>0&&o<e.length&&e[o-1].wt<=i&&(c=o+1),{from:s,to:c}}var Rr=class{constructor(e,t,n){this.Cg=!0,this.yg=!0,this.Pg=!0,this.kg=[],this.Tg=null,this.Rg=-1,this.ae=e,this.le=t,this.Dg=n}Pt(e){this.Cg=!0,e===`data`&&(this.yg=!0),e===`options`&&(this.Pg=!0)}Tt(){return this.ae.It()?(this.Ig(),this.Tg===null?null:this.Vg):null}Qs(e,t){return this.ae.It()?(this.Ig(),this.Tg===null?null:this.Bg(e,t)):null}Bg(e,t){return null}Eg(){this.kg=this.kg.map((e=>({...e,...this.ae.Sa().Sh(e.wt)})))}Ag(){this.Tg=null}Ig(){let e=this.le.Et(),t=e.N().enableConflation?e.sd():0;t!==this.Rg&&(this.yg=!0,this.Rg=t),this.yg&&=(this.Lg(),!1),this.Pg&&=(this.Eg(),!1),this.Cg&&=(this.zg(),!1)}zg(){let e=this.ae.Ft(),t=this.le.Et();if(this.Ag(),t.Zi()||e.Zi())return;let n=t.Ee();if(n===null||this.ae.Un().Th()===0)return;let r=this.ae.Lt();r!==null&&(this.Tg=Lr(this.kg,n,this.Dg),this.Og(e,t,r.Wt),this.Ng())}},zr=class{constructor(e,t){this.Fg=e,this.Ki=t}st(e,t,n){this.Fg.draw(e,this.Ki,t,n)}};function Br(e){switch(e){case`point`:return 2;case`range`:return 0;default:return 1}}var Vr=class extends Rr{constructor(e,t,n){super(e,t,!1),this.Yh=n,this.Fg=this.Yh.renderer(),this.Vg=new zr(this.Fg,(e=>this.Wg(e)))}get ga(){return this.Yh.conflationReducer}Ha(e){return this.Yh.priceValueBuilder(e)}dl(e){return this.Yh.isWhitespace(e)}Bg(e,t){let n=this.Fg.hitTest?.(e,t,(e=>this.Wg(e)));if(n!=null)return{ne:(r=n).distance,se:Br(r.type),ee:`custom`,gu:r.cursorStyle,te:r.objectId,ie:r.hitTestData};var r;let i=Pr(this.kg,this.Tg,e,t,this.le.Et().ml(),this.ae.N().hitTestTolerance,((e,t)=>{let n=e.Hg,r=NaN,i=NaN;if(n!==void 0&&!this.Yh.isWhitespace(n))for(let e of this.Yh.priceValueBuilder(n)){let t=this.Wg(e);t!==null&&(r=Number.isNaN(r)?t:Math.min(r,t),i=Number.isNaN(i)?t:Math.max(i,t))}t[0]=r,t[1]=i}));return i===null?null:{...i,ee:`custom`}}Lg(){let e=this.ae.Sa();this.kg=this.ae.Ua().Bh().map((t=>({wt:t.$n,_t:NaN,...e.Sh(t.$n),Hg:t.ue})))}Og(e,t){t.Ic(this.kg,D(this.Tg))}Ng(){this.Yh.update({bars:this.kg.map(Hr),barSpacing:this.le.Et().ml(),visibleRange:this.Tg,conflationFactor:this.le.Et().sd()},this.ae.N())}Wg(e){let t=this.ae.Lt();return t===null?null:this.ae.Ft().Nt(e,t.Wt)}};function Hr(e){return{x:e._t,time:e.wt,originalData:e.Hg,barColor:e.sh}}var Ur={color:`#2196f3`},Wr=(e,t,n)=>new Vr(e,t,y(n));function Gr(e){let t={value:e.Wt[3],time:e.Qr};return e.ig!==void 0&&(t.customValues=e.ig),t}function Kr(e){let t=Gr(e);return e.R!==void 0&&(t.color=e.R),t}function qr(e){let t=Gr(e);return e.vt!==void 0&&(t.lineColor=e.vt),e.ah!==void 0&&(t.topColor=e.ah),e.oh!==void 0&&(t.bottomColor=e.oh),t}function Jr(e){let t=Gr(e);return e._h!==void 0&&(t.topLineColor=e._h),e.uh!==void 0&&(t.bottomLineColor=e.uh),e.dh!==void 0&&(t.topFillColor1=e.dh),e.fh!==void 0&&(t.topFillColor2=e.fh),e.ph!==void 0&&(t.bottomFillColor1=e.ph),e.mh!==void 0&&(t.bottomFillColor2=e.mh),t}function Yr(e){let t={open:e.Wt[0],high:e.Wt[1],low:e.Wt[2],close:e.Wt[3],time:e.Qr};return e.ig!==void 0&&(t.customValues=e.ig),t}function Xr(e){let t=Yr(e);return e.R!==void 0&&(t.color=e.R),t}function Zr(e){let t=Yr(e),{R:n,Ht:r,hh:i}=e;return n!==void 0&&(t.color=n),r!==void 0&&(t.borderColor=r),i!==void 0&&(t.wickColor=i),t}function Qr(e){return{Area:qr,Line:Kr,Baseline:Jr,Histogram:Kr,Bar:Xr,Candlestick:Zr,Custom:$r}[e]}function $r(e){let t=e.Qr;return{...e.ue,time:t}}var ei={vertLine:{color:`#9598A1`,width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:`#131722`},horzLine:{color:`#9598A1`,width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:`#131722`},mode:1,doNotSnapToHiddenSeriesIndices:!1},ti={vertLines:{color:`#D6DCDE`,style:0,visible:!0},horzLines:{color:`#D6DCDE`,style:0,visible:!0}},ni={background:{type:`solid`,color:`#FFFFFF`},textColor:`#191919`,fontSize:12,fontFamily:te,panes:{enableResize:!0,separatorColor:`#E0E3EB`,separatorHoverColor:`rgba(178, 181, 189, 0.2)`},attributionLogo:!0,colorSpace:`srgb`,colorParsers:[]},ri={autoScale:!0,mode:0,invertScale:!1,alignLabels:!0,borderVisible:!0,borderColor:`#2B2B43`,entireTextOnly:!1,visible:!1,ticksVisible:!1,scaleMargins:{bottom:.1,top:.2},minimumWidth:0,ensureEdgeTickMarksVisible:!1,tickMarkDensity:2.5},ii={rightOffset:0,barSpacing:6,minBarSpacing:.5,maxBarSpacing:0,fixLeftEdge:!1,fixRightEdge:!1,lockVisibleTimeRangeOnResize:!1,rightBarStaysOnScroll:!1,borderVisible:!0,borderColor:`#2B2B43`,visible:!0,timeVisible:!1,secondsVisible:!0,shiftVisibleRangeOnNewBar:!0,allowShiftVisibleRangeOnWhitespaceReplacement:!1,ticksVisible:!1,uniformDistribution:!1,minimumHeight:0,allowBoldLabels:!0,ignoreWhitespaceIndices:!1,enableConflation:!1,conflationThresholdFactor:1,precomputeConflationOnInit:!1,precomputeConflationPriority:`background`};function ai(){return{addDefaultPane:!0,hoveredSeriesOnTop:!0,width:0,height:0,autoSize:!1,layout:ni,crosshair:ei,grid:ti,overlayPriceScales:{...ri},leftPriceScale:{...ri,visible:!1},rightPriceScale:{...ri,visible:!0},defaultVisiblePriceScaleId:`right`,timeScale:ii,localization:{locale:W?navigator.language:``,dateFormat:`dd MMM 'yy`},handleScroll:{mouseWheel:!0,pressedMouseMove:!0,horzTouchDrag:!0,vertTouchDrag:!0},handleScale:{axisPressedMouseMove:{time:!0,price:!0},axisDoubleClickReset:{time:!0,price:!0},mouseWheel:!0,pinch:!0},kineticScroll:{mouse:!1,touch:!0},trackingMode:{exitMode:1}}}var oi=class{constructor(e,t,n){this.hv=e,this.Ug=t,this.$g=n??0}applyOptions(e){this.hv.Qt().Dd(this.Ug,e,this.$g)}options(){return this.Ki().N()}width(){return Te(this.Ug)?this.hv.DM(this.Ug):0}setVisibleRange(e){this.setAutoScale(!1),this.Ki().Go(new F(e.from,e.to))}getVisibleRange(){let e,t,n=this.Ki().ar();if(n===null)return null;if(this.Ki().ho()){let r=this.Ki().S_(),i=dn(r);n=H(n,this.Ki().lo()),e=Number((Math.round(n.Je()/r)*r).toFixed(i)),t=Number((Math.round(n.Qe()/r)*r).toFixed(i))}else e=n.Je(),t=n.Qe();return{from:e,to:t}}setAutoScale(e){this.applyOptions({autoScale:e})}Ki(){return v(this.hv.Qt().Id(this.Ug,this.$g)).Ft}},si=class{constructor(e,t,n,r){this.hv=e,this.yt=n,this.jg=t,this.qg=r}getHeight(){return this.yt.$t()}setHeight(e){let t=this.hv.Qt(),n=t._f(this.yt);t.Ld(n,e)}getStretchFactor(){return this.yt.F_()}setStretchFactor(e){this.yt.W_(e),this.hv.Qt().ka()}paneIndex(){return this.hv.Qt()._f(this.yt)}moveTo(e){let t=this.paneIndex();t!==e&&(g(e>=0&&e<this.hv.lv().length,`Invalid pane index`),this.hv.Qt().Od(t,e))}getSeries(){return this.yt.Y_().map((e=>this.jg(e)))??[]}getHTMLElement(){let e=this.hv.lv();return e&&e.length!==0&&e[this.paneIndex()]?e[this.paneIndex()].fv():null}attachPrimitive(e){this.yt.ol(e),e.attached&&e.attached({chart:this.qg,requestUpdate:()=>this.yt.Qt().ka()})}detachPrimitive(e){this.yt._l(e)}priceScale(e){if(this.yt.O_(e)===null)throw Error(`Cannot find price scale with id: ${e}`);return new oi(this.hv,e,this.paneIndex())}setPreserveEmptyPane(e){this.yt.j_(e)}preserveEmptyPane(){return this.yt.q_()}addCustomSeries(e,t={},n=0){return this.qg.addCustomSeries(e,t,n)}addSeries(e,t={}){return this.qg.addSeries(e,t,this.paneIndex())}},ci={color:`#FF0000`,price:0,lineStyle:2,lineWidth:1,lineVisible:!0,axisLabelVisible:!0,title:``,axisLabelColor:``,axisLabelTextColor:``},li=class{constructor(e){this._r=e}applyOptions(e){this._r.vr(e)}options(){return this._r.N()}Yg(){return this._r}},ui=class{constructor(e,t,n,r,i,a){this.Kg=new b,this.ae=e,this.Gg=t,this.Zg=n,this.Pu=i,this.qg=r,this.Xg=a}m(){this.Kg.m()}priceFormatter(){return this.ae.sl()}priceToCoordinate(e){let t=this.ae.Lt();return t===null?null:this.ae.Ft().Nt(e,t.Wt)}coordinateToPrice(e){let t=this.ae.Lt();return t===null?null:this.ae.Ft().Tn(e,t.Wt)}barsInLogicalRange(e){if(e===null)return null;let t=new tn(new U(e.from,e.to)).Uu(),n=this.ae.Un();if(n.Zi())return null;let r=n.Hn(t.Na(),1),i=n.Hn(t.bi(),-1),a=v(n.Rh()),o=v(n.Qn());if(r!==null&&i!==null&&r.$n>i.$n)return{barsBefore:e.from-a,barsAfter:o-e.to};let s={barsBefore:r===null||r.$n===a?e.from-a:r.$n-a,barsAfter:i===null||i.$n===o?o-e.to:o-i.$n};return r!==null&&i!==null&&(s.from=r.Qr,s.to=i.Qr),s}setData(e){this.Pu,this.ae.bh(),this.Gg.Jg(this.ae,e),this.Qg(`full`)}update(e,t=!1){this.ae.bh(),this.Gg.tb(this.ae,e,t),this.Qg(`update`)}pop(e=1){let t=this.Gg.ib(this.ae,e);t.length!==0&&this.Qg(`update`);let n=Qr(this.seriesType());return t.map((e=>n(e)))}dataByIndex(e,t){let n=this.ae.Un().Hn(e,t);return n===null?null:Qr(this.seriesType())(n)}data(){let e=Qr(this.seriesType());return this.ae.Un().Bh().map((t=>e(t)))}subscribeDataChanged(e){this.Kg.i(e)}unsubscribeDataChanged(e){this.Kg._(e)}applyOptions(e){this.ae.vr(e)}options(){return E(this.ae.N())}priceScale(){return this.Zg.priceScale(this.ae.Ft().pl(),this.getPane().paneIndex())}createPriceLine(e){let t=x(E(ci),e);return new li(this.ae.Ea(t))}removePriceLine(e){this.ae.Aa(e.Yg())}priceLines(){return this.ae.La().map((e=>new li(e)))}seriesType(){return this.ae.bh()}lastValueData(e){let t=this.ae.Ae(e);return t.Le?{noData:!0}:{noData:!1,price:t.Mt,color:t.R}}attachPrimitive(e){this.ae.ol(e),e.attached&&e.attached({chart:this.qg,series:this,requestUpdate:()=>this.ae.Qt().ka(),horzScaleBehavior:this.Pu})}detachPrimitive(e){this.ae._l(e),e.detached&&e.detached(),this.ae.Qt().ka()}getPane(){let e=this.ae,t=v(this.ae.Qt().Ks(e));return this.Xg(t)}moveToPane(e){this.ae.Qt().rf(this.ae,e)}seriesOrder(){let e=this.ae.Qt().Ks(this.ae);return e===null?-1:e.Y_().indexOf(this.ae)}setSeriesOrder(e){let t=this.ae.Qt().Ks(this.ae);t!==null&&t.vu(this.ae,e)}Qg(e){this.Kg.v()&&this.Kg.p(e)}},di=class{constructor(e,t,n){this.nb=new b,this.Qu=new b,this.Nw=new b,this.sn=e,this.ia=e.Et(),this.vM=t,this.ia.Zc().i(this.sb.bind(this)),this.ia.Xc().i(this.eb.bind(this)),this.vM.qw().i(this.rb.bind(this)),this.Pu=n}m(){this.ia.Zc().u(this),this.ia.Xc().u(this),this.vM.qw().u(this),this.nb.m(),this.Qu.m(),this.Nw.m()}scrollPosition(){return this.ia.Oc()}scrollToPosition(e,t){t?this.ia.Yc(e,1e3):this.sn.gs(e)}scrollToRealTime(){this.ia.qc()}getVisibleRange(){let e=this.ia.xc();return e===null?null:{from:e.from.originalTime,to:e.to.originalTime}}setVisibleRange(e){let t={from:this.Pu.convertHorzItemToInternal(e.from),to:this.Pu.convertHorzItemToInternal(e.to)},n=this.ia.kc(t);this.sn.sf(n)}getVisibleLogicalRange(){let e=this.ia.Sc();return e===null?null:{from:e.Na(),to:e.bi()}}setVisibleLogicalRange(e){g(e.from<=e.to,`The from index cannot be after the to index.`),this.sn.sf(e)}resetTimeScale(){this.sn.ws()}fitContent(){this.sn.td()}logicalToCoordinate(e){let t=this.sn.Et();return t.Zi()?null:t.jt(e)}coordinateToLogical(e){return this.ia.Zi()?null:this.ia.Vc(e)}timeToIndex(e,t){let n=this.Pu.convertHorzItemToInternal(e);return this.ia.Mc(n,t)}timeToCoordinate(e){let t=this.timeToIndex(e,!1);return t===null?null:this.ia.jt(t)}coordinateToTime(e){let t=this.sn.Et(),n=t.Vc(e),r=t.en(n);return r===null?null:r.originalTime}width(){return this.vM.pv().width}height(){return this.vM.pv().height}subscribeVisibleTimeRangeChange(e){this.nb.i(e)}unsubscribeVisibleTimeRangeChange(e){this.nb._(e)}subscribeVisibleLogicalRangeChange(e){this.Qu.i(e)}unsubscribeVisibleLogicalRangeChange(e){this.Qu._(e)}subscribeSizeChange(e){this.Nw.i(e)}unsubscribeSizeChange(e){this.Nw._(e)}applyOptions(e){this.ia.vr(e)}options(){return{...E(this.ia.N()),barSpacing:this.ia.ml()}}sb(){this.nb.v()&&this.nb.p(this.getVisibleRange())}eb(){this.Qu.v()&&this.Qu.p(this.getVisibleLogicalRange())}rb(e){this.Nw.p(e.width,e.height)}};function fi(e){return function(e){if(T(e.handleScale)){let t=e.handleScale;e.handleScale={axisDoubleClickReset:{time:t,price:t},axisPressedMouseMove:{time:t,price:t},mouseWheel:t,pinch:t}}else if(e.handleScale!==void 0){let{axisPressedMouseMove:t,axisDoubleClickReset:n}=e.handleScale;T(t)&&(e.handleScale.axisPressedMouseMove={time:t,price:t}),T(n)&&(e.handleScale.axisDoubleClickReset={time:n,price:n})}let t=e.handleScroll;T(t)&&(e.handleScroll={horzTouchDrag:t,vertTouchDrag:t,mouseWheel:t,pressedMouseMove:t})}(e),e}var pi=class{constructor(e,t,n){this.hb=new Map,this.ab=new Map,this.lb=new b,this.ob=new b,this._b=new b,this.dd=new WeakMap,this.ub=new Cr(t);let r=n===void 0?E(ai()):x(E(ai()),fi(n));this.cb=t,this.hv=new cr(e,r,t),this.hv.mw().i((e=>{this.lb.v()&&this.lb.p(this.fb(e()))}),this),this.hv.ww().i((e=>{this.ob.v()&&this.ob.p(this.fb(e()))}),this),this.hv.Bd().i((e=>{this._b.v()&&this._b.p(this.fb(e()))}),this);let i=this.hv.Qt();this.pb=new di(i,this.hv.bM(),this.cb)}remove(){this.hv.mw().u(this),this.hv.ww().u(this),this.hv.Bd().u(this),this.pb.m(),this.hv.m(),this.hb.clear(),this.ab.clear(),this.lb.m(),this.ob.m(),this._b.m(),this.ub.m()}resize(e,t,n){this.autoSizeActive()||this.hv.wM(e,t,n)}addCustomSeries(e,t={},n=0){let r=(e=>({type:`Custom`,isBuiltIn:!1,defaultOptions:{...Ur,...e.defaultOptions()},mb:Wr,wb:e}))(y(e));return this.Mb(r,t,n)}addSeries(e,t={},n=0){return this.Mb(e,t,n)}removeSeries(e){let t=_(this.hb.get(e)),n=this.ub.if(t);this.hv.Qt().if(t),this.gb(n),this.hb.delete(e),this.ab.delete(t)}Jg(e,t){this.gb(this.ub.og(e,t))}tb(e,t,n){this.gb(this.ub.pg(e,t,n))}ib(e,t){let[n,r]=this.ub.wg(e,t);return n.length!==0&&this.gb(r),n}subscribeClick(e){this.lb.i(e)}unsubscribeClick(e){this.lb._(e)}subscribeCrosshairMove(e){this._b.i(e)}unsubscribeCrosshairMove(e){this._b._(e)}subscribeDblClick(e){this.ob.i(e)}unsubscribeDblClick(e){this.ob._(e)}priceScale(e,t=0){return new oi(this.hv,e,t)}timeScale(){return this.pb}applyOptions(e){this.hv.vr(fi(e))}options(){return this.hv.N()}takeScreenshot(e=!1,t=!1){let n,r;try{t||(n=this.hv.Qt().N().crosshair.mode,this.hv.vr({crosshair:{mode:2}})),r=this.hv.TM(e)}finally{t||n===void 0||this.hv.Qt().vr({crosshair:{mode:n}})}return r}addPane(e=!1){let t=this.hv.Qt().uf();return t.j_(e),this.bb(t)}removePane(e){this.hv.Qt().Ad(e)}swapPanes(e,t){this.hv.Qt().zd(e,t)}autoSizeActive(){return this.hv.CM()}chartElement(){return this.hv.Mv()}panes(){return this.hv.Qt().Gn().map((e=>this.bb(e)))}paneSize(e=0){let t=this.hv.AM(e);return{height:t.height,width:t.width}}setCrosshairPosition(e,t,n){let r=this.hb.get(n);if(r===void 0)return;let i=this.hv.Qt().Ks(r);i!==null&&this.hv.Qt().Gd(e,t,i)}clearCrosshairPosition(){this.hv.Qt().Zd(!0)}horzBehaviour(){return this.cb}Mb(e,t={},n=0){g(e.mb!==void 0),function(e){if(e===void 0||e.type===`custom`)return;let t=e;t.minMove!==void 0&&t.precision===void 0&&(t.precision=dn(t.minMove))}(t.priceFormat),e.type===`Candlestick`&&function(e){e.borderColor!==void 0&&(e.borderUpColor=e.borderColor,e.borderDownColor=e.borderColor),e.wickColor!==void 0&&(e.wickUpColor=e.wickColor,e.wickDownColor=e.wickColor)}(t);let r=x(E(d),E(e.defaultOptions),t),i=e.mb,a=new xt(this.hv.Qt(),e.type,r,i,e.wb);this.hv.Qt().Qd(a,n);let o=new ui(a,this,this,this,this.cb,(e=>this.bb(e)));return this.hb.set(o,a),this.ab.set(a,o),o}gb(e){let t=this.hv.Qt();for(let t of e.Y_.keys())t.Ia();t.Xd(e.Et.Dc,e.Et.Sg,e.Et.xg),e.Y_.forEach(((e,t)=>t.ht(e.ue,e.bg))),t.Et().dc(),t.Lc()}Sb(e){return _(this.ab.get(e))}xb(e){return e!==void 0&&this.ab.has(e)?this.Sb(e):void 0}fb(e){let t=new Map;e.QM.forEach(((e,n)=>{let r=n.bh(),i=Qr(r)(e);if(r!==`Custom`)g(dr(i));else{let e=n.cl();g(!e||!1===e(i))}t.set(this.Sb(n),i)}));let n=this.xb(e.jM),r=e.YM===void 0?void 0:{type:e.YM.ds,sourceKind:e.YM.KM,objectKind:e.YM.GM,series:this.xb(e.YM.Y_),objectId:e.YM.ZM,paneIndex:e.YM.XM};return{time:e.Qr,logical:e.$n,point:e.JM,paneIndex:e.XM,hoveredInfo:r,hoveredSeries:n,hoveredObjectId:e.qM,seriesData:t,sourceEvent:e.tg}}bb(e){let t=this.dd.get(e);return t||(t=new si(this.hv,(e=>this.Sb(e)),e,this),this.dd.set(e,t)),t}};function mi(e){if(w(e)){let t=document.getElementById(e);return g(t!==null,`Cannot find element in DOM with id=${e}`),t}return e}function hi(e,t,n){let r=new pi(mi(e),t,n);return t.setOptions(r.options()),r}function gi(e,t){return hi(e,new kn,kn.Tf(t))}function _i(e,t,n,r){return Math.hypot(n-e,r-t)}function vi(e,t,n,r,i,a,o,s=0){if(t.length===0||r.from>=t.length||r.to<=0)return;let{context:c,horizontalPixelRatio:l,verticalPixelRatio:u}=e,d=t[r.from],f=a(e,d),p=d;if(r.to-r.from<2){let t=i/2;c.beginPath();let n={_t:d._t-t,ut:d.ut},r={_t:d._t+t,ut:d.ut};c.moveTo(n._t*l,n.ut*u),c.lineTo(r._t*l,r.ut*u),o(e,f,n,r)}else{let i=s>0,m=0,h=(t,n)=>{if(o(e,f,p,n),c.beginPath(),f=t,p=n,i){let e=m%s;c.lineDashOffset=e,m=e}},g=p;c.beginPath(),c.moveTo(d._t*l,d.ut*u);for(let o=r.from+1;o<r.to;++o){g=t[o];let r=g._t*l,s=g.ut*u,d=a(e,g);switch(n){case 0:if(c.lineTo(r,s),i){let e=t[o-1],n=e._t*l,i=e.ut*u;m+=_i(n,i,r,s)}break;case 1:{let e=t[o-1],n=e.ut*u;c.lineTo(r,n),i&&(m+=Math.abs(g._t-e._t)*l),d!==f&&(h(d,g),c.lineTo(r,n)),c.lineTo(r,s),i&&(m+=Math.abs(g.ut-e.ut)*u);break}case 2:{let[e,n]=Si(t,o-1,o),a=e._t*l,d=e.ut*u,f=n._t*l,p=n.ut*u;if(c.bezierCurveTo(a,d,f,p,r,s),i){let e=t[o-1],n=e._t*l,i=e.ut*u,c=_i(n,i,r,s),h=_i(n,i,a,d)+_i(a,d,f,p)+_i(f,p,r,s);m+=(c+h)/2}break}}n!==1&&d!==f&&(h(d,g),c.moveTo(r,s))}(p!==g||p===g&&n===1)&&o(e,f,p,g),i&&(c.lineDashOffset=0)}}var yi=6;function bi(e,t){return{_t:e._t-t._t,ut:e.ut-t.ut}}function xi(e,t){return{_t:e._t/t,ut:e.ut/t}}function Si(e,t,n){let r=Math.max(0,t-1),i=Math.min(e.length-1,n+1);var a,o;return[(a=e[t],o=xi(bi(e[n],e[r]),yi),{_t:a._t+o._t,ut:a.ut+o.ut}),bi(e[n],xi(bi(e[i],e[t]),yi))]}function Ci(e,t){let n=e.context;n.strokeStyle=t,n.stroke()}var wi=class extends j{constructor(){super(...arguments),this.rt=null}ht(e){this.rt=e}et(e){if(this.rt===null)return;let{ot:t,lt:n,Cb:r,yb:i,ct:a,Gt:o,Pb:s}=this.rt;if(n===null)return;let c=e.context;c.lineCap=`butt`,c.lineWidth=a*e.verticalPixelRatio;let l=m(c,o);c.lineJoin=`round`;let u=this.kb.bind(this),d=function(e){return e.reduce(((e,t)=>e+t),0)}(l);i!==void 0&&vi(e,t,i,n,r,u,Ci,d),s&&function(e,t,n,r,i){if(r.to-r.from<=0)return;let{horizontalPixelRatio:a,verticalPixelRatio:o,context:s}=e,c=null,l=Math.max(1,Math.floor(a))%2/2,u=n*o+l;for(let n=r.to-1;n>=r.from;--n){let r=t[n];if(r){let t=i(e,r);t!==c&&(c!==null&&s.fill(),s.beginPath(),s.fillStyle=t,c=t);let n=Math.round(r._t*a)+l,d=r.ut*o;s.moveTo(n,d),s.arc(n,d,u,0,2*Math.PI)}}s.fill()}(e,t,s,n,u)}},Ti=class extends wi{kb(e,t){return t.vt}};function Ei(e,t,n,r,i){let a=1-i;return a*a*a*e+3*a*a*i*t+3*a*i*i*n+i*i*i*r}function Di(e,t,n,r,i){if(n===2){let[n,a]=Si(r,i-1,i);return[Math.min(e._t,t._t,n._t,a._t),Math.max(e._t,t._t,n._t,a._t)]}return[Math.min(e._t,t._t),Math.max(e._t,t._t)]}function Oi(e,t,n,r,i,a,o,s){switch(i){case 1:{let i=Q(e,t,n._t,n.ut,r._t,n.ut),a=Q(e,t,r._t,n.ut,r._t,r.ut),o=Math.min(i,a);return o<=s?o:null}case 2:{let[i,c]=Si(a,o-1,o),l=function(e,t,n){let r=1/0,i=n[0];for(let a=1;a<=12;a++){let o=a/12,s={_t:Ei(n[0]._t,n[1]._t,n[2]._t,n[3]._t,o),ut:Ei(n[0].ut,n[1].ut,n[2].ut,n[3].ut,o)};r=Math.min(r,Q(e,t,i._t,i.ut,s._t,s.ut)),i=s}return r}(e,t,[n,i,c,r]);return l<=s?l:null}default:{let i=Q(e,t,n._t,n.ut,r._t,r.ut);return i<=s?i:null}}}var ki=class extends Rr{constructor(e,t){super(e,t,!0)}Og(e,t,n){t.Ic(this.kg,D(this.Tg)),e.Jo(this.kg,n,D(this.Tg))}Tb(e,t){return{wt:e,Mt:t,_t:NaN,ut:NaN}}Lg(){let e=this.ae.Sa();this.kg=this.ae.Ua().Bh().map((t=>{let n;if((t.Gr??1)>1){let e=t.Wt[1],r=t.Wt[2],i=t.Wt[3];n=Math.abs(e-i)>Math.abs(r-i)?e:r}else n=t.Wt[3];return this.Rb(t.$n,n,e)}))}},Ai=class extends ki{Bg(e,t){let n=this.ae.N();return function(e,t,n,r,i,a,o,s=0,c=0){if(t===null||t.from>=t.to||e.length===0)return null;let l=Math.max(a/2,o??0)+c,u=1/0;if(o!==void 0){let i=o+c,a=Dr(e,n-i,t.from,t.to),s=Or(e,n+i,a,t.to);for(let t=a;t<s;t++){let i=e[t];if(!Ar(n,i._t,i._t,o+c))continue;let a=Math.hypot(n-i._t,r-i.ut);a<=o+c&&(u=Math.min(u,a))}}if(t.to-t.from<2){let i=e[t.from],a=Math.max(s/2,l),o=Q(n,r,i._t-a,i.ut,i._t+a,i.ut);return o<=l&&(u=Math.min(u,o)),Number.isFinite(u)?kr(u,2,`series-point`):null}let d=1/0,f=Dr(e,n-l,t.from,t.to),p=Or(e,n+l,f,t.to),m=Math.max(t.from+1,f),h=Math.min(t.to,p+1);for(let t=m;t<h;t++){let a=e[t-1],o=e[t],[s,c]=Di(a,o,i,e,t);if(!Ar(n,s,c,l))continue;let u=Oi(n,r,a,o,i,e,t,l);u!==null&&(d=Math.min(d,u))}return Number.isFinite(u)?kr(u,2,`series-point`):Number.isFinite(d)?kr(d,1,`series-line`):null}(this.kg,this.Tg,e,t,n.lineType,n.lineVisible?n.lineWidth:1,n.pointMarkersVisible?n.pointMarkersRadius||n.lineWidth/2+2:void 0,this.le.Et().ml(),n.hitTestTolerance)}},ji=class extends Ai{constructor(){super(...arguments),this.Vg=new Ti}Rb(e,t,n){return{...this.Tb(e,t),...n.Sh(e)}}Ng(){let e=this.ae.N(),t={ot:this.kg,Gt:e.lineStyle,yb:e.lineVisible?e.lineType:void 0,ct:e.lineWidth,Pb:e.pointMarkersVisible?e.pointMarkersRadius||e.lineWidth/2+2:void 0,lt:this.Tg,Cb:this.le.Et().ml()};this.Vg.ht(t)}},Mi={type:`Line`,isBuiltIn:!0,defaultOptions:{color:`#2196f3`,lineStyle:0,lineWidth:3,lineType:0,lineVisible:!0,crosshairMarkerVisible:!0,crosshairMarkerRadius:4,crosshairMarkerBorderColor:``,crosshairMarkerBorderWidth:2,crosshairMarkerBackgroundColor:``,lastPriceAnimation:0,pointMarkersVisible:!1},mb:(e,t)=>new ji(e,t)},Ni=class extends Rr{constructor(e,t){super(e,t,!1)}Bg(e,t){return Pr(this.kg,this.Tg,e,t,this.le.Et().ml(),this.ae.N().hitTestTolerance,((e,t)=>{t[0]=e.n_,t[1]=e.s_}))}Og(e,t,n){t.Ic(this.kg,D(this.Tg)),e.t_(this.kg,n,D(this.Tg))}fS(e,t,n){return{wt:e,jr:t.Wt[0],qr:t.Wt[1],Yr:t.Wt[2],Kr:t.Wt[3],_t:NaN,i_:NaN,n_:NaN,s_:NaN,e_:NaN}}Lg(){let e=this.ae.Sa();this.kg=this.ae.Ua().Bh().map((t=>this.Rb(t.$n,t,e)))}},Pi=class extends j{constructor(){super(...arguments),this.qt=null,this.oS=0}ht(e){this.qt=e}et(e){if(this.qt===null||this.qt.Un.length===0||this.qt.lt===null)return;let{horizontalPixelRatio:t}=e;this.oS=function(e,t){if(e>=2.5&&e<=4)return Math.floor(3*t);let n=1-.2*Math.atan(Math.max(4,e)-4)/(.5*Math.PI),r=Math.floor(e*n*t),i=Math.floor(e*t);return Math.max(Math.floor(t),Math.min(r,i))}(this.qt.ml,t),this.oS>=2&&Math.floor(t)%2!=this.oS%2&&this.oS--;let n=this.qt.Un;this.qt.pS&&this.vS(e,n,this.qt.lt),this.qt.gi&&this.Vm(e,n,this.qt.lt);let r=this.mS(t);(!this.qt.gi||this.oS>2*r)&&this.wS(e,n,this.qt.lt)}vS(e,t,n){if(this.qt===null)return;let{context:r,horizontalPixelRatio:i,verticalPixelRatio:a}=e,o=``,s=Math.min(Math.floor(i),Math.floor(this.qt.ml*i));s=Math.max(Math.floor(i),Math.min(s,this.oS));let c=Math.floor(.5*s),l=null;for(let e=n.from;e<n.to;e++){let n=t[e];n.rh!==o&&(r.fillStyle=n.rh,o=n.rh);let u=Math.round(Math.min(n.i_,n.e_)*a),d=Math.round(Math.max(n.i_,n.e_)*a),f=Math.round(n.n_*a),p=Math.round(n.s_*a),m=Math.round(i*n._t)-c,h=m+s-1;l!==null&&(m=Math.max(l+1,m),m=Math.min(m,h));let g=h-m+1;r.fillRect(m,f,g,u-f),r.fillRect(m,d+1,g,p-d),l=h}}mS(e){let t=Math.floor(1*e);this.oS<=2*t&&(t=Math.floor(.5*(this.oS-1)));let n=Math.max(Math.floor(e),t);return this.oS<=2*n?Math.max(Math.floor(e),Math.floor(1*e)):n}Vm(e,t,n){if(this.qt===null)return;let{context:r,horizontalPixelRatio:i,verticalPixelRatio:a}=e,o=``,s=this.mS(i),c=null;for(let e=n.from;e<n.to;e++){let n=t[e];n.eh!==o&&(r.fillStyle=n.eh,o=n.eh);let l=Math.round(n._t*i)-Math.floor(.5*this.oS),u=l+this.oS-1,d=Math.round(Math.min(n.i_,n.e_)*a),f=Math.round(Math.max(n.i_,n.e_)*a);if(c!==null&&(l=Math.max(c+1,l),l=Math.min(l,u)),this.qt.ml*i>2*s)de(r,l,d,u-l+1,f-d+1,s);else{let e=u-l+1;r.fillRect(l,d,e,f-d+1)}c=u}}wS(e,t,n){if(this.qt===null)return;let{context:r,horizontalPixelRatio:i,verticalPixelRatio:a}=e,o=``,s=this.mS(i);for(let e=n.from;e<n.to;e++){let n=t[e],c=Math.round(Math.min(n.i_,n.e_)*a),l=Math.round(Math.max(n.i_,n.e_)*a),u=Math.round(n._t*i)-Math.floor(.5*this.oS),d=u+this.oS-1;if(n.sh!==o){let e=n.sh;r.fillStyle=e,o=e}this.qt.gi&&(u+=s,c+=s,d-=s,l-=s),c>l||r.fillRect(u,c,d-u+1,l-c+1)}}},Fi=class extends Ni{constructor(){super(...arguments),this.Vg=new Pi}Rb(e,t,n){return{...this.fS(e,t,n),...n.Sh(e)}}Ng(){let e=this.ae.N();this.Vg.ht({Un:this.kg,ml:this.le.Et().ml(),pS:e.wickVisible,gi:e.borderVisible,lt:this.Tg})}},Ii={type:`Candlestick`,isBuiltIn:!0,defaultOptions:{upColor:`#26a69a`,downColor:`#ef5350`,wickVisible:!0,borderVisible:!0,borderColor:`#378658`,borderUpColor:`#26a69a`,borderDownColor:`#ef5350`,wickColor:`#737375`,wickUpColor:`#26a69a`,wickDownColor:`#ef5350`},mb:(e,t)=>new Fi(e,t)},Li=class extends j{constructor(){super(...arguments),this.qt=null,this.MS=[]}ht(e){this.qt=e,this.MS=[]}et({context:e,horizontalPixelRatio:t,verticalPixelRatio:n}){if(this.qt===null||this.qt.ot.length===0||this.qt.lt===null)return;this.MS.length||this.gS(t);let r=Math.max(1,Math.floor(n)),i=Math.round(this.qt.bS*n)-Math.floor(r/2),a=i+r;for(let t=this.qt.lt.from;t<this.qt.lt.to;t++){let o=this.qt.ot[t],s=this.MS[t-this.qt.lt.from],c=Math.round(o.ut*n),l,u;e.fillStyle=o.sh,c<=i?(l=c,u=a):(l=i,u=c-Math.floor(r/2)+r),e.fillRect(s.Na,l,s.bi-s.Na+1,u-l)}}gS(e){if(this.qt===null||this.qt.ot.length===0||this.qt.lt===null)return void(this.MS=[]);let t=Math.ceil(this.qt.ml*e)<=1?0:Math.max(1,Math.floor(e)),n=Math.round(this.qt.ml*e)-t;this.MS=Array(this.qt.lt.to-this.qt.lt.from);for(let t=this.qt.lt.from;t<this.qt.lt.to;t++){let r=this.qt.ot[t],i=Math.round(r._t*e),a,o;if(n%2){let e=(n-1)/2;a=i-e,o=i+e}else{let e=n/2;a=i-e,o=i+e-1}this.MS[t-this.qt.lt.from]={Na:a,bi:o,SS:i,ce:r._t*e,wt:r.wt}}for(let e=this.qt.lt.from+1;e<this.qt.lt.to;e++){let n=this.MS[e-this.qt.lt.from],r=this.MS[e-this.qt.lt.from-1];n.wt===r.wt+1&&n.Na-r.bi!==t+1&&(r.SS>r.ce?r.bi=n.Na-t-1:n.Na=r.bi+t+1)}let r=Math.ceil(this.qt.ml*e);for(let e=this.qt.lt.from;e<this.qt.lt.to;e++){let t=this.MS[e-this.qt.lt.from];t.bi<t.Na&&(t.bi=t.Na);let n=t.bi-t.Na+1;r=Math.min(n,r)}if(t>0&&r<4)for(let e=this.qt.lt.from;e<this.qt.lt.to;e++){let t=this.MS[e-this.qt.lt.from];t.bi-t.Na+1>r&&(t.SS>t.ce?--t.bi:t.Na+=1)}}},Ri=class extends ki{constructor(){super(...arguments),this.Vg=new Li}Bg(e,t){let n=this.ae.Ft().Nt(this.ae.N().base,v(this.ae.Lt()).Wt);return n===null?null:Pr(this.kg,this.Tg,e,t,this.le.Et().ml(),this.ae.N().hitTestTolerance,((e,t)=>{t[0]=e.ut,t[1]=n}))}Rb(e,t,n){return{...this.Tb(e,t),...n.Sh(e)}}Ng(){let e={ot:this.kg,ml:this.le.Et().ml(),lt:this.Tg,bS:this.ae.Ft().Nt(this.ae.N().base,v(this.ae.Lt()).Wt)};this.Vg.ht(e)}},zi={type:`Histogram`,isBuiltIn:!0,defaultOptions:{color:`#26a69a`,base:0},mb:(e,t)=>new Ri(e,t)},Bi=class{constructor(e,t){this.ae=e,this.Jh=t,this.CS()}detach(){this.ae.detachPrimitive(this.Jh)}getSeries(){return this.ae}applyOptions(e){this.Jh&&this.Jh.vr&&this.Jh.vr(e)}CS(){this.ae.attachPrimitive(this.Jh)}},Vi={autoScale:!0,zOrder:`normal`};function Hi(e,t){return Et(Math.min(Math.max(e,12),30)*t)}function $(e,t){return Et(Math.max(t,12)*(e===`circle`?.8:e===`square`?.7:1))}function Ui(e){return function(e){let t=Math.ceil(e);return t%2==0?t:t-1}(Hi(e,1))}function Wi(e){return Math.max(Hi(e,.1),3)}function Gi(e,t,n){return t?e:n?Math.ceil(e/2):0}function Ki(e,t,n,r){let i=($(`arrowUp`,r)-1)/2*n.YS,a=(Et(r/2)-1)/2*n.YS;t.beginPath(),e?(t.moveTo(n._t-i,n.ut),t.lineTo(n._t,n.ut-i),t.lineTo(n._t+i,n.ut),t.lineTo(n._t+a,n.ut),t.lineTo(n._t+a,n.ut+i),t.lineTo(n._t-a,n.ut+i),t.lineTo(n._t-a,n.ut)):(t.moveTo(n._t-i,n.ut),t.lineTo(n._t,n.ut+i),t.lineTo(n._t+i,n.ut),t.lineTo(n._t+a,n.ut),t.lineTo(n._t+a,n.ut-i),t.lineTo(n._t-a,n.ut-i),t.lineTo(n._t-a,n.ut)),t.fill()}function qi(e,t,n,r,i,a){let o=($(`arrowUp`,r)-1)/2,s=(Et(r/2)-1)/2;return i>=t-s-2&&i<=t+s+2&&a>=(e?n:n-o)-2&&a<=(e?n+o:n)+2||(()=>{if(i<t-o-3||i>t+o+3||a<(e?n-o-3:n)||a>(e?n:n+o+3))return!1;let r=Math.abs(i-t);return Math.abs(a-n)+3>=r/2})()}var Ji=class{constructor(){this.qt=null,this.$s=new P,this.F=-1,this.W=``,this.hm=``,this.KS=`normal`}ht(e){this.qt=e}js(e,t,n){this.F===e&&this.W===t||(this.F=e,this.W=t,this.hm=O(e,t),this.$s.Os()),this.KS=n}Qs(e,t){if(this.qt===null||this.qt.lt===null)return null;for(let n=this.qt.lt.from;n<this.qt.lt.to;n++){let r=this.qt.ot[n];if(r&&Xi(r,e,t))return{zOrder:`normal`,externalId:r.te??``,itemType:`marker`}}return null}draw(e){this.KS!==`aboveSeries`&&e.useBitmapCoordinateSpace((e=>{this.et(e)}))}drawBackground(e){this.KS===`aboveSeries`&&e.useBitmapCoordinateSpace((e=>{this.et(e)}))}et({context:e,horizontalPixelRatio:t,verticalPixelRatio:n}){if(this.qt!==null&&this.qt.lt!==null){e.textBaseline=`middle`,e.font=this.hm;for(let r=this.qt.lt.from;r<this.qt.lt.to;r++){let i=this.qt.ot[r];i.ri!==void 0&&(i.ri.nn=this.$s.Ii(e,i.ri.GS),i.ri.$t=this.F,i.ri._t=i._t-i.ri.nn/2),Yi(i,e,t,n)}}}};function Yi(e,t,n,r){t.fillStyle=e.R,e.ri!==void 0&&function(e,t,n,r,i,a){e.save(),e.scale(i,a),e.fillText(t,n,r),e.restore()}(t,e.ri.GS,e.ri._t,e.ri.ut,n,r),function(e,t,n){if(e.Th!==0){switch(e.ZS){case`arrowDown`:Ki(!1,t,n,e.Th);return;case`arrowUp`:Ki(!0,t,n,e.Th);return;case`circle`:(function(e,t,n){let r=($(`circle`,n)-1)/2;e.beginPath(),e.arc(t._t,t.ut,r*t.YS,0,2*Math.PI,!1),e.fill()})(t,n,e.Th);return;case`square`:(function(e,t,n){let r=$(`square`,n),i=(r-1)*t.YS/2,a=t._t-i,o=t.ut-i;e.fillRect(a,o,r*t.YS,r*t.YS)})(t,n,e.Th);return}e.ZS}}(e,t,function(e,t,n){let r=Math.max(1,Math.floor(t))%2/2;return{_t:Math.round(e._t*t)+r,ut:e.ut*n,YS:t}}(e,n,r))}function Xi(e,t,n){return!(e.ri===void 0||!function(e,t,n,r,i,a){let o=r/2;return i>=e&&i<=e+n&&a>=t-o&&a<=t+o}(e.ri._t,e.ri.ut,e.ri.nn,e.ri.$t,t,n))||function(e,t,n){if(e.Th===0)return!1;switch(e.ZS){case`arrowDown`:return qi(!0,e._t,e.ut,e.Th,t,n);case`arrowUp`:return qi(!1,e._t,e.ut,e.Th,t,n);case`circle`:return function(e,t,n,r,i){let a=2+$(`circle`,n)/2,o=e-r,s=t-i;return Math.sqrt(o*o+s*s)<=a}(e._t,e.ut,e.Th,t,n);case`square`:return function(e,t,n,r,i){let a=$(`square`,n),o=(a-1)/2,s=e-o,c=t-o;return r>=s&&r<=s+a&&i>=c&&i<=c+a}(e._t,e.ut,e.Th,t,n)}}(e,t,n)}function Zi(e){return e===`atPriceTop`||e===`atPriceBottom`||e===`atPriceMiddle`}function Qi(e,t,n,r,i,a,o,s){let c=function(e,t,n){if(Zi(t.position)&&t.price!==void 0)return t.price;if(`value`in(r=e)&&typeof r.value==`number`)return e.value;var r;if(function(e){return`open`in e&&`high`in e&&`low`in e&&`close`in e}(e)){if(t.position===`inBar`)return e.close;if(t.position===`aboveBar`)return n?e.low:e.high;if(t.position===`belowBar`)return n?e.high:e.low}}(n,t,o.priceScale().options().invertScale);if(c===void 0)return;let l=Zi(t.position),u=s.timeScale(),d=S(t.size)?Math.max(t.size,0):1,f=Ui(u.options().barSpacing)*d,p=f/2;switch(e.Th=f,t.position){case`inBar`:case`atPriceMiddle`:e.ut=v(o.priceToCoordinate(c)),e.ri!==void 0&&(e.ri.ut=e.ut+p+a+.6*i);return;case`aboveBar`:case`atPriceTop`:{let t=l?0:r.XS;e.ut=v(o.priceToCoordinate(c))-p-t,e.ri!==void 0&&(e.ri.ut=e.ut-p-.6*i,r.XS+=1.2*i),l||(r.XS+=f+a);return}case`belowBar`:case`atPriceBottom`:{let t=l?0:r.JS;e.ut=v(o.priceToCoordinate(c))+p+t,e.ri!==void 0&&(e.ri.ut=e.ut+p+a+.6*i,r.JS+=1.2*i),l||(r.JS+=f+a);return}}}var $i=class{constructor(e,t,n){this.QS=[],this.xt=!0,this.tx=!0,this.Xt=new Ji,this.Te=e,this.Gv=t,this.qt={ot:[],lt:null},this.yn=n}renderer(){if(!this.Te.options().visible)return null;this.xt&&this.Ig();let e=this.Gv.options().layout;return this.Xt.js(e.fontSize,e.fontFamily,this.yn.zOrder),this.Xt.ht(this.qt),this.Xt}ix(e){this.QS=e,this.Pt(`data`)}Pt(e){this.xt=!0,e===`data`&&(this.tx=!0)}nx(e){this.xt=!0,this.yn=e}zOrder(){return this.yn.zOrder===`aboveSeries`?`top`:this.yn.zOrder}Ig(){let e=this.Gv.timeScale(),t=this.QS;this.tx&&=(this.qt.ot=t.map((e=>({wt:e.time,_t:0,ut:0,Th:0,ZS:e.shape,R:e.color,te:e.id,sx:e.sx,ri:void 0}))),!1);let n=this.Gv.options().layout;this.qt.lt=null;let r=e.getVisibleLogicalRange();if(r===null)return;let i=new U(Math.floor(r.from),Math.ceil(r.to));if(this.Te.dataByIndex(0,1)===null||this.qt.ot.length===0)return;let a=NaN,o=Wi(e.options().barSpacing),s={XS:o,JS:o};this.qt.lt=Lr(this.qt.ot,i,!0);for(let r=this.qt.lt.from;r<this.qt.lt.to;r++){let i=t[r];i.time!==a&&(s.XS=o,s.JS=o,a=i.time);let c=this.qt.ot[r];c._t=v(e.logicalToCoordinate(i.time)),i.text!==void 0&&i.text.length>0&&(c.ri={GS:i.text,_t:0,ut:0,nn:0,$t:0});let l=this.Te.dataByIndex(i.time,0);l!==null&&Qi(c,i,l,s,n.fontSize,o,this.Te,this.Gv)}this.xt=!1}};function ea(e){return{...Vi,...e}}var ta=class{constructor(e){this.Yh=null,this.QS=[],this.hx=[],this.lx=null,this.Te=null,this.Gv=null,this.ox=!0,this._x=null,this.ux=null,this.vx=null,this.mx=!0,this.yn=ea(e)}attached(e){this.wx(),this.Gv=e.chart,this.Te=e.series,this.Yh=new $i(this.Te,v(this.Gv),this.yn),this.jS=e.requestUpdate,this.Te.subscribeDataChanged((e=>this.Qg(e))),this.mx=!0,this.DS()}DS(){this.jS&&this.jS()}detached(){this.Te&&this.lx&&this.Te.unsubscribeDataChanged(this.lx),this.Gv=null,this.Te=null,this.Yh=null,this.lx=null}ix(e){this.mx=!0,this.QS=e,this.wx(),this.ox=!0,this.ux=null,this.DS()}Mx(){return this.QS}paneViews(){return this.Yh?[this.Yh]:[]}updateAllViews(){this.gx()}hitTest(e,t){return this.Yh?this.Yh.renderer()?.Qs(e,t)??null:null}autoscaleInfo(e,t){if(this.yn.autoScale&&this.Yh){let e=this.bx();if(e)return{priceRange:null,margins:e}}return null}vr(e){this.yn=ea({...this.yn,...e}),this.DS&&this.DS()}bx(){let e=v(this.Gv).timeScale().options().barSpacing;if(this.ox||e!==this.vx){if(this.vx=e,this.QS.length>0){let t=Wi(e),n=1.5*Ui(e)+2*t,r=this.Sx();this._x={above:Gi(n,r.aboveBar,r.inBar),below:Gi(n,r.belowBar,r.inBar)}}else this._x=null;this.ox=!1}return this._x}Sx(){return this.ux===null&&(this.ux=this.QS.reduce(((e,t)=>(e[t.position]||(e[t.position]=!0),e)),{inBar:!1,aboveBar:!1,belowBar:!1,atPriceTop:!1,atPriceBottom:!1,atPriceMiddle:!1})),this.ux}wx(){if(!this.mx||!this.Gv||!this.Te)return;let e=this.Gv.timeScale(),t=this.Te?.data();if(e.getVisibleLogicalRange()==null||!this.Te||t.length===0)return void(this.hx=[]);let n=e.timeToIndex(v(t[0].time),!0);this.hx=this.QS.map(((t,r)=>{let i=e.timeToIndex(t.time,!0),a=i<n?1:-1,o=v(this.Te).dataByIndex(i,a),s={time:e.timeToIndex(v(o).time,!1),position:t.position,shape:t.shape,color:t.color,id:t.id,sx:r,text:t.text,size:t.size,price:t.price,Qr:t.time};if(t.position===`atPriceTop`||t.position===`atPriceBottom`||t.position===`atPriceMiddle`){if(t.price===void 0)throw Error(`Price is required for position ${t.position}`);return{...s,position:t.position,price:t.price}}return{...s,position:t.position,price:t.price}})),this.mx=!1}gx(e){this.Yh&&(this.wx(),this.Yh.ix(this.hx),this.Yh.nx(this.yn),this.Yh.Pt(e))}Qg(e){this.mx=!0,this.DS()}},na=class extends Bi{constructor(e,t,n){super(e,t),n&&this.setMarkers(n)}setMarkers(e){this.Jh.ix(e)}markers(){return this.Jh.Mx()}};function ra(e,t,n){let r=new na(e,new ta(n??{}));return t&&r.setMarkers(t),r}({...d});export{p as a,Mi as c,Ii as i,Ce as n,gi as o,ra as r,zi as s,cn as t};
@@ -0,0 +1 @@
1
+ import{O as e}from"./ui-gsFb8B2m.js";async function t(t,n){return(await e.get(`/listings`,{params:t,signal:n})).data}async function n(t,n=`all`,r=`all`,i=10,a){return(await e.get(`/listings/search`,{params:{q:t,market:n,type:r,limit:i},signal:a})).data}async function r(t){return(await e.post(`/listings/refresh`,null,{params:{market:t}})).data}async function i(t,n=3650){return(await e.get(`/listings/mf/${encodeURIComponent(t)}/history`,{params:{days:n}})).data}function a(e){return e.type===`mf`?`/analyze?view=funds&symbol=${encodeURIComponent(e.symbol)}&market=india`:`/analyze?symbol=${encodeURIComponent(e.symbol)}&market=${encodeURIComponent(e.market)}`}async function o(t,n=500,r){return(await e.get(`/listings/discovery`,{params:{market:t,size:n},signal:r})).data}async function s(t,n,r){let i={by:t};return n&&(i.group=n),(await e.get(`/listings/fund-rotation`,{params:i,signal:r,timeout:15e4})).data}async function c(t,n,r){let i={market:t};return n&&(i.view=n),(await e.get(`/listings/etf-rotation`,{params:i,signal:r,timeout:12e4})).data}async function l(t,n){return(await e.get(`/listings/rotation`,{params:{market:t},signal:n})).data}async function u(t,n){return(await e.get(`/listings/mf/${encodeURIComponent(t)}/sip`,{params:n})).data}async function d(t,n){return(await e.get(`/listings/mf/${encodeURIComponent(t)}/peers`,{signal:n,timeout:12e4})).data}async function f(t,n){return(await e.get(`/listings/mf/${encodeURIComponent(t)}/holdings`,{signal:n,timeout:6e4})).data}async function p(t,n){return(await e.get(`/listings/stock/${encodeURIComponent(t)}/funds`,{signal:n})).data}async function m(t,n,r,i=10){return(await e.get(`/listings/${t}/${n}/${encodeURIComponent(r)}/sip-days`,{params:{years:i},timeout:6e4})).data}async function h(t,n=1,r){return(await e.get(`/listings/big-trades`,{params:{market:t,days:n},signal:r,timeout:15e4})).data}async function g(t,n,r){return(await e.get(`/listings/hot`,{params:{market:t,area:n},signal:r,timeout:12e4})).data}async function _(t,n){return(await e.get(`/listings/mf/${encodeURIComponent(t)}/analytics`,{signal:n,timeout:12e4})).data}async function v(t,n,r){return(await e.get(`/listings/mf/${encodeURIComponent(t)}/overlap`,{params:{other:n},signal:r,timeout:9e4})).data}async function y(t,n){return(await e.get(`/listings/mf/${encodeURIComponent(t)}/cost`,{signal:n,timeout:9e4})).data}async function b(t,n){return(await e.get(`/listings/mf/${encodeURIComponent(t)}/style`,{signal:n,timeout:12e4})).data}async function x(t,n=!1){return(await e.post(`/listings/mf/${encodeURIComponent(t)}/ai-review`,null,{params:{refresh:n},timeout:2e5})).data}async function S(t,n,r){return(await e.get(`/listings/activity`,{params:{symbol:t,market:n},signal:r})).data}export{n as S,t as _,x as a,S as b,i as c,d,s as f,g,p as h,c as i,f as l,b as m,h as n,_ as o,u as p,o as r,y as s,a as t,v as u,l as v,r as x,m as y};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{b as t,p as n,t as r}from"./format-d8InM0Zw.js";import{D as i,O as a}from"./ui-gsFb8B2m.js";import{M as o}from"./index-CKAnq-Or.js";var s=n();function c({low:e,high:t,value:n}){if(e==null||t==null||n==null||t<=e)return(0,s.jsx)(`div`,{className:`text-end text-faint`,children:`—`});let i=Math.max(0,Math.min(100,(n-e)/(t-e)*100));return(0,s.jsxs)(`div`,{className:`ms-auto w-28`,title:`52w low ${e} · high ${t}`,children:[(0,s.jsx)(`div`,{className:`relative h-1 rounded-full bg-line`,children:(0,s.jsx)(`span`,{className:`absolute top-1/2 h-2.5 w-1 -translate-x-1/2 -translate-y-1/2 rounded-sm bg-accent`,style:{left:`${i}%`}})}),(0,s.jsxs)(`div`,{className:`tabular mt-1 flex justify-between text-[12px] text-faint`,children:[(0,s.jsx)(`span`,{children:r(e)}),(0,s.jsx)(`span`,{children:r(t)})]})]})}function l({status:e}){let{t}=o(`app`),n=Object.values(e.markets);if(!n.length)return null;let r=e=>e.last_trade!=null&&Date.now()/1e3-e.last_trade>3600,a=n.some(e=>e.open&&!r(e)),c=!a&&n.some(e=>e.open&&r(e)),l=n.find(e=>e.error)?.error,u=[...new Set(n.map(e=>e.source))].join(` · `),d=e.updated;return(0,s.jsxs)(`span`,{className:`inline-flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-muted`,title:t(`live.prices`,{sources:u}),children:[(0,s.jsxs)(`span`,{className:i(`inline-flex items-center gap-1.5 font-medium`,a?`text-up`:`text-muted`),children:[(0,s.jsx)(`span`,{className:i(`h-2 w-2 rounded-full`,a?`animate-pulse bg-up`:`bg-faint`)}),t(a?`live.live`:c?`live.noTrading`:`live.closed`)]}),(0,s.jsx)(`span`,{children:d==null?t(`live.connecting`):a?d<1?t(`live.updatedNow`):t(`live.updatedAgo`,{count:Math.round(d)}):t(`live.lastTraded`)}),(0,s.jsxs)(`span`,{className:`hidden text-faint sm:inline`,children:[`· `,u]}),l&&(0,s.jsxs)(`span`,{className:`text-warn`,children:[`· `,l]})]})}var u=e(t(),1),d=1e3,f=1200,p=(e,t)=>`${e}:${t.toUpperCase()}`;function m(e,t=!0){let[n,r]=(0,u.useState)({}),[i,o]=(0,u.useState)({markets:{},updated:null}),[s,c]=(0,u.useState)({}),l=(0,u.useRef)({}),m=(0,u.useMemo)(()=>{let t={};for(let n of e)n.type!==`mf`&&n.market&&n.symbol&&(t[n.market]??=[]).push(n.symbol);return t},[e]),h=JSON.stringify(m);(0,u.useEffect)(()=>{if(!t||!Object.keys(m).length)return;let e=!1,n;async function i(){if(document.visibilityState===`visible`){let t=await Promise.allSettled(Object.entries(m).map(([e,t])=>a.get(`/listings/live`,{params:{market:e,symbols:t.join(`,`)}}).then(t=>({market:e,data:t.data}))));if(e)return;let n={},i={},s={},u=Date.now();for(let e of t){if(e.status!==`fulfilled`)continue;let{market:t,data:r}=e.value;i[t]={open:r.open,age_seconds:r.age_seconds,source:r.source,error:r.error,last_trade:r.last_trade};for(let[e,i]of Object.entries(r.quotes)){let r=p(t,e);n[r]=i;let a=l.current[r];a!=null&&i.price!==a&&(s[r]={dir:i.price>a?`up`:`down`,until:u+f}),l.current[r]=i.price}}r(e=>({...e,...n}));let d=Object.values(i).map(e=>e.age_seconds).filter(e=>e!=null);o({markets:i,updated:d.length?Math.min(...d):null}),Object.keys(s).length&&c(e=>({...e,...s}))}e||(n=setTimeout(i,d))}return i(),()=>{e=!0,n&&clearTimeout(n)}},[h,t]);let g=(0,u.useMemo)(()=>e.map(e=>{let t=e.type===`mf`?void 0:n[p(e.market,e.symbol)];return t?{...e,price:t.price,change_percent:t.change_percent??e.change_percent,volume:t.volume??e.volume}:e}),[e,n]);function _(e){let t=s[p(e.market,e.symbol)];return t&&t.until>Date.now()?`flash-${t.dir}`:``}return{rows:g,status:i,flash:_}}export{l as n,c as r,m as t};
@@ -0,0 +1 @@
1
+ var e={title:`Mercados`,intro:`Todas las acciones, ETF y fondos de inversión, con búsqueda y orden.`,listings_one:`{{n}} valor`,listings_many:`{{n}} valores`,listings_other:`{{n}} valores`,dataUpdated:`datos actualizados {{ago}}`,refresh:`Actualizar datos`,refreshed:`Listado actualizado`,searchSubtitle:`Búsqueda «{{q}}»`,exportNote:`Primeras {{first}} de {{total}} coincidencias; acota los filtros para exportar el resto.`,ethical:{only:`Solo éticas`,count_one:`{{n}} ética`,count_many:`{{n}} éticas`,count_other:`{{n}} éticas`,onDescription:`Se muestran empresas y fondos que pasan el filtro ético. Abre una acción para ver sus ratios de deuda, efectivo e ingresos por intereses y la parte de los dividendos que conviene donar.`,offDescription:`Oculta bancos, aseguradoras, alcohol, tabaco, juego y otros negocios excluidos, además de los fondos convencionales.`},marketTabs:{india:{label:`India`,hint:`Todas las acciones y ETF de NSE + todos los fondos de AMFI`},us:{label:`EE. UU.`,hint:`Todas las acciones y ETF de NYSE / NASDAQ / AMEX`},china_a:{label:`China A`,hint:`Todas las acciones de Shanghái / Shenzhen / Pekín`},hong_kong:{label:`Hong Kong`,hint:`Todas las acciones, ETF y REIT de HKEX`},crypto:{label:`Cripto`,hint:`Principales pares con USDT`},all:{label:`Todos los mercados`,hint:`Todo lo anterior en una lista`}},types:{all:`Todo`,stock:`Acciones`,etf:`ETF`,mf:`Fondos de inversión`,crypto:`Cripto`},fund:`Fondo`,allIndustries:`Todas las industrias`,allSubCategories:`Todas las subcategorías`,searchStocks:`Buscar por símbolo o nombre de empresa`,searchFunds:`Buscar por nombre del fondo, gestora o código`,filtersButton:`Filtros`,clear:`Quitar filtros`,clearTitle:`Quitar la búsqueda, la industria y todos los filtros`,plan:{both:`Direct + Regular`,direct:`Direct`,regular:`Regular`},option:{any:`Cualquier opción`,growth:`Growth`},unavailable:`{{market}}: listado no disponible`,partial:`{{market}}: mostrando datos en caché o parciales`,retrying:`Reintentando automáticamente.`,loadError:`No se pudo cargar el listado`,categoryGuessed:`Categoría deducida del nombre de la empresa`,badge:{halal:`Ética`,doubtful:`Dudosa`,haram:`No ética`,unknown:`Sin filtrar`},empty:{title:`Ningún resultado`,noData:`Este mercado aún no tiene datos: mira el aviso de arriba.`,tryAgain:`Prueba una búsqueda más corta o quita los filtros.`},pager:{range:`{{from}}–{{to}} de {{total}}`,first:`Primera`,prev:`Anterior`,next:`Siguiente`,page:`Página {{page}} / {{pages}}`},col:{watch:`Seguir`,name:`Nombre`,market:`Mercado`,category:`Categoría`,price:`Precio`,nav:`Valor liq.`,sipDay:`Día SIP`,navDate:`Fecha valor liq.`,change:`Var. %`,marketCap:`Capit.`,volume:`Volumen`,range:`Rango 52 sem.`},filter:{any:`Cualquiera`,changeHint:`Variación de hoy en %, p. ej. mín. 2 o máx. -3`,capHint:`p. ej. mín. 2B, máx. 10B`,capHintIndia:`p. ej. mín. 5000cr, máx. 20000cr`,volumeHint:`Acciones negociadas hoy, p. ej. mín. 1M`},filters:{category:`Categoría`,fundType:`Tipo de fondo`,pickAny:`elige las que quieras`,noCategories:`No hay categorías en esta vista.`,ethical:`Ética`,ethicalHint:`filtro de inversión ética`,shariah:{halal:`Éticas`,halalHint:`Fondos: mandato con filtro ético. Acciones: el negocio pasa el filtro; abre la acción para ver los ratios de deuda / efectivo / ingresos por intereses`,doubtful:`Dudosas`,doubtfulHint:`Actividad mixta (hoteles, medios, REIT…): revisa las fuentes de ingresos`,haram:`No cumplen`,haramHint:`Finanzas o seguros basados en intereses, alcohol, tabaco, juego, cerdo, armas, contenido adulto, o un fondo convencional / con intereses`,unknown:`Sin clasificar`,unknownHint:`Sin datos de sector: abre la acción para un análisis completo`},sip:`Mejor día SIP`,sipHint:`últimos 3 / 5 / 10 años`,sipEdge:{consistent:`Día constante`,consistentHint:`El mejor día SIP cayó en fechas cercanas en 3, 5 y 10 años`,no_edge:`Sin ventaja fiable`,no_edgeHint:`El mejor día cambió entre periodos: cualquier día vale igual`,negligible:`Diferencia mínima`,negligibleHint:`El mejor y el peor día difieren menos de 0,1 puntos al año (casi todos los fondos de deuda)`,short:`Menos de 5 años`,shortHint:`Solo 3-5 años de precios, demasiado poco para comprobar la constancia`},nav:`Valor liquidativo`,price:{label:`Precio`,in:`en {{symbol}}`,eachCurrency:`en la moneda de cada valor`,under:`Menos de {{n}}`,above:`Más de {{n}}`},min:`Mín.`,max:`Máx.`,minPrice:`Precio mínimo`,maxPrice:`Precio máximo`,marketCap:`Capitalización`,cap:{mega:`Mega cap`,large:`Gran cap`,mid:`Mediana cap`,small:`Pequeña cap`,micro:`Micro cap`},today:`Hoy`,change:{gainers:`Suben`,losers:`Bajan`,up5:`Suben ≥ 5%`,down5:`Bajan ≥ 5%`},w52:{label:`52 semanas`,high:`Cerca del máx. 52 sem.`,highHint:`a menos del 5% del máximo de 52 semanas`,low:`Cerca del mín. 52 sem.`,lowHint:`a menos del 5% del mínimo de 52 semanas`},volume:`Volumen`,volumeHint:`acciones negociadas hoy`,clearAll:`Quitar todos los filtros`},insights:{title:`Claves del mercado`,list:`Todos los listados`,groups:{stocks:`Acciones`,markets:`Mercados`,economy:`Economía`},tabs:{hot_trade:{label:`Acciones calientes`,inline:`acciones calientes`},hot_invest:{label:`Tendencias`,inline:`tendencias`},pulse:{label:`Pulso del mercado`,inline:`pulso del mercado`},rotation:{label:`Rotación sectorial`,inline:`rotación sectorial`},funds:{label:`Rotación de fondos`,inline:`rotación de fondos`},deals:{label:`Grandes operaciones`,inline:`grandes operaciones`},screens:{label:`Filtros`,inline:`filtros`},rates:{label:`Tipos y metales`,inline:`tipos y metales`},mood:{label:`Ánimo del mercado`,inline:`ánimo del mercado`},flows:{label:`Flujos FII / DII`,inline:`flujos FII / DII`},world:{label:`Mercados mundiales`,inline:`mercados mundiales`},valuation:{label:`Valoración del mercado`,inline:`valoración del mercado`},macro:{label:`Macro`,inline:`macro`},countries:{label:`Países`,inline:`países`},commodities:{label:`Materias primas`,inline:`materias primas`},oil:{label:`Sensibilidad al petróleo`,inline:`sensibilidad al petróleo`}}}};export{e as default};
@@ -0,0 +1 @@
1
+ var e={title:`الأسواق`,intro:`كل الأسهم والصناديق المتداولة وصناديق الاستثمار، مع البحث والترتيب.`,listings_zero:`لا أدوات`,listings_one:`أداة واحدة`,listings_two:`أداتان`,listings_few:`{{n}} أدوات`,listings_many:`{{n}} أداة`,listings_other:`{{n}} أداة`,dataUpdated:`حُدّثت البيانات {{ago}}`,refresh:`تحديث البيانات`,refreshed:`تم تحديث القائمة`,searchSubtitle:`البحث عن "{{q}}"`,exportNote:`أول {{first}} من {{total}} نتيجة؛ ضيّق الفلاتر لتصدير الباقي.`,ethical:{only:`الأخلاقية فقط`,count_zero:`لا أدوات أخلاقية`,count_one:`أداة أخلاقية واحدة`,count_two:`أداتان أخلاقيتان`,count_few:`{{n}} أدوات أخلاقية`,count_many:`{{n}} أداة أخلاقية`,count_other:`{{n}} أداة أخلاقية`,onDescription:`تُعرض الشركات والصناديق التي تجتاز الفحص الأخلاقي. افتح السهم لترى نسب الدين والنقد والدخل من الفوائد، وحصة الأرباح التي ينبغي التبرع بها.`,offDescription:`إخفاء البنوك وشركات التأمين والكحول والتبغ والقمار وغيرها من الأنشطة المستبعدة، والصناديق التقليدية.`},marketTabs:{india:{label:`الهند`,hint:`كل أسهم وصناديق NSE المتداولة + كل صناديق AMFI`},us:{label:`أمريكا`,hint:`كل أسهم وصناديق NYSE / NASDAQ / AMEX المتداولة`},china_a:{label:`الصين A`,hint:`كل أسهم شنغهاي / شنتشن / بكين`},hong_kong:{label:`هونغ كونغ`,hint:`كل أسهم HKEX وصناديقها المتداولة وصناديق الريت`},crypto:{label:`العملات الرقمية`,hint:`أهم أزواج التداول مقابل USDT`},all:{label:`كل الأسواق`,hint:`كل ما سبق في قائمة واحدة`}},types:{all:`الكل`,stock:`الأسهم`,etf:`الصناديق المتداولة`,mf:`صناديق الاستثمار`,crypto:`العملات الرقمية`},fund:`صندوق`,allIndustries:`كل القطاعات`,allSubCategories:`كل الفئات الفرعية`,searchStocks:`ابحث بالرمز أو اسم الشركة`,searchFunds:`ابحث باسم الصندوق أو شركة الإدارة أو الرمز`,filtersButton:`الفلاتر`,clear:`مسح الفلاتر`,clearTitle:`إزالة البحث والقطاع وكل الفلاتر`,plan:{both:`Direct + Regular`,direct:`Direct`,regular:`Regular`},option:{any:`أي خيار`,growth:`Growth`},unavailable:`قائمة {{market}} غير متاحة`,partial:`{{market}}: تُعرض بيانات مخزّنة أو جزئية`,retrying:`إعادة المحاولة تلقائيًا.`,loadError:`تعذّر تحميل القائمة`,categoryGuessed:`الفئة مستنتجة من اسم الشركة`,badge:{halal:`أخلاقي`,doubtful:`مشكوك فيه`,haram:`غير أخلاقي`,unknown:`غير مفحوص`},empty:{title:`لا توجد نتائج`,noData:`لا بيانات لهذا السوق بعد - انظر التنبيه أعلاه.`,tryAgain:`جرّب بحثًا أقصر أو امسح الفلاتر.`},pager:{range:`{{from}}–{{to}} من {{total}}`,first:`الأولى`,prev:`السابقة`,next:`التالية`,page:`صفحة {{page}} / {{pages}}`},col:{watch:`متابعة`,name:`الاسم`,market:`السوق`,category:`الفئة`,price:`السعر`,nav:`صافي القيمة`,sipDay:`يوم الاستثمار الدوري`,navDate:`تاريخ صافي القيمة`,change:`التغير %`,marketCap:`القيمة السوقية`,volume:`الحجم`,range:`نطاق 52 أسبوعًا`},filter:{any:`أي`,changeHint:`تغيّر اليوم بالنسبة المئوية، مثل: الحد الأدنى 2 أو الأقصى -3`,capHint:`مثل: الحد الأدنى 2B، الأقصى 10B`,capHintIndia:`مثل: الحد الأدنى 5000cr، الأقصى 20000cr`,volumeHint:`الأسهم المتداولة اليوم، مثل: الحد الأدنى 1M`},filters:{category:`الفئة`,fundType:`نوع الصندوق`,pickAny:`اختر ما تشاء`,noCategories:`لا فئات في هذا العرض.`,ethical:`أخلاقي`,ethicalHint:`فحص الاستثمار الأخلاقي`,shariah:{halal:`أخلاقي`,halalHint:`الصناديق: تفويض خاضع للفحص الأخلاقي. الأسهم: النشاط يجتاز الفحص - افتح السهم لترى نسب الدين / النقد / الدخل من الفوائد`,doubtful:`مشكوك فيه`,doubtfulHint:`نشاط مختلط (فنادق، إعلام، صناديق ريت…) - راجع مصادر الإيرادات`,haram:`غير متوافق`,haramHint:`تمويل أو تأمين قائم على الفائدة، كحول، تبغ، قمار، لحم خنزير، أسلحة، محتوى للبالغين - أو صندوق تقليدي / بفائدة`,unknown:`غير مصنّف`,unknownHint:`لا بيانات عن القطاع - افتح السهم لفحص كامل`},sip:`أفضل يوم للاستثمار الدوري`,sipHint:`آخر 3 / 5 / 10 سنوات`,sipEdge:{consistent:`يوم ثابت`,consistentHint:`وقع أفضل يوم للاستثمار الدوري في أيام متقاربة خلال 3 و5 و10 سنوات`,no_edge:`لا أفضلية موثوقة`,no_edgeHint:`تغيّر أفضل يوم بين الفترات: أي يوم مثل غيره`,negligible:`الفرق ضئيل جدًا`,negligibleHint:`الفرق بين أفضل وأسوأ يوم أقل من 0.1 نقطة سنويًا (معظم صناديق الدين)`,short:`أقل من 5 سنوات`,shortHint:`أسعار 3-5 سنوات فقط، مدة قصيرة لقياس الثبات`},nav:`صافي القيمة`,price:{label:`السعر`,in:`بـ {{symbol}}`,eachCurrency:`بعملة كل أداة`,under:`أقل من {{n}}`,above:`أعلى من {{n}}`},min:`الأدنى`,max:`الأقصى`,minPrice:`أدنى سعر`,maxPrice:`أعلى سعر`,marketCap:`القيمة السوقية`,cap:{mega:`عملاقة`,large:`كبيرة`,mid:`متوسطة`,small:`صغيرة`,micro:`متناهية الصغر`},today:`اليوم`,change:{gainers:`الرابحة`,losers:`الخاسرة`,up5:`صعود ≥ 5%`,down5:`هبوط ≥ 5%`},w52:{label:`52 أسبوعًا`,high:`قرب أعلى 52 أسبوعًا`,highHint:`ضمن 5% من أعلى سعر خلال 52 أسبوعًا`,low:`قرب أدنى 52 أسبوعًا`,lowHint:`ضمن 5% من أدنى سعر خلال 52 أسبوعًا`},volume:`الحجم`,volumeHint:`الأسهم المتداولة اليوم`,clearAll:`مسح كل الفلاتر`},insights:{title:`رؤى السوق`,list:`كل الإدراجات`,groups:{stocks:`الأسهم`,markets:`الأسواق`,economy:`الاقتصاد`},tabs:{hot_trade:{label:`أسهم ساخنة`,inline:`أسهم ساخنة`},hot_invest:{label:`الرائج`,inline:`الرائج`},pulse:{label:`نبض السوق`,inline:`نبض السوق`},rotation:{label:`دوران القطاعات`,inline:`دوران القطاعات`},funds:{label:`دوران الصناديق`,inline:`دوران الصناديق`},deals:{label:`صفقات كبيرة`,inline:`صفقات كبيرة`},screens:{label:`فلاتر جاهزة`,inline:`فلاتر جاهزة`},rates:{label:`الفائدة والمعادن`,inline:`الفائدة والمعادن`},mood:{label:`مزاج السوق`,inline:`مزاج السوق`},flows:{label:`تدفقات FII / DII`,inline:`تدفقات FII / DII`},world:{label:`الأسواق العالمية`,inline:`الأسواق العالمية`},valuation:{label:`تقييم السوق`,inline:`تقييم السوق`},macro:{label:`الاقتصاد الكلي`,inline:`الاقتصاد الكلي`},countries:{label:`الدول`,inline:`الدول`},commodities:{label:`السلع`,inline:`السلع`},oil:{label:`الحساسية للنفط`,inline:`الحساسية للنفط`}}}};export{e as default};
@@ -0,0 +1 @@
1
+ var e={title:`Рынки`,intro:`Все акции, ETF и паевые фонды — с поиском и сортировкой.`,listings_one:`{{n}} инструмент`,listings_few:`{{n}} инструмента`,listings_many:`{{n}} инструментов`,listings_other:`{{n}} инструмента`,dataUpdated:`данные обновлены {{ago}}`,refresh:`Обновить данные`,refreshed:`Список обновлён`,searchSubtitle:`Поиск «{{q}}»`,exportNote:`Первые {{first}} из {{total}} совпадений; сузьте фильтры, чтобы выгрузить остальное.`,ethical:{only:`Только этичные`,count_one:`{{n}} этичный`,count_few:`{{n}} этичных`,count_many:`{{n}} этичных`,count_other:`{{n}} этичных`,onDescription:`Показаны компании и фонды, прошедшие этическую проверку. Откройте акцию, чтобы увидеть долю долга, денежных средств и процентного дохода, а также часть дивидендов, которую стоит отдать на благотворительность.`,offDescription:`Скрыть банки, страховщиков, алкоголь, табак, азартные игры и другие исключённые бизнесы, а также обычные фонды.`},marketTabs:{india:{label:`Индия`,hint:`Все акции и ETF на NSE + все паевые фонды AMFI`},us:{label:`США`,hint:`Все акции и ETF на NYSE / NASDAQ / AMEX`},china_a:{label:`Китай A`,hint:`Все акции Шанхая / Шэньчжэня / Пекина`},hong_kong:{label:`Гонконг`,hint:`Все акции, ETF и REIT на HKEX`},crypto:{label:`Крипто`,hint:`Основные пары к USDT`},all:{label:`Все рынки`,hint:`Всё перечисленное одним списком`}},types:{all:`Все`,stock:`Акции`,etf:`ETF`,mf:`Паевые фонды`,crypto:`Крипто`},fund:`Фонд`,allIndustries:`Все отрасли`,allSubCategories:`Все подкатегории`,searchStocks:`Поиск по тикеру или названию компании`,searchFunds:`Поиск по названию фонда, УК или коду схемы`,filtersButton:`Фильтры`,clear:`Сбросить фильтры`,clearTitle:`Убрать поиск, отрасль и все фильтры`,plan:{both:`Direct + Regular`,direct:`Direct`,regular:`Regular`},option:{any:`Любой вариант`,growth:`Growth`},unavailable:`{{market}}: список недоступен`,partial:`{{market}}: показаны кэшированные или неполные данные`,retrying:`Повторяем автоматически.`,loadError:`Не удалось загрузить список`,categoryGuessed:`Категория определена по названию компании`,badge:{halal:`Этичная`,doubtful:`Сомнительная`,haram:`Неэтичная`,unknown:`Не проверена`},empty:{title:`Ничего не найдено`,noData:`По этому рынку пока нет данных — см. предупреждение выше.`,tryAgain:`Сократите запрос или сбросьте фильтры.`},pager:{range:`{{from}}–{{to}} из {{total}}`,first:`В начало`,prev:`Назад`,next:`Далее`,page:`Стр. {{page}} / {{pages}}`},col:{watch:`Следить`,name:`Название`,market:`Рынок`,category:`Категория`,price:`Цена`,nav:`СЧА`,sipDay:`День SIP`,navDate:`Дата СЧА`,change:`Изм. %`,marketCap:`Капит.`,volume:`Объём`,range:`Диапазон 52 нед.`},filter:{any:`Любой`,changeHint:`Изменение за сегодня в %, напр. мин. 2 или макс. -3`,capHint:`напр. мин. 2B, макс. 10B`,capHintIndia:`напр. мин. 5000cr, макс. 20000cr`,volumeHint:`Акций продано сегодня, напр. мин. 1M`},filters:{category:`Категория`,fundType:`Тип фонда`,pickAny:`можно выбрать несколько`,noCategories:`Для этого вида нет категорий.`,ethical:`Этичность`,ethicalHint:`этическая проверка`,shariah:{halal:`Этичные`,halalHint:`Фонды: мандат с этической проверкой. Акции: бизнес проходит проверку — откройте акцию, чтобы увидеть доли долга, денежных средств и процентного дохода`,doubtful:`Сомнительные`,doubtfulHint:`Смешанная деятельность (отели, медиа, REIT…) — проверьте источники выручки`,haram:`Не соответствуют`,haramHint:`Процентное финансирование или страхование, алкоголь, табак, азартные игры, свинина, оружие, контент для взрослых — или процентный / обычный фонд`,unknown:`Без классификации`,unknownHint:`Нет данных об отрасли — откройте акцию для полной проверки`},sip:`Лучший день SIP`,sipHint:`за 3 / 5 / 10 лет`,sipEdge:{consistent:`Стабильный день`,consistentHint:`Лучший день SIP за 3, 5 и 10 лет приходился на близкие даты`,no_edge:`Нет надёжного преимущества`,no_edgeHint:`Лучший день менялся от периода к периоду: любой день не хуже другого`,negligible:`Разница слишком мала`,negligibleHint:`Лучший и худший день отличаются меньше чем на 0,1 п. в год (большинство долговых фондов)`,short:`Меньше 5 лет`,shortHint:`Есть только 3–5 лет цен — слишком мало для проверки стабильности`},nav:`СЧА`,price:{label:`Цена`,in:`в {{symbol}}`,eachCurrency:`в валюте каждого инструмента`,under:`До {{n}}`,above:`Выше {{n}}`},min:`Мин.`,max:`Макс.`,minPrice:`Минимальная цена`,maxPrice:`Максимальная цена`,marketCap:`Капитализация`,cap:{mega:`Мегакап`,large:`Крупные`,mid:`Средние`,small:`Малые`,micro:`Микрокап`},today:`Сегодня`,change:{gainers:`Растут`,losers:`Падают`,up5:`Рост ≥ 5%`,down5:`Падение ≥ 5%`},w52:{label:`52 недели`,high:`У максимума 52 нед.`,highHint:`в пределах 5% от максимума за 52 недели`,low:`У минимума 52 нед.`,lowHint:`в пределах 5% от минимума за 52 недели`},volume:`Объём`,volumeHint:`акций продано сегодня`,clearAll:`Сбросить все фильтры`},insights:{title:`Обзор рынка`,list:`Все бумаги`,groups:{stocks:`Акции`,markets:`Рынки`,economy:`Экономика`},tabs:{hot_trade:{label:`Горячие акции`,inline:`горячие акции`},hot_invest:{label:`В тренде`,inline:`в тренде`},pulse:{label:`Пульс рынка`,inline:`пульс рынка`},rotation:{label:`Ротация отраслей`,inline:`ротация отраслей`},funds:{label:`Ротация фондов`,inline:`ротация фондов`},deals:{label:`Крупные сделки`,inline:`крупные сделки`},screens:{label:`Скринеры`,inline:`скринеры`},rates:{label:`Ставки и металлы`,inline:`ставки и металлы`},mood:{label:`Настроение рынка`,inline:`настроение рынка`},flows:{label:`Потоки FII / DII`,inline:`потоки FII / DII`},world:{label:`Мировые рынки`,inline:`мировые рынки`},valuation:{label:`Оценка рынка`,inline:`оценка рынка`},macro:{label:`Макро`,inline:`макро`},countries:{label:`Страны`,inline:`страны`},commodities:{label:`Сырьё`,inline:`сырьё`},oil:{label:`Зависимость от нефти`,inline:`зависимость от нефти`}}}};export{e as default};