Files
DinQuant/frontend/dist/js/53.feb2b5f5.js
T
Dinger 8563e4ea53 v3.0.1
Signed-off-by: Dinger <quantdinger@gmail.com>
2026-04-07 22:47:07 +08:00

18 lines
381 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
(self["webpackChunkvue_antd_pro"]=self["webpackChunkvue_antd_pro"]||[]).push([[53],{66593:function(t,e,i){"use strict";i.r(e),i.d(e,{default:function(){return $a}});var n=function(){var t=this,e=t._self._c;return e("div",{staticClass:"chart-container",class:{"theme-dark":t.isDarkTheme}},[e("div",{staticClass:"chart-header"},[e("div",{staticClass:"header-top"},[e("div",{staticClass:"header-left"},[e("div",{staticClass:"search-section"},[e("a-select",{staticClass:"symbol-select",attrs:{"show-search":"",placeholder:t.$t("dashboard.indicator.selectSymbol"),dropdownClassName:"dark-dropdown","filter-option":t.filterSymbolOption,"not-found-content":null,open:t.symbolSearchOpen},on:{search:t.handleSymbolSearch,change:t.handleSymbolSelect,dropdownVisibleChange:t.handleDropdownVisibleChange},model:{value:t.searchSymbol,callback:function(e){t.searchSymbol=e},expression:"searchSymbol"}},[e("a-icon",{staticStyle:{color:"#999"},attrs:{slot:"suffixIcon",type:"search"},slot:"suffixIcon"}),t._l(t.symbolSuggestions,function(i){return e("a-select-option",{key:i.value,attrs:{value:i.value}},[e("div",{staticClass:"symbol-option"},[e("a-tag",{staticStyle:{"margin-right":"8px","margin-bottom":"0"},attrs:{color:t.getMarketColor(i.market)}},[t._v(" "+t._s(t.getMarketName(i.market))+" ")]),e("span",{staticClass:"symbol-name"},[t._v(t._s(i.symbol))]),i.name?e("span",{staticClass:"symbol-name-extra"},[t._v(t._s(i.name))]):t._e()],1)])}),e("a-select-option",{key:"add-stock-option",staticClass:"add-stock-option",attrs:{value:"__add_stock_option__"}},[e("div",{staticStyle:{width:"100%","text-align":"center",padding:"4px 0",color:"#1890ff",cursor:"pointer"}},[e("a-icon",{staticStyle:{"margin-right":"4px"},attrs:{type:"plus"}}),e("span",[t._v(t._s(t.$t("dashboard.analysis.watchlist.add")))])],1)])],2)],1),e("div",{staticClass:"timeframe-group"},t._l(["1m","5m","15m","30m","1H","4H","1D","1W"],function(i){return e("div",{key:i,staticClass:"timeframe-item",class:{active:t.timeframe===i},on:{click:function(e){return t.setTimeframe(i)}}},[t._v(" "+t._s(i)+" ")])}),0)]),t.currentSymbol?e("div",{staticClass:"current-symbol"},[e("div",{staticClass:"symbol-info"},[e("span",{staticClass:"symbol-label"},[t._v(t._s(t.currentSymbol))]),e("span",{staticClass:"market-tag"},[t._v(t._s(t.currentMarket))])]),e("div",{staticClass:"price-info",class:t.priceChangeClass},[e("span",{staticClass:"symbol-price"},[t._v(t._s(t.currentPrice))]),e("span",{staticClass:"symbol-change"},[t._v(" "+t._s(t.priceChange>0?"+":"")+t._s(t.priceChange.toFixed(2))+"% ")])]),t.isCryptoMarket?e("a-button",{staticClass:"qt-header-btn",attrs:{size:"small"},on:{click:t.openQuickTrade}},[e("a-icon",{attrs:{type:"thunderbolt",theme:"filled"}}),t._v(" "+t._s(t.$t("quickTrade.openPanel"))+" ")],1):t._e()],1):t._e()])]),e("div",{staticClass:"chart-content"},[e("div",{staticClass:"chart-main-row"},[t.currentSymbol?e("div",{staticClass:"mobile-symbol-price"},[e("div",{staticClass:"mobile-symbol-info"},[e("span",{staticClass:"mobile-market-tag"},[t._v(t._s(t.currentMarket))]),e("span",[t._v("-")]),e("span",{staticClass:"mobile-symbol-label"},[t._v(t._s(t.currentSymbol))])]),e("div",{staticClass:"mobile-price-info",class:t.priceChangeClass},[e("span",{staticClass:"mobile-symbol-price"},[t._v(t._s(t.currentPrice))]),e("span",{staticClass:"mobile-symbol-change"},[t._v(" "+t._s(t.priceChange>0?"+":"")+t._s(t.priceChange.toFixed(2))+"% ")])])]):t._e(),e("kline-chart",{ref:"klineChart",attrs:{symbol:t.currentSymbol,market:t.currentMarket,timeframe:t.timeframe,theme:t.chartTheme,activeIndicators:t.activeIndicators,realtimeEnabled:t.realtimeEnabled},on:{"price-change":t.handlePriceChange,retry:t.handleChartRetry,"indicator-toggle":t.handleIndicatorToggle}}),e("div",{staticClass:"chart-right"},[e("div",{staticClass:"indicators-panel"},[e("div",{staticClass:"panel-header"},[e("span",[t._v(t._s(t.$t("dashboard.indicator.panel.title")))]),e("div",{staticStyle:{display:"flex","align-items":"center","margin-left":"auto",gap:"8px"}},[t.isMobile?e("a-button",{staticClass:"mobile-header-create-btn",attrs:{type:"primary",size:"small",icon:"plus"},on:{click:t.handleCreateIndicator}},[t._v(" "+t._s(t.$t("dashboard.indicator.create"))+" ")]):t._e(),e("a-tooltip",{attrs:{title:t.realtimeEnabled?t.$t("dashboard.indicator.panel.realtimeOn"):t.$t("dashboard.indicator.panel.realtimeOff")}},[e("a-button",{staticClass:"realtime-toggle-btn",class:{active:t.realtimeEnabled},attrs:{type:"text"},on:{click:t.toggleRealtime}},[e("a-icon",{attrs:{type:t.realtimeEnabled?"sync":"pause-circle",spin:t.realtimeEnabled}})],1)],1)],1)]),e("div",{staticClass:"panel-body"},[t.isMobile?[e("div",{staticClass:"mobile-tab-content"},[e("div",{staticClass:"section-content custom-scrollbar"},[t._l(t.customIndicators,function(i){return e("div",{key:"custom-"+i.id,class:["indicator-card",{"indicator-active":t.isIndicatorActive("custom-"+i.id)}],on:{click:function(e){return t.toggleIndicator(i,"custom")}}},[e("div",{staticClass:"card-content"},[e("div",{staticClass:"card-header"},[e("span",{staticClass:"card-name"},[t._v(t._s(i.name))]),e("div",{staticClass:"card-actions"},[e("a-tooltip",{attrs:{title:t.$t("dashboard.indicator.action.edit")}},[e("a-icon",{staticClass:"action-icon edit-icon",attrs:{type:"edit"},on:{click:function(e){return e.stopPropagation(),t.handleEditIndicator(i)}}})],1),e("a-tooltip",{attrs:{title:t.$t("dashboard.indicator.action.delete")}},[e("a-icon",{staticClass:"action-icon delete-icon",attrs:{type:"delete"},on:{click:function(e){return e.stopPropagation(),t.handleDeleteIndicator(i)}}})],1),e("a-tooltip",{attrs:{title:t.isIndicatorActive("custom-"+i.id)?t.$t("dashboard.indicator.action.stop"):t.$t("dashboard.indicator.action.start")}},[e("a-icon",{class:["action-icon","toggle-icon",{active:t.isIndicatorActive("custom-"+i.id)}],attrs:{type:t.isIndicatorActive("custom-"+i.id)?"pause-circle":"play-circle"},on:{click:function(e){return e.stopPropagation(),t.toggleIndicator(i,"custom")}}})],1),e("a-tooltip",{attrs:{title:t.$t("dashboard.indicator.backtest.title")}},[e("a-icon",{staticClass:"action-icon backtest-icon",attrs:{type:"experiment"},on:{click:function(e){return e.stopPropagation(),t.handleOpenBacktest(i)}}})],1),e("a-tooltip",{attrs:{title:t.$t("dashboard.indicator.backtest.historyTitle")}},[e("a-icon",{staticClass:"action-icon backtest-history-icon",attrs:{type:"clock-circle"},on:{click:function(e){return e.stopPropagation(),t.handleOpenBacktestHistory(i)}}})],1),e("a-tooltip",{attrs:{title:i.publish_to_community?t.$t("dashboard.indicator.action.unpublish"):t.$t("dashboard.indicator.action.publish")}},[e("a-icon",{class:["action-icon","publish-icon",{published:i.publish_to_community}],attrs:{type:i.publish_to_community?"cloud":"cloud-upload"},on:{click:function(e){return e.stopPropagation(),t.handlePublishIndicator(i)}}})],1)],1)]),e("span",{staticClass:"card-desc"},[t._v(t._s(i.description||""))])])])}),0===t.customIndicators.length?e("div",{staticClass:"empty-indicators"},[e("a-icon",{attrs:{type:"info-circle"}}),e("span",[t._v(t._s(t.$t("dashboard.indicator.empty")))])],1):t._e()],2)])]:[e("div",{staticClass:"indicator-section",class:{"section-empty":0===t.customIndicators.length}},[e("div",{staticClass:"section-label"},[e("div",{staticClass:"section-label-left",on:{click:t.toggleCustomSection}},[e("a-icon",{staticClass:"collapse-icon",attrs:{type:t.customSectionCollapsed?"right":"down"}}),e("span",[t._v(t._s(t.$t("dashboard.indicator.section.myCreated"))+" ("+t._s(t.customIndicators.length)+")")])],1),e("a-button",{staticClass:"create-indicator-btn",attrs:{type:"primary",size:"small",icon:"plus"},on:{click:function(e){return e.stopPropagation(),t.handleCreateIndicator.apply(null,arguments)}}},[t._v(" "+t._s(t.$t("dashboard.indicator.create"))+" ")])],1),e("div",{directives:[{name:"show",rawName:"v-show",value:!t.customSectionCollapsed,expression:"!customSectionCollapsed"}],staticClass:"section-content custom-scrollbar"},[t._l(t.customIndicators,function(i){return e("div",{key:"custom-"+i.id,class:["indicator-card",{"indicator-active":t.isIndicatorActive("custom-"+i.id)}],on:{click:function(e){return t.toggleIndicator(i,"custom")}}},[e("div",{staticClass:"card-content"},[e("div",{staticClass:"card-header"},[e("span",{staticClass:"card-name"},[t._v(t._s(i.name))]),e("div",{staticClass:"card-actions"},[e("a-tooltip",{attrs:{title:t.$t("dashboard.indicator.action.edit")}},[e("a-icon",{staticClass:"action-icon edit-icon",attrs:{type:"edit"},on:{click:function(e){return e.stopPropagation(),t.handleEditIndicator(i)}}})],1),e("a-tooltip",{attrs:{title:t.$t("dashboard.indicator.action.delete")}},[e("a-icon",{staticClass:"action-icon delete-icon",attrs:{type:"delete"},on:{click:function(e){return e.stopPropagation(),t.handleDeleteIndicator(i)}}})],1),e("a-tooltip",{attrs:{title:t.isIndicatorActive("custom-"+i.id)?t.$t("dashboard.indicator.action.stop"):t.$t("dashboard.indicator.action.start")}},[e("a-icon",{class:["action-icon","toggle-icon",{active:t.isIndicatorActive("custom-"+i.id)}],attrs:{type:t.isIndicatorActive("custom-"+i.id)?"pause-circle":"play-circle"},on:{click:function(e){return e.stopPropagation(),t.toggleIndicator(i,"custom")}}})],1),e("a-tooltip",{attrs:{title:t.$t("dashboard.indicator.backtest.title")}},[e("a-icon",{staticClass:"action-icon backtest-icon",attrs:{type:"experiment"},on:{click:function(e){return e.stopPropagation(),t.handleOpenBacktest(i)}}})],1),e("a-tooltip",{attrs:{title:t.$t("dashboard.indicator.backtest.historyTitle")}},[e("a-icon",{staticClass:"action-icon backtest-history-icon",attrs:{type:"clock-circle"},on:{click:function(e){return e.stopPropagation(),t.handleOpenBacktestHistory(i)}}})],1),e("a-tooltip",{attrs:{title:i.publish_to_community?t.$t("dashboard.indicator.action.unpublish"):t.$t("dashboard.indicator.action.publish")}},[e("a-icon",{class:["action-icon","publish-icon",{published:i.publish_to_community}],attrs:{type:i.publish_to_community?"cloud":"cloud-upload"},on:{click:function(e){return e.stopPropagation(),t.handlePublishIndicator(i)}}})],1),e("a-tooltip",{attrs:{title:t.$t("dashboard.indicator.action.createStrategy")}},[e("a-icon",{staticClass:"action-icon create-strategy-icon",attrs:{type:"rocket"},on:{click:function(e){return e.stopPropagation(),t.handleCreateStrategyFromIndicator(i)}}})],1)],1)]),e("span",{staticClass:"card-desc"},[t._v(t._s(i.description||""))])])])}),0===t.customIndicators.length?e("div",{staticClass:"empty-indicators"},[e("a-icon",{attrs:{type:"info-circle"}}),e("span",[t._v(t._s(t.$t("dashboard.indicator.empty")))])],1):t._e()],2)]),e("div",{staticClass:"indicator-section",class:{"section-empty":0===t.purchasedIndicators.length}},[e("div",{staticClass:"section-label"},[e("div",{staticClass:"section-label-left",on:{click:function(e){t.purchasedSectionCollapsed=!t.purchasedSectionCollapsed}}},[e("a-icon",{staticClass:"collapse-icon",attrs:{type:t.purchasedSectionCollapsed?"right":"down"}}),e("span",[t._v(t._s(t.$t("dashboard.indicator.section.purchased"))+" ("+t._s(t.purchasedIndicators.length)+")")])],1),e("a-button",{staticClass:"buy-indicator-btn",attrs:{type:"link",size:"small",icon:"shop"},on:{click:function(e){return e.stopPropagation(),t.goToIndicatorMarket.apply(null,arguments)}}},[t._v(" "+t._s(t.$t("menu.dashboard.community"))+" ")])],1),e("div",{directives:[{name:"show",rawName:"v-show",value:!t.purchasedSectionCollapsed,expression:"!purchasedSectionCollapsed"}],staticClass:"section-content custom-scrollbar"},[t._l(t.purchasedIndicators,function(i){return e("div",{key:"purchased-"+i.id,class:["indicator-card","purchased-indicator",{"indicator-active":t.isIndicatorActive("purchased-"+i.id)}],on:{click:function(e){return t.toggleIndicator(i,"purchased")}}},[e("div",{staticClass:"card-content"},[e("div",{staticClass:"card-header"},[e("span",{staticClass:"card-name"},[e("a-icon",{staticClass:"purchased-icon",attrs:{type:"shopping"}}),t._v(" "+t._s(i.name)+" ")],1),e("div",{staticClass:"card-actions"},[e("a-tooltip",{attrs:{title:t.isIndicatorActive("purchased-"+i.id)?t.$t("dashboard.indicator.action.stop"):t.$t("dashboard.indicator.action.start")}},[e("a-icon",{class:["action-icon","toggle-icon",{active:t.isIndicatorActive("purchased-"+i.id)}],attrs:{type:t.isIndicatorActive("purchased-"+i.id)?"pause-circle":"play-circle"},on:{click:function(e){return e.stopPropagation(),t.toggleIndicator(i,"purchased")}}})],1),e("a-tooltip",{attrs:{title:t.$t("dashboard.indicator.backtest.title")}},[e("a-icon",{staticClass:"action-icon backtest-icon",attrs:{type:"experiment"},on:{click:function(e){return e.stopPropagation(),t.handleOpenBacktest(i)}}})],1),e("a-tooltip",{attrs:{title:t.$t("dashboard.indicator.backtest.historyTitle")}},[e("a-icon",{staticClass:"action-icon backtest-history-icon",attrs:{type:"clock-circle"},on:{click:function(e){return e.stopPropagation(),t.handleOpenBacktestHistory(i)}}})],1)],1)]),e("span",{staticClass:"card-desc"},[t._v(t._s(i.description||""))])])])}),0===t.purchasedIndicators.length?e("div",{staticClass:"empty-indicators"},[e("a-icon",{attrs:{type:"shopping"}}),e("span",[t._v(t._s(t.$t("dashboard.indicator.emptyPurchased")))])],1):t._e()],2)])]],2)])])],1),e("indicator-editor",{ref:"indicatorEditor",attrs:{visible:t.showIndicatorEditor,indicator:t.editingIndicator,userId:t.userId},on:{run:t.handleRunIndicator,save:t.handleSaveIndicator,cancel:function(e){t.showIndicatorEditor=!1,t.editingIndicator=null}}}),e("a-modal",{attrs:{visible:t.showParamsModal,title:t.$t("dashboard.indicator.paramsConfig.title"),confirmLoading:t.loadingParams,width:500,maskClosable:!1,keyboard:!1},on:{ok:t.confirmIndicatorParams,cancel:t.cancelIndicatorParams,afterClose:t.handleParamsModalAfterClose}},[t.pendingIndicator?e("div",{staticClass:"params-config-modal"},[e("div",{staticClass:"indicator-info"},[e("span",{staticClass:"indicator-name"},[t._v(t._s(t.pendingIndicator.name))])]),e("a-divider"),t.indicatorParams.length>0?e("div",{staticClass:"params-form"},t._l(t.indicatorParams,function(i){return e("div",{key:i.name,staticClass:"param-item"},[e("div",{staticClass:"param-header"},[e("label",{staticClass:"param-label"},[t._v(t._s(i.name))]),i.description?e("a-tooltip",{attrs:{title:i.description}},[e("a-icon",{staticStyle:{color:"#999","margin-left":"4px"},attrs:{type:"question-circle"}})],1):t._e()],1),"int"===i.type?e("a-input-number",{staticStyle:{width:"100%"},attrs:{precision:0},model:{value:t.indicatorParamValues[i.name],callback:function(e){t.$set(t.indicatorParamValues,i.name,e)},expression:"indicatorParamValues[param.name]"}}):"float"===i.type?e("a-input-number",{staticStyle:{width:"100%"},attrs:{precision:4},model:{value:t.indicatorParamValues[i.name],callback:function(e){t.$set(t.indicatorParamValues,i.name,e)},expression:"indicatorParamValues[param.name]"}}):"bool"===i.type?e("a-switch",{model:{value:t.indicatorParamValues[i.name],callback:function(e){t.$set(t.indicatorParamValues,i.name,e)},expression:"indicatorParamValues[param.name]"}}):e("a-input",{model:{value:t.indicatorParamValues[i.name],callback:function(e){t.$set(t.indicatorParamValues,i.name,e)},expression:"indicatorParamValues[param.name]"}})],1)}),0):e("a-empty",{attrs:{description:t.$t("dashboard.indicator.paramsConfig.noParams")}})],1):t._e()]),e("a-modal",{attrs:{title:t.publishIndicator&&t.publishIndicator.publish_to_community?t.$t("dashboard.indicator.publish.editTitle"):t.$t("dashboard.indicator.publish.title"),visible:t.showPublishModal,confirmLoading:t.publishing,width:"500px",okText:t.publishIndicator&&t.publishIndicator.publish_to_community?t.$t("dashboard.indicator.publish.update"):t.$t("dashboard.indicator.publish.confirm"),cancelText:t.$t("common.cancel")},on:{ok:t.handleConfirmPublish,cancel:function(e){t.showPublishModal=!1,t.publishIndicator=null}}},[e("a-form-model",{ref:"publishForm",attrs:{model:t.publishForm,rules:t.publishRules,layout:"vertical"}},[e("a-alert",{staticStyle:{"margin-bottom":"16px"},attrs:{type:"info","show-icon":"",message:t.$t("dashboard.indicator.publish.hint")}}),e("a-form-model-item",{attrs:{label:t.$t("dashboard.indicator.publish.pricingType"),prop:"pricingType"}},[e("a-radio-group",{model:{value:t.publishPricingType,callback:function(e){t.publishPricingType=e},expression:"publishPricingType"}},[e("a-radio",{attrs:{value:"free"}},[t._v(t._s(t.$t("dashboard.indicator.publish.free")))]),e("a-radio",{attrs:{value:"paid"}},[t._v(t._s(t.$t("dashboard.indicator.publish.paid")))])],1)],1),"paid"===t.publishPricingType?e("a-form-model-item",{attrs:{label:t.$t("dashboard.indicator.publish.price"),prop:"price"}},[e("a-input-number",{staticStyle:{width:"200px"},attrs:{min:1,max:1e4,precision:0},model:{value:t.publishPrice,callback:function(e){t.publishPrice=e},expression:"publishPrice"}}),e("span",{staticStyle:{"margin-left":"8px"}},[t._v(t._s(t.$t("community.credits")))])],1):t._e(),"paid"===t.publishPricingType?e("a-form-model-item",{attrs:{label:t.$t("dashboard.indicator.publish.vipFree")}},[e("a-switch",{model:{value:t.publishVipFree,callback:function(e){t.publishVipFree=e},expression:"publishVipFree"}}),e("div",{staticStyle:{"margin-top":"6px",color:"rgba(0,0,0,0.45)","font-size":"12px"}},[t._v(" "+t._s(t.$t("dashboard.indicator.publish.vipFreeHint"))+" ")])],1):t._e(),e("a-form-model-item",{attrs:{label:t.$t("dashboard.indicator.publish.description"),prop:"description"}},[e("a-textarea",{attrs:{placeholder:t.$t("dashboard.indicator.publish.descriptionPlaceholder"),rows:4,maxLength:500},model:{value:t.publishDescription,callback:function(e){t.publishDescription=e},expression:"publishDescription"}})],1),t.publishIndicator&&t.publishIndicator.publish_to_community?e("div",{staticStyle:{"margin-top":"16px"}},[e("a-button",{attrs:{type:"danger",ghost:"",loading:t.unpublishing},on:{click:t.handleUnpublish}},[e("a-icon",{attrs:{type:"close-circle"}}),t._v(" "+t._s(t.$t("dashboard.indicator.publish.unpublish"))+" ")],1)],1):t._e()],1)],1),e("a-modal",{attrs:{title:t.$t("dashboard.analysis.modal.addStock.title"),visible:t.showAddStockModal,confirmLoading:t.addingStock,width:"600px",okText:t.$t("dashboard.analysis.modal.addStock.confirm"),cancelText:t.$t("dashboard.analysis.modal.addStock.cancel")},on:{ok:t.handleAddStock,cancel:t.handleCloseAddStockModal}},[e("div",{staticClass:"add-stock-modal-content"},[e("a-tabs",{staticClass:"market-tabs",on:{change:t.handleMarketTabChange},model:{value:t.selectedMarketTab,callback:function(e){t.selectedMarketTab=e},expression:"selectedMarketTab"}},t._l(t.marketTypes,function(i){return e("a-tab-pane",{key:i.value,attrs:{tab:t.$t(i.i18nKey||"dashboard.analysis.market.".concat(i.value))}})}),1),e("div",{staticClass:"symbol-search-section"},[e("a-input-search",{attrs:{placeholder:t.$t("dashboard.analysis.modal.addStock.searchOrInputPlaceholder"),loading:t.searchingSymbols,size:"large","allow-clear":""},on:{search:t.handleSearchOrInput,change:t.handleSymbolSearchInput},model:{value:t.symbolSearchKeyword,callback:function(e){t.symbolSearchKeyword=e},expression:"symbolSearchKeyword"}},[e("a-button",{attrs:{slot:"enterButton",type:"primary",icon:"search"},slot:"enterButton"},[t._v(" "+t._s(t.$t("dashboard.analysis.modal.addStock.search"))+" ")])],1)],1),t.symbolSearchResults.length>0?e("div",{staticClass:"search-results-section"},[e("div",{staticClass:"section-title"},[e("a-icon",{staticStyle:{"margin-right":"4px"},attrs:{type:"search"}}),t._v(" "+t._s(t.$t("dashboard.analysis.modal.addStock.searchResults"))+" ")],1),e("a-list",{staticClass:"symbol-list",attrs:{"data-source":t.symbolSearchResults,loading:t.searchingSymbols,size:"small"},scopedSlots:t._u([{key:"renderItem",fn:function(i){return e("a-list-item",{staticClass:"symbol-list-item",on:{click:function(e){return t.selectSymbol(i)}}},[e("a-list-item-meta",[e("template",{slot:"title"},[e("div",{staticClass:"symbol-item-content"},[e("span",{staticClass:"symbol-code"},[t._v(t._s(i.symbol))]),e("span",{staticClass:"symbol-name"},[t._v(t._s(i.name))]),i.exchange?e("a-tag",{staticStyle:{"margin-left":"8px"},attrs:{size:"small",color:"blue"}},[t._v(" "+t._s(i.exchange)+" ")]):t._e()],1)])],2)],1)}}],null,!1,1074844145)})],1):t._e(),e("div",{staticClass:"hot-symbols-section"},[e("div",{staticClass:"section-title"},[e("a-icon",{staticStyle:{color:"#ff4d4f","margin-right":"4px"},attrs:{type:"fire"}}),t._v(" "+t._s(t.$t("dashboard.analysis.modal.addStock.hotSymbols"))+" ")],1),e("a-spin",{attrs:{spinning:t.loadingHotSymbols}},[t.hotSymbols.length>0?e("a-list",{staticClass:"symbol-list",attrs:{"data-source":t.hotSymbols,size:"small"},scopedSlots:t._u([{key:"renderItem",fn:function(i){return e("a-list-item",{staticClass:"symbol-list-item",on:{click:function(e){return t.selectSymbol(i)}}},[e("a-list-item-meta",[e("template",{slot:"title"},[e("div",{staticClass:"symbol-item-content"},[e("span",{staticClass:"symbol-code"},[t._v(t._s(i.symbol))]),e("span",{staticClass:"symbol-name"},[t._v(t._s(i.name))]),i.exchange?e("a-tag",{staticStyle:{"margin-left":"8px"},attrs:{size:"small",color:"orange"}},[t._v(" "+t._s(i.exchange)+" ")]):t._e()],1)])],2)],1)}}],null,!1,2177647935)}):e("a-empty",{attrs:{description:t.$t("dashboard.analysis.modal.addStock.noHotSymbols"),image:!1}})],1)],1),t.selectedSymbolForAdd?e("div",{staticClass:"selected-symbol-section"},[e("a-alert",{attrs:{message:t.$t("dashboard.analysis.modal.addStock.selectedSymbol"),type:"info","show-icon":"",closable:""},on:{close:function(e){t.selectedSymbolForAdd=null}}},[e("template",{slot:"description"},[e("div",{staticClass:"selected-symbol-info"},[e("a-tag",{staticStyle:{"margin-right":"8px"},attrs:{color:t.getMarketColor(t.selectedSymbolForAdd.market)}},[t._v(" "+t._s(t.$t("dashboard.analysis.market.".concat(t.selectedSymbolForAdd.market)))+" ")]),e("strong",[t._v(t._s(t.selectedSymbolForAdd.symbol))]),t.selectedSymbolForAdd.name?e("span",{staticStyle:{color:"#999","margin-left":"8px"}},[t._v(t._s(t.selectedSymbolForAdd.name))]):e("span",{staticStyle:{color:"#999","margin-left":"8px","font-style":"italic"}},[t._v(t._s(t.$t("dashboard.analysis.modal.addStock.nameWillBeFetched")))])],1)])],2)],1):t._e()],1)])],1),e("a-tooltip",{attrs:{title:t.$t("quickTrade.openPanel"),placement:"left"}},[!t.showQuickTrade&&t.currentSymbol&&t.isCryptoMarket?e("div",{staticClass:"qt-floating-btn",on:{click:t.openQuickTrade}},[e("a-icon",{attrs:{type:"thunderbolt",theme:"filled"}})],1):t._e()]),e("quick-trade-panel",{attrs:{visible:t.showQuickTrade,symbol:t.qtSymbol,"preset-side":t.qtSide,"preset-price":t.qtPrice,source:"indicator","market-type":"swap"},on:{close:function(e){t.showQuickTrade=!1},"order-success":t.onQuickTradeSuccess,"update:symbol":t.handleQuickTradeSymbolChange}})],1)},a=[],r=(i(62621),i(43898)),o=i(44735),s=i(15863),l=i(81127),c=i(56252),u=(i(6011),i(18787)),d=i(76338),h=(i(74423),i(85471)),p=i(95353),v=i(75769),f=i(35038),g=i(505),m=function(){var t=this,e=t._self._c;return e("div",[e("a-modal",{staticClass:"indicator-editor-modal",style:t.isMobile?{top:0,paddingBottom:0}:{top:"2%"},attrs:{title:t.$t("dashboard.indicator.editor.title"),visible:t.visible,width:t.isMobile?"100%":"95vw",confirmLoading:t.saving,okText:t.$t("dashboard.indicator.editor.save"),cancelText:t.$t("dashboard.indicator.editor.cancel"),maskClosable:!1,centered:!1},on:{ok:t.handleSave,cancel:t.handleCancel,afterClose:t.handleAfterClose}},[e("div",{staticClass:"editor-content"},[e("a-row",{staticClass:"editor-layout",class:{"mobile-layout":t.isMobile},attrs:{gutter:16}},[e("a-col",{staticClass:"code-editor-column",attrs:{span:24,xs:24,sm:24,md:24}},[e("div",{staticClass:"code-section"},[e("div",{staticClass:"section-header"},[e("div",{staticClass:"header-left"},[e("span",{staticClass:"section-title"},[t._v(t._s(t.$t("dashboard.indicator.editor.code")))])]),e("div",{staticClass:"section-actions"},[e("a-button",{staticStyle:{padding:"0 8px",color:"#52c41a","font-weight":"bold"},attrs:{type:"link",size:"small",loading:t.verifying},on:{click:t.handleVerifyCode}},[e("a-icon",{attrs:{type:"check-circle"}}),t._v(" "+t._s(t.$t("dashboard.indicator.editor.verifyCode"))+" ")],1),e("a-button",{staticStyle:{padding:"0"},attrs:{type:"link",size:"small"},on:{click:t.goToDocs}},[e("a-icon",{attrs:{type:"book"}}),t._v(" "+t._s(t.$t("dashboard.indicator.editor.guide"))+" ")],1)],1)]),e("a-alert",{staticStyle:{"margin-bottom":"12px"},attrs:{type:"info","show-icon":"",message:t.$t("dashboard.indicator.boundary.message"),description:t.$t("dashboard.indicator.boundary.indicatorRule")}}),e("div",{staticClass:"code-mode-split"},[e("a-row",{staticClass:"code-mode-row",attrs:{gutter:16}},[e("a-col",{staticClass:"code-pane",attrs:{xs:24,sm:24,md:18}},[e("div",{ref:"codeEditorContainer",staticClass:"code-editor-container"})]),e("a-col",{staticClass:"ai-pane",attrs:{xs:24,sm:24,md:6}},[e("div",{staticClass:"ai-panel"},[e("div",{staticClass:"ai-panel-title"},[e("a-icon",{attrs:{type:"robot"}}),e("span",[t._v(t._s(t.$t("dashboard.indicator.editor.aiGenerate")))])],1),e("a-textarea",{attrs:{placeholder:t.$t("dashboard.indicator.editor.aiPromptPlaceholder"),rows:12,"auto-size":{minRows:12,maxRows:20}},model:{value:t.aiPrompt,callback:function(e){t.aiPrompt=e},expression:"aiPrompt"}}),e("a-button",{staticStyle:{"margin-top":"10px"},attrs:{type:"primary",block:"",loading:t.aiGenerating,size:"large"},on:{click:t.handleAIGenerate}},[t._v(" "+t._s(t.$t("dashboard.indicator.editor.aiGenerateBtn"))+" ")])],1)])],1)],1)],1)])],1)],1),e("div",{staticClass:"editor-footer",attrs:{slot:"footer"},slot:"footer"},[e("a-button",{on:{click:t.handleCancel}},[t._v(" "+t._s(t.$t("dashboard.indicator.editor.cancel"))+" ")]),e("a-button",{attrs:{type:"primary",loading:t.saving},on:{click:t.handleSave}},[t._v(" "+t._s(t.$t("dashboard.indicator.editor.save"))+" ")])],1)])],1)},y=[],_=i(57532),b=i(15237),x=i.n(b),w=(i(74806),i(55218),i(97923),i(50436),i(74053)),S=i.n(w),C=i(75314),k={name:"IndicatorEditor",props:{visible:{type:Boolean,default:!1},indicator:{type:Object,default:null},userId:{type:Number,default:null}},data:function(){return{saving:!1,codeEditor:null,aiPrompt:"",aiGenerating:!1,verifying:!1,isMobile:!1}},computed:{},watch:{visible:function(t){var e=this;t?this.$nextTick(function(){setTimeout(function(){!e.codeEditor&&e.$refs.codeEditorContainer&&e.initCodeEditor(),e.initFormData()},200)}):this.codeEditor&&this.codeEditor.refresh()},indicator:{handler:function(t){var e=this;t&&this.visible&&this.$nextTick(function(){setTimeout(function(){e.initFormData()},100)})},deep:!0}},mounted:function(){var t=this;this.checkMobile(),window.addEventListener("resize",this.checkMobile),this.visible&&this.$nextTick(function(){setTimeout(function(){t.initCodeEditor()},100)})},beforeDestroy:function(){if(window.removeEventListener("resize",this.checkMobile),this.codeEditor)try{if("function"===typeof this.codeEditor.toTextArea)this.codeEditor.toTextArea();else if("function"===typeof this.codeEditor.getWrapperElement){var t=this.codeEditor.getWrapperElement();t&&t.parentNode&&t.parentNode.removeChild(t)}}catch(e){}finally{this.codeEditor=null}},methods:{getDefaultIndicatorCode:function(){return'#Demo Code:\n#my_indicator_name = "My Buy/Sell Indicator"\n#my_indicator_description = "Buy/Sell only; execution is normalized in backend."\n\n#df = df.copy()\n#sma = df["close"].rolling(14).mean()\n#buy = (df["close"] > sma) & (df["close"].shift(1) <= sma.shift(1))\n#sell = (df["close"] < sma) & (df["close"].shift(1) >= sma.shift(1))\n#df["buy"] = buy.fillna(False).astype(bool)\n#df["sell"] = sell.fillna(False).astype(bool)\n\n#buy_marks = [df["low"].iloc[i] * 0.995 if df["buy"].iloc[i] else None for i in range(len(df))]\n#sell_marks = [df["high"].iloc[i] * 1.005 if df["sell"].iloc[i] else None for i in range(len(df))]\n\n#output = {\n# "name": my_indicator_name,\n# "plots": [],\n# "signals": [\n# {"type": "buy", "text": "B", "data": buy_marks, "color": "#00E676"},\n# {"type": "sell", "text": "S", "data": sell_marks, "color": "#FF5252"}\n# ]\n#}\n'},checkMobile:function(){this.isMobile=window.innerWidth<=768},goToDocs:function(){window.open("https://github.com/brokermr810/QuantDinger/blob/main/docs/STRATEGY_DEV_GUIDE.md","_blank")},handleVerifyCode:function(){var t=this,e=this.codeEditor?this.codeEditor.getValue():"";e&&e.trim()?(this.verifying=!0,(0,v.Ay)({url:"/api/indicator/verifyCode",method:"post",data:{code:e}}).then(function(e){if(1===e.code){var i=e.data||{};t.$message.success("".concat(t.$t("dashboard.indicator.editor.verifyCodeSuccess")," (").concat(i.plots_count||0," plots, ").concat(i.signals_count||0," signals)"))}else{var n=e.data||{};t.$error({title:t.$t("dashboard.indicator.editor.verifyCodeFailed"),width:600,content:function(t){return t("div",[t("p",{style:{fontWeight:"bold",color:"#ff4d4f"}},e.msg),n.details?t("pre",{style:{background:"#f5f5f5",padding:"8px",overflow:"auto",maxHeight:"300px",marginTop:"8px",fontSize:"12px",fontFamily:"monospace"}},n.details):null])}})}}).catch(function(e){t.$message.error("Request Failed: "+(e.message||"Unknown Error"))}).finally(function(){t.verifying=!1})):this.$message.warning(this.$t("dashboard.indicator.editor.verifyCodeEmpty"))},cleanMarkdownCodeBlocks:function(t){if(!t||"string"!==typeof t)return t;var e=t.trim(),i=/```/.test(e);return i?(e=e.replace(/^```[\w]*\s*\n?/i,""),e.startsWith("```")&&(e=e.replace(/^```\s*\n?/g,"")),e.endsWith("```")&&(e=e.replace(/\n?```\s*$/g,"")),e=e.replace(/^\s*```[\w]*\s*$/gm,""),e=e.replace(/^\s*```\s*$/gm,""),e=e.replace(/\n{3,}/g,"\n\n"),e=e.trim(),e):e},initFormData:function(){var t=this;if(this.visible){var e=this.indicator&&this.indicator.code||"";e&&String(e).trim()||(e=this.getDefaultIndicatorCode()),this.$nextTick(function(){setTimeout(function(){t.aiPrompt="",t.codeEditor&&(t.codeEditor.setValue(e),t.codeEditor.refresh())},50)})}},initCodeEditor:function(){var t=this;if(this.$refs.codeEditorContainer){if(this.codeEditor){try{if("function"===typeof this.codeEditor.toTextArea)this.codeEditor.toTextArea();else if("function"===typeof this.codeEditor.getWrapperElement){var e=this.codeEditor.getWrapperElement();e&&e.parentNode&&e.parentNode.removeChild(e)}}catch(i){}this.codeEditor=null}try{this.$refs.codeEditorContainer.innerHTML="",this.codeEditor=x()(this.$refs.codeEditorContainer,{value:function(){var e=t.indicator&&t.indicator.code||"";return e&&String(e).trim()?e:t.getDefaultIndicatorCode()}(),mode:"python",theme:"eclipse",lineNumbers:!0,lineWrapping:!0,indentUnit:4,indentWithTabs:!1,smartIndent:!0,matchBrackets:!0,autoCloseBrackets:!0,styleActiveLine:!0,foldGutter:!1,gutters:["CodeMirror-linenumbers"],tabSize:4,viewportMargin:1/0}),this.codeEditor.on("change",function(t){t.getValue()}),this.$nextTick(function(){t.codeEditor&&t.codeEditor.refresh()})}catch(n){}}},handleSave:function(){var t=this.codeEditor?this.codeEditor.getValue():"",e=t||"";e.trim()?(this.saving=!0,this.$emit("save",{id:this.indicator?this.indicator.id:0,code:e,userid:this.userId})):this.$message.warning(this.$t("dashboard.indicator.editor.codeRequired"))},handleCancel:function(){this.codeEditor&&this.codeEditor.setValue(""),this.$emit("cancel")},handleAfterClose:function(){var t=this;this.codeEditor&&this.$nextTick(function(){t.codeEditor&&t.codeEditor.refresh()}),this.aiPrompt=""},handleAIGenerate:function(){var t=this;return(0,c.A)((0,l.A)().m(function e(){var i,n,a,r,o,s,c,u,d,h,p,v,f,g,m,y,b,x,w,k,I,E,A,P,M;return(0,l.A)().w(function(e){while(1)switch(e.p=e.n){case 0:if(t.aiPrompt&&t.aiPrompt.trim()){e.n=1;break}return t.$message.warning(t.$t("dashboard.indicator.editor.aiPromptRequired")),e.a(2);case 1:return t.aiGenerating=!0,i="",t.codeEditor&&(i=t.codeEditor.getValue()||""),t.codeEditor&&(t.codeEditor.setValue("# AI generating...\n"),t.codeEditor.refresh()),n="",e.p=2,a="/api/indicator/aiGenerate",r=S().get(C.Xh),o={prompt:t.aiPrompt.trim()},i.trim()&&(o.existingCode=i.trim()),e.n=3,fetch(a,{method:"POST",headers:{"Content-Type":"application/json",Authorization:r?"Bearer ".concat(r):"","Access-Token":r||"",Token:r||""},body:JSON.stringify(o),credentials:"include"});case 3:if(s=e.v,s.ok){e.n=5;break}return e.n=4,s.text().catch(function(){return""});case 4:throw c=e.v,new Error(c||"HTTP error! status: ".concat(s.status));case 5:if(s.body&&"function"===typeof s.body.getReader){e.n=6;break}throw new Error("AI 服务未返回可读取的流(response.body 不存在)");case 6:u=s.body.getReader(),d=new TextDecoder,h="";case 7:return e.n=8,u.read();case 8:if(p=e.v,v=p.done,f=p.value,!v){e.n=9;break}return e.a(3,21);case 9:h+=d.decode(f,{stream:!0}),g=h.split("\n\n"),h=g.pop()||"",m=(0,_.A)(g),e.p=10,m.s();case 11:if((y=m.n()).done){e.n=17;break}if(b=y.value,b.trim()&&b.startsWith("data: ")){e.n=12;break}return e.a(3,16);case 12:if(x=b.substring(6),"[DONE]"!==x){e.n=13;break}return e.a(3,17);case 13:if(e.p=13,w=JSON.parse(x),!w.error){e.n=14;break}throw new Error(w.error);case 14:w.content&&(n+=w.content,k=t.cleanMarkdownCodeBlocks(n),t.codeEditor&&(t.codeEditor.setValue(k),I=t.codeEditor.lineCount(),t.codeEditor.setCursor({line:I-1,ch:0}),t.codeEditor.refresh())),e.n=16;break;case 15:e.p=15,e.v;case 16:e.n=11;break;case 17:e.n=19;break;case 18:e.p=18,P=e.v,m.e(P);case 19:return e.p=19,m.f(),e.f(19);case 20:e.n=7;break;case 21:t.codeEditor&&n?(E=t.cleanMarkdownCodeBlocks(n),t.codeEditor.setValue(E),t.codeEditor.refresh(),t.$message.success(t.$t("dashboard.indicator.editor.aiGenerateSuccess"))):n||t.$message.warning("未生成任何代码,请尝试更详细的提示词"),e.n=23;break;case 22:e.p=22,M=e.v,t.$message.error(M.message||t.$t("dashboard.indicator.editor.aiGenerateError")),n&&t.codeEditor&&(A=t.cleanMarkdownCodeBlocks(n),t.codeEditor.setValue(A));case 23:return e.p=23,t.aiGenerating=!1,e.f(23);case 24:return e.a(2)}},e,null,[[13,15],[10,18,19,20],[2,22,23,24]])}))()}}},I=k,E=i(845),A=(0,E.A)(I,m,y,!1,null,"4fea1865",null),P=A.exports,M=function(){var t=this,e=t._self._c;return e("div",{staticClass:"chart-left",class:{"theme-dark":"dark"===t.chartTheme}},[e("div",{staticClass:"chart-wrapper"},[e("div",{staticClass:"drawing-toolbar"},[t._l(t.drawingTools,function(i){return e("a-tooltip",{key:i.name,attrs:{title:i.title,placement:"right"}},[e("div",{staticClass:"drawing-tool-btn",class:{active:t.activeDrawingTool===i.name},on:{click:function(e){return t.selectDrawingTool(i.name)}}},[e("a-icon",{attrs:{type:i.icon}})],1)])}),e("a-divider",{attrs:{type:"vertical"}}),e("a-tooltip",{attrs:{title:t.$t("dashboard.indicator.drawing.clearAll"),placement:"right"}},[e("div",{staticClass:"drawing-tool-btn",on:{click:t.clearAllDrawings}},[e("a-icon",{attrs:{type:"delete"}})],1)])],2),e("div",{staticClass:"chart-content-area"},[e("div",{staticClass:"indicator-toolbar"},t._l(t.indicatorButtons,function(i){return e("div",{key:i.id,staticClass:"indicator-btn",class:{active:t.isIndicatorActive(i.id)},attrs:{title:i.name},on:{click:function(e){return t.toggleIndicator(i)}}},[t._v(" "+t._s(i.shortName)+" ")])}),0),e("div",{staticClass:"kline-chart-container",attrs:{id:"kline-chart-container"}})]),t.loading?e("div",{staticClass:"chart-overlay"},[e("a-spin",{attrs:{size:"large"}},[e("a-icon",{staticStyle:{"font-size":"24px",color:"#13c2c2"},attrs:{slot:"indicator",type:"loading",spin:""},slot:"indicator"})],1)],1):t._e(),t.error?e("div",{staticClass:"chart-overlay"},[e("div",{staticClass:"error-box"},[e("a-icon",{staticStyle:{"font-size":"24px",color:"#ef5350","margin-bottom":"10px"},attrs:{type:"warning"}}),e("span",[t._v(t._s(t.error))]),e("a-button",{staticStyle:{"margin-top":"12px"},attrs:{type:"primary",size:"small",ghost:""},on:{click:t.handleRetry}},[t._v(" "+t._s(t.$t("dashboard.indicator.retry"))+" ")])],1)]):t._e(),t.pyodideLoadFailed?e("div",{staticClass:"chart-overlay pyodide-warning"},[e("div",{staticClass:"warning-box"},[e("a-icon",{staticStyle:{"font-size":"32px",color:"#faad14","margin-bottom":"12px"},attrs:{type:"warning"}}),e("div",{staticClass:"warning-title"},[t._v(t._s(t.$t("dashboard.indicator.warning.pyodideLoadFailed")))]),e("div",{staticClass:"warning-desc"},[t._v(t._s(t.$t("dashboard.indicator.warning.pyodideLoadFailedDesc")))])],1)]):t._e(),t.symbol||t.loading||t.error||t.pyodideLoadFailed?t._e():e("div",{staticClass:"chart-overlay initial-hint"},[e("div",{staticClass:"hint-box"},[e("a-icon",{staticStyle:{"font-size":"48px",color:"#1890ff","margin-bottom":"16px"},attrs:{type:"line-chart"}}),e("div",{staticClass:"hint-title"},[t._v(t._s(t.$t("dashboard.indicator.hint.selectSymbol")))]),e("div",{staticClass:"hint-desc"},[t._v(t._s(t.$t("dashboard.indicator.hint.selectSymbolDesc")))])],1)])])])},D=[],T=i(21560),B=i(26297),F=i(2403),R=function(t,e){return R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},R(t,e)};function L(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}R(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var N,O,z,V,W,H,$,K,Y,X=function(){return X=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var a in e=arguments[i],e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a]);return t},X.apply(this,arguments)};function j(t,e,i,n){function a(t){return t instanceof i?t:new i(function(e){e(t)})}return new(i||(i=Promise))(function(i,r){function o(t){try{l(n.next(t))}catch(e){r(e)}}function s(t){try{l(n["throw"](t))}catch(e){r(e)}}function l(t){t.done?i(t.value):a(t.value).then(o,s)}l((n=n.apply(t,e||[])).next())})}function U(t,e){var i,n,a,r={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},o=Object.create(("function"===typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o["throw"]=s(1),o["return"]=s(2),"function"===typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(t){return function(e){return l([t,e])}}function l(s){if(i)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(i=1,n&&(a=2&s[0]?n["return"]:s[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,s[1])).done)return a;switch(n=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,n=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(6===s[0]||2===s[0])){r=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){r.label=s[1];break}if(6===s[0]&&r.label<a[1]){r.label=a[1],a=s;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(s);break}a[2]&&r.ops.pop(),r.trys.pop();continue}s=e.call(t,r)}catch(l){s=[6,l],n=0}finally{i=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function G(t){var e="function"===typeof Symbol&&Symbol.iterator,i=e&&t[e],n=0;if(i)return i.call(t);if(t&&"number"===typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Z(t,e){var i="function"===typeof Symbol&&t[Symbol.iterator];if(!i)return t;var n,a,r=i.call(t),o=[];try{while((void 0===e||e-- >0)&&!(n=r.next()).done)o.push(n.value)}catch(s){a={error:s}}finally{try{n&&!n.done&&(i=r["return"])&&i.call(r)}finally{if(a)throw a.error}}return o}function q(t,e,i){if(i||2===arguments.length)for(var n,a=0,r=e.length;a<r;a++)!n&&a in e||(n||(n=Array.prototype.slice.call(e,0,a)),n[a]=e[a]);return t.concat(n||Array.prototype.slice.call(e))}"function"===typeof SuppressedError&&SuppressedError,function(t){t["Dashed"]="dashed",t["Solid"]="solid"}(N||(N={})),function(t){t["Stroke"]="stroke",t["Fill"]="fill",t["StrokeFill"]="stroke_fill"}(O||(O={})),function(t){t["Always"]="always",t["FollowCross"]="follow_cross",t["None"]="none"}(z||(z={})),function(t){t["Standard"]="standard",t["Rect"]="rect"}(V||(V={})),function(t){t["Left"]="left",t["Middle"]="middle",t["Right"]="right"}(W||(W={})),function(t){t["Fixed"]="fixed",t["Pointer"]="pointer"}(H||(H={})),function(t){t["CandleSolid"]="candle_solid",t["CandleStroke"]="candle_stroke",t["CandleUpStroke"]="candle_up_stroke",t["CandleDownStroke"]="candle_down_stroke",t["Ohlc"]="ohlc",t["Area"]="area"}($||($={})),function(t){t["Left"]="left",t["Right"]="right"}(K||(K={})),function(t){t["Normal"]="normal",t["Percentage"]="percentage",t["Log"]="log"}(Y||(Y={}));var J="#F92855",Q="rgba(249, 40, 85, .7)",tt="#2DC08E",et="rgba(45, 192, 142, .7)",it="#888888",nt="#FFFFFF",at="#1677FF",rt="#76808F",ot="#DDDDDD";function st(t){return"rgba(22, 119, 255, ".concat(t,")")}function lt(){function t(){return{show:!0,size:1,color:"#EDEDED",style:N.Dashed,dashedValue:[2,2]}}return{show:!0,horizontal:t(),vertical:t()}}function ct(){var t={show:!0,color:rt,textOffset:5,textSize:10,textFamily:"Helvetica Neue",textWeight:"normal"};return{type:$.CandleSolid,bar:{upColor:tt,downColor:J,noChangeColor:it,upBorderColor:tt,downBorderColor:J,noChangeBorderColor:it,upWickColor:tt,downWickColor:J,noChangeWickColor:it},area:{lineSize:2,lineColor:at,smooth:!1,value:"close",backgroundColor:[{offset:0,color:st(.01)},{offset:1,color:st(.2)}],point:{show:!0,color:at,radius:4,rippleColor:st(.3),rippleRadius:8,animation:!0,animationDuration:1e3}},priceMark:{show:!0,high:X({},t),low:X({},t),last:{show:!0,upColor:tt,downColor:J,noChangeColor:it,line:{show:!0,style:N.Dashed,dashedValue:[4,4],size:1},text:{show:!0,style:O.Fill,size:12,paddingLeft:4,paddingTop:4,paddingRight:4,paddingBottom:4,borderColor:"transparent",borderStyle:N.Solid,borderSize:0,borderDashedValue:[2,2],color:nt,family:"Helvetica Neue",weight:"normal",borderRadius:2}}},tooltip:{offsetLeft:4,offsetTop:6,offsetRight:4,offsetBottom:6,showRule:z.Always,showType:V.Standard,custom:[{title:"time",value:"{time}"},{title:"open",value:"{open}"},{title:"high",value:"{high}"},{title:"low",value:"{low}"},{title:"close",value:"{close}"},{title:"volume",value:"{volume}"}],defaultValue:"n/a",rect:{position:H.Fixed,paddingLeft:4,paddingRight:4,paddingTop:4,paddingBottom:4,offsetLeft:4,offsetTop:4,offsetRight:4,offsetBottom:4,borderRadius:4,borderSize:1,borderColor:"#F2F3F5",color:"#FEFEFE"},text:{size:12,family:"Helvetica Neue",weight:"normal",color:rt,marginLeft:8,marginTop:4,marginRight:8,marginBottom:4},icons:[]}}}function ut(){var t=["#FF9600","#935EBD",at,"#E11D74","#01C5C4"].map(function(t){return{style:N.Solid,smooth:!1,size:1,dashedValue:[2,2],color:t}});return{ohlc:{upColor:et,downColor:Q,noChangeColor:it},bars:[{style:O.Fill,borderStyle:N.Solid,borderSize:1,borderDashedValue:[2,2],upColor:et,downColor:Q,noChangeColor:it}],lines:t,circles:[{style:O.Fill,borderStyle:N.Solid,borderSize:1,borderDashedValue:[2,2],upColor:et,downColor:Q,noChangeColor:it}],lastValueMark:{show:!1,text:{show:!1,style:O.Fill,color:nt,size:12,family:"Helvetica Neue",weight:"normal",borderStyle:N.Solid,borderColor:"transparent",borderSize:0,borderDashedValue:[2,2],paddingLeft:4,paddingTop:4,paddingRight:4,paddingBottom:4,borderRadius:2}},tooltip:{offsetLeft:4,offsetTop:6,offsetRight:4,offsetBottom:6,showRule:z.Always,showType:V.Standard,showName:!0,showParams:!0,defaultValue:"n/a",text:{size:12,family:"Helvetica Neue",weight:"normal",color:rt,marginLeft:8,marginTop:4,marginRight:8,marginBottom:4},icons:[]}}}function dt(){return{show:!0,size:"auto",axisLine:{show:!0,color:ot,size:1},tickText:{show:!0,color:rt,size:12,family:"Helvetica Neue",weight:"normal",marginStart:4,marginEnd:4},tickLine:{show:!0,size:1,length:3,color:ot}}}function ht(){var t=dt();return t.type=Y.Normal,t.position=K.Right,t.inside=!1,t.reverse=!1,t}function pt(){function t(){return{show:!0,line:{show:!0,style:N.Dashed,dashedValue:[4,2],size:1,color:rt},text:{show:!0,style:O.Fill,color:nt,size:12,family:"Helvetica Neue",weight:"normal",borderStyle:N.Solid,borderDashedValue:[2,2],borderSize:1,borderColor:rt,borderRadius:2,paddingLeft:4,paddingRight:4,paddingTop:4,paddingBottom:4,backgroundColor:rt}}}return{show:!0,horizontal:t(),vertical:t()}}function vt(){var t=st(.35),e=st(.25);function i(){return{style:O.Fill,color:nt,size:12,family:"Helvetica Neue",weight:"normal",borderStyle:N.Solid,borderDashedValue:[2,2],borderSize:1,borderRadius:2,borderColor:at,paddingLeft:4,paddingRight:4,paddingTop:4,paddingBottom:4,backgroundColor:at}}return{point:{color:at,borderColor:t,borderSize:1,radius:5,activeColor:at,activeBorderColor:t,activeBorderSize:3,activeRadius:5},line:{style:N.Solid,smooth:!1,color:at,size:1,dashedValue:[2,2]},rect:{style:O.Fill,color:e,borderColor:at,borderSize:1,borderRadius:0,borderStyle:N.Solid,borderDashedValue:[2,2]},polygon:{style:O.Fill,color:at,borderColor:at,borderSize:1,borderStyle:N.Solid,borderDashedValue:[2,2]},circle:{style:O.Fill,color:e,borderColor:at,borderSize:1,borderStyle:N.Solid,borderDashedValue:[2,2]},arc:{style:N.Solid,color:at,size:1,dashedValue:[2,2]},text:i(),rectText:i()}}function ft(){return{size:1,color:ot,fill:!0,activeBackgroundColor:st(.08)}}function gt(){return{grid:lt(),candle:ct(),indicator:ut(),xAxis:dt(),yAxis:ht(),separator:ft(),crosshair:pt(),overlay:vt()}}var mt=!1;function yt(t,e,i,n,a,r){if(mt){var o=""!==n?"Call api `".concat(n,"`").concat(""!==a||""!==r?", ":"."):"",s=""!==a?"invalid parameter `".concat(a,"`").concat(""!==r?", ":"."):"",l=""!==r?r:"";console.log(t,e,i,o,s,l)}}function _t(t,e,i){yt("%c😑 klinecharts warning%c %s%s%s","padding:3px 4px;border-radius:2px;color:#ffffff;background-color:#FF9600","color:#FF9600",t,e,null!==i&&void 0!==i?i:"")}function bt(t,e,i){yt("%c😟 klinecharts error%c %s%s%s","padding:3px 4px;border-radius:2px;color:#ffffff;background-color:#F92855;","color:#F92855;",t,e,i)}function xt(){yt("%c❤️ Welcome to klinecharts. Version is 9.8.12","border-radius:4px;border:dashed 1px #1677FF;line-height:70px;padding:0 20px;margin:16px 0;font-size:14px;color:#1677FF;","","","","")}function wt(t,e){if(It(t)||It(e))for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var n=t[i],a=e[i];It(a)&&It(n)?wt(n,a):At(e[i])&&(t[i]=St(e[i]))}}function St(t){if(!It(t))return t;var e;for(var i in e=Ct(t)?[]:{},t)if(Object.prototype.hasOwnProperty.call(t,i)){var n=t[i];It(n)?e[i]=St(n):e[i]=n}return e}function Ct(t){return"[object Array]"===Object.prototype.toString.call(t)}function kt(t){return"function"===typeof t}function It(t){return"object"===typeof t&&At(t)}function Et(t){return"number"===typeof t&&!isNaN(t)}function At(t){return null!==t&&void 0!==t}function Pt(t){return"boolean"===typeof t}function Mt(t){return"string"===typeof t}var Dt,Tt,Bt=/\\(\\)?/g,Ft=RegExp("[^.[\\]]+|\\[(?:([^\"'][^[]*)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))","g");function Rt(t,e,i){if(At(t)){var n=[];e.replace(Ft,function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];var a=t;return At(e[1])?a=e[2].replace(Bt,"$1"):At(e[0])&&(a=e[0].trim()),n.push(a),""});var a=t,r=0,o=n.length;while(At(a)&&r<o)a=null===a||void 0===a?void 0:a[n[r++]];return At(a)?a:null!==i&&void 0!==i?i:"--"}return null!==i&&void 0!==i?i:"--"}function Lt(t,e,i){var n={};return t.formatToParts(new Date(e)).forEach(function(t){var e=t.type,i=t.value;switch(e){case"year":n.YYYY=i;break;case"month":n.MM=i;break;case"day":n.DD=i;break;case"hour":n.HH="24"===i?"00":i;break;case"minute":n.mm=i;break;case"second":n.ss=i;break}}),i.replace(/YYYY|MM|DD|HH|mm|ss/g,function(t){return n[t]})}function Nt(t,e){var i=+t;return Et(i)?i.toFixed(null!==e&&void 0!==e?e:2):"".concat(t)}function Ot(t){var e=+t;if(Et(e)){if(e>1e9)return"".concat(+(e/1e9).toFixed(3),"B");if(e>1e6)return"".concat(+(e/1e6).toFixed(3),"M");if(e>1e3)return"".concat(+(e/1e3).toFixed(3),"K")}return"".concat(t)}function zt(t,e){var i="".concat(t);if(0===e.length)return i;if(i.includes(".")){var n=i.split(".");return"".concat(n[0].replace(/(\d)(?=(\d{3})+$)/g,function(t){return"".concat(t).concat(e)}),".").concat(n[1])}return i.replace(/(\d)(?=(\d{3})+$)/g,function(t){return"".concat(t).concat(e)})}function Vt(t,e){var i="".concat(t),n=new RegExp("\\.0{"+e+",}[1-9][0-9]*$");if(n.test(i)){var a=i.split("."),r=a[a.length-1],o=r.match(/0*/);if(At(o)){var s=o[0].length;return a[a.length-1]=r.replace(/0*/,"0{".concat(s,"}")),a.join(".")}}return i}function Wt(t){var e,i,n;return null!==(n=null===(i=null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)||void 0===i?void 0:i.devicePixelRatio)&&void 0!==n?n:1}function Ht(t,e,i){return"".concat(null!==e&&void 0!==e?e:"normal"," ").concat(null!==t&&void 0!==t?t:12,"px ").concat(null!==i&&void 0!==i?i:"Helvetica Neue")}function $t(t,e,i,n){if(!At(Dt)){var a=document.createElement("canvas"),r=Wt(a);Dt=a.getContext("2d"),Dt.scale(r,r)}return Dt.font=Ht(e,i,n),Math.round(Dt.measureText(t).width)}(function(t){t["OnDataReady"]="onDataReady",t["OnZoom"]="onZoom",t["OnScroll"]="onScroll",t["OnVisibleRangeChange"]="onVisibleRangeChange",t["OnTooltipIconClick"]="onTooltipIconClick",t["OnCrosshairChange"]="onCrosshairChange",t["OnCandleBarClick"]="onCandleBarClick",t["OnPaneDrag"]="onPaneDrag"})(Tt||(Tt={}));var Kt,Yt,Xt=function(){function t(){this._callbacks=[]}return t.prototype.subscribe=function(t){var e,i=null!==(e=this._callbacks.indexOf(t))&&void 0!==e?e:-1;i<0&&this._callbacks.push(t)},t.prototype.unsubscribe=function(t){var e;if(kt(t)){var i=null!==(e=this._callbacks.indexOf(t))&&void 0!==e?e:-1;i>-1&&this._callbacks.splice(i,1)}else this._callbacks=[]},t.prototype.execute=function(t){this._callbacks.forEach(function(e){e(t)})},t.prototype.isEmpty=function(){return 0===this._callbacks.length},t}();function jt(t,e,i,n,a){var r,o=e.result,s=e.figures,l=e.styles,c=Rt(l,"circles",n.circles),u=c.length,d=Rt(l,"bars",n.bars),h=d.length,p=Rt(l,"lines",n.lines),v=p.length,f=0,g=0,m=0,y=0;s.forEach(function(s){var l;switch(s.type){case"circle":y=f;var _=c[f%u];r=X(X({},_),{color:_.noChangeColor}),f++;break;case"bar":y=g;var b=d[g%h];r=X(X({},b),{color:b.noChangeColor}),g++;break;case"line":y=m,r=p[m%v],m++;break}if(At(r)){var x={prev:{kLineData:t[i-1],indicatorData:o[i-1]},current:{kLineData:t[i],indicatorData:o[i]},next:{kLineData:t[i+1],indicatorData:o[i+1]}},w=null===(l=s.styles)||void 0===l?void 0:l.call(s,x,e,n);a(s,X(X({},r),w),y)}})}(function(t){t["Init"]="init",t["Forward"]="forward",t["Backward"]="backward"})(Kt||(Kt={})),function(t){t["Normal"]="normal",t["Price"]="price",t["Volume"]="volume"}(Yt||(Yt={}));var Ut,Gt=function(){function t(t){this.result=[],this._precisionFlag=!1;var e=t.name,i=t.shortName,n=t.series,a=t.calcParams,r=t.figures,o=t.precision,s=t.shouldOhlc,l=t.shouldFormatBigNumber,c=t.visible,u=t.zLevel,d=t.minValue,h=t.maxValue,p=t.styles,v=t.extendData,f=t.regenerateFigures,g=t.createTooltipDataSource,m=t.draw;this.name=e,this.shortName=null!==i&&void 0!==i?i:e,this.series=null!==n&&void 0!==n?n:Yt.Normal,this.precision=null!==o&&void 0!==o?o:4,this.calcParams=null!==a&&void 0!==a?a:[],this.figures=null!==r&&void 0!==r?r:[],this.shouldOhlc=null!==s&&void 0!==s&&s,this.shouldFormatBigNumber=null!==l&&void 0!==l&&l,this.visible=null===c||void 0===c||c,this.zLevel=null!==u&&void 0!==u?u:0,this.minValue=null!==d&&void 0!==d?d:null,this.maxValue=null!==h&&void 0!==h?h:null,this.styles=St(null!==p&&void 0!==p?p:{}),this.extendData=v,this.regenerateFigures=null!==f&&void 0!==f?f:null,this.createTooltipDataSource=null!==g&&void 0!==g?g:null,this.draw=null!==m&&void 0!==m?m:null}return t.prototype.setShortName=function(t){return this.shortName!==t&&(this.shortName=t,!0)},t.prototype.setSeries=function(t){return this.series!==t&&(this.series=t,!0)},t.prototype.setPrecision=function(t,e){var i=null!==e&&void 0!==e&&e,n=Math.floor(t);return!(!(n!==this.precision&&t>=0)||i&&(!i||this._precisionFlag))&&(this.precision=n,i||(this._precisionFlag=!0),!0)},t.prototype.setCalcParams=function(t){var e,i;return this.calcParams=t,this.figures=null!==(i=null===(e=this.regenerateFigures)||void 0===e?void 0:e.call(this,t))&&void 0!==i?i:this.figures,!0},t.prototype.setShouldOhlc=function(t){return this.shouldOhlc!==t&&(this.shouldOhlc=t,!0)},t.prototype.setShouldFormatBigNumber=function(t){return this.shouldFormatBigNumber!==t&&(this.shouldFormatBigNumber=t,!0)},t.prototype.setVisible=function(t){return this.visible!==t&&(this.visible=t,!0)},t.prototype.setZLevel=function(t){return this.zLevel!==t&&(this.zLevel=t,!0)},t.prototype.setStyles=function(t){return wt(this.styles,t),!0},t.prototype.setExtendData=function(t){return this.extendData!==t&&(this.extendData=t,!0)},t.prototype.setFigures=function(t){return this.figures!==t&&(this.figures=t,!0)},t.prototype.setMinValue=function(t){return this.minValue!==t&&(this.minValue=t,!0)},t.prototype.setMaxValue=function(t){return this.maxValue!==t&&(this.maxValue=t,!0)},t.prototype.setRegenerateFigures=function(t){return this.regenerateFigures!==t&&(this.regenerateFigures=t,!0)},t.prototype.setCreateTooltipDataSource=function(t){return this.createTooltipDataSource!==t&&(this.createTooltipDataSource=t,!0)},t.prototype.setDraw=function(t){return this.draw!==t&&(this.draw=t,!0)},t.prototype.calcIndicator=function(t){return j(this,void 0,void 0,function(){var e;return U(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.calc(t,this)];case 1:return e=i.sent(),this.result=e,[2,!0];case 2:return i.sent(),[2,!1];case 3:return[2]}})})},t.extend=function(e){var i=function(t){function i(){return t.call(this,e)||this}return L(i,t),i.prototype.calc=function(t,i){return e.calc(t,i)},i}(t);return i},t}();function Zt(){return["mouseClickEvent","mouseDoubleClickEvent","mouseRightClickEvent","tapEvent","doubleTapEvent","mouseDownEvent","touchStartEvent","mouseMoveEvent","touchMoveEvent"]}(function(t){t["Normal"]="normal",t["WeakMagnet"]="weak_magnet",t["StrongMagnet"]="strong_magnet"})(Ut||(Ut={}));var qt,Jt=1,Qt=-1,te="overlay_",ee="overlay_figure_",ie=function(){function t(t){this.currentStep=Jt,this.points=[],this._prevPressedPoint=null,this._prevPressedPoints=[];var e=t.mode,i=t.modeSensitivity,n=t.extendData,a=t.styles,r=t.name,o=t.totalStep,s=t.lock,l=t.visible,c=t.zLevel,u=t.needDefaultPointFigure,d=t.needDefaultXAxisFigure,h=t.needDefaultYAxisFigure,p=t.createPointFigures,v=t.createXAxisFigures,f=t.createYAxisFigures,g=t.performEventPressedMove,m=t.performEventMoveForDrawing,y=t.onDrawStart,_=t.onDrawing,b=t.onDrawEnd,x=t.onClick,w=t.onDoubleClick,S=t.onRightClick,C=t.onPressedMoveStart,k=t.onPressedMoving,I=t.onPressedMoveEnd,E=t.onMouseEnter,A=t.onMouseLeave,P=t.onRemoved,M=t.onSelected,D=t.onDeselected;this.name=r,this.totalStep=!Et(o)||o<2?1:o,this.lock=null!==s&&void 0!==s&&s,this.visible=null===l||void 0===l||l,this.zLevel=null!==c&&void 0!==c?c:0,this.needDefaultPointFigure=null!==u&&void 0!==u&&u,this.needDefaultXAxisFigure=null!==d&&void 0!==d&&d,this.needDefaultYAxisFigure=null!==h&&void 0!==h&&h,this.mode=null!==e&&void 0!==e?e:Ut.Normal,this.modeSensitivity=null!==i&&void 0!==i?i:8,this.extendData=n,this.styles=St(null!==a&&void 0!==a?a:{}),this.createPointFigures=null!==p&&void 0!==p?p:null,this.createXAxisFigures=null!==v&&void 0!==v?v:null,this.createYAxisFigures=null!==f&&void 0!==f?f:null,this.performEventPressedMove=null!==g&&void 0!==g?g:null,this.performEventMoveForDrawing=null!==m&&void 0!==m?m:null,this.onDrawStart=null!==y&&void 0!==y?y:null,this.onDrawing=null!==_&&void 0!==_?_:null,this.onDrawEnd=null!==b&&void 0!==b?b:null,this.onClick=null!==x&&void 0!==x?x:null,this.onDoubleClick=null!==w&&void 0!==w?w:null,this.onRightClick=null!==S&&void 0!==S?S:null,this.onPressedMoveStart=null!==C&&void 0!==C?C:null,this.onPressedMoving=null!==k&&void 0!==k?k:null,this.onPressedMoveEnd=null!==I&&void 0!==I?I:null,this.onMouseEnter=null!==E&&void 0!==E?E:null,this.onMouseLeave=null!==A&&void 0!==A?A:null,this.onRemoved=null!==P&&void 0!==P?P:null,this.onSelected=null!==M&&void 0!==M?M:null,this.onDeselected=null!==D&&void 0!==D?D:null}return t.prototype.setId=function(t){return!Mt(this.id)&&(this.id=t,!0)},t.prototype.setGroupId=function(t){return!Mt(this.groupId)&&(this.groupId=t,!0)},t.prototype.setPaneId=function(t){this.paneId=t},t.prototype.setExtendData=function(t){return t!==this.extendData&&(this.extendData=t,!0)},t.prototype.setStyles=function(t){return wt(this.styles,t),!0},t.prototype.setPoints=function(t){if(t.length>0){var e=void 0;if(this.points=q([],Z(t),!1),t.length>=this.totalStep-1?(this.currentStep=Qt,e=this.totalStep-1):(this.currentStep=t.length+1,e=t.length),null!==this.performEventMoveForDrawing)for(var i=0;i<e;i++)this.performEventMoveForDrawing({currentStep:i+2,mode:this.mode,points:this.points,performPointIndex:i,performPoint:this.points[i]});return this.currentStep===Qt&&null!==this.performEventPressedMove&&this.performEventPressedMove({currentStep:this.currentStep,mode:this.mode,points:this.points,performPointIndex:this.points.length-1,performPoint:this.points[this.points.length-1]}),!0}return!1},t.prototype.setLock=function(t){return this.lock!==t&&(this.lock=t,!0)},t.prototype.setVisible=function(t){return this.visible!==t&&(this.visible=t,!0)},t.prototype.setZLevel=function(t){return this.zLevel!==t&&(this.zLevel=t,!0)},t.prototype.setMode=function(t){return this.mode!==t&&(this.mode=t,!0)},t.prototype.setModeSensitivity=function(t){return this.modeSensitivity!==t&&(this.modeSensitivity=t,!0)},t.prototype.setOnDrawStartCallback=function(t){return this.onDrawStart!==t&&(this.onDrawStart=t,!0)},t.prototype.setOnDrawingCallback=function(t){return this.onDrawing!==t&&(this.onDrawing=t,!0)},t.prototype.setOnDrawEndCallback=function(t){return this.onDrawEnd!==t&&(this.onDrawEnd=t,!0)},t.prototype.setOnClickCallback=function(t){return this.onClick!==t&&(this.onClick=t,!0)},t.prototype.setOnDoubleClickCallback=function(t){return this.onDoubleClick!==t&&(this.onDoubleClick=t,!0)},t.prototype.setOnRightClickCallback=function(t){return this.onRightClick!==t&&(this.onRightClick=t,!0)},t.prototype.setOnPressedMoveStartCallback=function(t){return this.onPressedMoveStart!==t&&(this.onPressedMoveStart=t,!0)},t.prototype.setOnPressedMovingCallback=function(t){return this.onPressedMoving!==t&&(this.onPressedMoving=t,!0)},t.prototype.setOnPressedMoveEndCallback=function(t){return this.onPressedMoveEnd!==t&&(this.onPressedMoveEnd=t,!0)},t.prototype.setOnMouseEnterCallback=function(t){return this.onMouseEnter!==t&&(this.onMouseEnter=t,!0)},t.prototype.setOnMouseLeaveCallback=function(t){return this.onMouseLeave!==t&&(this.onMouseLeave=t,!0)},t.prototype.setOnRemovedCallback=function(t){return this.onRemoved!==t&&(this.onRemoved=t,!0)},t.prototype.setOnSelectedCallback=function(t){return this.onSelected!==t&&(this.onSelected=t,!0)},t.prototype.setOnDeselectedCallback=function(t){return this.onDeselected!==t&&(this.onDeselected=t,!0)},t.prototype.nextStep=function(){this.currentStep===this.totalStep-1?this.currentStep=Qt:this.currentStep++},t.prototype.forceComplete=function(){this.currentStep=Qt},t.prototype.isDrawing=function(){return this.currentStep!==Qt},t.prototype.isStart=function(){return this.currentStep===Jt},t.prototype.eventMoveForDrawing=function(t){var e,i=this.currentStep-1,n={};Et(t.timestamp)&&(n.timestamp=t.timestamp),Et(t.dataIndex)&&(n.dataIndex=t.dataIndex),Et(t.value)&&(n.value=t.value),this.points[i]=n,null===(e=this.performEventMoveForDrawing)||void 0===e||e.call(this,{currentStep:this.currentStep,mode:this.mode,points:this.points,performPointIndex:i,performPoint:n})},t.prototype.eventPressedPointMove=function(t,e){var i;Et(t.dataIndex)&&(this.points[e].dataIndex=t.dataIndex,this.points[e].timestamp=t.timestamp),Et(t.value)&&(this.points[e].value=t.value),null===(i=this.performEventPressedMove)||void 0===i||i.call(this,{currentStep:this.currentStep,points:this.points,mode:this.mode,performPointIndex:e,performPoint:this.points[e]})},t.prototype.startPressedMove=function(t){this._prevPressedPoint=X({},t),this._prevPressedPoints=St(this.points)},t.prototype.eventPressedOtherMove=function(t,e){var i,n;null!==this._prevPressedPoint&&(Et(t.dataIndex)&&Et(this._prevPressedPoint.dataIndex)&&(i=t.dataIndex-this._prevPressedPoint.dataIndex),Et(t.value)&&Et(this._prevPressedPoint.value)&&(n=t.value-this._prevPressedPoint.value),this.points=this._prevPressedPoints.map(function(t){var a;Et(t.timestamp)&&(t.dataIndex=e.timestampToDataIndex(t.timestamp));var r=X({},t);return Et(i)&&Et(t.dataIndex)&&(r.dataIndex=t.dataIndex+i,r.timestamp=null!==(a=e.dataIndexToTimestamp(r.dataIndex))&&void 0!==a?a:void 0),Et(n)&&Et(t.value)&&(r.value=t.value+n),r}))},t.extend=function(e){var i=function(t){function i(){return t.call(this,e)||this}return L(i,t),i}(t);return i},t}();function ne(){return{formatDate:Lt,formatBigNumber:Ot}}(function(t){t[t["Tooltip"]=0]="Tooltip",t[t["Crosshair"]=1]="Crosshair",t[t["XAxis"]=2]="XAxis"})(qt||(qt={}));var ae="en-US",re=-1;function oe(t){return kt(window.requestAnimationFrame)?window.requestAnimationFrame(t):window.setTimeout(t,20)}function se(t){kt(window.cancelAnimationFrame)?window.cancelAnimationFrame(t):window.clearTimeout(t)}var le=function(){function t(t){this._options={duration:500,iterationCount:1},this._currentIterationCount=0,this._running=!1,this._time=0,wt(this._options,t)}return t.prototype._loop=function(){var t=this;this._running=!0;var e=function(){var i;if(t._running){var n=(new Date).getTime()-t._time;n<t._options.duration?(null===(i=t._doFrameCallback)||void 0===i||i.call(t,n),oe(e)):(t.stop(),t._currentIterationCount++,t._currentIterationCount<t._options.iterationCount&&t.start())}};oe(e)},t.prototype.doFrame=function(t){return this._doFrameCallback=t,this},t.prototype.setDuration=function(t){return this._options.duration=t,this},t.prototype.setIterationCount=function(t){return this._options.iterationCount=t,this},t.prototype.start=function(){this._running||(this._time=(new Date).getTime(),this._loop())},t.prototype.stop=function(){var t;this._running&&(null===(t=this._doFrameCallback)||void 0===t||t.call(this,this._options.duration)),this._running=!1},t}(),ce=1,ue=(new Date).getTime();function de(t){var e=(new Date).getTime();return e===ue?++ce:ce=1,ue=e,"".concat(null!==t&&void 0!==t?t:"").concat(e,"_").concat(ce)}function he(t,e){var i,n=document.createElement(t),a=null!==e&&void 0!==e?e:{};for(var r in a)n.style[r]=null!==(i=a[r])&&void 0!==i?i:"";return n}function pe(t,e,i){var n=0,a=0;for(a=t.length-1;n!==a;){var r=Math.floor((a+n)/2),o=a-n,s=t[r][e];if(i===t[n][e])return n;if(i===t[a][e])return a;if(i===s)return r;if(i>s?n=r:a=r,o<=2)break}return n}function ve(t){var e=Math.floor(ye(t)),i=_e(e),n=t/i,a=0;return a=n<1.5?1:n<2.5?2:n<3.5?3:n<4.5?4:n<5.5?5:n<6.5?6:8,t=a*i,e>=-20?+t.toFixed(e<0?-e:0):t}function fe(t,e){null==e&&(e=10),e=Math.min(Math.max(0,e),20);var i=(+t).toFixed(e);return+i}function ge(t){var e=t.toString(),i=e.indexOf("e");if(i>0){var n=+e.slice(i+1);return n<0?-n:0}var a=e.indexOf(".");return a<0?0:e.length-1-a}function me(t,e,i){var n=[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER];return t.forEach(function(t){var a,r;n[0]=Math.max(null!==(a=t[e])&&void 0!==a?a:t,n[0]),n[1]=Math.min(null!==(r=t[i])&&void 0!==r?r:t,n[1])}),n}function ye(t){return Math.log(t)/Math.log(10)}function _e(t){return Math.pow(10,t)}function be(){return{from:0,to:0,realFrom:0,realTo:0}}var xe={MIN:1,MAX:50},we=8,Se=80,Ce=.88,ke=10,Ie=function(){function t(t){this._dateTimeFormat=this._buildDateTimeFormat(),this._zoomEnabled=!0,this._scrollEnabled=!0,this._totalBarSpace=0,this._barSpace=we,this._offsetRightDistance=Se,this._startLastBarRightSideDiffBarCount=0,this._scrollLimitRole=0,this._minVisibleBarCount={left:2,right:2},this._maxOffsetDistance={left:50,right:50},this._visibleRange=be(),this._chartStore=t,this._gapBarSpace=this._calcGapBarSpace(),this._lastBarRightSideDiffBarCount=this._offsetRightDistance/this._barSpace}return t.prototype._calcGapBarSpace=function(){var t;return this._barSpace>3?t=Math.floor(this._barSpace*Ce):(t=Math.floor(this._barSpace),t===this._barSpace&&t--),t%2===0&&t--,t=Math.max(1,t),t},t.prototype.adjustVisibleRange=function(){var t,e,i,n,a=this._chartStore.getDataList(),r=a.length,o=this._totalBarSpace/this._barSpace;1===this._scrollLimitRole?(i=(this._totalBarSpace-this._maxOffsetDistance.right)/this._barSpace,n=(this._totalBarSpace-this._maxOffsetDistance.left)/this._barSpace):(i=this._minVisibleBarCount.left,n=this._minVisibleBarCount.right),i=Math.max(0,i),n=Math.max(0,n);var s=o-Math.min(i,r);this._lastBarRightSideDiffBarCount>s&&(this._lastBarRightSideDiffBarCount=s);var l=-r+Math.min(n,r);this._lastBarRightSideDiffBarCount<l&&(this._lastBarRightSideDiffBarCount=l);var c=Math.round(this._lastBarRightSideDiffBarCount+r+.5),u=c;c>r&&(c=r);var d=Math.round(c-o)-1;d<0&&(d=0);var h=this._lastBarRightSideDiffBarCount>0?Math.round(r+this._lastBarRightSideDiffBarCount-o)-1:d;if(this._visibleRange={from:d,to:c,realFrom:h,realTo:u},this._chartStore.getActionStore().execute(Tt.OnVisibleRangeChange,this._visibleRange),this._chartStore.adjustVisibleDataList(),0===d){var p=a[0];this._chartStore.executeLoadMoreCallback(null!==(t=null===p||void 0===p?void 0:p.timestamp)&&void 0!==t?t:null),this._chartStore.executeLoadDataCallback({type:Kt.Forward,data:null!==p&&void 0!==p?p:null})}c===r&&this._chartStore.executeLoadDataCallback({type:Kt.Backward,data:null!==(e=a[r-1])&&void 0!==e?e:null})},t.prototype.getDateTimeFormat=function(){return this._dateTimeFormat},t.prototype._buildDateTimeFormat=function(t){var e={hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"};Mt(t)&&(e.timeZone=t);var i=null;try{i=new Intl.DateTimeFormat("en",e)}catch(n){_t("","","Timezone is error!!!")}return i},t.prototype.setTimezone=function(t){var e=this._buildDateTimeFormat(t);null!==e&&(this._dateTimeFormat=e)},t.prototype.getTimezone=function(){return this._dateTimeFormat.resolvedOptions().timeZone},t.prototype.getBarSpace=function(){return{bar:this._barSpace,halfBar:this._barSpace/2,gapBar:this._gapBarSpace,halfGapBar:Math.floor(this._gapBarSpace/2)}},t.prototype.setBarSpace=function(t,e){t<xe.MIN||t>xe.MAX||this._barSpace===t||(this._barSpace=t,this._gapBarSpace=this._calcGapBarSpace(),null===e||void 0===e||e(),this.adjustVisibleRange(),this._chartStore.getTooltipStore().recalculateCrosshair(!0),this._chartStore.getChart().adjustPaneViewport(!1,!0,!0,!0))},t.prototype.setTotalBarSpace=function(t){return this._totalBarSpace!==t&&(this._totalBarSpace=t,this.adjustVisibleRange(),this._chartStore.getTooltipStore().recalculateCrosshair(!0)),this},t.prototype.setOffsetRightDistance=function(t,e){return this._offsetRightDistance=1===this._scrollLimitRole?Math.min(this._maxOffsetDistance.right,t):t,this._lastBarRightSideDiffBarCount=this._offsetRightDistance/this._barSpace,null!==e&&void 0!==e&&e&&(this.adjustVisibleRange(),this._chartStore.getTooltipStore().recalculateCrosshair(!0),this._chartStore.getChart().adjustPaneViewport(!1,!0,!0,!0)),this},t.prototype.resetOffsetRightDistance=function(){this.setOffsetRightDistance(this._offsetRightDistance)},t.prototype.getInitialOffsetRightDistance=function(){return this._offsetRightDistance},t.prototype.getOffsetRightDistance=function(){return Math.max(0,this._lastBarRightSideDiffBarCount*this._barSpace)},t.prototype.getLastBarRightSideDiffBarCount=function(){return this._lastBarRightSideDiffBarCount},t.prototype.setLastBarRightSideDiffBarCount=function(t){return this._lastBarRightSideDiffBarCount=t,this},t.prototype.setMaxOffsetLeftDistance=function(t){return this._scrollLimitRole=1,this._maxOffsetDistance.left=t,this},t.prototype.setMaxOffsetRightDistance=function(t){return this._scrollLimitRole=1,this._maxOffsetDistance.right=t,this},t.prototype.setLeftMinVisibleBarCount=function(t){return this._scrollLimitRole=0,this._minVisibleBarCount.left=t,this},t.prototype.setRightMinVisibleBarCount=function(t){return this._scrollLimitRole=0,this._minVisibleBarCount.right=t,this},t.prototype.getVisibleRange=function(){return this._visibleRange},t.prototype.startScroll=function(){this._startLastBarRightSideDiffBarCount=this._lastBarRightSideDiffBarCount},t.prototype.scroll=function(t){if(this._scrollEnabled){var e=t/this._barSpace,i=this._lastBarRightSideDiffBarCount*this._barSpace;this._lastBarRightSideDiffBarCount=this._startLastBarRightSideDiffBarCount-e,this.adjustVisibleRange(),this._chartStore.getTooltipStore().recalculateCrosshair(!0),this._chartStore.getChart().adjustPaneViewport(!1,!0,!0,!0);var n=Math.round(i-this._lastBarRightSideDiffBarCount*this._barSpace);0!==n&&this._chartStore.getActionStore().execute(Tt.OnScroll,{distance:n})}},t.prototype.getDataByDataIndex=function(t){var e;return null!==(e=this._chartStore.getDataList()[t])&&void 0!==e?e:null},t.prototype.coordinateToFloatIndex=function(t){var e=this._chartStore.getDataList().length,i=(this._totalBarSpace-t)/this._barSpace,n=e+this._lastBarRightSideDiffBarCount-i;return Math.round(1e6*n)/1e6},t.prototype.dataIndexToTimestamp=function(t){var e,i=this.getDataByDataIndex(t);return null!==(e=null===i||void 0===i?void 0:i.timestamp)&&void 0!==e?e:null},t.prototype.timestampToDataIndex=function(t){var e=this._chartStore.getDataList();return 0===e.length?0:pe(e,"timestamp",t)},t.prototype.dataIndexToCoordinate=function(t){var e=this._chartStore.getDataList().length,i=e+this._lastBarRightSideDiffBarCount-t;return Math.floor(this._totalBarSpace-(i-.5)*this._barSpace)},t.prototype.coordinateToDataIndex=function(t){return Math.ceil(this.coordinateToFloatIndex(t))-1},t.prototype.zoom=function(t,e){var i,n=this;if(this._zoomEnabled){var a=null!==e&&void 0!==e?e:null;if(!Et(null===a||void 0===a?void 0:a.x)){var r=this._chartStore.getTooltipStore().getCrosshair();a={x:null!==(i=null===r||void 0===r?void 0:r.x)&&void 0!==i?i:this._totalBarSpace/2}}var o=a.x,s=this.coordinateToFloatIndex(o),l=this._barSpace,c=this._barSpace+t*(this._barSpace/ke);this.setBarSpace(c,function(){n._lastBarRightSideDiffBarCount+=s-n.coordinateToFloatIndex(o)});var u=this._barSpace/l;1!==u&&this._chartStore.getActionStore().execute(Tt.OnZoom,{scale:u})}},t.prototype.setZoomEnabled=function(t){return this._zoomEnabled=t,this},t.prototype.getZoomEnabled=function(){return this._zoomEnabled},t.prototype.setScrollEnabled=function(t){return this._scrollEnabled=t,this},t.prototype.getScrollEnabled=function(){return this._scrollEnabled},t.prototype.clear=function(){this._visibleRange=be()},t}(),Ee={name:"AVP",shortName:"AVP",series:Yt.Price,precision:2,figures:[{key:"avp",title:"AVP: ",type:"line"}],calc:function(t){var e=0,i=0;return t.map(function(t){var n,a,r={},o=null!==(n=null===t||void 0===t?void 0:t.turnover)&&void 0!==n?n:0,s=null!==(a=null===t||void 0===t?void 0:t.volume)&&void 0!==a?a:0;return e+=o,i+=s,0!==i&&(r.avp=e/i),r})}},Ae={name:"AO",shortName:"AO",calcParams:[5,34],figures:[{key:"ao",title:"AO: ",type:"bar",baseValue:0,styles:function(t,e,i){var n,a,r,o,s,l=t.prev,c=t.current,u=null!==(a=null===(n=l.indicatorData)||void 0===n?void 0:n.ao)&&void 0!==a?a:Number.MIN_SAFE_INTEGER,d=null!==(o=null===(r=c.indicatorData)||void 0===r?void 0:r.ao)&&void 0!==o?o:Number.MIN_SAFE_INTEGER;s=d>u?Rt(e.styles,"bars[0].upColor",i.bars[0].upColor):Rt(e.styles,"bars[0].downColor",i.bars[0].downColor);var h=d>u?O.Stroke:O.Fill;return{color:s,style:h,borderColor:s}}}],calc:function(t,e){var i=e.calcParams,n=Math.max(i[0],i[1]),a=0,r=0,o=0,s=0;return t.map(function(e,l){var c={},u=(e.low+e.high)/2;if(a+=u,r+=u,l>=i[0]-1){o=a/i[0];var d=t[l-(i[0]-1)];a-=(d.low+d.high)/2}if(l>=i[1]-1){s=r/i[1];d=t[l-(i[1]-1)];r-=(d.low+d.high)/2}return l>=n-1&&(c.ao=o-s),c})}},Pe={name:"BIAS",shortName:"BIAS",calcParams:[6,12,24],figures:[{key:"bias1",title:"BIAS6: ",type:"line"},{key:"bias2",title:"BIAS12: ",type:"line"},{key:"bias3",title:"BIAS24: ",type:"line"}],regenerateFigures:function(t){return t.map(function(t,e){return{key:"bias".concat(e+1),title:"BIAS".concat(t,": "),type:"line"}})},calc:function(t,e){var i=e.calcParams,n=e.figures,a=[];return t.map(function(e,r){var o={},s=e.close;return i.forEach(function(e,l){var c;if(a[l]=(null!==(c=a[l])&&void 0!==c?c:0)+s,r>=e-1){var u=a[l]/i[l];o[n[l].key]=(s-u)/u*100,a[l]-=t[r-(e-1)].close}}),o})}};function Me(t,e){var i=t.length,n=0;return t.forEach(function(t){var i=t.close-e;n+=i*i}),n=Math.abs(n),Math.sqrt(n/i)}var De={name:"BOLL",shortName:"BOLL",series:Yt.Price,calcParams:[20,2],precision:2,shouldOhlc:!0,figures:[{key:"up",title:"UP: ",type:"line"},{key:"mid",title:"MID: ",type:"line"},{key:"dn",title:"DN: ",type:"line"}],calc:function(t,e){var i=e.calcParams,n=i[0]-1,a=0;return t.map(function(e,r){var o=e.close,s={};if(a+=o,r>=n){s.mid=a/i[0];var l=Me(t.slice(r-n,r+1),s.mid);s.up=s.mid+i[1]*l,s.dn=s.mid-i[1]*l,a-=t[r-n].close}return s})}},Te={name:"BRAR",shortName:"BRAR",calcParams:[26],figures:[{key:"br",title:"BR: ",type:"line"},{key:"ar",title:"AR: ",type:"line"}],calc:function(t,e){var i=e.calcParams,n=0,a=0,r=0,o=0;return t.map(function(e,s){var l,c,u={},d=e.high,h=e.low,p=e.open,v=(null!==(l=t[s-1])&&void 0!==l?l:e).close;if(r+=d-p,o+=p-h,n+=d-v,a+=v-h,s>=i[0]-1){u.ar=0!==o?r/o*100:0,u.br=0!==a?n/a*100:0;var f=t[s-(i[0]-1)],g=f.high,m=f.low,y=f.open,_=(null!==(c=t[s-i[0]])&&void 0!==c?c:t[s-(i[0]-1)]).close;n-=g-_,a-=_-m,r-=g-y,o-=y-m}return u})}},Be={name:"BBI",shortName:"BBI",series:Yt.Price,precision:2,calcParams:[3,6,12,24],shouldOhlc:!0,figures:[{key:"bbi",title:"BBI: ",type:"line"}],calc:function(t,e){var i=e.calcParams,n=Math.max.apply(Math,q([],Z(i),!1)),a=[],r=[];return t.map(function(e,o){var s={},l=e.close;if(i.forEach(function(e,i){var n;a[i]=(null!==(n=a[i])&&void 0!==n?n:0)+l,o>=e-1&&(r[i]=a[i]/e,a[i]-=t[o-(e-1)].close)}),o>=n-1){var c=0;r.forEach(function(t){c+=t}),s.bbi=c/4}return s})}},Fe={name:"CCI",shortName:"CCI",calcParams:[20],figures:[{key:"cci",title:"CCI: ",type:"line"}],calc:function(t,e){var i=e.calcParams,n=i[0]-1,a=0,r=[];return t.map(function(e,o){var s={},l=(e.high+e.low+e.close)/3;if(a+=l,r.push(l),o>=n){var c=a/i[0],u=r.slice(o-n,o+1),d=0;u.forEach(function(t){d+=Math.abs(t-c)});var h=d/i[0];s.cci=0!==h?(l-c)/h/.015:0;var p=(t[o-n].high+t[o-n].low+t[o-n].close)/3;a-=p}return s})}},Re={name:"CR",shortName:"CR",calcParams:[26,10,20,40,60],figures:[{key:"cr",title:"CR: ",type:"line"},{key:"ma1",title:"MA1: ",type:"line"},{key:"ma2",title:"MA2: ",type:"line"},{key:"ma3",title:"MA3: ",type:"line"},{key:"ma4",title:"MA4: ",type:"line"}],calc:function(t,e){var i=e.calcParams,n=Math.ceil(i[1]/2.5+1),a=Math.ceil(i[2]/2.5+1),r=Math.ceil(i[3]/2.5+1),o=Math.ceil(i[4]/2.5+1),s=0,l=[],c=0,u=[],d=0,h=[],p=0,v=[],f=[];return t.forEach(function(e,g){var m,y,_,b,x,w={},S=null!==(m=t[g-1])&&void 0!==m?m:e,C=(S.high+S.close+S.low+S.open)/4,k=Math.max(0,e.high-C),I=Math.max(0,C-e.low);g>=i[0]-1&&(w.cr=0!==I?k/I*100:0,s+=w.cr,c+=w.cr,d+=w.cr,p+=w.cr,g>=i[0]+i[1]-2&&(l.push(s/i[1]),g>=i[0]+i[1]+n-3&&(w.ma1=l[l.length-1-n]),s-=null!==(y=f[g-(i[1]-1)].cr)&&void 0!==y?y:0),g>=i[0]+i[2]-2&&(u.push(c/i[2]),g>=i[0]+i[2]+a-3&&(w.ma2=u[u.length-1-a]),c-=null!==(_=f[g-(i[2]-1)].cr)&&void 0!==_?_:0),g>=i[0]+i[3]-2&&(h.push(d/i[3]),g>=i[0]+i[3]+r-3&&(w.ma3=h[h.length-1-r]),d-=null!==(b=f[g-(i[3]-1)].cr)&&void 0!==b?b:0),g>=i[0]+i[4]-2&&(v.push(p/i[4]),g>=i[0]+i[4]+o-3&&(w.ma4=v[v.length-1-o]),p-=null!==(x=f[g-(i[4]-1)].cr)&&void 0!==x?x:0)),f.push(w)}),f}},Le={name:"DMA",shortName:"DMA",calcParams:[10,50,10],figures:[{key:"dma",title:"DMA: ",type:"line"},{key:"ama",title:"AMA: ",type:"line"}],calc:function(t,e){var i=e.calcParams,n=Math.max(i[0],i[1]),a=0,r=0,o=0,s=[];return t.forEach(function(e,l){var c,u={},d=e.close;a+=d,r+=d;var h=0,p=0;if(l>=i[0]-1&&(h=a/i[0],a-=t[l-(i[0]-1)].close),l>=i[1]-1&&(p=r/i[1],r-=t[l-(i[1]-1)].close),l>=n-1){var v=h-p;u.dma=v,o+=v,l>=n+i[2]-2&&(u.ama=o/i[2],o-=null!==(c=s[l-(i[2]-1)].dma)&&void 0!==c?c:0)}s.push(u)}),s}},Ne={name:"DMI",shortName:"DMI",calcParams:[14,6],figures:[{key:"pdi",title:"PDI: ",type:"line"},{key:"mdi",title:"MDI: ",type:"line"},{key:"adx",title:"ADX: ",type:"line"},{key:"adxr",title:"ADXR: ",type:"line"}],calc:function(t,e){var i=e.calcParams,n=0,a=0,r=0,o=0,s=0,l=0,c=0,u=0,d=[];return t.forEach(function(e,h){var p,v,f={},g=null!==(p=t[h-1])&&void 0!==p?p:e,m=g.close,y=e.high,_=e.low,b=y-_,x=Math.abs(y-m),w=Math.abs(m-_),S=y-g.high,C=g.low-_,k=Math.max(Math.max(b,x),w),I=S>0&&S>C?S:0,E=C>0&&C>S?C:0;if(n+=k,a+=I,r+=E,h>=i[0]-1){h>i[0]-1?(o=o-o/i[0]+k,s=s-s/i[0]+I,l=l-l/i[0]+E):(o=n,s=a,l=r);var A=0,P=0;0!==o&&(A=100*s/o,P=100*l/o),f.pdi=A,f.mdi=P;var M=0;P+A!==0&&(M=Math.abs(P-A)/(P+A)*100),c+=M,h>=2*i[0]-2&&(u=h>2*i[0]-2?(u*(i[0]-1)+M)/i[0]:c/i[0],f.adx=u,h>=2*i[0]+i[1]-3&&(f.adxr=((null!==(v=d[h-(i[1]-1)].adx)&&void 0!==v?v:0)+u)/2))}d.push(f)}),d}},Oe={name:"EMV",shortName:"EMV",calcParams:[14,9],figures:[{key:"emv",title:"EMV: ",type:"line"},{key:"maEmv",title:"MAEMV: ",type:"line"}],calc:function(t,e){var i=e.calcParams,n=0,a=[];return t.map(function(e,r){var o,s={};if(r>0){var l=t[r-1],c=e.high,u=e.low,d=null!==(o=e.volume)&&void 0!==o?o:0,h=(c+u)/2-(l.high+l.low)/2;if(0===d||c-u===0)s.emv=0;else{var p=d/1e8/(c-u);s.emv=h/p}n+=s.emv,a.push(s.emv),r>=i[0]&&(s.maEmv=n/i[0],n-=a[r-i[0]])}return s})}},ze={name:"EMA",shortName:"EMA",series:Yt.Price,calcParams:[6,12,20],precision:2,shouldOhlc:!0,figures:[{key:"ema1",title:"EMA6: ",type:"line"},{key:"ema2",title:"EMA12: ",type:"line"},{key:"ema3",title:"EMA20: ",type:"line"}],regenerateFigures:function(t){return t.map(function(t,e){return{key:"ema".concat(e+1),title:"EMA".concat(t,": "),type:"line"}})},calc:function(t,e){var i=e.calcParams,n=e.figures,a=0,r=[];return t.map(function(t,e){var o={},s=t.close;return a+=s,i.forEach(function(t,i){e>=t-1&&(r[i]=e>t-1?(2*s+(t-1)*r[i])/(t+1):a/t,o[n[i].key]=r[i])}),o})}},Ve={name:"MTM",shortName:"MTM",calcParams:[12,6],figures:[{key:"mtm",title:"MTM: ",type:"line"},{key:"maMtm",title:"MAMTM: ",type:"line"}],calc:function(t,e){var i=e.calcParams,n=0,a=[];return t.forEach(function(e,r){var o,s={};if(r>=i[0]){var l=e.close,c=t[r-i[0]].close;s.mtm=l-c,n+=s.mtm,r>=i[0]+i[1]-1&&(s.maMtm=n/i[1],n-=null!==(o=a[r-(i[1]-1)].mtm)&&void 0!==o?o:0)}a.push(s)}),a}},We={name:"MA",shortName:"MA",series:Yt.Price,calcParams:[5,10,30,60],precision:2,shouldOhlc:!0,figures:[{key:"ma5",title:"MA5: ",type:"line"},{key:"ma10",title:"MA10: ",type:"line"},{key:"ma30",title:"MA30: ",type:"line"},{key:"ma60",title:"MA60: ",type:"line"}],regenerateFigures:function(t){return t.map(function(t,e){return{key:"ma".concat(e+1),title:"MA".concat(t,": "),type:"line"}})},calc:function(t,e){var i=e.calcParams,n=e.figures,a=[];return t.map(function(e,r){var o={},s=e.close;return i.forEach(function(e,i){var l;a[i]=(null!==(l=a[i])&&void 0!==l?l:0)+s,r>=e-1&&(o[n[i].key]=a[i]/e,a[i]-=t[r-(e-1)].close)}),o})}},He={name:"MACD",shortName:"MACD",calcParams:[12,26,9],figures:[{key:"dif",title:"DIF: ",type:"line"},{key:"dea",title:"DEA: ",type:"line"},{key:"macd",title:"MACD: ",type:"bar",baseValue:0,styles:function(t,e,i){var n,a,r,o,s,l=t.prev,c=t.current,u=null!==(a=null===(n=l.indicatorData)||void 0===n?void 0:n.macd)&&void 0!==a?a:Number.MIN_SAFE_INTEGER,d=null!==(o=null===(r=c.indicatorData)||void 0===r?void 0:r.macd)&&void 0!==o?o:Number.MIN_SAFE_INTEGER;s=d>0?Rt(e.styles,"bars[0].upColor",i.bars[0].upColor):d<0?Rt(e.styles,"bars[0].downColor",i.bars[0].downColor):Rt(e.styles,"bars[0].noChangeColor",i.bars[0].noChangeColor);var h=u<d?O.Stroke:O.Fill;return{style:h,color:s,borderColor:s}}}],calc:function(t,e){var i,n,a=e.calcParams,r=0,o=0,s=0,l=0,c=Math.max(a[0],a[1]);return t.map(function(t,e){var u={},d=t.close;return r+=d,e>=a[0]-1&&(i=e>a[0]-1?(2*d+(a[0]-1)*i)/(a[0]+1):r/a[0]),e>=a[1]-1&&(n=e>a[1]-1?(2*d+(a[1]-1)*n)/(a[1]+1):r/a[1]),e>=c-1&&(o=i-n,u.dif=o,s+=o,e>=c+a[2]-2&&(l=e>c+a[2]-2?(2*o+l*(a[2]-1))/(a[2]+1):s/a[2],u.macd=2*(o-l),u.dea=l)),u})}},$e={name:"OBV",shortName:"OBV",calcParams:[30],figures:[{key:"obv",title:"OBV: ",type:"line"},{key:"maObv",title:"MAOBV: ",type:"line"}],calc:function(t,e){var i=e.calcParams,n=0,a=0,r=[];return t.forEach(function(e,o){var s,l,c,u,d=null!==(s=t[o-1])&&void 0!==s?s:e;e.close<d.close?a-=null!==(l=e.volume)&&void 0!==l?l:0:e.close>d.close&&(a+=null!==(c=e.volume)&&void 0!==c?c:0);var h={obv:a};n+=a,o>=i[0]-1&&(h.maObv=n/i[0],n-=null!==(u=r[o-(i[0]-1)].obv)&&void 0!==u?u:0),r.push(h)}),r}},Ke={name:"PVT",shortName:"PVT",figures:[{key:"pvt",title:"PVT: ",type:"line"}],calc:function(t){var e=0;return t.map(function(i,n){var a,r,o={},s=i.close,l=null!==(a=i.volume)&&void 0!==a?a:1,c=(null!==(r=t[n-1])&&void 0!==r?r:i).close,u=0,d=c*l;return 0!==d&&(u=(s-c)/d),e+=u,o.pvt=e,o})}},Ye={name:"PSY",shortName:"PSY",calcParams:[12,6],figures:[{key:"psy",title:"PSY: ",type:"line"},{key:"maPsy",title:"MAPSY: ",type:"line"}],calc:function(t,e){var i=e.calcParams,n=0,a=0,r=[],o=[];return t.forEach(function(e,s){var l,c,u={},d=(null!==(l=t[s-1])&&void 0!==l?l:e).close,h=e.close-d>0?1:0;r.push(h),n+=h,s>=i[0]-1&&(u.psy=n/i[0]*100,a+=u.psy,s>=i[0]+i[1]-2&&(u.maPsy=a/i[1],a-=null!==(c=o[s-(i[1]-1)].psy)&&void 0!==c?c:0),n-=r[s-(i[0]-1)]),o.push(u)}),o}},Xe={name:"ROC",shortName:"ROC",calcParams:[12,6],figures:[{key:"roc",title:"ROC: ",type:"line"},{key:"maRoc",title:"MAROC: ",type:"line"}],calc:function(t,e){var i=e.calcParams,n=[],a=0;return t.forEach(function(e,r){var o,s,l={};if(r>=i[0]-1){var c=e.close,u=(null!==(o=t[r-i[0]])&&void 0!==o?o:t[r-(i[0]-1)]).close;l.roc=0!==u?(c-u)/u*100:0,a+=l.roc,r>=i[0]-1+i[1]-1&&(l.maRoc=a/i[1],a-=null!==(s=n[r-(i[1]-1)].roc)&&void 0!==s?s:0)}n.push(l)}),n}},je={name:"RSI",shortName:"RSI",calcParams:[6,12,24],figures:[{key:"rsi1",title:"RSI1: ",type:"line"},{key:"rsi2",title:"RSI2: ",type:"line"},{key:"rsi3",title:"RSI3: ",type:"line"}],regenerateFigures:function(t){return t.map(function(t,e){var i=e+1;return{key:"rsi".concat(i),title:"RSI".concat(i,": "),type:"line"}})},calc:function(t,e){var i=e.calcParams,n=e.figures,a=[],r=[];return t.map(function(e,o){var s,l={},c=(null!==(s=t[o-1])&&void 0!==s?s:e).close,u=e.close-c;return i.forEach(function(e,i){var s,c,d;if(u>0?a[i]=(null!==(s=a[i])&&void 0!==s?s:0)+u:r[i]=(null!==(c=r[i])&&void 0!==c?c:0)+Math.abs(u),o>=e-1){0!==r[i]?l[n[i].key]=100-100/(1+a[i]/r[i]):l[n[i].key]=0;var h=t[o-(e-1)],p=null!==(d=t[o-e])&&void 0!==d?d:h,v=h.close-p.close;v>0?a[i]-=v:r[i]-=Math.abs(v)}}),l})}},Ue={name:"SMA",shortName:"SMA",series:Yt.Price,calcParams:[12,2],precision:2,figures:[{key:"sma",title:"SMA: ",type:"line"}],shouldOhlc:!0,calc:function(t,e){var i=e.calcParams,n=0,a=0;return t.map(function(t,e){var r={},o=t.close;return n+=o,e>=i[0]-1&&(a=e>i[0]-1?(o*i[1]+a*(i[0]-i[1]+1))/(i[0]+1):n/i[0],r.sma=a),r})}},Ge={name:"KDJ",shortName:"KDJ",calcParams:[9,3,3],figures:[{key:"k",title:"K: ",type:"line"},{key:"d",title:"D: ",type:"line"},{key:"j",title:"J: ",type:"line"}],calc:function(t,e){var i=e.calcParams,n=[];return t.forEach(function(e,a){var r,o,s,l,c={},u=e.close;if(a>=i[0]-1){var d=me(t.slice(a-(i[0]-1),a+1),"high","low"),h=d[0],p=d[1],v=h-p,f=(u-p)/(0===v?1:v)*100;c.k=((i[1]-1)*(null!==(o=null===(r=n[a-1])||void 0===r?void 0:r.k)&&void 0!==o?o:50)+f)/i[1],c.d=((i[2]-1)*(null!==(l=null===(s=n[a-1])||void 0===s?void 0:s.d)&&void 0!==l?l:50)+c.k)/i[2],c.j=3*c.k-2*c.d}n.push(c)}),n}},Ze={name:"SAR",shortName:"SAR",series:Yt.Price,calcParams:[2,2,20],precision:2,shouldOhlc:!0,figures:[{key:"sar",title:"SAR: ",type:"circle",styles:function(t,e,i){var n,a,r=t.current,o=null!==(a=null===(n=r.indicatorData)||void 0===n?void 0:n.sar)&&void 0!==a?a:Number.MIN_SAFE_INTEGER,s=r.kLineData,l=((null===s||void 0===s?void 0:s.high)+(null===s||void 0===s?void 0:s.low))/2,c=o<l?Rt(e.styles,"circles[0].upColor",i.circles[0].upColor):Rt(e.styles,"circles[0].downColor",i.circles[0].downColor);return{color:c}}}],calc:function(t,e){var i=e.calcParams,n=i[0]/100,a=i[1]/100,r=i[2]/100,o=n,s=-100,l=!1,c=0;return t.map(function(e,i){var u=c,d=e.high,h=e.low;if(l){(-100===s||s<d)&&(s=d,o=Math.min(o+a,r)),c=u+o*(s-u);var p=Math.min(t[Math.max(1,i)-1].low,h);c>e.low?(c=s,o=n,s=-100,l=!l):c>p&&(c=p)}else{(-100===s||s>h)&&(s=h,o=Math.min(o+a,r)),c=u+o*(s-u);var v=Math.max(t[Math.max(1,i)-1].high,d);c<e.high?(c=s,o=0,s=-100,l=!l):c<v&&(c=v)}return{sar:c}})}},qe={name:"TRIX",shortName:"TRIX",calcParams:[12,9],figures:[{key:"trix",title:"TRIX: ",type:"line"},{key:"maTrix",title:"MATRIX: ",type:"line"}],calc:function(t,e){var i,n,a,r=e.calcParams,o=0,s=0,l=0,c=0,u=[];return t.forEach(function(t,e){var d,h={},p=t.close;if(o+=p,e>=r[0]-1&&(i=e>r[0]-1?(2*p+(r[0]-1)*i)/(r[0]+1):o/r[0],s+=i,e>=2*r[0]-2&&(n=e>2*r[0]-2?(2*i+(r[0]-1)*n)/(r[0]+1):s/r[0],l+=n,e>=3*r[0]-3))){var v=void 0,f=0;e>3*r[0]-3?(v=(2*n+(r[0]-1)*a)/(r[0]+1),f=(v-a)/a*100):v=l/r[0],a=v,h.trix=f,c+=f,e>=3*r[0]+r[1]-4&&(h.maTrix=c/r[1],c-=null!==(d=u[e-(r[1]-1)].trix)&&void 0!==d?d:0)}u.push(h)}),u}};function Je(){return{key:"volume",title:"VOLUME: ",type:"bar",baseValue:0,styles:function(t,e,i){var n=t.current.kLineData,a=Rt(e.styles,"bars[0].noChangeColor",i.bars[0].noChangeColor);return At(n)&&(n.close>n.open?a=Rt(e.styles,"bars[0].upColor",i.bars[0].upColor):n.close<n.open&&(a=Rt(e.styles,"bars[0].downColor",i.bars[0].downColor))),{color:a}}}}var Qe={name:"VOL",shortName:"VOL",series:Yt.Volume,calcParams:[5,10,20],shouldFormatBigNumber:!0,precision:0,minValue:0,figures:[{key:"ma1",title:"MA5: ",type:"line"},{key:"ma2",title:"MA10: ",type:"line"},{key:"ma3",title:"MA20: ",type:"line"},Je()],regenerateFigures:function(t){var e=t.map(function(t,e){return{key:"ma".concat(e+1),title:"MA".concat(t,": "),type:"line"}});return e.push(Je()),e},calc:function(t,e){var i=e.calcParams,n=e.figures,a=[];return t.map(function(e,r){var o,s=null!==(o=e.volume)&&void 0!==o?o:0,l={volume:s};return i.forEach(function(e,i){var o,c;a[i]=(null!==(o=a[i])&&void 0!==o?o:0)+s,r>=e-1&&(l[n[i].key]=a[i]/e,a[i]-=null!==(c=t[r-(e-1)].volume)&&void 0!==c?c:0)}),l})}},ti={name:"VR",shortName:"VR",calcParams:[26,6],figures:[{key:"vr",title:"VR: ",type:"line"},{key:"maVr",title:"MAVR: ",type:"line"}],calc:function(t,e){var i=e.calcParams,n=0,a=0,r=0,o=0,s=[];return t.forEach(function(e,l){var c,u,d,h,p,v={},f=e.close,g=(null!==(c=t[l-1])&&void 0!==c?c:e).close,m=null!==(u=e.volume)&&void 0!==u?u:0;if(f>g?n+=m:f<g?a+=m:r+=m,l>=i[0]-1){var y=r/2;v.vr=a+y===0?0:(n+y)/(a+y)*100,o+=v.vr,l>=i[0]+i[1]-2&&(v.maVr=o/i[1],o-=null!==(d=s[l-(i[1]-1)].vr)&&void 0!==d?d:0);var _=t[l-(i[0]-1)],b=null!==(h=t[l-i[0]])&&void 0!==h?h:_,x=_.close,w=null!==(p=_.volume)&&void 0!==p?p:0;x>b.close?n-=w:x<b.close?a-=w:r-=w}s.push(v)}),s}},ei={name:"WR",shortName:"WR",calcParams:[6,10,14],figures:[{key:"wr1",title:"WR1: ",type:"line"},{key:"wr2",title:"WR2: ",type:"line"},{key:"wr3",title:"WR3: ",type:"line"}],regenerateFigures:function(t){return t.map(function(t,e){return{key:"wr".concat(e+1),title:"WR".concat(e+1,": "),type:"line"}})},calc:function(t,e){var i=e.calcParams,n=e.figures;return t.map(function(e,a){var r={},o=e.close;return i.forEach(function(e,i){var s=e-1;if(a>=s){var l=me(t.slice(a-s,a+1),"high","low"),c=l[0],u=l[1],d=c-u;r[n[i].key]=0===d?0:(o-c)/d*100}}),r})}},ii={},ni=[Ee,Ae,Pe,De,Te,Be,Fe,Re,Le,Ne,Oe,ze,Ve,We,He,$e,Ke,Ye,Xe,je,Ue,Ge,Ze,qe,Qe,ti,ei];function ai(t){ii[t.name]=Gt.extend(t)}function ri(t){var e;return null!==(e=ii[t])&&void 0!==e?e:null}ni.forEach(function(t){ii[t.name]=Gt.extend(t)});var oi=function(){function t(t){this._instances=new Map,this._chartStore=t}return t.prototype._overrideInstance=function(t,e){var i=e.shortName,n=e.series,a=e.calcParams,r=e.precision,o=e.figures,s=e.minValue,l=e.maxValue,c=e.shouldOhlc,u=e.shouldFormatBigNumber,d=e.visible,h=e.zLevel,p=e.styles,v=e.extendData,f=e.regenerateFigures,g=e.createTooltipDataSource,m=e.draw,y=e.calc,_=!1;Mt(i)&&t.setShortName(i)&&(_=!0),At(n)&&t.setSeries(n)&&(_=!0);var b=!1;Ct(a)&&t.setCalcParams(a)&&(_=!0,b=!0),Ct(o)&&t.setFigures(o)&&(_=!0,b=!0),void 0!==s&&t.setMinValue(s)&&(_=!0),void 0!==l&&t.setMinValue(l)&&(_=!0),Et(r)&&t.setPrecision(r)&&(_=!0),Pt(c)&&t.setShouldOhlc(c)&&(_=!0),Pt(u)&&t.setShouldFormatBigNumber(u)&&(_=!0),Pt(d)&&t.setVisible(d)&&(_=!0);var x=!1;return Et(h)&&t.setZLevel(h)&&(_=!0,x=!0),At(p)&&t.setStyles(p)&&(_=!0),void 0!==v&&t.setExtendData(v)&&(_=!0,b=!0),void 0!==f&&t.setRegenerateFigures(f)&&(_=!0),void 0!==g&&t.setCreateTooltipDataSource(g)&&(_=!0),void 0!==m&&t.setDraw(m)&&(_=!0),kt(y)&&(t.calc=y,b=!0),[_,b,x]},t.prototype._sort=function(t){var e;Mt(t)?null===(e=this._instances.get(t))||void 0===e||e.sort(function(t,e){return t.zLevel-e.zLevel}):this._instances.forEach(function(t){t.sort(function(t,e){return t.zLevel-e.zLevel})})},t.prototype.addInstance=function(t,e,i){return j(this,void 0,void 0,function(){var n,a,r,o,s;return U(this,function(l){switch(l.label){case 0:return n=t.name,a=this._instances.get(e),At(a)?(r=a.find(function(t){return t.name===n}),At(r)?[4,Promise.reject(new Error("Duplicate indicators."))]:[3,2]):[3,2];case 1:return[2,l.sent()];case 2:return At(a)||(a=[]),o=ri(n),s=new o,this.synchronizeSeriesPrecision(s),this._overrideInstance(s,t),i||(a=[]),a.push(s),this._instances.set(e,a),this._sort(e),[4,s.calcIndicator(this._chartStore.getDataList())];case 3:return[2,l.sent()]}})})},t.prototype.getInstances=function(t){var e;return null!==(e=this._instances.get(t))&&void 0!==e?e:[]},t.prototype.removeInstance=function(t,e){var i,n=!1,a=this._instances.get(t);if(At(a)){if(Mt(e)){var r=a.findIndex(function(t){return t.name===e});r>-1&&(a.splice(r,1),n=!0)}else this._instances.set(t,[]),n=!0;0===(null===(i=this._instances.get(t))||void 0===i?void 0:i.length)&&this._instances.delete(t)}return n},t.prototype.hasInstances=function(t){return this._instances.has(t)},t.prototype.calcInstance=function(t,e){return j(this,void 0,void 0,function(){var i,n,a,r,o=this;return U(this,function(s){switch(s.label){case 0:return i=[],Mt(t)?Mt(e)?(n=this._instances.get(e),At(n)&&(a=n.find(function(e){return e.name===t}),At(a)&&i.push(a.calcIndicator(this._chartStore.getDataList())))):this._instances.forEach(function(e){var n=e.find(function(e){return e.name===t});At(n)&&i.push(n.calcIndicator(o._chartStore.getDataList()))}):this._instances.forEach(function(t){t.forEach(function(t){i.push(t.calcIndicator(o._chartStore.getDataList()))})}),[4,Promise.all(i)];case 1:return r=s.sent(),[2,r.includes(!0)]}})})},t.prototype.getInstanceByPaneId=function(t,e){var i,n,a=function(t){var e=new Map;return t.forEach(function(t){e.set(t.name,t)}),e};if(Mt(t)){var r=null!==(i=this._instances.get(t))&&void 0!==i?i:[];return Mt(e)?null!==(n=null===r||void 0===r?void 0:r.find(function(t){return t.name===e}))&&void 0!==n?n:null:a(r)}var o=new Map;return this._instances.forEach(function(t,e){o.set(e,a(t))}),o},t.prototype.synchronizeSeriesPrecision=function(t){var e=this._chartStore.getPrecision(),i=e.price,n=e.volume,a=function(t){switch(t.series){case Yt.Price:t.setPrecision(i,!0);break;case Yt.Volume:t.setPrecision(n,!0);break}};At(t)?a(t):this._instances.forEach(function(t){t.forEach(function(t){a(t)})})},t.prototype.override=function(t,e){return j(this,void 0,void 0,function(){var i,n,a,r,o,s,l,c=this;return U(this,function(u){switch(u.label){case 0:return i=t.name,n=new Map,null!==e?(a=this._instances.get(e),At(a)&&n.set(e,a)):n=this._instances,r=!1,o=[],s=!1,n.forEach(function(e){var n=e.find(function(t){return t.name===i});if(At(n)){var a=c._overrideInstance(n,t);a[2]&&(s=!0),a[1]?o.push(n.calcIndicator(c._chartStore.getDataList())):a[0]&&(r=!0)}}),s&&this._sort(),[4,Promise.all(o)];case 1:return l=u.sent(),[2,[r,l.includes(!0)]]}})})},t}(),si=function(){function t(t){this._crosshair={},this._activeIcon=null,this._chartStore=t}return t.prototype.setCrosshair=function(t,e){var i,n,a=null!==e&&void 0!==e?e:{},r=a.notInvalidate,o=a.notExecuteAction,s=this._chartStore.getDataList(),l=null!==t&&void 0!==t?t:{};Et(l.x)?(i=this._chartStore.getTimeScaleStore().coordinateToDataIndex(l.x),n=i<0?0:i>s.length-1?s.length-1:i):(i=s.length-1,n=i);var c=s[n],u=this._chartStore.getTimeScaleStore().dataIndexToCoordinate(i),d={x:this._crosshair.x,y:this._crosshair.y,paneId:this._crosshair.paneId};this._crosshair=X(X({},l),{realX:u,kLineData:c,realDataIndex:i,dataIndex:n}),d.x===l.x&&d.y===l.y&&d.paneId===l.paneId||(null===c||null!==o&&void 0!==o&&o||this._chartStore.getChart().crosshairChange(this._crosshair),null!==r&&void 0!==r&&r||this._chartStore.getChart().updatePane(1))},t.prototype.recalculateCrosshair=function(t){this.setCrosshair(this._crosshair,{notInvalidate:t})},t.prototype.getCrosshair=function(){return this._crosshair},t.prototype.setActiveIcon=function(t){this._activeIcon=null!==t&&void 0!==t?t:null},t.prototype.getActiveIcon=function(){return this._activeIcon},t.prototype.clear=function(){this.setCrosshair({},{notInvalidate:!0}),this.setActiveIcon()},t}(),li={name:"fibonacciLine",totalStep:3,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e,i=t.coordinates,n=t.bounding,a=t.overlay,r=t.precision,o=t.thousandsSeparator,s=t.decimalFoldThreshold,l=t.yAxis,c=a.points;if(i.length>0){var u=null===(e=null===l||void 0===l?void 0:l.isInCandle())||void 0===e||e?r.price:r.excludePriceVolumeMax,d=[],h=[],p=0,v=n.width;if(i.length>1&&Et(c[0].value)&&Et(c[1].value)){var f=[1,.786,.618,.5,.382,.236,0],g=i[0].y-i[1].y,m=c[0].value-c[1].value;f.forEach(function(t){var e,n=i[1].y+g*t,a=Vt(zt(((null!==(e=c[1].value)&&void 0!==e?e:0)+m*t).toFixed(u),o),s);d.push({coordinates:[{x:p,y:n},{x:v,y:n}]}),h.push({x:p,y:n,text:"".concat(a," (").concat((100*t).toFixed(1),"%)"),baseline:"bottom"})})}return[{type:"line",attrs:d},{type:"text",isCheckEvent:!1,attrs:h}]}return[]}},ci={name:"horizontalRayLine",totalStep:3,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e=t.coordinates,i=t.bounding,n={x:0,y:e[0].y};return At(e[1])&&e[0].x<e[1].x&&(n.x=i.width),[{type:"line",attrs:{coordinates:[e[0],n]}}]},performEventPressedMove:function(t){var e=t.points,i=t.performPoint;e[0].value=i.value,e[1].value=i.value},performEventMoveForDrawing:function(t){var e=t.currentStep,i=t.points,n=t.performPoint;2===e&&(i[0].value=n.value)}},ui={name:"horizontalSegment",totalStep:3,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e=t.coordinates,i=[];return 2===e.length&&i.push({coordinates:e}),[{type:"line",attrs:i}]},performEventPressedMove:function(t){var e=t.points,i=t.performPoint;e[0].value=i.value,e[1].value=i.value},performEventMoveForDrawing:function(t){var e=t.currentStep,i=t.points,n=t.performPoint;2===e&&(i[0].value=n.value)}},di={name:"horizontalStraightLine",totalStep:2,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e=t.coordinates,i=t.bounding;return[{type:"line",attrs:{coordinates:[{x:0,y:e[0].y},{x:i.width,y:e[0].y}]}}]}},hi=function(){function t(){this._children=[],this._callbacks=new Map}return t.prototype.registerEvent=function(t,e){return this._callbacks.set(t,e),this},t.prototype.onEvent=function(t,e,i){var n=this._callbacks.get(t);return!(!At(n)||!this.checkEventOn(e))&&n(e,i)},t.prototype.checkEventOn=function(t){var e,i;try{for(var n=G(this._children),a=n.next();!a.done;a=n.next()){var r=a.value;if(r.checkEventOn(t))return!0}}catch(o){e={error:o}}finally{try{a&&!a.done&&(i=n.return)&&i.call(n)}finally{if(e)throw e.error}}return!1},t.prototype.dispatchEvent=function(t,e,i){var n=this._children.length-1;if(n>-1)for(var a=n;a>-1;a--)if(this._children[a].dispatchEvent(t,e,i))return!0;return this.onEvent(t,e,i)},t.prototype.addChild=function(t){return this._children.push(t),this},t.prototype.clear=function(){this._children=[]},t}(),pi=2,vi=function(t){function e(e){var i=t.call(this)||this;return i.attrs=e.attrs,i.styles=e.styles,i}return L(e,t),e.prototype.checkEventOn=function(t){return this.checkEventOnImp(t,this.attrs,this.styles)},e.prototype.setAttrs=function(t){return this.attrs=t,this},e.prototype.setStyles=function(t){return this.styles=t,this},e.prototype.draw=function(t){this.drawImp(t,this.attrs,this.styles)},e.extend=function(t){var i=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return L(i,e),i.prototype.checkEventOnImp=function(e,i,n){return t.checkEventOn(e,i,n)},i.prototype.drawImp=function(e,i,n){t.draw(e,i,n)},i}(e);return i},e}(hi);function fi(t,e){var i=[];i=i.concat(e);for(var n=0;n<i.length;n++){var a=i[n].coordinates;if(a.length>1)for(var r=1;r<a.length;r++){var o=a[r-1],s=a[r];if(o.x===s.x){if(Math.abs(o.y-t.y)+Math.abs(s.y-t.y)-Math.abs(o.y-s.y)<pi+pi&&Math.abs(t.x-o.x)<pi)return!0}else{var l=yi(o,s),c=gi(l,t),u=Math.abs(c-t.y);if(Math.abs(o.x-t.x)+Math.abs(s.x-t.x)-Math.abs(o.x-s.x)<pi+pi&&u*u/(l[0]*l[0]+1)<pi*pi)return!0}}}return!1}function gi(t,e){return null!==t?e.x*t[0]+t[1]:e.y}function mi(t,e,i){var n=yi(t,e);return gi(n,i)}function yi(t,e){var i=t.x-e.x;if(0!==i){var n=(t.y-e.y)/i,a=t.y-n*t.x;return[n,a]}return null}function _i(t,e,i){var n=e.length,a=Et(i)?i>0&&i<1?i:0:i?.5:0;if(a>0&&n>2){for(var r=e[0].x,o=e[0].y,s=1;s<n-1;s++){var l=e[s-1],c=e[s],u=e[s+1],d=c.x-l.x,h=c.y-l.y,p=u.x-c.x,v=u.y-c.y,f=u.x-l.x,g=u.y-l.y,m=Math.sqrt(d*d+h*h),y=Math.sqrt(p*p+v*v),_=y/(y+m),b=c.x+f*a*_,x=c.y+g*a*_;b=Math.min(b,Math.max(u.x,c.x)),x=Math.min(x,Math.max(u.y,c.y)),b=Math.max(b,Math.min(u.x,c.x)),x=Math.max(x,Math.min(u.y,c.y)),f=b-c.x,g=x-c.y;var w=c.x-f*m/y,S=c.y-g*m/y;w=Math.min(w,Math.max(l.x,c.x)),S=Math.min(S,Math.max(l.y,c.y)),w=Math.max(w,Math.min(l.x,c.x)),S=Math.max(S,Math.min(l.y,c.y)),f=c.x-w,g=c.y-S,b=c.x+f*y/m,x=c.y+g*y/m,t.bezierCurveTo(r,o,w,S,c.x,c.y),r=b,o=x}var C=e[n-1];t.bezierCurveTo(r,o,C.x,C.y,C.x,C.y)}else for(s=1;s<n;s++)t.lineTo(e[s].x,e[s].y)}function bi(t,e,i){var n=[];n=n.concat(e);var a=i.style,r=void 0===a?N.Solid:a,o=i.smooth,s=void 0!==o&&o,l=i.size,c=void 0===l?1:l,u=i.color,d=void 0===u?"currentColor":u,h=i.dashedValue,p=void 0===h?[2,2]:h;t.lineWidth=c,t.strokeStyle=d,r===N.Dashed?t.setLineDash(p):t.setLineDash([]);var v=c%2===1?.5:0;n.forEach(function(e){var i=e.coordinates;i.length>1&&(2!==i.length||i[0].x!==i[1].x&&i[0].y!==i[1].y?(t.save(),c%2===1&&t.translate(.5,.5),t.beginPath(),t.moveTo(i[0].x,i[0].y),_i(t,i,s),t.stroke(),t.closePath(),t.restore()):(t.beginPath(),i[0].x===i[1].x?(t.moveTo(i[0].x+v,i[0].y),t.lineTo(i[1].x+v,i[1].y)):(t.moveTo(i[0].x,i[0].y+v),t.lineTo(i[1].x,i[1].y+v)),t.stroke(),t.closePath()))})}var xi={name:"line",checkEventOn:fi,draw:function(t,e,i){bi(t,e,i)}};function wi(t,e,i){var n=null!==i&&void 0!==i?i:0,a=[];if(t.length>1)if(t[0].x===t[1].x){var r=0,o=e.height;if(a.push({coordinates:[{x:t[0].x,y:r},{x:t[0].x,y:o}]}),t.length>2){a.push({coordinates:[{x:t[2].x,y:r},{x:t[2].x,y:o}]});for(var s=t[0].x-t[2].x,l=0;l<n;l++){var c=s*(l+1);a.push({coordinates:[{x:t[0].x+c,y:r},{x:t[0].x+c,y:o}]})}}}else{var u=0,d=e.width,h=yi(t[0],t[1]),p=h[0],v=h[1];if(a.push({coordinates:[{x:u,y:u*p+v},{x:d,y:d*p+v}]}),t.length>2){var f=t[2].y-p*t[2].x;a.push({coordinates:[{x:u,y:u*p+f},{x:d,y:d*p+f}]});for(s=v-f,l=0;l<n;l++){var g=v+s*(l+1);a.push({coordinates:[{x:u,y:u*p+g},{x:d,y:d*p+g}]})}}}return a}var Si={name:"parallelStraightLine",totalStep:4,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e=t.coordinates,i=t.bounding;return[{type:"line",attrs:wi(e,i)}]}},Ci={name:"priceChannelLine",totalStep:4,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e=t.coordinates,i=t.bounding;return[{type:"line",attrs:wi(e,i,1)}]}},ki={name:"priceLine",totalStep:2,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e,i=t.coordinates,n=t.bounding,a=t.precision,r=t.overlay,o=t.thousandsSeparator,s=t.decimalFoldThreshold,l=t.yAxis,c=r.points[0].value,u=void 0===c?0:c,d=null===(e=null===l||void 0===l?void 0:l.isInCandle())||void 0===e||e?a.price:a.excludePriceVolumeMax;return[{type:"line",attrs:{coordinates:[i[0],{x:n.width,y:i[0].y}]}},{type:"text",ignoreEvent:!0,attrs:{x:i[0].x,y:i[0].y,text:Vt(zt(u.toFixed(d),o),s),baseline:"bottom"}}]}};function Ii(t,e){if(t.length>1){var i=void 0;return i=t[0].x===t[1].x&&t[0].y!==t[1].y?t[0].y<t[1].y?{x:t[0].x,y:e.height}:{x:t[0].x,y:0}:t[0].x>t[1].x?{x:0,y:mi(t[0],t[1],{x:0,y:t[0].y})}:{x:e.width,y:mi(t[0],t[1],{x:e.width,y:t[0].y})},{coordinates:[t[0],i]}}return[]}var Ei={name:"rayLine",totalStep:3,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e=t.coordinates,i=t.bounding;return[{type:"line",attrs:Ii(e,i)}]}},Ai={name:"segment",totalStep:3,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e=t.coordinates;return 2===e.length?[{type:"line",attrs:{coordinates:e}}]:[]}},Pi={name:"straightLine",totalStep:3,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e=t.coordinates,i=t.bounding;return 2===e.length?e[0].x===e[1].x?[{type:"line",attrs:{coordinates:[{x:e[0].x,y:0},{x:e[0].x,y:i.height}]}}]:[{type:"line",attrs:{coordinates:[{x:0,y:mi(e[0],e[1],{x:0,y:e[0].y})},{x:i.width,y:mi(e[0],e[1],{x:i.width,y:e[0].y})}]}}]:[]}},Mi={name:"verticalRayLine",totalStep:3,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e=t.coordinates,i=t.bounding;if(2===e.length){var n={x:e[0].x,y:0};return e[0].y<e[1].y&&(n.y=i.height),[{type:"line",attrs:{coordinates:[e[0],n]}}]}return[]},performEventPressedMove:function(t){var e=t.points,i=t.performPoint;e[0].timestamp=i.timestamp,e[0].dataIndex=i.dataIndex,e[1].timestamp=i.timestamp,e[1].dataIndex=i.dataIndex},performEventMoveForDrawing:function(t){var e=t.currentStep,i=t.points,n=t.performPoint;2===e&&(i[0].timestamp=n.timestamp,i[0].dataIndex=n.dataIndex)}},Di={name:"verticalSegment",totalStep:3,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e=t.coordinates;return 2===e.length?[{type:"line",attrs:{coordinates:e}}]:[]},performEventPressedMove:function(t){var e=t.points,i=t.performPoint;e[0].timestamp=i.timestamp,e[0].dataIndex=i.dataIndex,e[1].timestamp=i.timestamp,e[1].dataIndex=i.dataIndex},performEventMoveForDrawing:function(t){var e=t.currentStep,i=t.points,n=t.performPoint;2===e&&(i[0].timestamp=n.timestamp,i[0].dataIndex=n.dataIndex)}},Ti={name:"verticalStraightLine",totalStep:2,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e=t.coordinates,i=t.bounding;return[{type:"line",attrs:{coordinates:[{x:e[0].x,y:0},{x:e[0].x,y:i.height}]}}]}},Bi={name:"simpleAnnotation",totalStep:2,styles:{line:{style:N.Dashed}},createPointFigures:function(t){var e,i,n=t.overlay,a=t.coordinates;At(n.extendData)&&(i=kt(n.extendData)?n.extendData(n):null!==(e=n.extendData)&&void 0!==e?e:"");var r=a[0].x,o=a[0].y-6,s=o-50,l=s-5;return[{type:"line",attrs:{coordinates:[{x:r,y:o},{x:r,y:s}]},ignoreEvent:!0},{type:"polygon",attrs:{coordinates:[{x:r,y:s},{x:r-4,y:l},{x:r+4,y:l}]},ignoreEvent:!0},{type:"text",attrs:{x:r,y:l,text:null!==i&&void 0!==i?i:"",align:"center",baseline:"bottom"},ignoreEvent:!0}]}},Fi={name:"simpleTag",totalStep:2,styles:{line:{style:N.Dashed}},createPointFigures:function(t){var e=t.bounding,i=t.coordinates;return{type:"line",attrs:{coordinates:[{x:0,y:i[0].y},{x:e.width,y:i[0].y}]},ignoreEvent:!0}},createYAxisFigures:function(t){var e,i,n,a,r,o=t.overlay,s=t.coordinates,l=t.bounding,c=t.yAxis,u=t.precision,d=null!==(e=null===c||void 0===c?void 0:c.isFromZero())&&void 0!==e&&e;return d?(n="left",a=0):(n="right",a=l.width),At(o.extendData)&&(r=kt(o.extendData)?o.extendData(o):null!==(i=o.extendData)&&void 0!==i?i:""),!At(r)&&Et(o.points[0].value)&&(r=Nt(o.points[0].value,u.price)),{type:"text",attrs:{x:a,y:s[0].y,text:null!==r&&void 0!==r?r:"",align:n,baseline:"middle"}}}},Ri={},Li=[li,ci,ui,di,Si,Ci,ki,Ei,Ai,Pi,Mi,Di,Ti,Bi,Fi];function Ni(t){Ri[t.name]=ie.extend(t)}function Oi(t){var e;return null!==(e=Ri[t])&&void 0!==e?e:null}Li.forEach(function(t){Ri[t.name]=ie.extend(t)});var zi=30,Vi=100,Wi={CANDLE:"candle_pane",INDICATOR:"indicator_pane_",X_AXIS:"x_axis_pane"},Hi=function(){function t(t){this._instances=new Map,this._progressInstanceInfo=null,this._pressedInstanceInfo={paneId:"",instance:null,figureType:0,figureKey:"",figureIndex:-1,attrsIndex:-1},this._hoverInstanceInfo={paneId:"",instance:null,figureType:0,figureKey:"",figureIndex:-1,attrsIndex:-1},this._clickInstanceInfo={paneId:"",instance:null,figureType:0,figureKey:"",figureIndex:-1,attrsIndex:-1},this._chartStore=t}return t.prototype._overrideInstance=function(t,e){var i=e.id,n=e.groupId,a=e.points,r=e.styles,o=e.lock,s=e.visible,l=e.zLevel,c=e.mode,u=e.modeSensitivity,d=e.extendData,h=e.onDrawStart,p=e.onDrawing,v=e.onDrawEnd,f=e.onClick,g=e.onDoubleClick,m=e.onRightClick,y=e.onPressedMoveStart,_=e.onPressedMoving,b=e.onPressedMoveEnd,x=e.onMouseEnter,w=e.onMouseLeave,S=e.onRemoved,C=e.onSelected,k=e.onDeselected,I=!1,E=!1;return Mt(i)&&t.setId(i),Mt(n)&&t.setGroupId(n),Ct(a)&&t.setPoints(a)&&(I=!0),At(r)&&t.setStyles(r)&&(I=!0),Pt(o)&&t.setLock(o),Pt(s)&&t.setVisible(s)&&(I=!0),Et(l)&&t.setZLevel(l)&&(I=!0,E=!0),At(c)&&t.setMode(c),Et(u)&&t.setModeSensitivity(u),void 0!==d&&t.setExtendData(d)&&(I=!0),void 0!==h&&t.setOnDrawStartCallback(h),void 0!==p&&t.setOnDrawingCallback(p),void 0!==v&&t.setOnDrawEndCallback(v),void 0!==f&&t.setOnClickCallback(f),void 0!==g&&t.setOnDoubleClickCallback(g),void 0!==m&&t.setOnRightClickCallback(m),void 0!==y&&t.setOnPressedMoveStartCallback(y),void 0!==_&&t.setOnPressedMovingCallback(_),void 0!==b&&t.setOnPressedMoveEndCallback(b),void 0!==x&&t.setOnMouseEnterCallback(x),void 0!==w&&t.setOnMouseLeaveCallback(w),void 0!==S&&t.setOnRemovedCallback(S),void 0!==C&&t.setOnSelectedCallback(C),void 0!==k&&t.setOnDeselectedCallback(k),[I,E]},t.prototype.getInstanceById=function(t){var e,i;try{for(var n=G(this._instances),a=n.next();!a.done;a=n.next()){var r=a.value,o=r[1],s=o.find(function(e){return e.id===t});if(At(s))return s}}catch(l){e={error:l}}finally{try{a&&!a.done&&(i=n.return)&&i.call(n)}finally{if(e)throw e.error}}return null!==this._progressInstanceInfo&&this._progressInstanceInfo.instance.id===t?this._progressInstanceInfo.instance:null},t.prototype._sort=function(t){var e;Mt(t)?null===(e=this._instances.get(t))||void 0===e||e.sort(function(t,e){return t.zLevel-e.zLevel}):this._instances.forEach(function(t){t.sort(function(t,e){return t.zLevel-e.zLevel})})},t.prototype.addInstances=function(t,e,i){var n=this,a=t.map(function(t){var a,r,o,s,l=null!==(a=t.id)&&void 0!==a?a:de(te);if(null===n.getInstanceById(l)){var c=Oi(t.name);if(null!==c){var u=new c;u.setPaneId(e);var d=null!==(r=t.groupId)&&void 0!==r?r:l;return t.id=l,t.groupId=d,n._overrideInstance(u,t),u.isDrawing()?n._progressInstanceInfo={paneId:e,instance:u,appointPaneFlag:i}:(n._instances.has(e)||n._instances.set(e,[]),null===(o=n._instances.get(e))||void 0===o||o.push(u)),u.isStart()&&(null===(s=u.onDrawStart)||void 0===s||s.call(u,{overlay:u})),l}}return null});if(a.some(function(t){return null!==t})){this._sort();var r=this._chartStore.getChart();r.updatePane(1,e),r.updatePane(1,Wi.X_AXIS)}return a},t.prototype.getProgressInstanceInfo=function(){return this._progressInstanceInfo},t.prototype.progressInstanceComplete=function(){var t;if(null!==this._progressInstanceInfo){var e=this._progressInstanceInfo,i=e.instance,n=e.paneId;i.isDrawing()||(this._instances.has(n)||this._instances.set(n,[]),null===(t=this._instances.get(n))||void 0===t||t.push(i),this._sort(n),this._progressInstanceInfo=null)}},t.prototype.updateProgressInstanceInfo=function(t,e){null!==this._progressInstanceInfo&&(Pt(e)&&e&&(this._progressInstanceInfo.appointPaneFlag=e),this._progressInstanceInfo.paneId=t,this._progressInstanceInfo.instance.setPaneId(t))},t.prototype.getInstances=function(t){var e;if(!Mt(t)){var i=[];return this._instances.forEach(function(t){i=i.concat(t)}),i}return null!==(e=this._instances.get(t))&&void 0!==e?e:[]},t.prototype.override=function(t){var e=this,i=t.id,n=t.groupId,a=t.name,r=!1,o=!1,s=function(i){var n=e._overrideInstance(i,t);n[0]&&(r=!0),n[1]&&(o=!0)};if(Mt(i)){var l=this.getInstanceById(i);null!==l&&s(l)}else{var c=Mt(a),u=Mt(n);if(this._instances.forEach(function(t){t.forEach(function(t){(c&&t.name===a||u&&t.groupId===n||!c&&!u)&&s(t)})}),null!==this._progressInstanceInfo){var d=this._progressInstanceInfo.instance;(c&&d.name===a||u&&d.groupId===n||!c&&!u)&&s(d)}}o&&this._sort(),r&&this._chartStore.getChart().updatePane(1)},t.prototype.removeInstance=function(t){var e,i,n,a=function(t,e){if(Mt(t.id)){if(e.id!==t.id)return!1}else if(Mt(t.groupId)){if(e.groupId!==t.groupId)return!1}else if(Mt(t.name)&&e.name!==t.name)return!1;return!0},r=[],o=At(t);if(null!==this._progressInstanceInfo){var s=this._progressInstanceInfo.instance;(!o||o&&a(t,s))&&(r.push(this._progressInstanceInfo.paneId),null===(n=s.onRemoved)||void 0===n||n.call(s,{overlay:s}),this._progressInstanceInfo=null)}if(o){var l=new Map,c=function(e){var i=e[1],n=i.filter(function(i){var n;return!a(t,i)||(r.includes(e[0])||r.push(e[0]),null===(n=i.onRemoved)||void 0===n||n.call(i,{overlay:i}),!1)});n.length>0&&l.set(e[0],n)};try{for(var u=G(this._instances),d=u.next();!d.done;d=u.next()){var h=d.value;c(h)}}catch(v){e={error:v}}finally{try{d&&!d.done&&(i=u.return)&&i.call(u)}finally{if(e)throw e.error}}this._instances=l}else this._instances.forEach(function(t,e){r.push(e),t.forEach(function(t){var e;null===(e=t.onRemoved)||void 0===e||e.call(t,{overlay:t})})}),this._instances.clear();if(r.length>0){var p=this._chartStore.getChart();r.forEach(function(t){p.updatePane(1,t)}),p.updatePane(1,Wi.X_AXIS)}},t.prototype.setPressedInstanceInfo=function(t){this._pressedInstanceInfo=t},t.prototype.getPressedInstanceInfo=function(){return this._pressedInstanceInfo},t.prototype.updatePointPosition=function(t,e){if(t>0){var i=this._chartStore.getDataList();this._instances.forEach(function(n){n.forEach(function(n){var a=n.points;a.forEach(function(n){if(!At(n.timestamp)&&At(n.dataIndex)){e===Kt.Forward&&(n.dataIndex=n.dataIndex+t);var a=i[n.dataIndex];n.timestamp=null===a||void 0===a?void 0:a.timestamp}})})})}},t.prototype.setHoverInstanceInfo=function(t,e){var i,n,a=this._hoverInstanceInfo,r=a.instance,o=a.figureType,s=a.figureKey,l=a.figureIndex;if(((null===r||void 0===r?void 0:r.id)!==(null===(i=t.instance)||void 0===i?void 0:i.id)||o!==t.figureType||l!==t.figureIndex)&&(this._hoverInstanceInfo=t,(null===r||void 0===r?void 0:r.id)!==(null===(n=t.instance)||void 0===n?void 0:n.id))){var c=!1,u=!1;null!==r&&(u=!0,kt(r.onMouseLeave)&&(r.onMouseLeave(X({overlay:r,figureKey:s,figureIndex:l},e)),c=!0)),null!==t.instance&&(u=!0,kt(t.instance.onMouseEnter)&&(t.instance.onMouseEnter(X({overlay:t.instance,figureKey:t.figureKey,figureIndex:t.figureIndex},e)),c=!0)),u&&this._sort(),c||this._chartStore.getChart().updatePane(1)}},t.prototype.getHoverInstanceInfo=function(){return this._hoverInstanceInfo},t.prototype.setClickInstanceInfo=function(t,e){var i,n,a,r,o,s,l,c,u,d=this._clickInstanceInfo,h=d.paneId,p=d.instance,v=d.figureType,f=d.figureKey,g=d.figureIndex;if(null!==(n=null===(i=t.instance)||void 0===i?void 0:i.isDrawing())&&void 0!==n&&n||null===(r=null===(a=t.instance)||void 0===a?void 0:a.onClick)||void 0===r||r.call(a,X({overlay:t.instance,figureKey:t.figureKey,figureIndex:t.figureIndex},e)),((null===p||void 0===p?void 0:p.id)!==(null===(o=t.instance)||void 0===o?void 0:o.id)||v!==t.figureType||g!==t.figureIndex)&&(this._clickInstanceInfo=t,(null===p||void 0===p?void 0:p.id)!==(null===(s=t.instance)||void 0===s?void 0:s.id))){null===(l=null===p||void 0===p?void 0:p.onDeselected)||void 0===l||l.call(p,X({overlay:p,figureKey:f,figureIndex:g},e)),null===(u=null===(c=t.instance)||void 0===c?void 0:c.onSelected)||void 0===u||u.call(c,X({overlay:t.instance,figureKey:t.figureKey,figureIndex:t.figureIndex},e));var m=this._chartStore.getChart();m.updatePane(1,t.paneId),h!==t.paneId&&m.updatePane(1,h),m.updatePane(1,Wi.X_AXIS)}},t.prototype.getClickInstanceInfo=function(){return this._clickInstanceInfo},t.prototype.isEmpty=function(){return 0===this._instances.size&&null===this._progressInstanceInfo},t.prototype.isDrawing=function(){var t,e;return null!==this._progressInstanceInfo&&null!==(e=null===(t=this._progressInstanceInfo)||void 0===t?void 0:t.instance.isDrawing())&&void 0!==e&&e},t}(),$i=function(){function t(){this._actions=new Map}return t.prototype.execute=function(t,e){var i;null===(i=this._actions.get(t))||void 0===i||i.execute(e)},t.prototype.subscribe=function(t,e){var i;this._actions.has(t)||this._actions.set(t,new Xt),null===(i=this._actions.get(t))||void 0===i||i.subscribe(e)},t.prototype.unsubscribe=function(t,e){var i=this._actions.get(t);At(i)&&(i.unsubscribe(e),i.isEmpty()&&this._actions.delete(t))},t.prototype.has=function(t){var e=this._actions.get(t);return At(e)&&!e.isEmpty()},t}(),Ki={grid:{horizontal:{color:"#EDEDED"},vertical:{color:"#EDEDED"}},candle:{priceMark:{high:{color:"#76808F"},low:{color:"#76808F"}},tooltip:{rect:{color:"#FEFEFE",borderColor:"#F2F3F5"},text:{color:"#76808F"}}},indicator:{tooltip:{text:{color:"#76808F"}}},xAxis:{axisLine:{color:"#DDDDDD"},tickText:{color:"#76808F"},tickLine:{color:"#DDDDDD"}},yAxis:{axisLine:{color:"#DDDDDD"},tickText:{color:"#76808F"},tickLine:{color:"#DDDDDD"}},separator:{color:"#DDDDDD"},crosshair:{horizontal:{line:{color:"#76808F"},text:{borderColor:"#686D76",backgroundColor:"#686D76"}},vertical:{line:{color:"#76808F"},text:{borderColor:"#686D76",backgroundColor:"#686D76"}}}},Yi={grid:{horizontal:{color:"#292929"},vertical:{color:"#292929"}},candle:{priceMark:{high:{color:"#929AA5"},low:{color:"#929AA5"}},tooltip:{rect:{color:"rgba(10, 10, 10, .6)",borderColor:"rgba(10, 10, 10, .6)"},text:{color:"#929AA5"}}},indicator:{tooltip:{text:{color:"#929AA5"}}},xAxis:{axisLine:{color:"#333333"},tickText:{color:"#929AA5"},tickLine:{color:"#333333"}},yAxis:{axisLine:{color:"#333333"},tickText:{color:"#929AA5"},tickLine:{color:"#333333"}},separator:{color:"#333333"},crosshair:{horizontal:{line:{color:"#929AA5"},text:{borderColor:"#373a40",backgroundColor:"#373a40"}},vertical:{line:{color:"#929AA5"},text:{borderColor:"#373a40",backgroundColor:"#373a40"}}}},Xi={light:Ki,dark:Yi};function ji(t){var e;return null!==(e=Xi[t])&&void 0!==e?e:null}var Ui=function(){function t(t,e){this._styles=gt(),this._customApi=ne(),this._locale=ae,this._precision={price:2,volume:0},this._thousandsSeparator=",",this._decimalFoldThreshold=3,this._dataList=[],this._loadMoreCallback=null,this._loadDataCallback=null,this._loading=!0,this._forwardMore=!0,this._backwardMore=!0,this._timeScaleStore=new Ie(this),this._indicatorStore=new oi(this),this._overlayStore=new Hi(this),this._tooltipStore=new si(this),this._actionStore=new $i,this._visibleDataList=[],this._chart=t,this.setOptions(e)}return t.prototype.adjustVisibleDataList=function(){this._visibleDataList=[];for(var t=this._timeScaleStore.getVisibleRange(),e=t.realFrom,i=t.realTo,n=e;n<i;n++){var a=this._dataList[n],r=this._timeScaleStore.dataIndexToCoordinate(n);this._visibleDataList.push({dataIndex:n,x:r,data:a})}},t.prototype.setOptions=function(t){var e,i,n,a;if(At(t)){var r=t.locale,o=t.timezone,s=t.styles,l=t.customApi,c=t.thousandsSeparator,u=t.decimalFoldThreshold;if(Mt(r)&&(this._locale=r),Mt(o)&&this._timeScaleStore.setTimezone(o),At(s)){var d=null;d=Mt(s)?ji(s):s,wt(this._styles,d),Ct(null===(i=null===(e=null===d||void 0===d?void 0:d.candle)||void 0===e?void 0:e.tooltip)||void 0===i?void 0:i.custom)&&(this._styles.candle.tooltip.custom=null===(a=null===(n=null===d||void 0===d?void 0:d.candle)||void 0===n?void 0:n.tooltip)||void 0===a?void 0:a.custom)}At(l)&&wt(this._customApi,l),Mt(c)&&(this._thousandsSeparator=c),Et(u)&&u>0&&(this._decimalFoldThreshold=u)}return this},t.prototype.getStyles=function(){return this._styles},t.prototype.getLocale=function(){return this._locale},t.prototype.getCustomApi=function(){return this._customApi},t.prototype.getThousandsSeparator=function(){return this._thousandsSeparator},t.prototype.getDecimalFoldThreshold=function(){return this._decimalFoldThreshold},t.prototype.getPrecision=function(){return this._precision},t.prototype.setPrecision=function(t){return this._precision=t,this._indicatorStore.synchronizeSeriesPrecision(),this},t.prototype.getDataList=function(){return this._dataList},t.prototype.getVisibleFirstData=function(){var t,e=this._timeScaleStore.getVisibleRange().from;return null!==(t=this._dataList[e])&&void 0!==t?t:null},t.prototype.getVisibleDataList=function(){return this._visibleDataList},t.prototype.addData=function(t,e,i){return j(this,void 0,void 0,function(){var n,a,r,o,s,l,c;return U(this,function(u){switch(u.label){case 0:if(n=!1,a=!1,r=0,Ct(t)){switch(r=t.length,e){case Kt.Init:this.clear(),this._dataList=t,this._forwardMore=null===i||void 0===i||i,this._timeScaleStore.resetOffsetRightDistance(),a=!0;break;case Kt.Backward:this._dataList=this._dataList.concat(t),this._backwardMore=null!==i&&void 0!==i&&i,a=r>0;break;case Kt.Forward:this._dataList=t.concat(this._dataList),this._forwardMore=null!==i&&void 0!==i&&i,a=r>0}this._loading=!1,n=!0}else o=this._dataList.length,s=t.timestamp,l=Rt(this._dataList[o-1],"timestamp",0),s>l?(this._dataList.push(t),c=this._timeScaleStore.getLastBarRightSideDiffBarCount(),c<0&&this._timeScaleStore.setLastBarRightSideDiffBarCount(--c),r=1,n=!0,a=!0):s===l&&(this._dataList[o-1]=t,n=!0,a=!0);if(!n)return[3,5];u.label=1;case 1:return u.trys.push([1,4,,5]),this._overlayStore.updatePointPosition(r,e),a?(this._timeScaleStore.adjustVisibleRange(),this._tooltipStore.recalculateCrosshair(!0),[4,this._indicatorStore.calcInstance()]):[3,3];case 2:u.sent(),this._chart.adjustPaneViewport(!1,!0,!0,!0),u.label=3;case 3:return this._actionStore.execute(Tt.OnDataReady),[3,5];case 4:return u.sent(),[3,5];case 5:return[2]}})})},t.prototype.setLoadMoreCallback=function(t){this._loadMoreCallback=t},t.prototype.executeLoadMoreCallback=function(t){this._forwardMore&&!this._loading&&At(this._loadMoreCallback)&&(this._loading=!0,this._loadMoreCallback(t))},t.prototype.setLoadDataCallback=function(t){this._loadDataCallback=t},t.prototype.executeLoadDataCallback=function(t){var e=this;if(!this._loading&&At(this._loadDataCallback)&&(this._forwardMore&&t.type===Kt.Forward||this._backwardMore&&t.type===Kt.Backward)){var i=function(i,n){e.addData(i,t.type,n).then(function(){}).catch(function(){})};this._loading=!0,this._loadDataCallback(X(X({},t),{callback:i}))}},t.prototype.clear=function(){this._forwardMore=!0,this._backwardMore=!0,this._loading=!0,this._dataList=[],this._visibleDataList=[],this._timeScaleStore.clear(),this._tooltipStore.clear()},t.prototype.getTimeScaleStore=function(){return this._timeScaleStore},t.prototype.getIndicatorStore=function(){return this._indicatorStore},t.prototype.getOverlayStore=function(){return this._overlayStore},t.prototype.getTooltipStore=function(){return this._tooltipStore},t.prototype.getActionStore=function(){return this._actionStore},t.prototype.getChart=function(){return this._chart},t}(),Gi={MAIN:"main",X_AXIS:"xAxis",Y_AXIS:"yAxis",SEPARATOR:"separator"},Zi=7;function qi(){return j(this,void 0,void 0,function(){return U(this,function(t){switch(t.label){case 0:return[4,new Promise(function(t){var e=new ResizeObserver(function(i){t(i.every(function(t){return"devicePixelContentBoxSize"in t})),e.disconnect()});e.observe(document.body,{box:"device-pixel-content-box"})}).catch(function(){return!1})];case 1:return[2,t.sent()]}})})}var Ji=function(){function t(t,e){var i=this;this._supportedDevicePixelContentBox=!1,this._width=0,this._height=0,this._pixelWidth=0,this._pixelHeight=0,this._nextPixelWidth=0,this._nextPixelHeight=0,this._requestAnimationId=re,this._mediaQueryListener=function(){var t=Wt(i._element);i._nextPixelWidth=Math.round(i._element.clientWidth*t),i._nextPixelHeight=Math.round(i._element.clientHeight*t),i._resetPixelRatio()},this._listener=e,this._element=he("canvas",t),this._ctx=this._element.getContext("2d",{willReadFrequently:!0}),qi().then(function(t){i._supportedDevicePixelContentBox=t,t?(i._resizeObserver=new ResizeObserver(function(t){var e,n=t.find(function(t){return t.target===i._element}),a=null===(e=null===n||void 0===n?void 0:n.devicePixelContentBoxSize)||void 0===e?void 0:e[0];At(a)&&(i._nextPixelWidth=a.inlineSize,i._nextPixelHeight=a.blockSize,i._pixelWidth===i._nextPixelWidth&&i._pixelHeight===i._nextPixelHeight||i._resetPixelRatio())}),i._resizeObserver.observe(i._element,{box:"device-pixel-content-box"})):(i._mediaQueryList=window.matchMedia("(resolution: ".concat(Wt(i._element),"dppx)")),i._mediaQueryList.addListener(i._mediaQueryListener))}).catch(function(t){return!1})}return t.prototype._resetPixelRatio=function(){var t=this;this._executeListener(function(){var e=t._element.clientWidth,i=t._element.clientHeight,n=t._nextPixelWidth/e,a=t._nextPixelHeight/i;t._width=e,t._height=i,t._pixelWidth=t._nextPixelWidth,t._pixelHeight=t._nextPixelHeight,t._element.width=t._nextPixelWidth,t._element.height=t._nextPixelHeight,t._ctx.scale(n,a)})},t.prototype._executeListener=function(t){var e=this;this._requestAnimationId===re&&(this._requestAnimationId=oe(function(){e._ctx.clearRect(0,0,e._width,e._height),null===t||void 0===t||t(),e._listener(),e._requestAnimationId=re}))},t.prototype.update=function(t,e){if(this._width!==t||this._height!==e){if(this._element.style.width="".concat(t,"px"),this._element.style.height="".concat(e,"px"),!this._supportedDevicePixelContentBox){var i=Wt(this._element);this._nextPixelWidth=Math.round(t*i),this._nextPixelHeight=Math.round(e*i),this._resetPixelRatio()}}else this._executeListener()},t.prototype.getElement=function(){return this._element},t.prototype.getContext=function(){return this._ctx},t.prototype.destroy=function(){At(this._resizeObserver)&&this._resizeObserver.unobserve(this._element),At(this._mediaQueryList)&&this._mediaQueryList.removeListener(this._mediaQueryListener)},t}();function Qi(t){var e={width:0,height:0,left:0,right:0,top:0,bottom:0};return At(t)&&wt(e,t),e}var tn=function(t){function e(e,i){var n=t.call(this)||this;return n._bounding=Qi(),n._pane=i,n._rootContainer=e,n._container=n.createContainer(),e.appendChild(n._container),n}return L(e,t),e.prototype.setBounding=function(t){return wt(this._bounding,t),this},e.prototype.getContainer=function(){return this._container},e.prototype.getBounding=function(){return this._bounding},e.prototype.getPane=function(){return this._pane},e.prototype.update=function(t){this.updateImp(this._container,this._bounding,null!==t&&void 0!==t?t:3)},e.prototype.destroy=function(){this._rootContainer.removeChild(this._container)},e}(hi),en=function(t){function e(e,i){var n=t.call(this,e,i)||this;n._mainCanvas=new Ji({position:"absolute",top:"0",left:"0",zIndex:"2",boxSizing:"border-box"},function(){n.updateMain(n._mainCanvas.getContext())}),n._overlayCanvas=new Ji({position:"absolute",top:"0",left:"0",zIndex:"2",boxSizing:"border-box"},function(){n.updateOverlay(n._overlayCanvas.getContext())});var a=n.getContainer();return a.appendChild(n._mainCanvas.getElement()),a.appendChild(n._overlayCanvas.getElement()),n}return L(e,t),e.prototype.createContainer=function(){return he("div",{margin:"0",padding:"0",position:"absolute",top:"0",overflow:"hidden",boxSizing:"border-box",zIndex:"1"})},e.prototype.updateImp=function(t,e,i){var n=e.width,a=e.height,r=e.left;t.style.left="".concat(r,"px");var o=i,s=t.clientWidth,l=t.clientHeight;switch(n===s&&a===l||(t.style.width="".concat(n,"px"),t.style.height="".concat(a,"px"),o=3),o){case 0:this._mainCanvas.update(n,a);break;case 1:this._overlayCanvas.update(n,a);break;case 3:case 4:this._mainCanvas.update(n,a),this._overlayCanvas.update(n,a);break}},e.prototype.destroy=function(){this._mainCanvas.destroy(),this._overlayCanvas.destroy()},e.prototype.getImage=function(t){var e=this.getBounding(),i=e.width,n=e.height,a=he("canvas",{width:"".concat(i,"px"),height:"".concat(n,"px"),boxSizing:"border-box"}),r=a.getContext("2d"),o=Wt(a);return a.width=i*o,a.height=n*o,r.scale(o,o),r.drawImage(this._mainCanvas.getElement(),0,0,i,n),t&&r.drawImage(this._overlayCanvas.getElement(),0,0,i,n),a},e}(tn);function nn(t){return"transparent"===t||"none"===t||/^[rR][gG][Bb][Aa]\(([\s]*(2[0-4][0-9]|25[0-5]|[01]?[0-9][0-9]?)[\s]*,){3}[\s]*0[\s]*\)$/.test(t)||/^[hH][Ss][Ll][Aa]\(([\s]*(3603[0-5][0-9]|[012]?[0-9][0-9]?)[\s]*,)([\s]*((100|[0-9][0-9]?)%|0)[\s]*,){2}([\s]*0[\s]*)\)$/.test(t)}function an(t,e){var i=[];i=i.concat(e);for(var n=0;n<i.length;n++){var a=i[n],r=a.x,o=a.y,s=a.r,l=t.x-r,c=t.y-o;if(!(l*l+c*c>s*s))return!0}return!1}function rn(t,e,i){var n=[];n=n.concat(e);var a=i.style,r=void 0===a?O.Fill:a,o=i.color,s=void 0===o?"currentColor":o,l=i.borderSize,c=void 0===l?1:l,u=i.borderColor,d=void 0===u?"currentColor":u,h=i.borderStyle,p=void 0===h?N.Solid:h,v=i.borderDashedValue,f=void 0===v?[2,2]:v,g=(r===O.Fill||i.style===O.StrokeFill)&&(!Mt(s)||!nn(s));g&&(t.fillStyle=s,n.forEach(function(e){var i=e.x,n=e.y,a=e.r;t.beginPath(),t.arc(i,n,a,0,2*Math.PI),t.closePath(),t.fill()})),(r===O.Stroke||i.style===O.StrokeFill)&&c>0&&!nn(d)&&(t.strokeStyle=d,t.lineWidth=c,p===N.Dashed?t.setLineDash(f):t.setLineDash([]),n.forEach(function(e){var i=e.x,n=e.y,a=e.r;(!g||a>c)&&(t.beginPath(),t.arc(i,n,a,0,2*Math.PI),t.closePath(),t.stroke())}))}var on={name:"circle",checkEventOn:an,draw:function(t,e,i){rn(t,e,i)}};function sn(t,e){var i=[];i=i.concat(e);for(var n=0;n<i.length;n++){for(var a=!1,r=i[n].coordinates,o=0,s=r.length-1;o<r.length;s=o++)r[o].y>t.y!==r[s].y>t.y&&t.x<(r[s].x-r[o].x)*(t.y-r[o].y)/(r[s].y-r[o].y)+r[o].x&&(a=!a);if(a)return!0}return!1}function ln(t,e,i){var n=[];n=n.concat(e);var a=i.style,r=void 0===a?O.Fill:a,o=i.color,s=void 0===o?"currentColor":o,l=i.borderSize,c=void 0===l?1:l,u=i.borderColor,d=void 0===u?"currentColor":u,h=i.borderStyle,p=void 0===h?N.Solid:h,v=i.borderDashedValue,f=void 0===v?[2,2]:v;r!==O.Fill&&i.style!==O.StrokeFill||Mt(s)&&nn(s)||(t.fillStyle=s,n.forEach(function(e){var i=e.coordinates;t.beginPath(),t.moveTo(i[0].x,i[0].y);for(var n=1;n<i.length;n++)t.lineTo(i[n].x,i[n].y);t.closePath(),t.fill()})),(r===O.Stroke||i.style===O.StrokeFill)&&c>0&&!nn(d)&&(t.strokeStyle=d,t.lineWidth=c,p===N.Dashed?t.setLineDash(f):t.setLineDash([]),n.forEach(function(e){var i=e.coordinates;t.beginPath(),t.moveTo(i[0].x,i[0].y);for(var n=1;n<i.length;n++)t.lineTo(i[n].x,i[n].y);t.closePath(),t.stroke()}))}var cn={name:"polygon",checkEventOn:sn,draw:function(t,e,i){ln(t,e,i)}};function un(t,e){var i=[];i=i.concat(e);for(var n=0;n<i.length;n++){var a=i[n],r=a.x,o=a.width;o<2*pi&&(r-=pi,o=2*pi);var s=a.y,l=a.height;if(l<2*pi&&(s-=pi,l=2*pi),t.x>=r&&t.x<=r+o&&t.y>=s&&t.y<=s+l)return!0}return!1}function dn(t,e,i){var n,a=[];a=a.concat(e);var r=i.style,o=void 0===r?O.Fill:r,s=i.color,l=void 0===s?"transparent":s,c=i.borderSize,u=void 0===c?1:c,d=i.borderColor,h=void 0===d?"transparent":d,p=i.borderStyle,v=void 0===p?N.Solid:p,f=i.borderRadius,g=void 0===f?0:f,m=i.borderDashedValue,y=void 0===m?[2,2]:m,_=null!==(n=t.roundRect)&&void 0!==n?n:t.rect,b=(o===O.Fill||i.style===O.StrokeFill)&&(!Mt(l)||!nn(l));if(b&&(t.fillStyle=l,a.forEach(function(e){var i=e.x,n=e.y,a=e.width,r=e.height;t.beginPath(),_.call(t,i,n,a,r,g),t.closePath(),t.fill()})),(o===O.Stroke||i.style===O.StrokeFill)&&u>0&&!nn(h)){t.strokeStyle=h,t.fillStyle=h,t.lineWidth=u,v===N.Dashed?t.setLineDash(y):t.setLineDash([]);var x=u%2===1?.5:0,w=Math.round(2*x);a.forEach(function(e){var i=e.x,n=e.y,a=e.width,r=e.height;a>2*u&&r>2*u?(t.beginPath(),_.call(t,i+x,n+x,a-w,r-w,g),t.closePath(),t.stroke()):b||t.fillRect(i,n,a,r)})}}var hn={name:"rect",checkEventOn:un,draw:function(t,e,i){dn(t,e,i)}};function pn(t,e){var i,n,a=e.size,r=void 0===a?12:a,o=e.paddingLeft,s=void 0===o?0:o,l=e.paddingTop,c=void 0===l?0:l,u=e.paddingRight,d=void 0===u?0:u,h=e.paddingBottom,p=void 0===h?0:h,v=e.weight,f=void 0===v?"normal":v,g=e.family,m=t.x,y=t.y,_=t.text,b=t.align,x=void 0===b?"left":b,w=t.baseline,S=void 0===w?"top":w,C=t.width,k=t.height,I=null!==C&&void 0!==C?C:s+$t(_,r,f,g)+d,E=null!==k&&void 0!==k?k:c+r+p;switch(x){case"left":case"start":i=m;break;case"right":case"end":i=m-I;break;default:i=m-I/2;break}switch(S){case"top":case"hanging":n=y;break;case"bottom":case"ideographic":case"alphabetic":n=y-E;break;default:n=y-E/2;break}return{x:i,y:n,width:I,height:E}}function vn(t,e,i){var n=[];n=n.concat(e);for(var a=0;a<n.length;a++){var r=pn(n[a],i),o=r.x,s=r.y,l=r.width,c=r.height;if(t.x>=o&&t.x<=o+l&&t.y>=s&&t.y<=s+c)return!0}return!1}function fn(t,e,i){var n=[];n=n.concat(e);var a=i.color,r=void 0===a?"currentColor":a,o=i.size,s=void 0===o?12:o,l=i.family,c=i.weight,u=i.paddingLeft,d=void 0===u?0:u,h=i.paddingTop,p=void 0===h?0:h,v=i.paddingRight,f=void 0===v?0:v,g=n.map(function(t){return pn(t,i)});dn(t,g,X(X({},i),{color:i.backgroundColor})),t.textAlign="left",t.textBaseline="top",t.font=Ht(s,c,l),t.fillStyle=r,n.forEach(function(e,i){var n=g[i];t.fillText(e.text,n.x+d,n.y+p,n.width-d-f)})}var gn={name:"text",checkEventOn:vn,draw:function(t,e,i){fn(t,e,i)}},mn=gn;function yn(t,e){var i=t.x-e.x,n=t.y-e.y;return Math.sqrt(i*i+n*n)}function _n(t,e){var i=[];i=i.concat(e);for(var n=0;n<i.length;n++){var a=i[n];if(Math.abs(yn(t,a)-a.r)<pi){var r=a.r,o=a.startAngle,s=a.endAngle,l=r*Math.cos(o)+a.x,c=r*Math.sin(o)+a.y,u=r*Math.cos(s)+a.x,d=r*Math.sin(s)+a.y;if(t.x<=Math.max(l,u)+pi&&t.x>=Math.min(l,u)-pi&&t.y<=Math.max(c,d)+pi&&t.y>=Math.min(c,d)-pi)return!0}}return!1}function bn(t,e,i){var n=[];n=n.concat(e);var a=i.style,r=void 0===a?N.Solid:a,o=i.size,s=void 0===o?1:o,l=i.color,c=void 0===l?"currentColor":l,u=i.dashedValue,d=void 0===u?[2,2]:u;t.lineWidth=s,t.strokeStyle=c,r===N.Dashed?t.setLineDash(d):t.setLineDash([]),n.forEach(function(e){var i=e.x,n=e.y,a=e.r,r=e.startAngle,o=e.endAngle;t.beginPath(),t.arc(i,n,a,r,o),t.stroke(),t.closePath()})}var xn={name:"arc",checkEventOn:_n,draw:function(t,e,i){bn(t,e,i)}},wn={},Sn=[on,xi,cn,hn,gn,mn,xn];function Cn(t){var e;return null!==(e=wn[t])&&void 0!==e?e:null}Sn.forEach(function(t){wn[t.name]=vi.extend(t)});var kn=function(t){function e(e){var i=t.call(this)||this;return i._widget=e,i}return L(e,t),e.prototype.getWidget=function(){return this._widget},e.prototype.createFigure=function(t,e){var i=Cn(t.name);if(null!==i){var n=new i(t);if(At(e)){for(var a in e)e.hasOwnProperty(a)&&n.registerEvent(a,e[a]);this.addChild(n)}return n}return null},e.prototype.draw=function(t){this.clear(),this.drawImp(t)},e}(hi),In=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return L(e,t),e.prototype.drawImp=function(t){var e,i,n=this.getWidget(),a=this.getWidget().getPane(),r=a.getChart(),o=n.getBounding(),s=r.getStyles().grid,l=s.show;if(l){t.save(),t.globalCompositeOperation="destination-over";var c=s.horizontal,u=c.show;if(u){var d=a.getAxisComponent(),h=d.getTicks().map(function(t){return{coordinates:[{x:0,y:t.coord},{x:o.width,y:t.coord}]}});null===(e=this.createFigure({name:"line",attrs:h,styles:c}))||void 0===e||e.draw(t)}var p=s.vertical,v=p.show;if(v){var f=r.getXAxisPane().getAxisComponent();h=f.getTicks().map(function(t){return{coordinates:[{x:t.coord,y:0},{x:t.coord,y:o.height}]}});null===(i=this.createFigure({name:"line",attrs:h,styles:p}))||void 0===i||i.draw(t)}t.restore()}},e}(kn),En=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return L(e,t),e.prototype.eachChildren=function(t){var e=this.getWidget().getPane(),i=e.getChart().getChartStore(),n=i.getVisibleDataList(),a=i.getTimeScaleStore().getBarSpace();n.forEach(function(e,i){t(e,a,i)})},e}(kn),An=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._boundCandleBarClickEvent=function(t){return function(){return e.getWidget().getPane().getChart().getChartStore().getActionStore().execute(Tt.OnCandleBarClick,t),!1}},e}return L(e,t),e.prototype.drawImp=function(t){var e=this,i=this.getWidget().getPane(),n=i.getId()===Wi.CANDLE,a=i.getChart().getChartStore(),r=this.getCandleBarOptions(a);if(null!==r){var o=0,s=0;if(r.type===$.Ohlc){var l=a.getTimeScaleStore().getBarSpace().gapBar;o=Math.min(Math.max(Math.round(.2*l),1),8),o>2&&o%2===1&&o--,s=Math.floor(s/2)}var c=i.getAxisComponent();this.eachChildren(function(i,a){var l=i.data,u=i.x;if(At(l)){var d=l.open,h=l.high,p=l.low,v=l.close,f=r.type,g=r.styles,m=[];v>d?(m[0]=g.upColor,m[1]=g.upBorderColor,m[2]=g.upWickColor):v<d?(m[0]=g.downColor,m[1]=g.downBorderColor,m[2]=g.downWickColor):(m[0]=g.noChangeColor,m[1]=g.noChangeBorderColor,m[2]=g.noChangeWickColor);var y=c.convertToPixel(d),_=c.convertToPixel(v),b=[y,_,c.convertToPixel(h),c.convertToPixel(p)];b.sort(function(t,e){return t-e});var x=[];switch(f){case $.CandleSolid:x=e._createSolidBar(u,b,a,m);break;case $.CandleStroke:x=e._createStrokeBar(u,b,a,m);break;case $.CandleUpStroke:x=v>d?e._createStrokeBar(u,b,a,m):e._createSolidBar(u,b,a,m);break;case $.CandleDownStroke:x=d>v?e._createStrokeBar(u,b,a,m):e._createSolidBar(u,b,a,m);break;case $.Ohlc:x=[{name:"rect",attrs:[{x:u-s,y:b[0],width:o,height:b[3]-b[0]},{x:u-a.halfGapBar,y:y+o>b[3]?b[3]-o:y,width:a.halfGapBar,height:o},{x:u+s,y:_+o>b[3]?b[3]-o:_,width:a.halfGapBar-s,height:o}],styles:{color:m[0]}}];break}x.forEach(function(a){var r,o;n&&(o={mouseClickEvent:e._boundCandleBarClickEvent(i)}),null===(r=e.createFigure(a,o))||void 0===r||r.draw(t)})}})}},e.prototype.getCandleBarOptions=function(t){var e=t.getStyles().candle;return{type:e.type,styles:e.bar}},e.prototype._createSolidBar=function(t,e,i,n){return[{name:"rect",attrs:{x:t,y:e[0],width:1,height:e[3]-e[0]},styles:{color:n[2]}},{name:"rect",attrs:{x:t-i.halfGapBar,y:e[1],width:i.gapBar,height:Math.max(1,e[2]-e[1])},styles:{style:O.StrokeFill,color:n[0],borderColor:n[1]}}]},e.prototype._createStrokeBar=function(t,e,i,n){return[{name:"rect",attrs:[{x:t,y:e[0],width:1,height:e[1]-e[0]},{x:t,y:e[2],width:1,height:e[3]-e[2]}],styles:{color:n[2]}},{name:"rect",attrs:{x:t-i.halfGapBar,y:e[1],width:i.gapBar,height:Math.max(1,e[2]-e[1])},styles:{style:O.Stroke,borderColor:n[1]}}]},e}(En),Pn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return L(e,t),e.prototype.getCandleBarOptions=function(t){var e,i,n=this.getWidget().getPane(),a=n.getAxisComponent();if(!a.isInCandle()){var r=t.getIndicatorStore().getInstances(n.getId());try{for(var o=G(r),s=o.next();!s.done;s=o.next()){var l=s.value;if(l.shouldOhlc&&l.visible){var c=l.styles,u=t.getStyles().indicator,d=Rt(c,"ohlc.upColor",u.ohlc.upColor),h=Rt(c,"ohlc.downColor",u.ohlc.downColor),p=Rt(c,"ohlc.noChangeColor",u.ohlc.noChangeColor);return{type:$.Ohlc,styles:{upColor:d,downColor:h,noChangeColor:p,upBorderColor:d,downBorderColor:h,noChangeBorderColor:p,upWickColor:d,downWickColor:h,noChangeWickColor:p}}}}}catch(v){e={error:v}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(e)throw e.error}}}return null},e.prototype.drawImp=function(e){var i=this;t.prototype.drawImp.call(this,e);var n=this.getWidget(),a=n.getPane(),r=a.getChart(),o=n.getBounding(),s=r.getXAxisPane().getAxisComponent(),l=a.getAxisComponent(),c=r.getChartStore(),u=c.getDataList(),d=c.getTimeScaleStore(),h=d.getVisibleRange(),p=c.getIndicatorStore().getInstances(a.getId()),v=c.getStyles().indicator;e.save(),p.forEach(function(t){var n;if(t.visible){t.zLevel<0?e.globalCompositeOperation="destination-over":e.globalCompositeOperation="source-over";var a=!1;if(null!==t.draw&&(e.save(),a=null!==(n=t.draw({ctx:e,kLineDataList:u,indicator:t,visibleRange:h,bounding:o,barSpace:d.getBarSpace(),defaultStyles:v,xAxis:s,yAxis:l}))&&void 0!==n&&n,e.restore()),!a){var r=t.result,c=[];i.eachChildren(function(n,a){var d,h,p,f=a.halfGapBar,g=n.dataIndex,m=n.x,y=s.convertToPixel(g-1),_=s.convertToPixel(g+1),b=null!==(d=r[g-1])&&void 0!==d?d:null,x=null!==(h=r[g])&&void 0!==h?h:null,w=null!==(p=r[g+1])&&void 0!==p?p:null,S={x:y},C={x:m},k={x:_};t.figures.forEach(function(t){var e=t.key,i=null===b||void 0===b?void 0:b[e];Et(i)&&(S[e]=l.convertToPixel(i));var n=null===x||void 0===x?void 0:x[e];Et(n)&&(C[e]=l.convertToPixel(n));var a=null===w||void 0===w?void 0:w[e];Et(a)&&(k[e]=l.convertToPixel(a))}),jt(u,t,g,v,function(t,n,r){var u,d,h;if(At(null===x||void 0===x?void 0:x[t.key])){var p=C[t.key],v=null===(u=t.attrs)||void 0===u?void 0:u.call(t,{data:{prev:b,current:x,next:w},coordinate:{prev:S,current:C,next:k},bounding:o,barSpace:a,xAxis:s,yAxis:l});if(!At(v))switch(t.type){case"circle":v={x:m,y:p,r:Math.max(1,f)};break;case"rect":case"bar":var g=null!==(d=t.baseValue)&&void 0!==d?d:l.getRange().from,y=l.convertToPixel(g),_=Math.abs(y-p);g!==(null===x||void 0===x?void 0:x[t.key])&&(_=Math.max(1,_));var I=void 0;I=p>y?y:p,v={x:m-f,y:I,width:Math.max(1,2*f),height:_};break;case"line":At(c[r])||(c[r]=[]),Et(C[t.key])&&Et(k[t.key])&&c[r].push({coordinates:[{x:C.x,y:C[t.key]},{x:k.x,y:k[t.key]}],styles:n});break}var E=t.type;At(v)&&"line"!==E&&(null===(h=i.createFigure({name:"bar"===E?"rect":E,attrs:v,styles:n}))||void 0===h||h.draw(e))}})}),c.forEach(function(t){if(t.length>1){for(var n=[{coordinates:[t[0].coordinates[0],t[0].coordinates[1]],styles:t[0].styles}],a=1;a<t.length;a++){var r=n[n.length-1],o=t[a],s=r.coordinates[r.coordinates.length-1];s.x===o.coordinates[0].x&&s.y===o.coordinates[0].y&&r.styles.style===o.styles.style&&r.styles.color===o.styles.color&&r.styles.size===o.styles.size&&r.styles.smooth===o.styles.smooth&&r.styles.dashedValue[0]===o.styles.dashedValue[0]&&r.styles.dashedValue[1]===o.styles.dashedValue[1]?r.coordinates.push(o.coordinates[1]):n.push({coordinates:[o.coordinates[0],o.coordinates[1]],styles:o.styles})}n.forEach(function(t){var n,a=t.coordinates,r=t.styles;null===(n=i.createFigure({name:"line",attrs:{coordinates:a},styles:r}))||void 0===n||n.draw(e)})}})}}}),e.restore()},e}(An),Mn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return L(e,t),e.prototype.drawImp=function(t){var e=this.getWidget(),i=e.getPane(),n=e.getBounding(),a=e.getPane().getChart().getChartStore(),r=a.getTooltipStore().getCrosshair(),o=a.getStyles().crosshair;if(Mt(r.paneId)&&o.show){if(r.paneId===i.getId()){var s=r.y;this._drawLine(t,[{x:0,y:s},{x:n.width,y:s}],o.horizontal)}var l=r.realX;this._drawLine(t,[{x:l,y:0},{x:l,y:n.height}],o.vertical)}},e.prototype._drawLine=function(t,e,i){var n;if(i.show){var a=i.line;a.show&&(null===(n=this.createFigure({name:"line",attrs:{coordinates:e},styles:a}))||void 0===n||n.draw(t))}},e}(kn),Dn=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._boundIconClickEvent=function(t){return function(){var i=e.getWidget().getPane();return i.getChart().getChartStore().getActionStore().execute(Tt.OnTooltipIconClick,X({},t)),!0}},e._boundIconMouseMoveEvent=function(t){return function(){var i=e.getWidget().getPane(),n=i.getChart().getChartStore().getTooltipStore();return n.setActiveIcon(X({},t)),!0}},e}return L(e,t),e.prototype.drawImp=function(t){var e=this.getWidget(),i=e.getPane(),n=i.getChart().getChartStore(),a=n.getTooltipStore().getCrosshair();if(At(a.kLineData)){var r=e.getBounding(),o=n.getCustomApi(),s=n.getThousandsSeparator(),l=n.getDecimalFoldThreshold(),c=n.getIndicatorStore().getInstances(i.getId()),u=n.getTooltipStore().getActiveIcon(),d=n.getStyles().indicator,h=d.tooltip,p=h.offsetLeft,v=h.offsetTop,f=h.offsetRight;this.drawIndicatorTooltip(t,i.getId(),n.getDataList(),a,u,c,o,s,l,p,v,r.width-f,d)}},e.prototype.drawIndicatorTooltip=function(t,e,i,n,a,r,o,s,l,c,u,d,h){var p=this,v=h.tooltip;if(this.isDrawTooltip(n,v)){var f=v.text;r.forEach(function(r){var g=0,m={x:c,y:u},y=p.getIndicatorTooltipData(i,n,r,o,s,l,h),_=y.name,b=y.calcParamsText,x=y.values,w=y.icons,S=_.length>0,C=x.length>0;if(S||C){var k=Z(p.classifyTooltipIcons(w),3),I=k[0],E=k[1],A=k[2];if(g=p.drawStandardTooltipIcons(t,a,I,m,e,r.name,c,g,d),S){var P=_;b.length>0&&(P="".concat(P).concat(b)),g=p.drawStandardTooltipLegends(t,[{title:{text:"",color:f.color},value:{text:P,color:f.color}}],m,c,g,d,f)}g=p.drawStandardTooltipIcons(t,a,E,m,e,r.name,c,g,d),C&&(g=p.drawStandardTooltipLegends(t,x,m,c,g,d,v.text)),g=p.drawStandardTooltipIcons(t,a,A,m,e,r.name,c,g,d),u=m.y+g}})}return u},e.prototype.drawStandardTooltipIcons=function(t,e,i,n,a,r,o,s,l){var c=this;if(i.length>0){var u=0,d=0;i.forEach(function(e){var i=e.marginLeft,n=void 0===i?0:i,a=e.marginTop,r=void 0===a?0:a,o=e.marginRight,s=void 0===o?0:o,l=e.marginBottom,c=void 0===l?0:l,h=e.paddingLeft,p=void 0===h?0:h,v=e.paddingTop,f=void 0===v?0:v,g=e.paddingRight,m=void 0===g?0:g,y=e.paddingBottom,_=void 0===y?0:y,b=e.size,x=e.fontFamily,w=e.icon;t.font=Ht(b,"normal",x),u+=n+p+t.measureText(w).width+m+s,d=Math.max(d,r+f+b+_+c)}),n.x+u>l?(n.x=o,n.y+=s,s=d):s=Math.max(s,d),i.forEach(function(i){var o,s=i.marginLeft,l=void 0===s?0:s,u=i.marginTop,d=void 0===u?0:u,h=i.marginRight,p=void 0===h?0:h,v=i.paddingLeft,f=void 0===v?0:v,g=i.paddingTop,m=void 0===g?0:g,y=i.paddingRight,_=void 0===y?0:y,b=i.paddingBottom,x=void 0===b?0:b,w=i.color,S=i.activeColor,C=i.size,k=i.fontFamily,I=i.icon,E=i.backgroundColor,A=i.activeBackgroundColor,P=(null===e||void 0===e?void 0:e.paneId)===a&&(null===e||void 0===e?void 0:e.indicatorName)===r&&(null===e||void 0===e?void 0:e.iconId)===i.id;null===(o=c.createFigure({name:"text",attrs:{text:I,x:n.x+l,y:n.y+d},styles:{paddingLeft:f,paddingTop:m,paddingRight:_,paddingBottom:x,color:P?S:w,size:C,family:k,backgroundColor:P?A:E}},{mouseClickEvent:c._boundIconClickEvent({paneId:a,indicatorName:r,iconId:i.id}),mouseMoveEvent:c._boundIconMouseMoveEvent({paneId:a,indicatorName:r,iconId:i.id})}))||void 0===o||o.draw(t),n.x+=l+f+t.measureText(I).width+_+p})}return s},e.prototype.drawStandardTooltipLegends=function(t,e,i,n,a,r,o){var s=this;if(e.length>0){var l=o.marginLeft,c=o.marginTop,u=o.marginRight,d=o.marginBottom,h=o.size,p=o.family,v=o.weight;t.font=Ht(h,v,p),e.forEach(function(e){var o,f,g=e.title,m=e.value,y=t.measureText(g.text).width,_=t.measureText(m.text).width,b=y+_,x=c+h+d;i.x+l+b+u>r?(i.x=n,i.y+=a,a=x):a=Math.max(a,x),g.text.length>0&&(null===(o=s.createFigure({name:"text",attrs:{x:i.x+l,y:i.y+c,text:g.text},styles:{color:g.color,size:h,family:p,weight:v}}))||void 0===o||o.draw(t)),null===(f=s.createFigure({name:"text",attrs:{x:i.x+l+y,y:i.y+c,text:m.text},styles:{color:m.color,size:h,family:p,weight:v}}))||void 0===f||f.draw(t),i.x+=l+b+u})}return a},e.prototype.isDrawTooltip=function(t,e){var i=e.showRule;return i===z.Always||i===z.FollowCross&&Mt(t.paneId)},e.prototype.getIndicatorTooltipData=function(t,e,i,n,a,r,o){var s,l,c=o.tooltip,u=c.showName?i.shortName:"",d="",h=i.calcParams;h.length>0&&c.showParams&&(d="(".concat(h.join(","),")"));var p={name:u,calcParamsText:d,values:[],icons:c.icons},v=e.dataIndex,f=null!==(s=i.result)&&void 0!==s?s:[],g=[];if(i.visible){var m=null!==(l=f[v])&&void 0!==l?l:{};jt(t,i,v,o,function(t,e){var o;if(Mt(t.title)){var s=e.color,l=null!==(o=m[t.key])&&void 0!==o?o:c.defaultValue;Et(l)&&(l=Nt(l,i.precision),i.shouldFormatBigNumber&&(l=n.formatBigNumber(l)),l=Vt(zt(l,a),r)),g.push({title:{text:t.title,color:s},value:{text:l,color:s}})}}),p.values=g}if(null!==i.createTooltipDataSource){var y=this.getWidget(),_=y.getPane(),b=_.getChart().getChartStore(),x=i.createTooltipDataSource({kLineDataList:t,indicator:i,visibleRange:b.getTimeScaleStore().getVisibleRange(),bounding:y.getBounding(),crosshair:e,defaultStyles:o,xAxis:_.getChart().getXAxisPane().getAxisComponent(),yAxis:_.getAxisComponent()}),w=x.name,S=x.calcParamsText,C=x.values,k=x.icons;if(Mt(w)&&c.showName&&(p.name=w),Mt(S)&&c.showParams&&(p.calcParamsText=S),At(k)&&(p.icons=k),At(C)&&i.visible){var I=[],E=o.tooltip.text.color;C.forEach(function(t){var e,o={text:"",color:E};It(t.title)?o=t.title:o.text=t.title;var s={text:"",color:E};if(It(t.value)?s=t.value:s.text=null!==(e=t.value)&&void 0!==e?e:c.defaultValue,Et(s.text)){var l=Nt(s.text,i.precision);i.shouldFormatBigNumber&&(l=n.formatBigNumber(l)),l=Vt(zt(l,a),r),s.text=l}I.push({title:o,value:s})}),p.values=I}}return p},e.prototype.classifyTooltipIcons=function(t){var e=[],i=[],n=[];return t.forEach(function(t){switch(t.position){case W.Left:e.push(t);break;case W.Middle:i.push(t);break;case W.Right:n.push(t);break}}),[e,i,n]},e}(kn),Tn=function(t){function e(e){var i=t.call(this,e)||this;return i._initEvent(),i}return L(e,t),e.prototype._initEvent=function(){var t=this,e=this.getWidget().getPane(),i=e.getId(),n=e.getChart().getChartStore().getOverlayStore();this.registerEvent("mouseMoveEvent",function(e){var a,r=n.getProgressInstanceInfo();if(null!==r){var o=r.instance,s=r.paneId;o.isStart()&&(n.updateProgressInstanceInfo(i),s=i);var l=o.points.length-1,c="".concat(ee,"point_").concat(l);return o.isDrawing()&&s===i&&(o.eventMoveForDrawing(t._coordinateToPoint(r.instance,e)),null===(a=o.onDrawing)||void 0===a||a.call(o,X({overlay:o,figureKey:c,figureIndex:l},e))),t._figureMouseMoveEvent(o,1,c,l,0)(e)}return n.setHoverInstanceInfo({paneId:i,instance:null,figureType:0,figureKey:"",figureIndex:-1,attrsIndex:-1},e),!1}).registerEvent("mouseClickEvent",function(e){var a,r,o=n.getProgressInstanceInfo();if(null!==o){var s=o.instance,l=o.paneId;s.isStart()&&(n.updateProgressInstanceInfo(i,!0),l=i);var c=s.points.length-1,u="".concat(ee,"point_").concat(c);return s.isDrawing()&&l===i&&(s.eventMoveForDrawing(t._coordinateToPoint(s,e)),null===(a=s.onDrawing)||void 0===a||a.call(s,X({overlay:s,figureKey:u,figureIndex:c},e)),s.nextStep(),s.isDrawing()||(n.progressInstanceComplete(),null===(r=s.onDrawEnd)||void 0===r||r.call(s,X({overlay:s,figureKey:u,figureIndex:c},e)))),t._figureMouseClickEvent(s,1,u,c,0)(e)}return n.setClickInstanceInfo({paneId:i,instance:null,figureType:0,figureKey:"",figureIndex:-1,attrsIndex:-1},e),!1}).registerEvent("mouseDoubleClickEvent",function(e){var a,r=n.getProgressInstanceInfo();if(null!==r){var o=r.instance,s=r.paneId;if(o.isDrawing()&&s===i&&(o.forceComplete(),!o.isDrawing())){n.progressInstanceComplete();var l=o.points.length-1,c="".concat(ee,"point_").concat(l);null===(a=o.onDrawEnd)||void 0===a||a.call(o,X({overlay:o,figureKey:c,figureIndex:l},e))}var u=o.points.length-1;return t._figureMouseClickEvent(o,1,"".concat(ee,"point_").concat(u),u,0)(e)}return!1}).registerEvent("mouseRightClickEvent",function(e){var i=n.getProgressInstanceInfo();if(null!==i){var a=i.instance;if(a.isDrawing()){var r=a.points.length-1;return t._figureMouseRightClickEvent(a,1,"".concat(ee,"point_").concat(r),r,0)(e)}}return!1}).registerEvent("mouseUpEvent",function(t){var e,a=n.getPressedInstanceInfo(),r=a.instance,o=a.figureIndex,s=a.figureKey;return null!==r&&(null===(e=r.onPressedMoveEnd)||void 0===e||e.call(r,X({overlay:r,figureKey:s,figureIndex:o},t))),n.setPressedInstanceInfo({paneId:i,instance:null,figureType:0,figureKey:"",figureIndex:-1,attrsIndex:-1}),!1}).registerEvent("pressedMouseMoveEvent",function(e){var i,a,r=n.getPressedInstanceInfo(),o=r.instance,s=r.figureType,l=r.figureIndex,c=r.figureKey;if(null!==o){if(!o.lock&&(null===(a=null===(i=o.onPressedMoving)||void 0===i?void 0:i.call(o,X({overlay:o,figureIndex:l,figureKey:c},e)))||void 0===a||!a)){var u=t._coordinateToPoint(o,e);1===s?o.eventPressedPointMove(u,l):o.eventPressedOtherMove(u,t.getWidget().getPane().getChart().getChartStore().getTimeScaleStore())}return!0}return!1})},e.prototype._createFigureEvents=function(t,e,i,n,a,r){var o;if(!t.isDrawing()){var s=[];if(At(r)&&(Pt(r)?r&&(s=Zt()):s=r),0===s.length)return{mouseMoveEvent:this._figureMouseMoveEvent(t,e,i,n,a),mouseDownEvent:this._figureMouseDownEvent(t,e,i,n,a),mouseClickEvent:this._figureMouseClickEvent(t,e,i,n,a),mouseRightClickEvent:this._figureMouseRightClickEvent(t,e,i,n,a),mouseDoubleClickEvent:this._figureMouseDoubleClickEvent(t,e,i,n,a)};o={},s.includes("mouseMoveEvent")||s.includes("touchMoveEvent")||(o.mouseMoveEvent=this._figureMouseMoveEvent(t,e,i,n,a)),s.includes("mouseDownEvent")||s.includes("touchStartEvent")||(o.mouseDownEvent=this._figureMouseDownEvent(t,e,i,n,a)),s.includes("mouseClickEvent")||s.includes("tapEvent")||(o.mouseClickEvent=this._figureMouseClickEvent(t,e,i,n,a)),s.includes("mouseDoubleClickEvent")||s.includes("doubleTapEvent")||(o.mouseDoubleClickEvent=this._figureMouseDoubleClickEvent(t,e,i,n,a)),s.includes("mouseRightClickEvent")||(o.mouseRightClickEvent=this._figureMouseRightClickEvent(t,e,i,n,a))}return o},e.prototype._figureMouseMoveEvent=function(t,e,i,n,a){var r=this;return function(o){var s=r.getWidget().getPane(),l=s.getChart().getChartStore().getOverlayStore();return l.setHoverInstanceInfo({paneId:s.getId(),instance:t,figureType:e,figureKey:i,figureIndex:n,attrsIndex:a},o),!0}},e.prototype._figureMouseDownEvent=function(t,e,i,n,a){var r=this;return function(o){var s,l=r.getWidget().getPane(),c=l.getId(),u=l.getChart().getChartStore().getOverlayStore();return t.startPressedMove(r._coordinateToPoint(t,o)),null===(s=t.onPressedMoveStart)||void 0===s||s.call(t,X({overlay:t,figureIndex:n,figureKey:i},o)),u.setPressedInstanceInfo({paneId:c,instance:t,figureType:e,figureKey:i,figureIndex:n,attrsIndex:a}),!0}},e.prototype._figureMouseClickEvent=function(t,e,i,n,a){var r=this;return function(o){var s=r.getWidget().getPane(),l=s.getId(),c=s.getChart().getChartStore().getOverlayStore();return c.setClickInstanceInfo({paneId:l,instance:t,figureType:e,figureKey:i,figureIndex:n,attrsIndex:a},o),!0}},e.prototype._figureMouseDoubleClickEvent=function(t,e,i,n,a){return function(e){var a;return null===(a=t.onDoubleClick)||void 0===a||a.call(t,X(X({},e),{figureIndex:n,figureKey:i,overlay:t})),!0}},e.prototype._figureMouseRightClickEvent=function(t,e,i,n,a){var r=this;return function(e){var a,o;if(null===(o=null===(a=t.onRightClick)||void 0===a?void 0:a.call(t,X({overlay:t,figureIndex:n,figureKey:i},e)))||void 0===o||!o){var s=r.getWidget().getPane(),l=s.getChart().getChartStore().getOverlayStore();l.removeInstance(t)}return!0}},e.prototype._coordinateToPoint=function(t,e){var i,n={},a=this.getWidget().getPane(),r=a.getChart(),o=a.getId(),s=r.getChartStore().getTimeScaleStore();if(this.coordinateToPointTimestampDataIndexFlag()){var l=r.getXAxisPane().getAxisComponent(),c=l.convertFromPixel(e.x),u=null!==(i=s.dataIndexToTimestamp(c))&&void 0!==i?i:void 0;n.dataIndex=c,n.timestamp=u}if(this.coordinateToPointValueFlag()){var d=a.getAxisComponent(),h=d.convertFromPixel(e.y);if(t.mode!==Ut.Normal&&o===Wi.CANDLE&&Et(n.dataIndex)){var p=s.getDataByDataIndex(n.dataIndex);if(null!==p){var v=t.modeSensitivity;if(h>p.high)if(t.mode===Ut.WeakMagnet){var f=d.convertToPixel(p.high),g=d.convertFromPixel(f-v);h<g&&(h=p.high)}else h=p.high;else if(h<p.low)if(t.mode===Ut.WeakMagnet){var m=d.convertToPixel(p.low);g=d.convertFromPixel(m-v);h>g&&(h=p.low)}else h=p.low;else{var y=Math.max(p.open,p.close),_=Math.min(p.open,p.close);h=h>y?h-y<p.high-h?y:p.high:h<_?h-p.low<_-h?p.low:_:y-h<h-_?y:_}}}n.value=h}return n},e.prototype.coordinateToPointValueFlag=function(){return!0},e.prototype.coordinateToPointTimestampDataIndexFlag=function(){return!0},e.prototype.dispatchEvent=function(e,i,n){return this.getWidget().getPane().getChart().getChartStore().getOverlayStore().isDrawing()?this.onEvent(e,i,n):t.prototype.dispatchEvent.call(this,e,i,n)},e.prototype.checkEventOn=function(){return!0},e.prototype.drawImp=function(t){var e=this,i=this.getWidget(),n=i.getPane(),a=n.getId(),r=n.getChart(),o=n.getAxisComponent(),s=r.getXAxisPane().getAxisComponent(),l=i.getBounding(),c=r.getChartStore(),u=c.getCustomApi(),d=c.getThousandsSeparator(),h=c.getDecimalFoldThreshold(),p=c.getTimeScaleStore(),v=p.getDateTimeFormat(),f=p.getBarSpace(),g=c.getPrecision(),m=c.getStyles().overlay,y=c.getOverlayStore(),_=y.getHoverInstanceInfo(),b=y.getClickInstanceInfo(),x=this.getCompleteOverlays(y,a),w=c.getIndicatorStore().getInstances(a),S=w.reduce(function(t,e){var i=e.precision;return t[e.name]=i,t.max=Math.max(t.max,i),t.min=Math.min(t.min,i),t.excludePriceVolumeMax=Math.max(t.excludePriceVolumeMax,i),t.excludePriceVolumeMin=Math.min(t.excludePriceVolumeMin,i),t},X(X({},g),{max:Math.max(g.price,g.volume),min:Math.min(g.price,g.volume),excludePriceVolumeMax:Number.MIN_SAFE_INTEGER,excludePriceVolumeMin:Number.MAX_SAFE_INTEGER}));x.forEach(function(i){i.visible&&e._drawOverlay(t,i,l,f,S,v,u,d,h,m,s,o,_,b,p)});var C=y.getProgressInstanceInfo();if(null!==C){var k=this.getProgressOverlay(C,a);null!==k&&k.visible&&this._drawOverlay(t,k,l,f,S,v,u,d,h,m,s,o,_,b,p)}},e.prototype._drawOverlay=function(t,e,i,n,a,r,o,s,l,c,u,d,h,p,v){var f=e.points,g=f.map(function(t){var e,i,n=t.dataIndex;Et(t.timestamp)&&(n=v.timestampToDataIndex(t.timestamp));var a={x:0,y:0};return Et(n)&&(a.x=null!==(e=null===u||void 0===u?void 0:u.convertToPixel(n))&&void 0!==e?e:0),Et(t.value)&&(a.y=null!==(i=null===d||void 0===d?void 0:d.convertToPixel(t.value))&&void 0!==i?i:0),a});if(g.length>0){var m=(new Array).concat(this.getFigures(e,g,i,n,a,s,l,r,c,u,d));this.drawFigures(t,e,m,c)}this.drawDefaultFigures(t,e,g,i,a,r,o,s,l,c,u,d,h,p)},e.prototype.drawFigures=function(t,e,i,n){var a=this;i.forEach(function(i,r){var o=i.type,s=i.styles,l=i.attrs,c=i.ignoreEvent,u=[].concat(l);u.forEach(function(l,u){var d,h,p,v=a._createFigureEvents(e,2,null!==(d=i.key)&&void 0!==d?d:"",r,u,c),f=X(X(X({},n[o]),null===(h=e.styles)||void 0===h?void 0:h[o]),s);null===(p=a.createFigure({name:o,attrs:l,styles:f},v))||void 0===p||p.draw(t)})})},e.prototype.getCompleteOverlays=function(t,e){return t.getInstances(e)},e.prototype.getProgressOverlay=function(t,e){return t.paneId===e?t.instance:null},e.prototype.getFigures=function(t,e,i,n,a,r,o,s,l,c,u){var d,h;return null!==(h=null===(d=t.createPointFigures)||void 0===d?void 0:d.call(t,{overlay:t,coordinates:e,bounding:i,barSpace:n,precision:a,thousandsSeparator:r,decimalFoldThreshold:o,dateTimeFormat:s,defaultStyles:l,xAxis:c,yAxis:u}))&&void 0!==h?h:[]},e.prototype.drawDefaultFigures=function(t,e,i,n,a,r,o,s,l,c,u,d,h,p){var v,f,g=this;if(e.needDefaultPointFigure&&((null===(v=h.instance)||void 0===v?void 0:v.id)===e.id&&0!==h.figureType||(null===(f=p.instance)||void 0===f?void 0:f.id)===e.id&&0!==p.figureType)){var m=e.styles,y=X(X({},c.point),null===m||void 0===m?void 0:m.point);i.forEach(function(i,n){var a,r,o,s=i.x,l=i.y,c=y.radius,u=y.color,d=y.borderColor,p=y.borderSize;(null===(a=h.instance)||void 0===a?void 0:a.id)===e.id&&1===h.figureType&&h.figureIndex===n&&(c=y.activeRadius,u=y.activeColor,d=y.activeBorderColor,p=y.activeBorderSize),null===(r=g.createFigure({name:"circle",attrs:{x:s,y:l,r:c+p},styles:{color:d}},g._createFigureEvents(e,1,"".concat(ee,"point_").concat(n),n,0)))||void 0===r||r.draw(t),null===(o=g.createFigure({name:"circle",attrs:{x:s,y:l,r:c},styles:{color:u}}))||void 0===o||o.draw(t)})}},e}(kn),Bn=function(t){function e(e,i){var n=t.call(this,e,i)||this;return n._gridView=new In(n),n._indicatorView=new Pn(n),n._crosshairLineView=new Mn(n),n._tooltipView=n.createTooltipView(),n._overlayView=new Tn(n),n.addChild(n._tooltipView),n.addChild(n._overlayView),n.getContainer().style.cursor="crosshair",n.registerEvent("mouseMoveEvent",function(){return i.getChart().getChartStore().getTooltipStore().setActiveIcon(),!1}),n}return L(e,t),e.prototype.getName=function(){return Gi.MAIN},e.prototype.updateMain=function(t){this.updateMainContent(t),this._indicatorView.draw(t),this._gridView.draw(t)},e.prototype.createTooltipView=function(){return new Dn(this)},e.prototype.updateMainContent=function(t){},e.prototype.updateOverlay=function(t){this._overlayView.draw(t),this._crosshairLineView.draw(t),this._tooltipView.draw(t)},e}(en),Fn=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._ripplePoint=e.createFigure({name:"circle",attrs:{x:0,y:0,r:0},styles:{style:"fill"}}),e._animationFrameTime=0,e._animation=new le({iterationCount:1/0}).doFrame(function(t){e._animationFrameTime=t;var i=e.getWidget().getPane();i.getChart().updatePane(0,i.getId())}),e}return L(e,t),e.prototype.drawImp=function(t){var e,i,n,a=this.getWidget(),r=a.getPane(),o=r.getChart(),s=o.getDataList(),l=s.length-1,c=a.getBounding(),u=r.getAxisComponent(),d=o.getStyles().candle.area,h=[],p=Number.MAX_SAFE_INTEGER,v=Number.MIN_SAFE_INTEGER,f=null;if(this.eachChildren(function(t){var e=t.data,i=t.x,n=null===e||void 0===e?void 0:e[d.value];if(Et(n)){var a=u.convertToPixel(n);v===Number.MIN_SAFE_INTEGER&&(v=i),h.push({x:i,y:a}),p=Math.min(p,a),t.dataIndex===l&&(f={x:i,y:a})}}),h.length>0){null===(e=this.createFigure({name:"line",attrs:{coordinates:h},styles:{color:d.lineColor,size:d.lineSize,smooth:d.smooth}}))||void 0===e||e.draw(t);var g=d.backgroundColor,m=void 0;if(Ct(g)){var y=t.createLinearGradient(0,c.height,0,p);try{g.forEach(function(t){var e=t.offset,i=t.color;y.addColorStop(e,i)})}catch(x){}m=y}else m=g;t.fillStyle=m,t.beginPath(),t.moveTo(v,c.height),t.lineTo(h[0].x,h[0].y),_i(t,h,d.smooth),t.lineTo(h[h.length-1].x,c.height),t.closePath(),t.fill()}var _=d.point;if(_.show&&At(f)){null===(i=this.createFigure({name:"circle",attrs:{x:f.x,y:f.y,r:_.radius},styles:{style:"fill",color:_.color}}))||void 0===i||i.draw(t);var b=_.rippleRadius;_.animation&&(b=_.radius+this._animationFrameTime/_.animationDuration*(_.rippleRadius-_.radius),this._animation.setDuration(_.animationDuration).start()),null===(n=this._ripplePoint)||void 0===n||n.setAttrs({x:f.x,y:f.y,r:b}).setStyles({style:"fill",color:_.rippleColor}).draw(t)}else this.stopAnimation()},e.prototype.stopAnimation=function(){this._animation.stop()},e}(En),Rn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return L(e,t),e.prototype.drawImp=function(t){var e=this.getWidget(),i=e.getPane(),n=i.getChart().getChartStore(),a=n.getStyles().candle.priceMark,r=a.high,o=a.low;if(a.show&&(r.show||o.show)){var s=n.getThousandsSeparator(),l=n.getDecimalFoldThreshold(),c=n.getPrecision(),u=i.getAxisComponent(),d=Number.MIN_SAFE_INTEGER,h=0,p=Number.MAX_SAFE_INTEGER,v=0;this.eachChildren(function(t){var e=t.data,i=t.x;At(e)&&(d<e.high&&(d=e.high,h=i),p>e.low&&(p=e.low,v=i))});var f=u.convertToPixel(d),g=u.convertToPixel(p);r.show&&d!==Number.MIN_SAFE_INTEGER&&this._drawMark(t,Vt(zt(Nt(d,c.price),s),l),{x:h,y:f},f<g?[-2,-5]:[2,5],r),o.show&&p!==Number.MAX_SAFE_INTEGER&&this._drawMark(t,Vt(zt(Nt(p,c.price),s),l),{x:v,y:g},f<g?[2,5]:[-2,-5],o)}},e.prototype._drawMark=function(t,e,i,n,a){var r,o,s,l,c,u,d=i.x,h=i.y+n[0];null===(r=this.createFigure({name:"line",attrs:{coordinates:[{x:d-2,y:h+n[0]},{x:d,y:h},{x:d+2,y:h+n[0]}]},styles:{color:a.color}}))||void 0===r||r.draw(t);var p=this.getWidget().getBounding().width;d>p/2?(l=d-5,c=l-a.textOffset,u="right"):(l=d+5,u="left",c=l+a.textOffset);var v=h+n[1];null===(o=this.createFigure({name:"line",attrs:{coordinates:[{x:d,y:h},{x:d,y:v},{x:l,y:v}]},styles:{color:a.color}}))||void 0===o||o.draw(t),null===(s=this.createFigure({name:"text",attrs:{x:c,y:v,text:e,align:u,baseline:"middle"},styles:{color:a.color,size:a.textSize,family:a.textFamily,weight:a.textWeight}}))||void 0===s||s.draw(t)},e}(En),Ln=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return L(e,t),e.prototype.drawImp=function(t){var e,i=this.getWidget(),n=i.getPane(),a=i.getBounding(),r=n.getChart().getChartStore(),o=r.getStyles().candle.priceMark,s=o.last,l=s.line;if(o.show&&s.show&&l.show){var c=n.getAxisComponent(),u=r.getDataList(),d=u[u.length-1];if(null!=d){var h=d.close,p=d.open,v=c.convertToNicePixel(h),f=void 0;f=h>p?s.upColor:h<p?s.downColor:s.noChangeColor,null===(e=this.createFigure({name:"line",attrs:{coordinates:[{x:0,y:v},{x:a.width,y:v}]},styles:{style:l.style,color:f,size:l.size,dashedValue:l.dashedValue}}))||void 0===e||e.draw(t)}}},e}(kn),Nn={time:"时间:",open:"开:",high:"高:",low:"低:",close:"收:",volume:"成交量:",turnover:"成交额:",change:"涨幅:"},On={time:"Time: ",open:"Open: ",high:"High: ",low:"Low: ",close:"Close: ",volume:"Volume: ",turnover:"Turnover: ",change:"Change: "},zn={"zh-CN":Nn,"en-US":On};function Vn(t,e){var i,n;return null!==(n=null===(i=zn[e])||void 0===i?void 0:i[t])&&void 0!==n?n:t}var Wn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return L(e,t),e.prototype.drawImp=function(t){var e=this.getWidget(),i=e.getPane(),n=i.getId(),a=i.getChart().getChartStore(),r=a.getTooltipStore().getCrosshair();if(At(r.kLineData)){var o=e.getBounding(),s=i.getYAxisWidget().getBounding(),l=a.getDataList(),c=a.getPrecision(),u=a.getLocale(),d=a.getCustomApi(),h=a.getThousandsSeparator(),p=a.getDecimalFoldThreshold(),v=a.getTooltipStore().getActiveIcon(),f=a.getIndicatorStore().getInstances(i.getId()),g=a.getTimeScaleStore().getDateTimeFormat(),m=a.getStyles(),y=m.candle,_=m.indicator;if(y.tooltip.showType===V.Rect&&_.tooltip.showType===V.Rect){var b=this.isDrawTooltip(r,y.tooltip),x=this.isDrawTooltip(r,_.tooltip);this._drawRectTooltip(t,l,f,o,s,r,c,g,u,d,h,p,b,x,y.tooltip.offsetTop,m)}else if(y.tooltip.showType===V.Standard&&_.tooltip.showType===V.Standard){var w=y.tooltip,S=w.offsetLeft,C=w.offsetTop,k=w.offsetRight,I=o.width-k,E=this._drawCandleStandardTooltip(t,l,n,r,v,c,g,u,d,h,p,S,C,I,y);this.drawIndicatorTooltip(t,n,l,r,v,f,d,h,p,S,E,I,_)}else if(y.tooltip.showType===V.Rect&&_.tooltip.showType===V.Standard){var A=y.tooltip,P=(S=A.offsetLeft,C=A.offsetTop,k=A.offsetRight,I=o.width-k,this.drawIndicatorTooltip(t,n,l,r,v,f,d,h,p,S,C,I,_));b=this.isDrawTooltip(r,y.tooltip);this._drawRectTooltip(t,l,f,o,s,r,c,g,u,d,h,p,b,!1,P,m)}else{var M=y.tooltip,D=(S=M.offsetLeft,C=M.offsetTop,k=M.offsetRight,I=o.width-k,this._drawCandleStandardTooltip(t,l,n,r,v,c,g,u,d,h,p,S,C,I,y));x=this.isDrawTooltip(r,_.tooltip);this._drawRectTooltip(t,l,f,o,s,r,c,g,u,d,h,p,!1,x,D,m)}}},e.prototype._drawCandleStandardTooltip=function(t,e,i,n,a,r,o,s,l,c,u,d,h,p,v){var f,g,m,y=v.tooltip,_=y.text,b=0,x={x:d,y:h};if(this.isDrawTooltip(n,y)){var w=null!==(f=n.dataIndex)&&void 0!==f?f:0,S=this._getCandleTooltipLegends({prev:null!==(g=e[w-1])&&void 0!==g?g:null,current:n.kLineData,next:null!==(m=e[w+1])&&void 0!==m?m:null},r,o,s,l,c,u,v),C=Z(this.classifyTooltipIcons(y.icons),3),k=C[0],I=C[1],E=C[2];b=this.drawStandardTooltipIcons(t,a,k,x,i,"",d,b,p),b=this.drawStandardTooltipIcons(t,a,I,x,i,"",d,b,p),S.length>0&&(b=this.drawStandardTooltipLegends(t,S,x,d,b,p,_)),b=this.drawStandardTooltipIcons(t,a,E,x,i,"",d,b,p)}return x.y+b},e.prototype._drawRectTooltip=function(t,e,i,n,a,r,o,s,l,c,u,d,h,p,v,f){var g,m,y,_,b,x=this,w=f.candle,S=f.indicator,C=w.tooltip,k=S.tooltip;if(h||p){var I=null!==(g=r.dataIndex)&&void 0!==g?g:0,E=this._getCandleTooltipLegends({prev:null!==(m=e[I-1])&&void 0!==m?m:null,current:r.kLineData,next:null!==(y=e[I+1])&&void 0!==y?y:null},o,s,l,c,u,d,w),A=C.offsetLeft,P=C.offsetTop,M=C.offsetRight,D=C.offsetBottom,T=C.text,B=T.marginLeft,F=T.marginRight,R=T.marginTop,L=T.marginBottom,N=T.size,z=T.weight,V=T.family,W=C.rect,$=W.position,Y=W.paddingLeft,X=W.paddingRight,j=W.paddingTop,U=W.paddingBottom,G=W.offsetLeft,Z=W.offsetRight,q=W.offsetTop,J=W.offsetBottom,Q=W.borderSize,tt=W.borderRadius,et=W.borderColor,it=W.color,nt=0,at=0,rt=0;h&&(t.font=Ht(N,z,V),E.forEach(function(e){var i=e.title,n=e.value,a="".concat(i.text).concat(n.text),r=t.measureText(a).width+B+F;nt=Math.max(nt,r)}),rt+=(L+R+N)*E.length);var ot=k.text,st=ot.marginLeft,lt=ot.marginRight,ct=ot.marginTop,ut=ot.marginBottom,dt=ot.size,ht=ot.weight,pt=ot.family,vt=[];if(p&&(t.font=Ht(dt,ht,pt),i.forEach(function(i){var n,a=null!==(n=x.getIndicatorTooltipData(e,r,i,c,u,d,S).values)&&void 0!==n?n:[];vt.push(a),a.forEach(function(e){var i=e.title,n=e.value,a="".concat(i.text).concat(n.text),r=t.measureText(a).width+st+lt;nt=Math.max(nt,r),rt+=ct+ut+dt})})),at+=nt,0!==at&&0!==rt){at+=2*Q+Y+X,rt+=2*Q+j+U;var ft=n.width/2,gt=$===H.Pointer&&r.paneId===Wi.CANDLE,mt=(null!==(_=r.realX)&&void 0!==_?_:0)>ft,yt=0;if(gt){var _t=r.realX;yt=mt?_t-Z-at:_t+G}else mt?(yt=G+A,f.yAxis.inside&&f.yAxis.position===K.Left&&(yt+=a.width)):(yt=n.width-Z-at-M,f.yAxis.inside&&f.yAxis.position===K.Right&&(yt-=a.width));var bt=v+q;if(gt){var xt=r.y;bt=xt-rt/2,bt+rt>n.height-J-D&&(bt=n.height-J-rt-D),bt<v+q&&(bt=v+q+P)}null===(b=this.createFigure({name:"rect",attrs:{x:yt,y:bt,width:at,height:rt},styles:{style:O.StrokeFill,color:it,borderColor:et,borderSize:Q,borderRadius:tt}}))||void 0===b||b.draw(t);var wt=yt+Q+Y+B,St=bt+Q+j;if(h&&E.forEach(function(e){var i,n;St+=R;var a=e.title;null===(i=x.createFigure({name:"text",attrs:{x:wt,y:St,text:a.text},styles:{color:a.color,size:N,family:V,weight:z}}))||void 0===i||i.draw(t);var r=e.value;null===(n=x.createFigure({name:"text",attrs:{x:yt+at-Q-F-X,y:St,text:r.text,align:"right"},styles:{color:r.color,size:N,family:V,weight:z}}))||void 0===n||n.draw(t),St+=N+L}),p){var Ct=yt+Q+Y+st;vt.forEach(function(e){e.forEach(function(e){var i,n;St+=ct;var a=e.title,r=e.value;null===(i=x.createFigure({name:"text",attrs:{x:Ct,y:St,text:a.text},styles:{color:a.color,size:dt,family:pt,weight:ht}}))||void 0===i||i.draw(t),null===(n=x.createFigure({name:"text",attrs:{x:yt+at-Q-lt-X,y:St,text:r.text,align:"right"},styles:{color:r.color,size:dt,family:pt,weight:ht}}))||void 0===n||n.draw(t),St+=dt+ut})})}}}},e.prototype._getCandleTooltipLegends=function(t,e,i,n,a,r,o,s){var l,c,u,d,h,p=s.tooltip,v=p.text.color,f=t.current,g=null!==(c=null===(l=t.prev)||void 0===l?void 0:l.close)&&void 0!==c?c:f.close,m=f.close-g,y=e.price,_=e.volume,b={"{time}":a.formatDate(i,f.timestamp,"YYYY-MM-DD HH:mm",qt.Tooltip),"{open}":Vt(zt(Nt(f.open,y),r),o),"{high}":Vt(zt(Nt(f.high,y),r),o),"{low}":Vt(zt(Nt(f.low,y),r),o),"{close}":Vt(zt(Nt(f.close,y),r),o),"{volume}":Vt(zt(a.formatBigNumber(Nt(null!==(u=f.volume)&&void 0!==u?u:p.defaultValue,_)),r),o),"{turnover}":Vt(zt(Nt(null!==(d=f.turnover)&&void 0!==d?d:p.defaultValue,y),r),o),"{change}":0===g?p.defaultValue:"".concat(zt(Nt(m/g*100),r),"%")},x=null!==(h=kt(p.custom)?p.custom(t,s):p.custom)&&void 0!==h?h:[];return x.map(function(t){var e,i=t.title,a=t.value,r={text:"",color:""};It(i)?r=X({},i):(r.text=i,r.color=v),r.text=Vn(r.text,n);var o={text:p.defaultValue,color:""};It(a)?o=X({},a):(o.text=a,o.color=v);var l=o.text.match(/{(\S*)}/);if(null!==l&&l.length>1){var c="{".concat(l[1],"}");o.text=o.text.replace(c,null!==(e=b[c])&&void 0!==e?e:p.defaultValue),"{change}"===c&&(o.color=0===m?s.priceMark.last.noChangeColor:m>0?s.priceMark.last.upColor:s.priceMark.last.downColor)}return{title:r,value:o}})},e}(Dn),Hn=function(t){function e(e,i){var n=t.call(this,e,i)||this;return n._candleBarView=new An(n),n._candleAreaView=new Fn(n),n._candleHighLowPriceView=new Rn(n),n._candleLastPriceLineView=new Ln(n),n.addChild(n._candleBarView),n}return L(e,t),e.prototype.updateMainContent=function(t){var e=this.getPane().getChart().getStyles().candle;e.type!==$.Area?(this._candleBarView.draw(t),this._candleHighLowPriceView.draw(t),this._candleAreaView.stopAnimation()):this._candleAreaView.draw(t),this._candleLastPriceLineView.draw(t)},e.prototype.createTooltipView=function(){return new Wn(this)},e}(Bn),$n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return L(e,t),e.prototype.drawImp=function(t){var e,i,n=this,a=this.getWidget(),r=a.getPane(),o=a.getBounding(),s=r.getAxisComponent(),l=this.getAxisStyles(r.getChart().getStyles());if(l.show){l.axisLine.show&&(null===(e=this.createFigure({name:"line",attrs:this.createAxisLine(o,l),styles:l.axisLine}))||void 0===e||e.draw(t));var c=s.getTicks();if(l.tickLine.show){var u=this.createTickLines(c,o,l);u.forEach(function(e){var i;null===(i=n.createFigure({name:"line",attrs:e,styles:l.tickLine}))||void 0===i||i.draw(t)})}if(l.tickText.show){var d=this.createTickTexts(c,o,l);null===(i=this.createFigure({name:"text",attrs:d,styles:l.tickText}))||void 0===i||i.draw(t)}}},e}(kn),Kn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return L(e,t),e.prototype.getAxisStyles=function(t){return t.yAxis},e.prototype.createAxisLine=function(t,e){var i,n=this.getWidget().getPane().getAxisComponent(),a=e.axisLine.size;return i=n.isFromZero()?0:t.width-a,{coordinates:[{x:i,y:0},{x:i,y:t.height}]}},e.prototype.createTickLines=function(t,e,i){var n=this.getWidget().getPane().getAxisComponent(),a=i.axisLine,r=i.tickLine,o=0,s=0;return n.isFromZero()?(o=0,a.show&&(o+=a.size),s=o+r.length):(o=e.width,a.show&&(o-=a.size),s=o-r.length),t.map(function(t){return{coordinates:[{x:o,y:t.coord},{x:s,y:t.coord}]}})},e.prototype.createTickTexts=function(t,e,i){var n=this.getWidget().getPane().getAxisComponent(),a=i.axisLine,r=i.tickLine,o=i.tickText,s=0;n.isFromZero()?(s=o.marginStart,a.show&&(s+=a.size),r.show&&(s+=r.length)):(s=e.width-o.marginEnd,a.show&&(s-=a.size),r.show&&(s-=r.length));var l=this.getWidget().getPane().getAxisComponent().isFromZero()?"left":"right";return t.map(function(t){return{x:s,y:t.coord,text:t.text,align:l,baseline:"middle"}})},e}($n),Yn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return L(e,t),e.prototype.drawImp=function(t){var e,i=this.getWidget(),n=i.getPane(),a=i.getBounding(),r=n.getChart().getChartStore(),o=r.getStyles().candle.priceMark,s=o.last,l=s.text;if(o.show&&s.show&&l.show){var c=r.getPrecision(),u=n.getAxisComponent(),d=r.getDataList(),h=d[d.length-1];if(At(h)){var p=h.close,v=h.open,f=u.convertToNicePixel(p),g=void 0;g=p>v?s.upColor:p<v?s.downColor:s.noChangeColor;var m=void 0;if(u.getType()===Y.Percentage){var y=r.getVisibleFirstData(),_=y.close;m="".concat(((p-_)/_*100).toFixed(2),"%")}else m=Nt(p,c.price);m=Vt(zt(m,r.getThousandsSeparator()),r.getDecimalFoldThreshold());var b=void 0,x=void 0;u.isFromZero()?(b=0,x="left"):(b=a.width,x="right"),null===(e=this.createFigure({name:"text",attrs:{x:b,y:f,text:m,align:x,baseline:"middle"},styles:X(X({},l),{backgroundColor:g})}))||void 0===e||e.draw(t)}}},e}(kn),Xn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return L(e,t),e.prototype.drawImp=function(t){var e=this,i=this.getWidget(),n=i.getPane(),a=i.getBounding(),r=n.getChart().getChartStore(),o=r.getCustomApi(),s=r.getStyles().indicator,l=s.lastValueMark,c=l.text;if(l.show){var u=n.getAxisComponent(),d=r.getDataList(),h=d.length-1,p=r.getIndicatorStore().getInstances(n.getId()),v=r.getThousandsSeparator(),f=r.getDecimalFoldThreshold();p.forEach(function(i){var n=i.result,r=n[h];if(At(r)&&i.visible){var l=i.precision;jt(d,i,h,s,function(n,s){var d,h=r[n.key];if(Et(h)){var p=u.convertToNicePixel(h),g=Nt(h,l);i.shouldFormatBigNumber&&(g=o.formatBigNumber(g)),g=Vt(zt(g,v),f);var m=void 0,y=void 0;u.isFromZero()?(m=0,y="left"):(m=a.width,y="right"),null===(d=e.createFigure({name:"text",attrs:{x:m,y:p,text:g,align:y,baseline:"middle"},styles:X(X({},c),{backgroundColor:s.color})}))||void 0===d||d.draw(t)}})}})}},e}(kn),jn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return L(e,t),e.prototype.coordinateToPointTimestampDataIndexFlag=function(){return!1},e.prototype.drawDefaultFigures=function(t,e,i,n,a,r,o,s,l,c,u,d,h,p){this.drawFigures(t,e,this.getDefaultFigures(e,i,n,a,r,o,s,l,u,d,p),c)},e.prototype.getDefaultFigures=function(t,e,i,n,a,r,o,s,l,c,u){var d,h,p=[];if(t.needDefaultYAxisFigure&&t.id===(null===(d=u.instance)||void 0===d?void 0:d.id)&&u.paneId===this.getWidget().getPane().getId()){var v,f,g=Number.MAX_SAFE_INTEGER,m=Number.MIN_SAFE_INTEGER,y=null!==(h=null===c||void 0===c?void 0:c.isFromZero())&&void 0!==h&&h;y?(v="left",f=0):(v="right",f=i.width),e.forEach(function(e,i){var a=t.points[i];if(Et(a.value)){g=Math.min(g,e.y),m=Math.max(m,e.y);var r=Vt(zt(Nt(a.value,n.price),o),s);p.push({type:"text",attrs:{x:f,y:e.y,text:r,align:v,baseline:"middle"},ignoreEvent:!0})}}),e.length>1&&p.unshift({type:"rect",attrs:{x:0,y:g,width:i.width,height:m-g},ignoreEvent:!0})}return p},e.prototype.getFigures=function(t,e,i,n,a,r,o,s,l,c,u){var d,h;return null!==(h=null===(d=t.createYAxisFigures)||void 0===d?void 0:d.call(t,{overlay:t,coordinates:e,bounding:i,barSpace:n,precision:a,thousandsSeparator:r,decimalFoldThreshold:o,dateTimeFormat:s,defaultStyles:l,xAxis:c,yAxis:u}))&&void 0!==h?h:[]},e}(Tn),Un=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return L(e,t),e.prototype.drawImp=function(t){var e,i=this.getWidget(),n=i.getPane(),a=i.getBounding(),r=i.getPane().getChart().getChartStore(),o=r.getTooltipStore().getCrosshair(),s=r.getStyles().crosshair;if(Mt(o.paneId)&&this.compare(o,n.getId())&&s.show){var l=this.getDirectionStyles(s),c=l.text;if(l.show&&c.show){var u=n.getAxisComponent(),d=this.getText(o,r,u);t.font=Ht(c.size,c.weight,c.family),null===(e=this.createFigure({name:"text",attrs:this.getTextAttrs(d,t.measureText(d).width,o,a,u,c),styles:c}))||void 0===e||e.draw(t)}}},e.prototype.compare=function(t,e){return t.paneId===e},e.prototype.getDirectionStyles=function(t){return t.horizontal},e.prototype.getText=function(t,e,i){var n,a=i,r=i.convertFromPixel(t.y);if(a.getType()===Y.Percentage){var o=e.getVisibleFirstData();n="".concat(((r-o.close)/o.close*100).toFixed(2),"%")}else{var s=e.getIndicatorStore().getInstances(t.paneId),l=0,c=!1;a.isInCandle()?l=e.getPrecision().price:s.forEach(function(t){l=Math.max(t.precision,l),c||(c=t.shouldFormatBigNumber)}),n=Nt(r,l),c&&(n=e.getCustomApi().formatBigNumber(n))}return Vt(zt(n,e.getThousandsSeparator()),e.getDecimalFoldThreshold())},e.prototype.getTextAttrs=function(t,e,i,n,a,r){var o,s,l=a;return l.isFromZero()?(o=0,s="left"):(o=n.width,s="right"),{x:o,y:i.y,text:t,align:s,baseline:"middle"}},e}(kn),Gn=function(t){function e(e,i){var n=t.call(this,e,i)||this;return n._yAxisView=new Kn(n),n._candleLastPriceLabelView=new Yn(n),n._indicatorLastValueView=new Xn(n),n._overlayYAxisView=new jn(n),n._crosshairHorizontalLabelView=new Un(n),n.getContainer().style.cursor="ns-resize",n.addChild(n._overlayYAxisView),n}return L(e,t),e.prototype.getName=function(){return Gi.Y_AXIS},e.prototype.updateMain=function(t){this._yAxisView.draw(t),this.getPane().getAxisComponent().isInCandle()&&this._candleLastPriceLabelView.draw(t),this._indicatorLastValueView.draw(t)},e.prototype.updateOverlay=function(t){this._overlayYAxisView.draw(t),this._crosshairHorizontalLabelView.draw(t)},e}(en),Zn=function(){function t(t){this._range={from:0,to:0,range:0,realFrom:0,realTo:0,realRange:0},this._prevRange={from:0,to:0,range:0,realFrom:0,realTo:0,realRange:0},this._ticks=[],this._autoCalcTickFlag=!0,this._parent=t}return t.prototype.getParent=function(){return this._parent},t.prototype.buildTicks=function(t){if(this._autoCalcTickFlag&&(this._range=this.calcRange()),this._prevRange.from!==this._range.from||this._prevRange.to!==this._range.to||t){this._prevRange=this._range;var e=this.optimalTicks(this._calcTicks());return this._ticks=this.createTicks({range:this._range,bounding:this.getSelfBounding(),defaultTicks:e}),!0}return!1},t.prototype.getTicks=function(){return this._ticks},t.prototype.getScrollZoomEnabled=function(){var t;return null===(t=this.getParent().getOptions().axisOptions.scrollZoomEnabled)||void 0===t||t},t.prototype.setRange=function(t){this._autoCalcTickFlag=!1,this._range=t},t.prototype.getRange=function(){return this._range},t.prototype.setAutoCalcTickFlag=function(t){this._autoCalcTickFlag=t},t.prototype.getAutoCalcTickFlag=function(){return this._autoCalcTickFlag},t.prototype._calcTicks=function(){var t=this._range,e=t.realFrom,i=t.realTo,n=t.realRange,a=[];if(n>=0){var r=Z(this._calcTickInterval(n),2),o=r[0],s=r[1],l=fe(Math.ceil(e/o)*o,s),c=fe(Math.floor(i/o)*o,s),u=0,d=l;if(0!==o)while(d<=c){var h=d.toFixed(s);a[u]={text:h,coord:0,value:h},++u,d+=o}}return a},t.prototype._calcTickInterval=function(t){var e=ve(t/8),i=ge(e);return[e,i]},t}(),qn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return L(e,t),e.prototype.calcRange=function(){var t,e,i,n,a=this.getParent(),r=a.getChart(),o=r.getChartStore(),s=Number.MAX_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER,c=[],u=!1,d=Number.MAX_SAFE_INTEGER,h=Number.MIN_SAFE_INTEGER,p=Number.MAX_SAFE_INTEGER,v=o.getIndicatorStore().getInstances(a.getId());v.forEach(function(t){var e,i,n;u||(u=null!==(e=t.shouldOhlc)&&void 0!==e&&e),p=Math.min(p,t.precision),Et(t.minValue)&&(d=Math.min(d,t.minValue)),Et(t.maxValue)&&(h=Math.max(h,t.maxValue)),c.push({figures:null!==(i=t.figures)&&void 0!==i?i:[],result:null!==(n=t.result)&&void 0!==n?n:[]})});var f=4,g=this.isInCandle();if(g){var m=o.getPrecision().price;f=p!==Number.MAX_SAFE_INTEGER?Math.min(p,m):m}else p!==Number.MAX_SAFE_INTEGER&&(f=p);var y=o.getVisibleDataList(),_=r.getStyles().candle,b=_.type===$.Area,x=_.area.value,w=g&&!b||!g&&u;y.forEach(function(t){var e=t.dataIndex,i=t.data;if(At(i)&&(w&&(s=Math.min(s,i.low),l=Math.max(l,i.high)),g&&b)){var n=i[x];Et(n)&&(s=Math.min(s,n),l=Math.max(l,n))}c.forEach(function(t){var i,n=t.figures,a=t.result,r=null!==(i=a[e])&&void 0!==i?i:{};n.forEach(function(t){var e=r[t.key];Et(e)&&(s=Math.min(s,e),l=Math.max(l,e))})})}),s!==Number.MAX_SAFE_INTEGER&&l!==Number.MIN_SAFE_INTEGER?(s=Math.min(d,s),l=Math.max(h,l)):(s=0,l=10);var S,C=this.getType();switch(C){case Y.Percentage:var k=o.getVisibleFirstData();At(k)&&Et(k.close)&&(s=(s-k.close)/k.close*100,l=(l-k.close)/k.close*100),S=Math.pow(10,-2);break;case Y.Log:s=ye(s),l=ye(l),S=.05*_e(-f);break;default:S=_e(-f)}if(s===l||Math.abs(s-l)<S){var I=d===s,E=h===l;s=I?s:E?s-8*S:s-4*S,l=E?l:I?l+8*S:l+4*S}var A=null!==(e=null===(t=this.getParent().getYAxisWidget())||void 0===t?void 0:t.getBounding().height)&&void 0!==e?e:0,P=a.getOptions().gap,M=null!==(i=null===P||void 0===P?void 0:P.top)&&void 0!==i?i:.2;M>=1&&(M/=A);var D=null!==(n=null===P||void 0===P?void 0:P.bottom)&&void 0!==n?n:.1;D>=1&&(D/=A);var T,B,F,R=Math.abs(l-s);return s-=R*D,l+=R*M,R=Math.abs(l-s),C===Y.Log?(T=_e(s),B=_e(l),F=Math.abs(B-T)):(T=s,B=l,F=R),{from:s,to:l,range:R,realFrom:T,realTo:B,realRange:F}},e.prototype._innerConvertToPixel=function(t){var e,i,n=null!==(i=null===(e=this.getParent().getYAxisWidget())||void 0===e?void 0:e.getBounding().height)&&void 0!==i?i:0,a=this.getRange(),r=a.from,o=a.range,s=(t-r)/o;return this.isReverse()?Math.round(s*n):Math.round((1-s)*n)},e.prototype.isInCandle=function(){return this.getParent().getId()===Wi.CANDLE},e.prototype.getType=function(){return this.isInCandle()?this.getParent().getChart().getStyles().yAxis.type:Y.Normal},e.prototype.getPosition=function(){return this.getParent().getChart().getStyles().yAxis.position},e.prototype.isReverse=function(){return!!this.isInCandle()&&this.getParent().getChart().getStyles().yAxis.reverse},e.prototype.isFromZero=function(){var t=this.getParent().getChart().getStyles().yAxis,e=t.inside;return t.position===K.Left&&e||t.position===K.Right&&!e},e.prototype.optimalTicks=function(t){var e,i,n=this,a=this.getParent(),r=null!==(i=null===(e=a.getYAxisWidget())||void 0===e?void 0:e.getBounding().height)&&void 0!==i?i:0,o=a.getChart().getChartStore(),s=o.getCustomApi(),l=[],c=this.getType(),u=o.getIndicatorStore().getInstances(a.getId()),d=o.getThousandsSeparator(),h=o.getDecimalFoldThreshold(),p=0,v=!1;this.isInCandle()?p=o.getPrecision().price:u.forEach(function(t){p=Math.max(p,t.precision),v||(v=t.shouldFormatBigNumber)});var f,g=o.getStyles().xAxis.tickText.size;return t.forEach(function(t){var e,i=t.value,a=n._innerConvertToPixel(+i);switch(c){case Y.Percentage:e="".concat(Nt(i,2),"%");break;case Y.Log:a=n._innerConvertToPixel(ye(+i)),e=Nt(i,p);break;default:e=Nt(i,p),v&&(e=s.formatBigNumber(i));break}e=Vt(zt(e,d),h);var o=Et(f);a>g&&a<r-g&&(o&&Math.abs(f-a)>2*g||!o)&&(l.push({text:e,coord:a,value:i}),f=a)}),l},e.prototype.getAutoSize=function(){var t=this.getParent(),e=t.getChart(),i=e.getStyles(),n=i.yAxis,a=n.size;if("auto"!==a)return a;var r=e.getChartStore(),o=r.getCustomApi(),s=0;if(n.show&&(n.axisLine.show&&(s+=n.axisLine.size),n.tickLine.show&&(s+=n.tickLine.length),n.tickText.show)){var l=0;this.getTicks().forEach(function(t){l=Math.max(l,$t(t.text,n.tickText.size,n.tickText.weight,n.tickText.family))}),s+=n.tickText.marginStart+n.tickText.marginEnd+l}var c=i.crosshair,u=0;if(c.show&&c.horizontal.show&&c.horizontal.text.show){var d=r.getIndicatorStore().getInstances(t.getId()),h=0,p=!1;d.forEach(function(t){h=Math.max(t.precision,h),p||(p=t.shouldFormatBigNumber)});var v=2;if(this.getType()!==Y.Percentage)if(this.isInCandle()){var f=r.getPrecision().price,g=i.indicator.lastValueMark;v=g.show&&g.text.show?Math.max(h,f):f}else v=h;var m=Nt(this.getRange().to,v);p&&(m=o.formatBigNumber(m)),m=Vt(m,r.getDecimalFoldThreshold()),u+=c.horizontal.text.paddingLeft+c.horizontal.text.paddingRight+2*c.horizontal.text.borderSize+$t(m,c.horizontal.text.size,c.horizontal.text.weight,c.horizontal.text.family)}return Math.max(s,u)},e.prototype.getSelfBounding=function(){return this.getParent().getYAxisWidget().getBounding()},e.prototype.convertFromPixel=function(t){var e,i,n=null!==(i=null===(e=this.getParent().getYAxisWidget())||void 0===e?void 0:e.getBounding().height)&&void 0!==i?i:0,a=this.getRange(),r=a.from,o=a.range,s=this.isReverse()?t/n:1-t/n,l=s*o+r;switch(this.getType()){case Y.Percentage:var c=this.getParent().getChart().getChartStore().getVisibleFirstData();return At(c)&&Et(c.close)?c.close*l/100+c.close:0;case Y.Log:return _e(l);default:return l}},e.prototype.convertToRealValue=function(t){var e=t;return this.getType()===Y.Log&&(e=_e(t)),e},e.prototype.convertToPixel=function(t){var e=t;switch(this.getType()){case Y.Percentage:var i=this.getParent().getChart().getChartStore().getVisibleFirstData();At(i)&&Et(i.close)&&(e=(t-i.close)/i.close*100);break;case Y.Log:e=ye(t);break;default:e=t}return this._innerConvertToPixel(e)},e.prototype.convertToNicePixel=function(t){var e,i,n=null!==(i=null===(e=this.getParent().getYAxisWidget())||void 0===e?void 0:e.getBounding().height)&&void 0!==i?i:0,a=this.convertToPixel(t);return Math.round(Math.max(.05*n,Math.min(a,.98*n)))},e.extend=function(t){var i=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return L(i,e),i.prototype.createTicks=function(e){return t.createTicks(e)},i}(e);return i},e}(Zn),Jn={name:"default",createTicks:function(t){var e=t.defaultTicks;return e}},Qn={default:qn.extend(Jn)};function ta(t){var e;return null!==(e=Qn[t])&&void 0!==e?e:Qn.default}var ea=function(){function t(t,e,i,n){this._bounding=Qi(),this._chart=i,this._id=n,this._init(t,e)}return t.prototype._init=function(t,e){this._rootContainer=t,this._container=he("div",{width:"100%",margin:"0",padding:"0",position:"relative",overflow:"hidden",boxSizing:"border-box"}),null!==e?t.insertBefore(this._container,e):t.appendChild(this._container)},t.prototype.getContainer=function(){return this._container},t.prototype.getId=function(){return this._id},t.prototype.getChart=function(){return this._chart},t.prototype.getBounding=function(){return this._bounding},t.prototype.update=function(t){this._bounding.height!==this._container.clientHeight&&(this._container.style.height="".concat(this._bounding.height,"px")),this.updateImp(null!==t&&void 0!==t?t:3,this._container,this._bounding)},t.prototype.destroy=function(){this._rootContainer.removeChild(this._container)},t}(),ia=function(t){function e(e,i,n,a,r){var o=t.call(this,e,i,n,a)||this;o._yAxisWidget=null,o._options={minHeight:zi,dragEnabled:!0,gap:{top:.2,bottom:.1},axisOptions:{name:"default",scrollZoomEnabled:!0}};var s=o.getContainer();return o._mainWidget=o.createMainWidget(s),o._yAxisWidget=o.createYAxisWidget(s),o.setOptions(r),o}return L(e,t),e.prototype.setOptions=function(t){var e,i,n,a,r,o=null===(e=t.axisOptions)||void 0===e?void 0:e.name;return(this._options.axisOptions.name!==o&&Mt(o)||!At(this._axis))&&(this._axis=this.createAxisComponent(null!==o&&void 0!==o?o:"default")),wt(this._options,t),this.getId()===Wi.X_AXIS?(a=this.getMainWidget().getContainer(),r="ew-resize"):(a=this.getYAxisWidget().getContainer(),r="ns-resize"),null===(n=null===(i=t.axisOptions)||void 0===i?void 0:i.scrollZoomEnabled)||void 0===n||n?a.style.cursor=r:a.style.cursor="default",this},e.prototype.getOptions=function(){return this._options},e.prototype.getAxisComponent=function(){return this._axis},e.prototype.setBounding=function(t,e,i){var n,a;wt(this.getBounding(),t);var r={};return At(t.height)&&(r.height=t.height),At(t.top)&&(r.top=t.top),this._mainWidget.setBounding(r),null===(n=this._yAxisWidget)||void 0===n||n.setBounding(r),At(e)&&this._mainWidget.setBounding(e),At(i)&&(null===(a=this._yAxisWidget)||void 0===a||a.setBounding(i)),this},e.prototype.getMainWidget=function(){return this._mainWidget},e.prototype.getYAxisWidget=function(){return this._yAxisWidget},e.prototype.updateImp=function(t){var e;this._mainWidget.update(t),null===(e=this._yAxisWidget)||void 0===e||e.update(t)},e.prototype.destroy=function(){var e;t.prototype.destroy.call(this),this._mainWidget.destroy(),null===(e=this._yAxisWidget)||void 0===e||e.destroy()},e.prototype.getImage=function(t){var e=this.getBounding(),i=e.width,n=e.height,a=he("canvas",{width:"".concat(i,"px"),height:"".concat(n,"px"),boxSizing:"border-box"}),r=a.getContext("2d"),o=Wt(a);a.width=i*o,a.height=n*o,r.scale(o,o);var s=this._mainWidget.getBounding();if(r.drawImage(this._mainWidget.getImage(t),s.left,0,s.width,s.height),null!==this._yAxisWidget){var l=this._yAxisWidget.getBounding();r.drawImage(this._yAxisWidget.getImage(t),l.left,0,l.width,l.height)}return a},e.prototype.createYAxisWidget=function(t){return null},e}(ea),na=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return L(e,t),e.prototype.createAxisComponent=function(t){var e=ta(null!==t&&void 0!==t?t:"default");return new e(this)},e.prototype.createMainWidget=function(t){return new Bn(t,this)},e.prototype.createYAxisWidget=function(t){return new Gn(t,this)},e}(ia),aa=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return L(e,t),e.prototype.createMainWidget=function(t){return new Hn(t,this)},e}(na),ra=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return L(e,t),e.prototype.getAxisStyles=function(t){return t.xAxis},e.prototype.createAxisLine=function(t){return{coordinates:[{x:0,y:0},{x:t.width,y:0}]}},e.prototype.createTickLines=function(t,e,i){var n=i.tickLine,a=i.axisLine.size;return t.map(function(t){return{coordinates:[{x:t.coord,y:0},{x:t.coord,y:a+n.length}]}})},e.prototype.createTickTexts=function(t,e,i){var n=i.tickText,a=i.axisLine.size,r=i.tickLine.length;return t.map(function(t){return{x:t.coord,y:a+r+n.marginStart,text:t.text,align:"center",baseline:"top"}})},e}($n),oa=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return L(e,t),e.prototype.coordinateToPointTimestampDataIndexFlag=function(){return!0},e.prototype.coordinateToPointValueFlag=function(){return!1},e.prototype.getCompleteOverlays=function(t){return t.getInstances()},e.prototype.getProgressOverlay=function(t){return t.instance},e.prototype.getDefaultFigures=function(t,e,i,n,a,r,o,s,l,c,u){var d,h=[];if(t.needDefaultXAxisFigure&&t.id===(null===(d=u.instance)||void 0===d?void 0:d.id)){var p=Number.MAX_SAFE_INTEGER,v=Number.MIN_SAFE_INTEGER;e.forEach(function(e,i){p=Math.min(p,e.x),v=Math.max(v,e.x);var n=t.points[i];if(Et(n.timestamp)){var o=r.formatDate(a,n.timestamp,"YYYY-MM-DD HH:mm",qt.Crosshair);h.push({type:"text",attrs:{x:e.x,y:0,text:o,align:"center"},ignoreEvent:!0})}}),e.length>1&&h.unshift({type:"rect",attrs:{x:p,y:0,width:v-p,height:i.height},ignoreEvent:!0})}return h},e.prototype.getFigures=function(t,e,i,n,a,r,o,s,l,c,u){var d,h;return null!==(h=null===(d=t.createXAxisFigures)||void 0===d?void 0:d.call(t,{overlay:t,coordinates:e,bounding:i,barSpace:n,precision:a,thousandsSeparator:r,decimalFoldThreshold:o,dateTimeFormat:s,defaultStyles:l,xAxis:c,yAxis:u}))&&void 0!==h?h:[]},e}(jn),sa=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return L(e,t),e.prototype.compare=function(t){return At(t.kLineData)&&t.dataIndex===t.realDataIndex},e.prototype.getDirectionStyles=function(t){return t.vertical},e.prototype.getText=function(t,e){var i,n=null===(i=t.kLineData)||void 0===i?void 0:i.timestamp;return e.getCustomApi().formatDate(e.getTimeScaleStore().getDateTimeFormat(),n,"YYYY-MM-DD HH:mm",qt.Crosshair)},e.prototype.getTextAttrs=function(t,e,i,n,a,r){var o,s=i.realX,l="center";return s-e/2-r.paddingLeft<0?(o=0,l="left"):s+e/2+r.paddingRight>n.width?(o=n.width,l="right"):o=s,{x:o,y:0,text:t,align:l,baseline:"top"}},e}(Un),la=function(t){function e(e,i){var n=t.call(this,e,i)||this;return n._xAxisView=new ra(n),n._overlayXAxisView=new oa(n),n._crosshairVerticalLabelView=new sa(n),n.getContainer().style.cursor="ew-resize",n.addChild(n._overlayXAxisView),n}return L(e,t),e.prototype.getName=function(){return Gi.X_AXIS},e.prototype.updateMain=function(t){this._xAxisView.draw(t)},e.prototype.updateOverlay=function(t){this._overlayXAxisView.draw(t),this._crosshairVerticalLabelView.draw(t)},e}(en),ca=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return L(e,t),e.prototype.calcRange=function(){var t=this.getParent().getChart().getChartStore(),e=t.getTimeScaleStore().getVisibleRange(),i=e.from,n=e.to,a=i,r=n-1,o=n-i;return{from:a,to:r,range:o,realFrom:a,realTo:r,realRange:o}},e.prototype.optimalTicks=function(t){var e,i,n=this.getParent().getChart(),a=n.getChartStore(),r=a.getCustomApi().formatDate,o=[],s=t.length,l=a.getDataList();if(s>0){var c=a.getTimeScaleStore().getDateTimeFormat(),u=n.getStyles().xAxis.tickText,d=$t("00-00 00:00",u.size,u.weight,u.family),h=parseInt(t[0].value,10),p=this.convertToPixel(h),v=1;if(s>1){var f=parseInt(t[1].value,10),g=this.convertToPixel(f),m=Math.abs(g-p);m<d&&(v=Math.ceil(d/m))}for(var y=0;y<s;y+=v){var _=parseInt(t[y].value,10),b=l[_],x=b.timestamp,w=r(c,x,"HH:mm",qt.XAxis);if(0!==y){var S=parseInt(t[y-v].value,10),C=l[S],k=C.timestamp;w=null!==(e=this._optimalTickLabel(r,c,x,k))&&void 0!==e?e:w}var I=this.convertToPixel(_);o.push({text:w,coord:I,value:x})}var E=o.length;if(1===E)o[0].text=r(c,o[0].value,"YYYY-MM-DD HH:mm",qt.XAxis);else{var A=o[0].value,P=o[1].value;if(At(o[2])){var M=o[2].text;/^[0-9]{2}-[0-9]{2}$/.test(M)?o[0].text=r(c,A,"MM-DD",qt.XAxis):/^[0-9]{4}-[0-9]{2}$/.test(M)?o[0].text=r(c,A,"YYYY-MM",qt.XAxis):/^[0-9]{4}$/.test(M)&&(o[0].text=r(c,A,"YYYY",qt.XAxis))}else o[0].text=null!==(i=this._optimalTickLabel(r,c,A,P))&&void 0!==i?i:o[0].text}}return o},e.prototype._optimalTickLabel=function(t,e,i,n){var a=t(e,i,"YYYY",qt.XAxis),r=t(e,i,"YYYY-MM",qt.XAxis),o=t(e,i,"MM-DD",qt.XAxis);return a!==t(e,n,"YYYY",qt.XAxis)?a:r!==t(e,n,"YYYY-MM",qt.XAxis)?r:o!==t(e,n,"MM-DD",qt.XAxis)?o:null},e.prototype.getAutoSize=function(){var t=this.getParent().getChart().getStyles(),e=t.xAxis,i=e.size;if("auto"!==i)return i;var n=t.crosshair,a=0;e.show&&(e.axisLine.show&&(a+=e.axisLine.size),e.tickLine.show&&(a+=e.tickLine.length),e.tickText.show&&(a+=e.tickText.marginStart+e.tickText.marginEnd+e.tickText.size));var r=0;return n.show&&n.vertical.show&&n.vertical.text.show&&(r+=n.vertical.text.paddingTop+n.vertical.text.paddingBottom+2*n.vertical.text.borderSize+n.vertical.text.size),Math.max(a,r)},e.prototype.getSelfBounding=function(){return this.getParent().getMainWidget().getBounding()},e.prototype.convertTimestampFromPixel=function(t){var e=this.getParent().getChart().getChartStore().getTimeScaleStore(),i=e.coordinateToDataIndex(t);return e.dataIndexToTimestamp(i)},e.prototype.convertTimestampToPixel=function(t){var e=this.getParent().getChart().getChartStore().getTimeScaleStore(),i=e.timestampToDataIndex(t);return e.dataIndexToCoordinate(i)},e.prototype.convertFromPixel=function(t){return this.getParent().getChart().getChartStore().getTimeScaleStore().coordinateToDataIndex(t)},e.prototype.convertToPixel=function(t){return this.getParent().getChart().getChartStore().getTimeScaleStore().dataIndexToCoordinate(t)},e.extend=function(t){var i=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return L(i,e),i.prototype.createTicks=function(e){return t.createTicks(e)},i}(e);return i},e}(Zn),ua={name:"default",createTicks:function(t){var e=t.defaultTicks;return e}},da={default:ca.extend(ua)};function ha(t){var e;return null!==(e=da[t])&&void 0!==e?e:da.default}var pa=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return L(e,t),e.prototype.createAxisComponent=function(t){var e=ha(t);return new e(this)},e.prototype.createMainWidget=function(t){return new la(t,this)},e}(ia);function va(t,e){var i=0;return function(){var n=Date.now();n-i>e&&(t.apply(this,arguments),i=n)}}var fa=function(t){function e(e,i){var n=t.call(this,e,i)||this;return n._dragFlag=!1,n._dragStartY=0,n._topPaneHeight=0,n._bottomPaneHeight=0,n._pressedMouseMoveEvent=va(n._pressedTouchMouseMoveEvent,20),n.registerEvent("touchStartEvent",n._mouseDownEvent.bind(n)).registerEvent("touchMoveEvent",n._pressedMouseMoveEvent.bind(n)).registerEvent("touchEndEvent",n._mouseUpEvent.bind(n)).registerEvent("mouseDownEvent",n._mouseDownEvent.bind(n)).registerEvent("mouseUpEvent",n._mouseUpEvent.bind(n)).registerEvent("pressedMouseMoveEvent",n._pressedMouseMoveEvent.bind(n)).registerEvent("mouseEnterEvent",n._mouseEnterEvent.bind(n)).registerEvent("mouseLeaveEvent",n._mouseLeaveEvent.bind(n)),n}return L(e,t),e.prototype.getName=function(){return Gi.SEPARATOR},e.prototype.checkEventOn=function(){return!0},e.prototype._mouseDownEvent=function(t){this._dragFlag=!0,this._dragStartY=t.pageY;var e=this.getPane();return this._topPaneHeight=e.getTopPane().getBounding().height,this._bottomPaneHeight=e.getBottomPane().getBounding().height,!0},e.prototype._mouseUpEvent=function(){return this._dragFlag=!1,this._mouseLeaveEvent()},e.prototype._pressedTouchMouseMoveEvent=function(t){var e=t.pageY-this._dragStartY,i=this.getPane(),n=i.getTopPane(),a=i.getBottomPane(),r=e<0;if(null!==n&&(null===a||void 0===a?void 0:a.getOptions().dragEnabled)){var o=void 0,s=void 0,l=void 0,c=void 0;r?(o=n,s=a,l=this._topPaneHeight,c=this._bottomPaneHeight):(o=a,s=n,l=this._bottomPaneHeight,c=this._topPaneHeight);var u=o.getOptions().minHeight;if(l>u){var d=Math.max(l-Math.abs(e),u),h=l-d;o.setBounding({height:d}),s.setBounding({height:c+h});var p=i.getChart();p.getChartStore().getActionStore().execute(Tt.OnPaneDrag,{paneId:i.getId()}),p.adjustPaneViewport(!0,!0,!0,!0,!0)}}return!0},e.prototype._mouseEnterEvent=function(){var t,e=this.getPane(),i=e.getBottomPane();if(null!==(t=null===i||void 0===i?void 0:i.getOptions().dragEnabled)&&void 0!==t&&t){var n=e.getChart(),a=n.getStyles().separator;return this.getContainer().style.background=a.activeBackgroundColor,!0}return!1},e.prototype._mouseLeaveEvent=function(){return!this._dragFlag&&(this.getContainer().style.background="",!0)},e.prototype.createContainer=function(){return he("div",{width:"100%",height:"".concat(Zi,"px"),margin:"0",padding:"0",position:"absolute",top:"-3px",zIndex:"20",boxSizing:"border-box",cursor:"ns-resize"})},e.prototype.updateImp=function(t,e,i){if(4===i||2===i){var n=this.getPane().getChart().getStyles().separator;t.style.top="".concat(-Math.floor((Zi-n.size)/2),"px"),t.style.height="".concat(Zi,"px")}},e}(tn),ga=function(t){function e(e,i,n,a,r,o){var s=t.call(this,e,i,n,a)||this;return s.getContainer().style.overflow="",s._topPane=r,s._bottomPane=o,s._separatorWidget=new fa(s.getContainer(),s),s}return L(e,t),e.prototype.setBounding=function(t){return wt(this.getBounding(),t),this},e.prototype.getTopPane=function(){return this._topPane},e.prototype.setTopPane=function(t){return this._topPane=t,this},e.prototype.getBottomPane=function(){return this._bottomPane},e.prototype.setBottomPane=function(t){return this._bottomPane=t,this},e.prototype.getWidget=function(){return this._separatorWidget},e.prototype.getImage=function(t){var e=this.getBounding(),i=e.width,n=e.height,a=this.getChart().getStyles().separator,r=he("canvas",{width:"".concat(i,"px"),height:"".concat(n,"px"),boxSizing:"border-box"}),o=r.getContext("2d"),s=Wt(r);return r.width=i*s,r.height=n*s,o.scale(s,s),o.fillStyle=a.color,o.fillRect(0,0,i,n),r},e.prototype.updateImp=function(t,e,i){if(4===t||2===t){var n=this.getChart().getStyles().separator;e.style.backgroundColor=n.color,e.style.height="".concat(i.height,"px"),e.style.marginLeft="".concat(i.left,"px"),e.style.width="".concat(i.width,"px"),this._separatorWidget.update(t)}},e}(ea);function ma(){var t;return"undefined"!==typeof window&&(null!==(t=window.navigator.userAgent.toLowerCase().indexOf("firefox"))&&void 0!==t?t:-1)>-1}function ya(){return"undefined"!==typeof window&&/iPhone|iPad|iPod/.test(window.navigator.platform)}var _a,ba=10,xa=function(){function t(t,e,i){var n=this;this._clickCount=0,this._clickTimeoutId=null,this._clickCoordinate={x:Number.NEGATIVE_INFINITY,y:Number.POSITIVE_INFINITY},this._tapCount=0,this._tapTimeoutId=null,this._tapCoordinate={x:Number.NEGATIVE_INFINITY,y:Number.POSITIVE_INFINITY},this._longTapTimeoutId=null,this._longTapActive=!1,this._mouseMoveStartCoordinate=null,this._touchMoveStartCoordinate=null,this._touchMoveExceededManhattanDistance=!1,this._cancelClick=!1,this._cancelTap=!1,this._unsubscribeOutsideMouseEvents=null,this._unsubscribeOutsideTouchEvents=null,this._unsubscribeMobileSafariEvents=null,this._unsubscribeMousemove=null,this._unsubscribeMouseWheel=null,this._unsubscribeContextMenu=null,this._unsubscribeRootMouseEvents=null,this._unsubscribeRootTouchEvents=null,this._startPinchMiddleCoordinate=null,this._startPinchDistance=0,this._pinchPrevented=!1,this._preventTouchDragProcess=!1,this._mousePressed=!1,this._lastTouchEventTimeStamp=0,this._activeTouchId=null,this._acceptMouseLeave=!ya(),this._onFirefoxOutsideMouseUp=function(t){n._mouseUpHandler(t)},this._onMobileSafariDoubleClick=function(t){if(n._firesTouchEvents(t)){if(++n._tapCount,null!==n._tapTimeoutId&&n._tapCount>1){var e=n._mouseTouchMoveWithDownInfo(n._getCoordinate(t),n._tapCoordinate).manhattanDistance;e<30&&!n._cancelTap&&n._processEvent(n._makeCompatEvent(t),n._handler.doubleTapEvent),n._resetTapTimeout()}}else if(++n._clickCount,null!==n._clickTimeoutId&&n._clickCount>1){e=n._mouseTouchMoveWithDownInfo(n._getCoordinate(t),n._clickCoordinate).manhattanDistance;e<5&&!n._cancelClick&&n._processEvent(n._makeCompatEvent(t),n._handler.mouseDoubleClickEvent),n._resetClickTimeout()}},this._target=t,this._handler=e,this._options=i,this._init()}return t.prototype.destroy=function(){null!==this._unsubscribeOutsideMouseEvents&&(this._unsubscribeOutsideMouseEvents(),this._unsubscribeOutsideMouseEvents=null),null!==this._unsubscribeOutsideTouchEvents&&(this._unsubscribeOutsideTouchEvents(),this._unsubscribeOutsideTouchEvents=null),null!==this._unsubscribeMousemove&&(this._unsubscribeMousemove(),this._unsubscribeMousemove=null),null!==this._unsubscribeMouseWheel&&(this._unsubscribeMouseWheel(),this._unsubscribeMouseWheel=null),null!==this._unsubscribeContextMenu&&(this._unsubscribeContextMenu(),this._unsubscribeContextMenu=null),null!==this._unsubscribeRootMouseEvents&&(this._unsubscribeRootMouseEvents(),this._unsubscribeRootMouseEvents=null),null!==this._unsubscribeRootTouchEvents&&(this._unsubscribeRootTouchEvents(),this._unsubscribeRootTouchEvents=null),null!==this._unsubscribeMobileSafariEvents&&(this._unsubscribeMobileSafariEvents(),this._unsubscribeMobileSafariEvents=null),this._clearLongTapTimeout(),this._resetClickTimeout()},t.prototype._mouseEnterHandler=function(t){var e,i,n,a=this;null===(e=this._unsubscribeMousemove)||void 0===e||e.call(this),null===(i=this._unsubscribeMouseWheel)||void 0===i||i.call(this),null===(n=this._unsubscribeContextMenu)||void 0===n||n.call(this);var r=this._mouseMoveHandler.bind(this);this._unsubscribeMousemove=function(){a._target.removeEventListener("mousemove",r)},this._target.addEventListener("mousemove",r);var o=this._mouseWheelHandler.bind(this);this._unsubscribeMouseWheel=function(){a._target.removeEventListener("wheel",o)},this._target.addEventListener("wheel",o,{passive:!1});var s=this._contextMenuHandler.bind(this);this._unsubscribeContextMenu=function(){a._target.removeEventListener("contextmenu",s)},this._target.addEventListener("contextmenu",s,{passive:!1}),this._firesTouchEvents(t)||(this._processEvent(this._makeCompatEvent(t),this._handler.mouseEnterEvent),this._acceptMouseLeave=!0)},t.prototype._resetClickTimeout=function(){null!==this._clickTimeoutId&&clearTimeout(this._clickTimeoutId),this._clickCount=0,this._clickTimeoutId=null,this._clickCoordinate={x:Number.NEGATIVE_INFINITY,y:Number.POSITIVE_INFINITY}},t.prototype._resetTapTimeout=function(){null!==this._tapTimeoutId&&clearTimeout(this._tapTimeoutId),this._tapCount=0,this._tapTimeoutId=null,this._tapCoordinate={x:Number.NEGATIVE_INFINITY,y:Number.POSITIVE_INFINITY}},t.prototype._mouseMoveHandler=function(t){this._mousePressed||null!==this._touchMoveStartCoordinate||this._firesTouchEvents(t)||(this._processEvent(this._makeCompatEvent(t),this._handler.mouseMoveEvent),this._acceptMouseLeave=!0)},t.prototype._mouseWheelHandler=function(t){if(Math.abs(t.deltaX)>Math.abs(t.deltaY)){if(!At(this._handler.mouseWheelHortEvent))return;if(this._preventDefault(t),0===Math.abs(t.deltaX))return;this._handler.mouseWheelHortEvent(this._makeCompatEvent(t),-t.deltaX)}else{if(!At(this._handler.mouseWheelVertEvent))return;var e=-t.deltaY/100;if(0===e)return;switch(this._preventDefault(t),t.deltaMode){case t.DOM_DELTA_PAGE:e*=120;break;case t.DOM_DELTA_LINE:e*=32;break}if(0!==e){var i=Math.sign(e)*Math.min(1,Math.abs(e));this._handler.mouseWheelVertEvent(this._makeCompatEvent(t),i)}}},t.prototype._contextMenuHandler=function(t){this._preventDefault(t)},t.prototype._touchMoveHandler=function(t){var e=this._touchWithId(t.changedTouches,this._activeTouchId);if(null!==e&&(this._lastTouchEventTimeStamp=this._eventTimeStamp(t),null===this._startPinchMiddleCoordinate&&!this._preventTouchDragProcess)){this._pinchPrevented=!0;var i=this._mouseTouchMoveWithDownInfo(this._getCoordinate(e),this._touchMoveStartCoordinate),n=i.xOffset,a=i.yOffset,r=i.manhattanDistance;if(this._touchMoveExceededManhattanDistance||!(r<5)){if(!this._touchMoveExceededManhattanDistance){var o=.5*n,s=a>=o&&!this._options.treatVertDragAsPageScroll(),l=o>a&&!this._options.treatHorzDragAsPageScroll();s||l||(this._preventTouchDragProcess=!0),this._touchMoveExceededManhattanDistance=!0,this._cancelTap=!0,this._clearLongTapTimeout(),this._resetTapTimeout()}this._preventTouchDragProcess||this._processEvent(this._makeCompatEvent(t,e),this._handler.touchMoveEvent)}}},t.prototype._mouseMoveWithDownHandler=function(t){if(0===t.button){var e=this._mouseTouchMoveWithDownInfo(this._getCoordinate(t),this._mouseMoveStartCoordinate),i=e.manhattanDistance;i>=5&&(this._cancelClick=!0,this._resetClickTimeout()),this._cancelClick&&this._processEvent(this._makeCompatEvent(t),this._handler.pressedMouseMoveEvent)}},t.prototype._mouseTouchMoveWithDownInfo=function(t,e){var i=Math.abs(e.x-t.x),n=Math.abs(e.y-t.y),a=i+n;return{xOffset:i,yOffset:n,manhattanDistance:a}},t.prototype._touchEndHandler=function(t){var e=this._touchWithId(t.changedTouches,this._activeTouchId);if(null===e&&0===t.touches.length&&(e=t.changedTouches[0]),null!==e){this._activeTouchId=null,this._lastTouchEventTimeStamp=this._eventTimeStamp(t),this._clearLongTapTimeout(),this._touchMoveStartCoordinate=null,null!==this._unsubscribeRootTouchEvents&&(this._unsubscribeRootTouchEvents(),this._unsubscribeRootTouchEvents=null);var i=this._makeCompatEvent(t,e);if(this._processEvent(i,this._handler.touchEndEvent),++this._tapCount,null!==this._tapTimeoutId&&this._tapCount>1){var n=this._mouseTouchMoveWithDownInfo(this._getCoordinate(e),this._tapCoordinate).manhattanDistance;n<30&&!this._cancelTap&&this._processEvent(i,this._handler.doubleTapEvent),this._resetTapTimeout()}else this._cancelTap||(this._processEvent(i,this._handler.tapEvent),At(this._handler.tapEvent)&&this._preventDefault(t));0===this._tapCount&&this._preventDefault(t),0===t.touches.length&&this._longTapActive&&(this._longTapActive=!1,this._preventDefault(t))}},t.prototype._mouseUpHandler=function(t){if(0===t.button){var e=this._makeCompatEvent(t);if(this._mouseMoveStartCoordinate=null,this._mousePressed=!1,null!==this._unsubscribeRootMouseEvents&&(this._unsubscribeRootMouseEvents(),this._unsubscribeRootMouseEvents=null),ma()){var i=this._target.ownerDocument.documentElement;i.removeEventListener("mouseleave",this._onFirefoxOutsideMouseUp)}if(!this._firesTouchEvents(t))if(this._processEvent(e,this._handler.mouseUpEvent),++this._clickCount,null!==this._clickTimeoutId&&this._clickCount>1){var n=this._mouseTouchMoveWithDownInfo(this._getCoordinate(t),this._clickCoordinate).manhattanDistance;n<5&&!this._cancelClick&&this._processEvent(e,this._handler.mouseDoubleClickEvent),this._resetClickTimeout()}else this._cancelClick||this._processEvent(e,this._handler.mouseClickEvent)}},t.prototype._clearLongTapTimeout=function(){null!==this._longTapTimeoutId&&(clearTimeout(this._longTapTimeoutId),this._longTapTimeoutId=null)},t.prototype._touchStartHandler=function(t){if(null===this._activeTouchId){var e=t.changedTouches[0];this._activeTouchId=e.identifier,this._lastTouchEventTimeStamp=this._eventTimeStamp(t);var i=this._target.ownerDocument.documentElement;this._cancelTap=!1,this._touchMoveExceededManhattanDistance=!1,this._preventTouchDragProcess=!1,this._touchMoveStartCoordinate=this._getCoordinate(e),null!==this._unsubscribeRootTouchEvents&&(this._unsubscribeRootTouchEvents(),this._unsubscribeRootTouchEvents=null);var n=this._touchMoveHandler.bind(this),a=this._touchEndHandler.bind(this);this._unsubscribeRootTouchEvents=function(){i.removeEventListener("touchmove",n),i.removeEventListener("touchend",a)},i.addEventListener("touchmove",n,{passive:!1}),i.addEventListener("touchend",a,{passive:!1}),this._clearLongTapTimeout(),this._longTapTimeoutId=setTimeout(this._longTapHandler.bind(this,t),500),this._processEvent(this._makeCompatEvent(t,e),this._handler.touchStartEvent),null===this._tapTimeoutId&&(this._tapCount=0,this._tapTimeoutId=setTimeout(this._resetTapTimeout.bind(this),500),this._tapCoordinate=this._getCoordinate(e))}},t.prototype._mouseDownHandler=function(t){if(2===t.button)return this._preventDefault(t),void this._processEvent(this._makeCompatEvent(t),this._handler.mouseRightClickEvent);if(0===t.button){var e=this._target.ownerDocument.documentElement;ma()&&e.addEventListener("mouseleave",this._onFirefoxOutsideMouseUp),this._cancelClick=!1,this._mouseMoveStartCoordinate=this._getCoordinate(t),null!==this._unsubscribeRootMouseEvents&&(this._unsubscribeRootMouseEvents(),this._unsubscribeRootMouseEvents=null);var i=this._mouseMoveWithDownHandler.bind(this),n=this._mouseUpHandler.bind(this);this._unsubscribeRootMouseEvents=function(){e.removeEventListener("mousemove",i),e.removeEventListener("mouseup",n)},e.addEventListener("mousemove",i),e.addEventListener("mouseup",n),this._mousePressed=!0,this._firesTouchEvents(t)||(this._processEvent(this._makeCompatEvent(t),this._handler.mouseDownEvent),null===this._clickTimeoutId&&(this._clickCount=0,this._clickTimeoutId=setTimeout(this._resetClickTimeout.bind(this),500),this._clickCoordinate=this._getCoordinate(t)))}},t.prototype._init=function(){var t=this;this._target.addEventListener("mouseenter",this._mouseEnterHandler.bind(this)),this._target.addEventListener("touchcancel",this._clearLongTapTimeout.bind(this));var e=this._target.ownerDocument,i=function(e){null!=t._handler.mouseDownOutsideEvent&&(e.composed&&t._target.contains(e.composedPath()[0])||null!==e.target&&t._target.contains(e.target)||t._handler.mouseDownOutsideEvent({x:0,y:0,pageX:0,pageY:0}))};this._unsubscribeOutsideTouchEvents=function(){e.removeEventListener("touchstart",i)},this._unsubscribeOutsideMouseEvents=function(){e.removeEventListener("mousedown",i)},e.addEventListener("mousedown",i),e.addEventListener("touchstart",i,{passive:!0}),ya()&&(this._unsubscribeMobileSafariEvents=function(){t._target.removeEventListener("dblclick",t._onMobileSafariDoubleClick)},this._target.addEventListener("dblclick",this._onMobileSafariDoubleClick)),this._target.addEventListener("mouseleave",this._mouseLeaveHandler.bind(this)),this._target.addEventListener("touchstart",this._touchStartHandler.bind(this),{passive:!0}),this._target.addEventListener("mousedown",function(t){if(1===t.button)return t.preventDefault(),!1}),this._target.addEventListener("mousedown",this._mouseDownHandler.bind(this)),this._initPinch(),this._target.addEventListener("touchmove",function(){},{passive:!1})},t.prototype._initPinch=function(){var t=this;(At(this._handler.pinchStartEvent)||At(this._handler.pinchEvent)||At(this._handler.pinchEndEvent))&&(this._target.addEventListener("touchstart",function(e){t._checkPinchState(e.touches)},{passive:!0}),this._target.addEventListener("touchmove",function(e){if(2===e.touches.length&&null!==t._startPinchMiddleCoordinate&&At(t._handler.pinchEvent)){var i=t._getTouchDistance(e.touches[0],e.touches[1]),n=i/t._startPinchDistance;t._handler.pinchEvent(X(X({},t._startPinchMiddleCoordinate),{pageX:0,pageY:0}),n),t._preventDefault(e)}},{passive:!1}),this._target.addEventListener("touchend",function(e){t._checkPinchState(e.touches)}))},t.prototype._checkPinchState=function(t){1===t.length&&(this._pinchPrevented=!1),2!==t.length||this._pinchPrevented||this._longTapActive?this._stopPinch():this._startPinch(t)},t.prototype._startPinch=function(t){var e,i=null!==(e=this._target.getBoundingClientRect())&&void 0!==e?e:{left:0,top:0};this._startPinchMiddleCoordinate={x:(t[0].clientX-i.left+(t[1].clientX-i.left))/2,y:(t[0].clientY-i.top+(t[1].clientY-i.top))/2},this._startPinchDistance=this._getTouchDistance(t[0],t[1]),At(this._handler.pinchStartEvent)&&this._handler.pinchStartEvent({x:0,y:0,pageX:0,pageY:0}),this._clearLongTapTimeout()},t.prototype._stopPinch=function(){null!==this._startPinchMiddleCoordinate&&(this._startPinchMiddleCoordinate=null,At(this._handler.pinchEndEvent)&&this._handler.pinchEndEvent({x:0,y:0,pageX:0,pageY:0}))},t.prototype._mouseLeaveHandler=function(t){var e,i,n;null===(e=this._unsubscribeMousemove)||void 0===e||e.call(this),null===(i=this._unsubscribeMouseWheel)||void 0===i||i.call(this),null===(n=this._unsubscribeContextMenu)||void 0===n||n.call(this),this._firesTouchEvents(t)||this._acceptMouseLeave&&(this._processEvent(this._makeCompatEvent(t),this._handler.mouseLeaveEvent),this._acceptMouseLeave=!ya())},t.prototype._longTapHandler=function(t){var e=this._touchWithId(t.touches,this._activeTouchId);null!==e&&(this._processEvent(this._makeCompatEvent(t,e),this._handler.longTapEvent),this._cancelTap=!0,this._longTapActive=!0)},t.prototype._firesTouchEvents=function(t){var e;return At(null===(e=t.sourceCapabilities)||void 0===e?void 0:e.firesTouchEvents)?t.sourceCapabilities.firesTouchEvents:this._eventTimeStamp(t)<this._lastTouchEventTimeStamp+500},t.prototype._processEvent=function(t,e){null===e||void 0===e||e.call(this._handler,t)},t.prototype._makeCompatEvent=function(t,e){var i,n=this,a=null!==e&&void 0!==e?e:t,r=null!==(i=this._target.getBoundingClientRect())&&void 0!==i?i:{left:0,top:0};return{x:a.clientX-r.left,y:a.clientY-r.top,pageX:a.pageX,pageY:a.pageY,isTouch:!t.type.startsWith("mouse")&&"contextmenu"!==t.type&&"click"!==t.type&&"wheel"!==t.type,preventDefault:function(){"touchstart"!==t.type&&n._preventDefault(t)}}},t.prototype._getTouchDistance=function(t,e){var i=t.clientX-e.clientX,n=t.clientY-e.clientY;return Math.sqrt(i*i+n*n)},t.prototype._preventDefault=function(t){t.cancelable&&t.preventDefault()},t.prototype._getCoordinate=function(t){return{x:t.pageX,y:t.pageY}},t.prototype._eventTimeStamp=function(t){var e;return null!==(e=t.timeStamp)&&void 0!==e?e:performance.now()},t.prototype._touchWithId=function(t,e){for(var i=0;i<t.length;++i)if(t[i].identifier===e)return t[i];return null},t}(),wa=function(){function t(t,e){var i=this;this._flingStartTime=(new Date).getTime(),this._flingScrollRequestId=null,this._startScrollCoordinate=null,this._touchCoordinate=null,this._touchCancelCrosshair=!1,this._touchZoomed=!1,this._pinchScale=1,this._mouseDownWidget=null,this._prevYAxisRange=null,this._xAxisStartScaleCoordinate=null,this._xAxisStartScaleDistance=0,this._xAxisScale=1,this._yAxisStartScaleDistance=0,this._mouseMoveTriggerWidgetInfo={pane:null,widget:null},this._boundKeyBoardDownEvent=function(t){if(t.shiftKey)switch(t.code){case"Equal":i._chart.getChartStore().getTimeScaleStore().zoom(.5);break;case"Minus":i._chart.getChartStore().getTimeScaleStore().zoom(-.5);break;case"ArrowLeft":var e=i._chart.getChartStore().getTimeScaleStore();e.startScroll(),e.scroll(-3*e.getBarSpace().bar);break;case"ArrowRight":e=i._chart.getChartStore().getTimeScaleStore();e.startScroll(),e.scroll(3*e.getBarSpace().bar);break}},this._container=t,this._chart=e,this._event=new xa(t,this,{treatVertDragAsPageScroll:function(){return!1},treatHorzDragAsPageScroll:function(){return!1}}),t.addEventListener("keydown",this._boundKeyBoardDownEvent)}return t.prototype.pinchStartEvent=function(){return this._touchZoomed=!0,this._pinchScale=1,!0},t.prototype.pinchEvent=function(t,e){var i=this._findWidgetByEvent(t),n=i.pane,a=i.widget;if((null===n||void 0===n?void 0:n.getId())!==Wi.X_AXIS&&(null===a||void 0===a?void 0:a.getName())===Gi.MAIN){var r=this._makeWidgetEvent(t,a),o=5*(e-this._pinchScale);return this._pinchScale=e,this._chart.getChartStore().getTimeScaleStore().zoom(o,{x:r.x,y:r.y}),!0}return!1},t.prototype.mouseWheelHortEvent=function(t,e){var i=this._chart.getChartStore().getTimeScaleStore();return i.startScroll(),i.scroll(e),!0},t.prototype.mouseWheelVertEvent=function(t,e){var i=this._findWidgetByEvent(t).widget,n=this._makeWidgetEvent(t,i),a=null===i||void 0===i?void 0:i.getName();return a===Gi.MAIN&&(this._chart.getChartStore().getTimeScaleStore().zoom(e,{x:n.x,y:n.y}),!0)},t.prototype.mouseDownEvent=function(t){var e,i,n=this._findWidgetByEvent(t),a=n.pane,r=n.widget;if(this._mouseDownWidget=r,null!==r){var o=this._makeWidgetEvent(t,r),s=r.getName();switch(s){case Gi.SEPARATOR:return r.dispatchEvent("mouseDownEvent",o);case Gi.MAIN:var l=null!==(e=a.getAxisComponent().getRange())&&void 0!==e?e:null;return this._prevYAxisRange=null===l?l:X({},l),this._startScrollCoordinate={x:o.x,y:o.y},this._chart.getChartStore().getTimeScaleStore().startScroll(),r.dispatchEvent("mouseDownEvent",o);case Gi.X_AXIS:var c=r.dispatchEvent("mouseDownEvent",o);return c&&this._chart.updatePane(1),this._xAxisStartScaleCoordinate={x:o.x,y:o.y},this._xAxisStartScaleDistance=o.pageX,c;case Gi.Y_AXIS:c=r.dispatchEvent("mouseDownEvent",o);c&&this._chart.updatePane(1);l=null!==(i=a.getAxisComponent().getRange())&&void 0!==i?i:null;return this._prevYAxisRange=null===l?l:X({},l),this._yAxisStartScaleDistance=o.pageY,c}}return!1},t.prototype.mouseMoveEvent=function(t){var e,i,n,a=this._findWidgetByEvent(t),r=a.pane,o=a.widget,s=this._makeWidgetEvent(t,o);if((null===(e=this._mouseMoveTriggerWidgetInfo.pane)||void 0===e?void 0:e.getId())===(null===r||void 0===r?void 0:r.getId())&&(null===(i=this._mouseMoveTriggerWidgetInfo.widget)||void 0===i?void 0:i.getName())===(null===o||void 0===o?void 0:o.getName())||(null===o||void 0===o||o.dispatchEvent("mouseEnterEvent",s),null===(n=this._mouseMoveTriggerWidgetInfo.widget)||void 0===n||n.dispatchEvent("mouseLeaveEvent",s),this._mouseMoveTriggerWidgetInfo={pane:r,widget:o}),null!==o){var l=o.getName();switch(l){case Gi.MAIN:var c=o.dispatchEvent("mouseMoveEvent",s),u=this._chart.getChartStore(),d={x:s.x,y:s.y,paneId:null===r||void 0===r?void 0:r.getId()};return c&&null!==u.getTooltipStore().getActiveIcon()&&(d=void 0,null!==o&&(o.getContainer().style.cursor="pointer")),this._chart.getChartStore().getTooltipStore().setCrosshair(d),c;case Gi.SEPARATOR:case Gi.X_AXIS:case Gi.Y_AXIS:c=o.dispatchEvent("mouseMoveEvent",s);return this._chart.getChartStore().getTooltipStore().setCrosshair(),c}}return!1},t.prototype.pressedMouseMoveEvent=function(t){var e,i,n,a,r;if(null!==this._mouseDownWidget&&this._mouseDownWidget.getName()===Gi.SEPARATOR)return this._mouseDownWidget.dispatchEvent("pressedMouseMoveEvent",t);var o=this._findWidgetByEvent(t),s=o.pane,l=o.widget;if(null!==l&&(null===(e=this._mouseDownWidget)||void 0===e?void 0:e.getPane().getId())===(null===s||void 0===s?void 0:s.getId())&&(null===(i=this._mouseDownWidget)||void 0===i?void 0:i.getName())===l.getName()){var c=this._makeWidgetEvent(t,l),u=l.getName();switch(u){case Gi.MAIN:var d=l.getBounding(),h=l.dispatchEvent("pressedMouseMoveEvent",c);if(!h&&null!==this._startScrollCoordinate){var p=s.getAxisComponent();if(null!==this._prevYAxisRange&&!p.getAutoCalcTickFlag()&&p.getScrollZoomEnabled()){var v,f=this._prevYAxisRange,g=f.from,m=f.to,y=f.range;v=null!==(n=null===p||void 0===p?void 0:p.isReverse())&&void 0!==n&&n?this._startScrollCoordinate.y-c.y:c.y-this._startScrollCoordinate.y;var _=v/d.height,b=y*_,x=g+b,w=m+b,S=p.convertToRealValue(x),C=p.convertToRealValue(w);p.setRange({from:x,to:w,range:w-x,realFrom:S,realTo:C,realRange:C-S})}var k=c.x-this._startScrollCoordinate.x;this._chart.getChartStore().getTimeScaleStore().scroll(k)}return this._chart.getChartStore().getTooltipStore().setCrosshair({x:c.x,y:c.y,paneId:null===s||void 0===s?void 0:s.getId()}),h;case Gi.X_AXIS:h=l.dispatchEvent("pressedMouseMoveEvent",c);if(h)this._chart.updatePane(1);else{var I=s.getAxisComponent();if(null===(a=null===I||void 0===I?void 0:I.getScrollZoomEnabled())||void 0===a||a){_=this._xAxisStartScaleDistance/c.pageX;if(Number.isFinite(_)){var E=10*(_-this._xAxisScale);this._xAxisScale=_,this._chart.getChartStore().getTimeScaleStore().zoom(E,null!==(r=this._xAxisStartScaleCoordinate)&&void 0!==r?r:void 0)}}}return h;case Gi.Y_AXIS:h=l.dispatchEvent("pressedMouseMoveEvent",c);if(h)this._chart.updatePane(1);else{p=s.getAxisComponent();if(null!==this._prevYAxisRange&&p.getScrollZoomEnabled()){var A=this._prevYAxisRange,P=(g=A.from,m=A.to,y=A.range,_=c.pageY/this._yAxisStartScaleDistance,y*_);b=(P-y)/2,x=g-b,w=m+b,S=p.convertToRealValue(x),C=p.convertToRealValue(w);p.setRange({from:x,to:w,range:P,realFrom:S,realTo:C,realRange:C-S}),this._chart.adjustPaneViewport(!1,!0,!0,!0)}}return h}}return!1},t.prototype.mouseUpEvent=function(t){var e=this._findWidgetByEvent(t).widget,i=!1;if(null!==e){var n=this._makeWidgetEvent(t,e),a=e.getName();switch(a){case Gi.MAIN:case Gi.SEPARATOR:case Gi.X_AXIS:case Gi.Y_AXIS:i=e.dispatchEvent("mouseUpEvent",n);break}i&&this._chart.updatePane(1)}return this._mouseDownWidget=null,this._startScrollCoordinate=null,this._prevYAxisRange=null,this._xAxisStartScaleCoordinate=null,this._xAxisStartScaleDistance=0,this._xAxisScale=1,this._yAxisStartScaleDistance=0,i},t.prototype.mouseClickEvent=function(t){var e=this._findWidgetByEvent(t).widget;if(null!==e){var i=this._makeWidgetEvent(t,e);return e.dispatchEvent("mouseClickEvent",i)}return!1},t.prototype.mouseRightClickEvent=function(t){var e=this._findWidgetByEvent(t).widget,i=!1;if(null!==e){var n=this._makeWidgetEvent(t,e),a=e.getName();switch(a){case Gi.MAIN:case Gi.X_AXIS:case Gi.Y_AXIS:i=e.dispatchEvent("mouseRightClickEvent",n);break}i&&this._chart.updatePane(1)}return!1},t.prototype.mouseDoubleClickEvent=function(t){var e=this._findWidgetByEvent(t),i=e.pane,n=e.widget;if(null!==n){var a=n.getName();switch(a){case Gi.MAIN:var r=this._makeWidgetEvent(t,n);return n.dispatchEvent("mouseDoubleClickEvent",r);case Gi.Y_AXIS:var o=i.getAxisComponent();if(!o.getAutoCalcTickFlag())return o.setAutoCalcTickFlag(!0),this._chart.adjustPaneViewport(!1,!0,!0,!0),!0;break}}return!1},t.prototype.mouseLeaveEvent=function(){return this._chart.getChartStore().getTooltipStore().setCrosshair(),!0},t.prototype.touchStartEvent=function(t){var e=this._findWidgetByEvent(t),i=e.pane,n=e.widget;if(null!==n){var a=this._makeWidgetEvent(t,n),r=n.getName();switch(r){case Gi.MAIN:var o=this._chart.getChartStore(),s=o.getTooltipStore();if(n.dispatchEvent("mouseDownEvent",a))return this._touchCancelCrosshair=!0,this._touchCoordinate=null,s.setCrosshair(void 0,{notInvalidate:!0}),this._chart.updatePane(1),!0;if(null!==this._flingScrollRequestId&&(se(this._flingScrollRequestId),this._flingScrollRequestId=null),this._flingStartTime=(new Date).getTime(),this._startScrollCoordinate={x:a.x,y:a.y},o.getTimeScaleStore().startScroll(),this._touchZoomed=!1,null!==this._touchCoordinate){var l=a.x-this._touchCoordinate.x,c=a.y-this._touchCoordinate.y,u=Math.sqrt(l*l+c*c);u<ba?(this._touchCoordinate={x:a.x,y:a.y},s.setCrosshair({x:a.x,y:a.y,paneId:null===i||void 0===i?void 0:i.getId()})):(this._touchCoordinate=null,this._touchCancelCrosshair=!0,s.setCrosshair())}return!0;case Gi.X_AXIS:case Gi.Y_AXIS:var d=n.dispatchEvent("mouseDownEvent",a);return d&&this._chart.updatePane(1),d}}return!1},t.prototype.touchMoveEvent=function(t){var e,i,n,a=this._findWidgetByEvent(t),r=a.pane,o=a.widget;if(null!==o){var s=this._makeWidgetEvent(t,o),l=o.getName(),c=this._chart.getChartStore(),u=c.getTooltipStore();switch(l){case Gi.MAIN:if(o.dispatchEvent("pressedMouseMoveEvent",s))return null===(e=s.preventDefault)||void 0===e||e.call(s),u.setCrosshair(void 0,{notInvalidate:!0}),this._chart.updatePane(1),!0;if(null!==this._touchCoordinate)null===(i=s.preventDefault)||void 0===i||i.call(s),u.setCrosshair({x:s.x,y:s.y,paneId:null===r||void 0===r?void 0:r.getId()});else if(null!==this._startScrollCoordinate&&Math.abs(this._startScrollCoordinate.x-s.x)>this._startScrollCoordinate.y-s.y){var d=s.x-this._startScrollCoordinate.x;c.getTimeScaleStore().scroll(d)}return!0;case Gi.X_AXIS:case Gi.Y_AXIS:var h=o.dispatchEvent("pressedMouseMoveEvent",s);return h&&(null===(n=s.preventDefault)||void 0===n||n.call(s),this._chart.updatePane(1)),h}}return!1},t.prototype.touchEndEvent=function(t){var e=this,i=this._findWidgetByEvent(t).widget;if(null!==i){var n=this._makeWidgetEvent(t,i),a=i.getName();switch(a){case Gi.MAIN:if(i.dispatchEvent("mouseUpEvent",n),null!==this._startScrollCoordinate){var r=(new Date).getTime()-this._flingStartTime,o=n.x-this._startScrollCoordinate.x,s=o/(r>0?r:1)*20;if(r<200&&Math.abs(s)>0){var l=this._chart.getChartStore().getTimeScaleStore(),c=function(){e._flingScrollRequestId=oe(function(){l.startScroll(),l.scroll(s),s*=.975,Math.abs(s)<1?null!==e._flingScrollRequestId&&(se(e._flingScrollRequestId),e._flingScrollRequestId=null):c()})};c()}}return!0;case Gi.X_AXIS:case Gi.Y_AXIS:var u=i.dispatchEvent("mouseUpEvent",n);u&&this._chart.updatePane(1)}}return!1},t.prototype.tapEvent=function(t){var e=this._findWidgetByEvent(t),i=e.pane,n=e.widget,a=!1;if(null!==n){var r=this._makeWidgetEvent(t,n),o=n.dispatchEvent("mouseClickEvent",r);if(n.getName()===Gi.MAIN){var s=this._makeWidgetEvent(t,n),l=this._chart.getChartStore(),c=l.getTooltipStore();o?(this._touchCancelCrosshair=!0,this._touchCoordinate=null,c.setCrosshair(void 0,{notInvalidate:!0}),a=!0):(this._touchCancelCrosshair||this._touchZoomed||(this._touchCoordinate={x:s.x,y:s.y},c.setCrosshair({x:s.x,y:s.y,paneId:null===i||void 0===i?void 0:i.getId()},{notInvalidate:!0}),a=!0),this._touchCancelCrosshair=!1)}(a||o)&&this._chart.updatePane(1)}return a},t.prototype.doubleTapEvent=function(t){return this.mouseDoubleClickEvent(t)},t.prototype.longTapEvent=function(t){var e=this._findWidgetByEvent(t),i=e.pane,n=e.widget;if(null!==n&&n.getName()===Gi.MAIN){var a=this._makeWidgetEvent(t,n);return this._touchCoordinate={x:a.x,y:a.y},this._chart.getChartStore().getTooltipStore().setCrosshair({x:a.x,y:a.y,paneId:null===i||void 0===i?void 0:i.getId()}),!0}return!1},t.prototype._findWidgetByEvent=function(t){var e,i,n,a,r=t.x,o=t.y,s=this._chart.getAllSeparatorPanes(),l=this._chart.getChartStore().getStyles().separator.size;try{for(var c=G(s),u=c.next();!u.done;u=c.next()){var d=Z(u.value,2),h=d[1],p=h.getBounding(),v=p.top-Math.round((Zi-l)/2);if(r>=p.left&&r<=p.left+p.width&&o>=v&&o<=v+Zi)return{pane:h,widget:h.getWidget()}}}catch(k){e={error:k}}finally{try{u&&!u.done&&(i=c.return)&&i.call(c)}finally{if(e)throw e.error}}var f=this._chart.getAllDrawPanes(),g=null;try{for(var m=G(f),y=m.next();!y.done;y=m.next()){var _=y.value;p=_.getBounding();if(r>=p.left&&r<=p.left+p.width&&o>=p.top&&o<=p.top+p.height){g=_;break}}}catch(I){n={error:I}}finally{try{y&&!y.done&&(a=m.return)&&a.call(m)}finally{if(n)throw n.error}}var b=null;if(null!==g){if(null===b){var x=g.getMainWidget(),w=x.getBounding();r>=w.left&&r<=w.left+w.width&&o>=w.top&&o<=w.top+w.height&&(b=x)}if(null===b){var S=g.getYAxisWidget();if(null!==S){var C=S.getBounding();r>=C.left&&r<=C.left+C.width&&o>=C.top&&o<=C.top+C.height&&(b=S)}}}return{pane:g,widget:b}},t.prototype._makeWidgetEvent=function(t,e){var i,n,a,r=null!==(i=null===e||void 0===e?void 0:e.getBounding())&&void 0!==i?i:null;return X(X({},t),{x:t.x-(null!==(n=null===r||void 0===r?void 0:r.left)&&void 0!==n?n:0),y:t.y-(null!==(a=null===r||void 0===r?void 0:r.top)&&void 0!==a?a:0)})},t.prototype.destroy=function(){this._container.removeEventListener("keydown",this._boundKeyBoardDownEvent),this._event.destroy()},t}();(function(t){t["Root"]="root",t["Main"]="main",t["YAxis"]="yAxis"})(_a||(_a={}));var Sa=function(){function t(t,e){this._drawPanes=[],this._separatorPanes=new Map,this._initContainer(t),this._chartEvent=new wa(this._chartContainer,this),this._chartStore=new Ui(this,e),this._initPanes(e),this.adjustPaneViewport(!0,!0,!0)}return t.prototype._initContainer=function(t){this._container=t,this._chartContainer=he("div",{position:"relative",width:"100%",outline:"none",borderStyle:"none",cursor:"crosshair",boxSizing:"border-box",userSelect:"none",webkitUserSelect:"none",msUserSelect:"none",MozUserSelect:"none",webkitTapHighlightColor:"transparent"}),this._chartContainer.tabIndex=1,t.appendChild(this._chartContainer)},t.prototype._initPanes=function(t){var e,i=this,n=null!==(e=null===t||void 0===t?void 0:t.layout)&&void 0!==e?e:[{type:"candle"}],a=!1,r=!1,o=function(t){if(!r){var e=i._createPane(pa,Wi.X_AXIS,null!==t&&void 0!==t?t:{});i._xAxisPane=e,r=!0}};n.forEach(function(t){var e,n,r;switch(t.type){case"candle":if(!a){var s=null!==(e=t.options)&&void 0!==e?e:{};wt(s,{id:Wi.CANDLE}),i._candlePane=i._createPane(aa,Wi.CANDLE,s);var l=null!==(n=t.content)&&void 0!==n?n:[];l.forEach(function(t){i.createIndicator(t,!0,s)}),a=!0}break;case"indicator":var c;l=null!==(r=t.content)&&void 0!==r?r:[];if(l.length>0)l.forEach(function(e){At(c)?i.createIndicator(e,!0,{id:c}):c=i.createIndicator(e,!0,t.options)});break;case"xAxis":o(t.options);break}}),o({position:"bottom"})},t.prototype._createPane=function(t,e,i){var n,a=null,r=null,o=null===i||void 0===i?void 0:i.position;switch(o){case"top":var s=this._drawPanes[0];At(s)&&(r=new t(this._chartContainer,s.getContainer(),this,e,null!==i&&void 0!==i?i:{}),a=0);break;case"bottom":break;default:for(var l=this._drawPanes.length-1;l>-1;l--){var c=this._drawPanes[l],u=this._drawPanes[l-1];if("bottom"===(null===c||void 0===c?void 0:c.getOptions().position)&&"bottom"!==(null===u||void 0===u?void 0:u.getOptions().position)){r=new t(this._chartContainer,c.getContainer(),this,e,null!==i&&void 0!==i?i:{}),a=l;break}}}if(At(r)||(r=new t(this._chartContainer,null,this,e,null!==i&&void 0!==i?i:{})),Et(a)?(this._drawPanes.splice(a,0,r),n=a):(this._drawPanes.push(r),n=this._drawPanes.length-1),r.getId()!==Wi.X_AXIS){var d=this._drawPanes[n+1];if(At(d)&&d.getId()===Wi.X_AXIS&&(d=this._drawPanes[n+2]),At(d)){var h=this._separatorPanes.get(d);At(h)?h.setTopPane(r):(h=new ga(this._chartContainer,d.getContainer(),this,"",r,d),this._separatorPanes.set(d,h))}var p=this._drawPanes[n-1];if(At(p)&&p.getId()===Wi.X_AXIS&&(p=this._drawPanes[n-2]),At(p)){h=new ga(this._chartContainer,r.getContainer(),this,"",p,r);this._separatorPanes.set(r,h)}}return r},t.prototype._measurePaneHeight=function(){var t,e=this,i=Math.floor(this._container.clientHeight),n=this._chartStore.getStyles().separator.size,a=this._xAxisPane.getAxisComponent().getAutoSize(),r=i-a-this._separatorPanes.size*n;r<0&&(r=0);var o=0;this._drawPanes.forEach(function(t){if(t.getId()!==Wi.CANDLE&&t.getId()!==Wi.X_AXIS){var e=t.getBounding().height,i=t.getOptions().minHeight;e<i&&(e=i),o+e>r?(o=r,e=Math.max(r-o,0)):o+=e,t.setBounding({height:e})}});var s=r-o;null===(t=this._candlePane)||void 0===t||t.setBounding({height:s}),this._xAxisPane.setBounding({height:a});var l=0;this._drawPanes.forEach(function(t){var i=e._separatorPanes.get(t);At(i)&&(i.setBounding({height:n,top:l}),l+=n),t.setBounding({top:l}),l+=t.getBounding().height})},t.prototype._measurePaneWidth=function(){var t=this,e=Math.floor(this._container.clientWidth),i=this._chartStore.getStyles(),n=i.yAxis,a=n.position===K.Left,r=!n.inside,o=0,s=0,l=0,c=0;this._drawPanes.forEach(function(t){t.getId()!==Wi.X_AXIS&&(s=Math.max(s,t.getAxisComponent().getAutoSize()))}),s>e&&(s=e),r?(o=e-s,a?(l=0,c=s):(l=e-s,c=0)):(o=e,c=0,l=a?0:e-s),this._chartStore.getTimeScaleStore().setTotalBarSpace(o);var u,d={width:e},h={width:o,left:c},p={width:s,left:l},v=i.separator.fill;u=r&&!v?h:d,this._drawPanes.forEach(function(e){var i;null===(i=t._separatorPanes.get(e))||void 0===i||i.setBounding(u),e.setBounding(d,h,p)})},t.prototype._setPaneOptions=function(t,e){var i,n;if(Mt(t.id)){var a=this.getDrawPaneById(t.id),r=!1;if(null!==a){var o=e;if(t.id!==Wi.CANDLE&&Et(t.height)&&t.height>0){var s=Math.max(null!==(i=t.minHeight)&&void 0!==i?i:a.getOptions().minHeight,0),l=Math.max(s,t.height);a.setBounding({height:l}),o=!0,r=!0}(Mt(null===(n=t.axisOptions)||void 0===n?void 0:n.name)||At(t.gap))&&(o=!0),a.setOptions(t),o&&this.adjustPaneViewport(r,!0,!0,!0,!0)}}},t.prototype.getDrawPaneById=function(t){if(t===Wi.CANDLE)return this._candlePane;if(t===Wi.X_AXIS)return this._xAxisPane;var e=this._drawPanes.find(function(e){return e.getId()===t});return null!==e&&void 0!==e?e:null},t.prototype.getContainer=function(){return this._container},t.prototype.getChartStore=function(){return this._chartStore},t.prototype.getXAxisPane=function(){return this._xAxisPane},t.prototype.getAllDrawPanes=function(){return this._drawPanes},t.prototype.getAllSeparatorPanes=function(){return this._separatorPanes},t.prototype.adjustPaneViewport=function(t,e,i,n,a){t&&this._measurePaneHeight();var r=e,o=null!==n&&void 0!==n&&n,s=null!==a&&void 0!==a&&a;(o||s)&&this._drawPanes.forEach(function(t){var e=t.getAxisComponent().buildTicks(s);r||(r=e)}),r&&this._measurePaneWidth(),null!==i&&void 0!==i&&i&&(this._xAxisPane.getAxisComponent().buildTicks(!0),this.updatePane(4))},t.prototype.updatePane=function(t,e){if(At(e)){var i=this.getDrawPaneById(e);null===i||void 0===i||i.update(t)}else this._separatorPanes.forEach(function(e){e.update(t)}),this._drawPanes.forEach(function(e){e.update(t)})},t.prototype.crosshairChange=function(t){var e=this,i=this._chartStore.getActionStore();if(i.has(Tt.OnCrosshairChange)){var n={};this._drawPanes.forEach(function(i){var a=i.getId(),r={},o=e._chartStore.getIndicatorStore().getInstances(a);o.forEach(function(e){var i,n=e.result;r[e.name]=n[null!==(i=t.dataIndex)&&void 0!==i?i:n.length-1]}),n[a]=r}),Mt(t.paneId)&&i.execute(Tt.OnCrosshairChange,X(X({},t),{indicatorData:n}))}},t.prototype.getDom=function(t,e){var i,n;if(!Mt(t))return this._chartContainer;var a=this.getDrawPaneById(t);if(null!==a){var r=null!==e&&void 0!==e?e:_a.Root;switch(r){case _a.Root:return a.getContainer();case _a.Main:return a.getMainWidget().getContainer();case _a.YAxis:return null!==(n=null===(i=a.getYAxisWidget())||void 0===i?void 0:i.getContainer())&&void 0!==n?n:null}}return null},t.prototype.getSize=function(t,e){var i,n;if(!At(t))return{width:Math.floor(this._chartContainer.clientWidth),height:Math.floor(this._chartContainer.clientHeight),left:0,top:0,right:0,bottom:0};var a=this.getDrawPaneById(t);if(null!==a){var r=null!==e&&void 0!==e?e:_a.Root;switch(r){case _a.Root:return a.getBounding();case _a.Main:return a.getMainWidget().getBounding();case _a.YAxis:return null!==(n=null===(i=a.getYAxisWidget())||void 0===i?void 0:i.getBounding())&&void 0!==n?n:null}}return null},t.prototype.setStyles=function(t){var e,i,n;this._chartStore.setOptions({styles:t}),n=Mt(t)?ji(t):t,At(null===(e=null===n||void 0===n?void 0:n.yAxis)||void 0===e?void 0:e.type)&&(null===(i=this._candlePane)||void 0===i||i.getAxisComponent().setAutoCalcTickFlag(!0)),this.adjustPaneViewport(!0,!0,!0,!0,!0)},t.prototype.getStyles=function(){return this._chartStore.getStyles()},t.prototype.setLocale=function(t){this._chartStore.setOptions({locale:t}),this.adjustPaneViewport(!0,!0,!0,!0,!0)},t.prototype.getLocale=function(){return this._chartStore.getLocale()},t.prototype.setCustomApi=function(t){this._chartStore.setOptions({customApi:t}),this.adjustPaneViewport(!0,!0,!0,!0,!0)},t.prototype.setPriceVolumePrecision=function(t,e){this._chartStore.setPrecision({price:t,volume:e})},t.prototype.getPriceVolumePrecision=function(){return this._chartStore.getPrecision()},t.prototype.setTimezone=function(t){this._chartStore.setOptions({timezone:t}),this._xAxisPane.getAxisComponent().buildTicks(!0),this._xAxisPane.update(3)},t.prototype.getTimezone=function(){return this._chartStore.getTimeScaleStore().getTimezone()},t.prototype.setOffsetRightDistance=function(t){this._chartStore.getTimeScaleStore().setOffsetRightDistance(t,!0)},t.prototype.getOffsetRightDistance=function(){return this._chartStore.getTimeScaleStore().getOffsetRightDistance()},t.prototype.setMaxOffsetLeftDistance=function(t){t<0?_t("setMaxOffsetLeftDistance","distance","distance must greater than zero!!!"):this._chartStore.getTimeScaleStore().setMaxOffsetLeftDistance(t)},t.prototype.setMaxOffsetRightDistance=function(t){t<0?_t("setMaxOffsetRightDistance","distance","distance must greater than zero!!!"):this._chartStore.getTimeScaleStore().setMaxOffsetRightDistance(t)},t.prototype.setLeftMinVisibleBarCount=function(t){t<0?_t("setLeftMinVisibleBarCount","barCount","barCount must greater than zero!!!"):this._chartStore.getTimeScaleStore().setLeftMinVisibleBarCount(Math.ceil(t))},t.prototype.setRightMinVisibleBarCount=function(t){t<0?_t("setRightMinVisibleBarCount","barCount","barCount must greater than zero!!!"):this._chartStore.getTimeScaleStore().setRightMinVisibleBarCount(Math.ceil(t))},t.prototype.setBarSpace=function(t){this._chartStore.getTimeScaleStore().setBarSpace(t)},t.prototype.getBarSpace=function(){return this._chartStore.getTimeScaleStore().getBarSpace().bar},t.prototype.getVisibleRange=function(){return this._chartStore.getTimeScaleStore().getVisibleRange()},t.prototype.clearData=function(){this._chartStore.clear()},t.prototype.getDataList=function(){return this._chartStore.getDataList()},t.prototype.applyNewData=function(t,e,i){At(i)&&_t("applyNewData","","param `callback` has been deprecated since version 9.8.0, use `subscribeAction('onDataReady')` instead."),this._chartStore.addData(t,Kt.Init,e).then(function(){}).catch(function(){}).finally(function(){null===i||void 0===i||i()})},t.prototype.applyMoreData=function(t,e,i){_t("","","Api `applyMoreData` has been deprecated since version 9.8.0."),this._chartStore.addData(t,Kt.Forward,null===e||void 0===e||e).then(function(){}).catch(function(){}).finally(function(){null===i||void 0===i||i()})},t.prototype.updateData=function(t,e){At(e)&&_t("updateData","","param `callback` has been deprecated since version 9.8.0, use `subscribeAction('onDataReady')` instead."),this._chartStore.addData(t).then(function(){}).catch(function(){}).finally(function(){null===e||void 0===e||e()})},t.prototype.loadMore=function(t){_t("","","Api `loadMore` has been deprecated since version 9.8.0, use `setLoadDataCallback` instead."),this._chartStore.setLoadMoreCallback(t)},t.prototype.setLoadDataCallback=function(t){this._chartStore.setLoadDataCallback(t)},t.prototype.createIndicator=function(t,e,i,n){var a,r=this,o=Mt(t)?{name:t}:t;if(null===ri(o.name))return _t("createIndicator","value","indicator not supported, you may need to use registerIndicator to add one!!!"),null;var s=null===i||void 0===i?void 0:i.id,l=this.getDrawPaneById(null!==s&&void 0!==s?s:"");if(null!==l)this._chartStore.getIndicatorStore().addInstance(o,null!==s&&void 0!==s?s:"",null!==e&&void 0!==e&&e).then(function(t){var e;r._setPaneOptions(null!==i&&void 0!==i?i:{},null!==(e=l.getAxisComponent().buildTicks(!0))&&void 0!==e&&e)}).catch(function(t){});else{null!==s&&void 0!==s||(s=de(Wi.INDICATOR));var c=this._createPane(na,s,null!==i&&void 0!==i?i:{}),u=null!==(a=null===i||void 0===i?void 0:i.height)&&void 0!==a?a:Vi;c.setBounding({height:u}),this._chartStore.getIndicatorStore().addInstance(o,s,null!==e&&void 0!==e&&e).finally(function(){r.adjustPaneViewport(!0,!0,!0,!0,!0),null===n||void 0===n||n()})}return null!==s&&void 0!==s?s:null},t.prototype.overrideIndicator=function(t,e,i){var n=this;this._chartStore.getIndicatorStore().override(t,null!==e&&void 0!==e?e:null).then(function(t){var e=Z(t,2),a=e[0],r=e[1];(a||r)&&(n.adjustPaneViewport(!1,r,!0,r),null===i||void 0===i||i())}).catch(function(){})},t.prototype.getIndicatorByPaneId=function(t,e){return this._chartStore.getIndicatorStore().getInstanceByPaneId(t,e)},t.prototype.removeIndicator=function(t,e){var i,n,a,r=this._chartStore.getIndicatorStore(),o=r.removeInstance(t,e);if(o){var s=!1;if(t!==Wi.CANDLE&&!r.hasInstances(t)){var l=this.getDrawPaneById(t),c=this._drawPanes.findIndex(function(e){return e.getId()===t});if(null!==l){s=!0;var u=this._separatorPanes.get(l);if(At(u)){var d=null===u||void 0===u?void 0:u.getTopPane();try{for(var h=G(this._separatorPanes),p=h.next();!p.done;p=h.next()){var v=p.value;if(v[1].getTopPane().getId()===l.getId()){v[1].setTopPane(d);break}}}catch(g){i={error:g}}finally{try{p&&!p.done&&(n=h.return)&&n.call(h)}finally{if(i)throw i.error}}u.destroy(),this._separatorPanes.delete(l)}this._drawPanes.splice(c,1),l.destroy();var f=this._drawPanes[0];At(f)&&f.getId()===Wi.X_AXIS&&(f=this._drawPanes[1]),null===(a=this._separatorPanes.get(f))||void 0===a||a.destroy(),this._separatorPanes.delete(f)}}this.adjustPaneViewport(s,!0,!0,!0,!0)}},t.prototype.createOverlay=function(t,e){var i=[];if(Mt(t))i=[{name:t}];else if(Ct(t))i=t.map(function(t){return Mt(t)?{name:t}:t});else{var n=t;i=[n]}var a=!0;At(e)&&null!==this.getDrawPaneById(e)||(e=Wi.CANDLE,a=!1);var r=this._chartStore.getOverlayStore().addInstances(i,e,a);return Ct(t)?r:r[0]},t.prototype.getOverlayById=function(t){return this._chartStore.getOverlayStore().getInstanceById(t)},t.prototype.overrideOverlay=function(t){this._chartStore.getOverlayStore().override(t)},t.prototype.removeOverlay=function(t){var e;At(t)&&(e=Mt(t)?{id:t}:t),this._chartStore.getOverlayStore().removeInstance(e)},t.prototype.setPaneOptions=function(t){this._setPaneOptions(t,!1)},t.prototype.setZoomEnabled=function(t){this._chartStore.getTimeScaleStore().setZoomEnabled(t)},t.prototype.isZoomEnabled=function(){return this._chartStore.getTimeScaleStore().getZoomEnabled()},t.prototype.setScrollEnabled=function(t){this._chartStore.getTimeScaleStore().setScrollEnabled(t)},t.prototype.isScrollEnabled=function(){return this._chartStore.getTimeScaleStore().getScrollEnabled()},t.prototype.scrollByDistance=function(t,e){var i=Et(e)&&e>0?e:0,n=this._chartStore.getTimeScaleStore();if(n.startScroll(),i>0){var a=new le({duration:i});a.doFrame(function(e){var a=t*(e/i);n.scroll(a)}),a.start()}else n.scroll(t)},t.prototype.scrollToRealTime=function(t){var e=this._chartStore.getTimeScaleStore(),i=e.getBarSpace().bar,n=e.getLastBarRightSideDiffBarCount()-e.getInitialOffsetRightDistance()/i,a=n*i;this.scrollByDistance(a,t)},t.prototype.scrollToDataIndex=function(t,e){var i=this._chartStore.getTimeScaleStore(),n=(i.getLastBarRightSideDiffBarCount()+(this.getDataList().length-1-t))*i.getBarSpace().bar;this.scrollByDistance(n,e)},t.prototype.scrollToTimestamp=function(t,e){var i=pe(this.getDataList(),"timestamp",t);this.scrollToDataIndex(i,e)},t.prototype.zoomAtCoordinate=function(t,e,i){var n=Et(i)&&i>0?i:0,a=this._chartStore.getTimeScaleStore(),r=a.getBarSpace().bar,o=r*t,s=o-r;if(n>0){var l=0,c=new le({duration:n});c.doFrame(function(t){var i=s*(t/n),r=(i-l)/a.getBarSpace().bar*ke;a.zoom(r,e),l=i}),c.start()}else a.zoom(s/r*ke,e)},t.prototype.zoomAtDataIndex=function(t,e,i){var n=this._chartStore.getTimeScaleStore().dataIndexToCoordinate(e);this.zoomAtCoordinate(t,{x:n,y:0},i)},t.prototype.zoomAtTimestamp=function(t,e,i){var n=pe(this.getDataList(),"timestamp",e);this.zoomAtDataIndex(t,n,i)},t.prototype.convertToPixel=function(t,e){var i,n=e.paneId,a=void 0===n?Wi.CANDLE:n,r=e.absolute,o=void 0!==r&&r,s=[];if(a!==Wi.X_AXIS){var l=this.getDrawPaneById(a);if(null!==l){var c=this._chartStore.getTimeScaleStore(),u=l.getBounding(),d=(new Array).concat(t),h=this._xAxisPane.getAxisComponent(),p=l.getAxisComponent();s=d.map(function(t){var e={},i=t.dataIndex;if(Et(t.timestamp)&&(i=c.timestampToDataIndex(t.timestamp)),Et(i)&&(e.x=null===h||void 0===h?void 0:h.convertToPixel(i)),Et(t.value)){var n=null===p||void 0===p?void 0:p.convertToPixel(t.value);e.y=o?u.top+n:n}return e})}}return Ct(t)?s:null!==(i=s[0])&&void 0!==i?i:{}},t.prototype.convertFromPixel=function(t,e){var i,n=e.paneId,a=void 0===n?Wi.CANDLE:n,r=e.absolute,o=void 0!==r&&r,s=[];if(a!==Wi.X_AXIS){var l=this.getDrawPaneById(a);if(null!==l){var c=this._chartStore.getTimeScaleStore(),u=l.getBounding(),d=(new Array).concat(t),h=this._xAxisPane.getAxisComponent(),p=l.getAxisComponent();s=d.map(function(t){var e,i,n={};if(Et(t.x)){var a=null!==(e=null===h||void 0===h?void 0:h.convertFromPixel(t.x))&&void 0!==e?e:-1;n.dataIndex=a,n.timestamp=null!==(i=c.dataIndexToTimestamp(a))&&void 0!==i?i:void 0}if(Et(t.y)){var r=o?t.y-u.top:t.y;n.value=p.convertFromPixel(r)}return n})}}return Ct(t)?s:null!==(i=s[0])&&void 0!==i?i:{}},t.prototype.executeAction=function(t,e){var i;switch(t){case Tt.OnCrosshairChange:var n=X({},e);n.paneId=null!==(i=n.paneId)&&void 0!==i?i:Wi.CANDLE,this._chartStore.getTooltipStore().setCrosshair(n,{notExecuteAction:!0});break}},t.prototype.subscribeAction=function(t,e){this._chartStore.getActionStore().subscribe(t,e)},t.prototype.unsubscribeAction=function(t,e){this._chartStore.getActionStore().unsubscribe(t,e)},t.prototype.getConvertPictureUrl=function(t,e,i){var n=this,a=this._chartContainer.clientWidth,r=this._chartContainer.clientHeight,o=he("canvas",{width:"".concat(a,"px"),height:"".concat(r,"px"),boxSizing:"border-box"}),s=o.getContext("2d"),l=Wt(o);o.width=a*l,o.height=r*l,s.scale(l,l),s.fillStyle=null!==i&&void 0!==i?i:"#FFFFFF",s.fillRect(0,0,a,r);var c=null!==t&&void 0!==t&&t;return this._drawPanes.forEach(function(t){var e=n._separatorPanes.get(t);if(At(e)){var i=e.getBounding();s.drawImage(e.getImage(c),i.left,i.top,i.width,i.height)}var r=t.getBounding();s.drawImage(t.getImage(c),0,r.top,a,r.height)}),o.toDataURL("image/".concat(null!==e&&void 0!==e?e:"jpeg"))},t.prototype.resize=function(){this.adjustPaneViewport(!0,!0,!0,!0,!0)},t.prototype.destroy=function(){this._chartEvent.destroy(),this._drawPanes.forEach(function(t){t.destroy()}),this._drawPanes=[],this._separatorPanes.forEach(function(t){t.destroy()}),this._separatorPanes.clear(),this._container.removeChild(this._chartContainer)},t}(),Ca=new Map,ka=1;function Ia(t,e){var i;if(xt(),i=Mt(t)?document.getElementById(t):t,null===i)return bt("","","The chart cannot be initialized correctly. Please check the parameters. The chart container cannot be null and child elements need to be added!!!"),null;var n=Ca.get(i.id);if(At(n))return _t("","","The chart has been initialized on the dom!!!"),n;var a="k_line_chart_".concat(ka++);return n=new Sa(i,e),n.id=a,i.setAttribute("k-line-chart-id",a),Ca.set(a,n),n}var Ea=i(21396),Aa=i.n(Ea);function Pa(t,e,i,n){if(!t||!e||!i||!n)return t;try{var a=Aa().enc.Base64.parse(t),r=Aa().lib.WordArray.create(a.words.slice(0,4)),o=Aa().lib.WordArray.create(a.words.slice(4)),s=Aa().enc.Base64.parse(n),l=Aa().AES.decrypt({ciphertext:o},s,{iv:r,mode:Aa().mode.CBC,padding:Aa().pad.Pkcs7}),c=l.toString(Aa().enc.Utf8);return c||t}catch(u){return t}}function Ma(t,e){return Da.apply(this,arguments)}function Da(){return Da=(0,c.A)((0,l.A)().m(function t(e,i){var n,a;return(0,l.A)().w(function(t){while(1)switch(t.p=t.n){case 0:if(e&&i){t.n=1;break}throw new Error("用户ID和指标ID不能为空");case 1:return t.p=1,t.n=2,(0,v.Ay)({url:"/api/indicator/getDecryptKey",method:"post",data:{userid:e,indicatorId:i}});case 2:if(n=t.v,1!==n.code||!n.data||!n.data.key){t.n=3;break}return t.a(2,n.data.key);case 3:throw new Error(n.msg||"获取解密密钥失败");case 4:t.n=6;break;case 5:throw t.p=5,a=t.v,new Error("无法获取解密密钥,请检查网络连接或联系管理员: "+(a.message||"未知错误"));case 6:return t.a(2)}},t,null,[[1,5]])})),Da.apply(this,arguments)}function Ta(t,e,i){return Ba.apply(this,arguments)}function Ba(){return Ba=(0,c.A)((0,l.A)().m(function t(e,i,n){var a;return(0,l.A)().w(function(t){while(1)switch(t.n){case 0:return t.n=1,Ma(i,n);case 1:return a=t.v,t.a(2,Pa(e,i,n,a))}},t)})),Ba.apply(this,arguments)}function Fa(t,e){if(1===e||!0===e)return!0;if(t&&t.length>100)try{var i=atob(t);if(i.length>50)return!0}catch(n){}return!1}var Ra={name:"KlineChart",props:{symbol:{type:String,default:""},market:{type:String,default:""},timeframe:{type:String,default:"1H"},theme:{type:String,default:"light"},activeIndicators:{type:Array,default:function(){return[]}},realtimeEnabled:{type:Boolean,default:!1},userId:{type:Number,default:null}},emits:["retry","price-change","load","indicator-toggle"],setup:function(t,e){var i=e.emit,n=(0,h.IJ)([]),a=(0,h.KR)(!1),r=(0,h.KR)(null),s=(0,h.KR)(!1),u=(0,h.KR)(!0),p=null,f=(0,h.KR)(!1),g=(0,h.IJ)(null),m=(0,h.KR)(t.theme||"light"),y=(0,h.KR)(null),b=(0,h.KR)(5e3),x=(0,h.KR)(!1),w=(0,h.KR)(1e4),S=(0,h.KR)(0),C=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(g.value){var e=Date.now(),i=Number(w.value||1e4);(t||!S.value||e-S.value>=i)&&(S.value=e,xt())}},k=(0,h.KR)([]),I=(0,h.KR)([]),E=(0,h.KR)([]),A=(0,h.KR)(null),P=(0,h.nI)(),M=P.proxy,D=(0,h.EW)(function(){return[{name:"line",title:M.$t("dashboard.indicator.drawing.line"),icon:"line"},{name:"horizontalLine",title:M.$t("dashboard.indicator.drawing.horizontalLine"),icon:"minus"},{name:"verticalLine",title:M.$t("dashboard.indicator.drawing.verticalLine"),icon:"column-width"},{name:"ray",title:M.$t("dashboard.indicator.drawing.ray"),icon:"arrow-right"},{name:"straightLine",title:M.$t("dashboard.indicator.drawing.straightLine"),icon:"menu"},{name:"parallelStraightLine",title:M.$t("dashboard.indicator.drawing.parallelLine"),icon:"menu"},{name:"priceLine",title:M.$t("dashboard.indicator.drawing.priceLine"),icon:"dollar"},{name:"priceChannelLine",title:M.$t("dashboard.indicator.drawing.priceChannel"),icon:"border"},{name:"fibonacciLine",title:M.$t("dashboard.indicator.drawing.fibonacciLine"),icon:"rise"},{name:"measure",title:M.$t("dashboard.indicator.drawing.measure"),icon:"drag"}]}),R=(0,h.KR)([{id:"sma",name:"SMA (简单移动平均)",shortName:"SMA",type:"line",defaultParams:{length:20}},{id:"ema",name:"EMA (指数移动平均)",shortName:"EMA",type:"line",defaultParams:{length:20}},{id:"rsi",name:"RSI (相对强弱)",shortName:"RSI",type:"line",defaultParams:{length:14}},{id:"macd",name:"MACD",shortName:"MACD",type:"macd",defaultParams:{fast:12,slow:26,signal:9}},{id:"bb",name:"布林带 (Bollinger Bands)",shortName:"BB",type:"band",defaultParams:{length:20,mult:2}},{id:"atr",name:"ATR (平均真实波幅)",shortName:"ATR",type:"line",defaultParams:{period:14}},{id:"cci",name:"CCI (商品通道指数)",shortName:"CCI",type:"line",defaultParams:{length:20}},{id:"williams",name:"Williams %R (威廉指标)",shortName:"W%R",type:"line",defaultParams:{length:14}},{id:"mfi",name:"MFI (资金流量指标)",shortName:"MFI",type:"line",defaultParams:{length:14}},{id:"adx",name:"ADX (平均趋向指数)",shortName:"ADX",type:"adx",defaultParams:{length:14}},{id:"obv",name:"OBV (能量潮)",shortName:"OBV",type:"line",defaultParams:{}},{id:"adosc",name:"ADOSC (积累/派发振荡器)",shortName:"ADOSC",type:"line",defaultParams:{fast:3,slow:10}},{id:"ad",name:"AD (积累/派发线)",shortName:"AD",type:"line",defaultParams:{}},{id:"kdj",name:"KDJ (随机指标)",shortName:"KDJ",type:"line",defaultParams:{period:9,k:3,d:3}}]),L=function(e){return t.activeIndicators.some(function(t){return t.id===e})},N=function(t){if(g.value){var e={line:"segment",horizontalLine:"horizontalStraightLine",verticalLine:"verticalStraightLine",ray:"rayLine",straightLine:"straightLine",parallelStraightLine:"parallelStraightLine",priceLine:"priceLine",priceChannelLine:"priceChannelLine",fibonacciLine:"fibonacciLine",measure:"priceRangeMeasure"},i=e[t]||t;if(A.value!==t){A.value=t;try{var n={name:i,lock:!1,extendData:{isDrawing:!0}},a=g.value.createOverlay(n);a?E.value.push(a):A.value=null}catch(r){A.value=null}}else{A.value=null;try{"function"===typeof g.value.overrideOverlay&&g.value.overrideOverlay(null)}catch(o){}}}},O=function(){if(g.value)try{E.value.forEach(function(t){try{"function"===typeof g.value.removeOverlay?g.value.removeOverlay(t):"function"===typeof g.value.removeOverlayById&&g.value.removeOverlayById(t)}catch(e){}}),E.value=[],A.value=null,"function"===typeof g.value.overrideOverlay&&g.value.overrideOverlay(null)}catch(t){}},z=function(t){var e=L(t.id);if(e)i("indicator-toggle",{action:"remove",indicator:{id:t.id}});else{var n=(0,d.A)((0,d.A)({},t),{},{params:(0,d.A)({},t.defaultParams),calculate:null});i("indicator-toggle",{action:"add",indicator:n})}},V=(0,h.KR)(null),W=(0,h.KR)(!1),H=(0,h.KR)(!1),$=(0,h.KR)(!1),K=(0,h.EW)(function(){return"dark"===m.value?{backgroundColor:"#141414",textColor:"#d1d4dc",textColorSecondary:"#787b86",borderColor:"#2a2a2a",gridLineColor:"#252525",gridLineColorDashed:"#363c4e",tooltipBg:"rgba(25, 27, 32, 0.95)",tooltipBorder:"#333",tooltipText:"#ccc",tooltipTextSecondary:"#888",axisLabelColor:"#787b86",splitAreaColor:["rgba(250,250,250,0.05)","rgba(200,200,200,0.02)"],dataZoomBorder:"#2a2a2a",dataZoomFiller:"rgba(41, 98, 255, 0.15)",dataZoomHandle:"#13c2c2",dataZoomText:"transparent",dataZoomBg:"#252525"}:{backgroundColor:"#fff",textColor:"#333",textColorSecondary:"#666",borderColor:"#e8e8e8",gridLineColor:"#e8e8e8",gridLineColorDashed:"#e8e8e8",tooltipBg:"rgba(255, 255, 255, 0.95)",tooltipBorder:"#e8e8e8",tooltipText:"#333",tooltipTextSecondary:"#666",axisLabelColor:"#666",splitAreaColor:["rgba(250,250,250,0.05)","rgba(200,200,200,0.02)"],dataZoomBorder:"#e8e8e8",dataZoomFiller:"rgba(24, 144, 255, 0.15)",dataZoomHandle:"#1890ff",dataZoomText:"#999",dataZoomBg:"#f0f2f5"}}),Y=function(t){return"dark"===m.value?["#13c2c2","#e040fb","#ffeb3b","#00e676","#ff6d00","#9c27b0"][t%6]:["#13c2c2","#9c27b0","#f57c00","#1976d2","#c2185b","#7b1fa2"][t%6]},X=function(){return new Promise(function(t,e){if(window.pyodide)return V.value=window.pyodide,H.value=!0,void t(window.pyodide);W.value=!0;var i="0.25.0",n=function(t){return t&&t.endsWith("/")?t:t?t+"/":t},a="/assets/pyodide/v".concat(i,"/full/"),r="https://cdn.jsdelivr.net/pyodide/v".concat(i,"/full/"),o=n({NODE_ENV:"production",VUE_APP_API_BASE_URL:"/api",VUE_APP_PREVIEW:"false",BASE_URL:"/"}.VUE_APP_PYODIDE_LOCAL_BASE||a),s=n({NODE_ENV:"production",VUE_APP_API_BASE_URL:"/api",VUE_APP_PREVIEW:"false",BASE_URL:"/"}.VUE_APP_PYODIDE_CDN_BASE||r),u=({NODE_ENV:"production",VUE_APP_API_BASE_URL:"/api",VUE_APP_PREVIEW:"false",BASE_URL:"/"}.VUE_APP_PYODIDE_PREFER_CDN||"").toString().toLowerCase(),d=!u||("true"===u||"1"===u||"yes"===u),h=function(t){return new Promise(function(e,i){var n=document.querySelector('script[data-pyodide-src="'.concat(t,'"]'));if(n)return"function"===typeof window.loadPyodide?e():(n.addEventListener("load",function(){return e()},{once:!0}),void n.addEventListener("error",function(){return i(new Error("Pyodide 脚本加载失败"))},{once:!0}));var a=document.createElement("script");a.dataset.pyodideSrc=t,a.src=t,a.onload=function(){return e()},a.onerror=function(){return i(new Error("Pyodide 脚本加载失败"))},document.head.appendChild(a)})},p=function(){var e=(0,c.A)((0,l.A)().m(function e(i){return(0,l.A)().w(function(e){while(1)switch(e.n){case 0:if("function"===typeof window.loadPyodide){e.n=1;break}throw new Error("loadPyodide 函数未找到");case 1:return e.n=2,window.loadPyodide({indexURL:i});case 2:return window.pyodide=e.v,e.n=3,window.pyodide.loadPackage(["pandas","numpy"]);case 3:V.value=window.pyodide,H.value=!0,W.value=!1,t(window.pyodide);case 4:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}();(0,c.A)((0,l.A)().m(function t(){var e,i,n;return(0,l.A)().w(function(t){while(1)switch(t.p=t.n){case 0:if(e=function(){var t=(0,c.A)((0,l.A)().m(function t(e){return(0,l.A)().w(function(t){while(1)switch(t.n){case 0:return t.n=1,h(e+"pyodide.js");case 1:return t.n=2,p(e);case 2:return t.a(2)}},t)}));return function(e){return t.apply(this,arguments)}}(),t.p=1,!d){t.n=3;break}return t.n=2,e(s);case 2:t.n=4;break;case 3:return t.n=4,e(o);case 4:t.n=9;break;case 5:return t.p=5,i=t.v,t.p=6,t.n=7,e(d?o:s);case 7:t.n=9;break;case 8:throw t.p=8,n=t.v,n||i;case 9:return t.a(2)}},t,null,[[6,8],[1,5]])}))().catch(function(t){W.value=!1,$.value=!0,e(t)})})},j=function(t){if(!t||"string"!==typeof t)return null;try{var e={},i=t.match(/(\w+)\s*=\s*(\d+\.?\d*)/g);return i&&i.forEach(function(t){var i=t.split("=");if(2===i.length){var n=i[0].trim(),a=parseFloat(i[1].trim());isNaN(a)||(e[n]=a)}}),{params:e,plots:[],success:!0}}catch(n){return{params:{},plots:[],success:!1}}},U=function(){var e=(0,c.A)((0,l.A)().m(function e(i,n){var a,r,s,c,u,d,h,p,v,f,g,m,y,_,b,x,w,S,C=arguments;return(0,l.A)().w(function(e){while(1)switch(e.p=e.n){case 0:if(a=C.length>2&&void 0!==C[2]?C[2]:{},r=C.length>3&&void 0!==C[3]?C[3]:{},H.value&&V.value){e.n=5;break}if(!W.value){e.n=4;break}s=0;case 1:if(!(W.value&&s<30)){e.n=4;break}return e.n=2,new Promise(function(t){return setTimeout(t,500)});case 2:if(s++,!H.value||!V.value){e.n=3;break}return e.a(3,4);case 3:e.n=1;break;case 4:if(H.value&&V.value){e.n=5;break}throw W.value?(W.value=!1,$.value=!0):$.value=!0,new Error("Python 引擎未就绪,请等待加载完成");case 5:if(e.p=5,c=i,u=r.is_encrypted||r.isEncrypted||0,!u&&!Fa(i,u)){e.n=11;break}if(d=r.user_id||r.userId||t.userId||a.userId,h=r.originalId||r.id||a.indicatorId,!d||!h){e.n=10;break}return e.p=6,e.n=7,Ta(c,d,h);case 7:c=e.v,e.n=9;break;case 8:throw e.p=8,x=e.v,new Error("代码解密失败,无法执行指标: "+(x.message||"未知错误"));case 9:e.n=11;break;case 10:throw new Error("缺少必要的解密参数(用户ID或指标ID),无法执行加密指标");case 11:return p=n.map(function(t){var e=t.timestamp||t.time;return e<1e10&&(e*=1e3),{time:Math.floor(e/1e3),open:parseFloat(t.open)||0,high:parseFloat(t.high)||0,low:parseFloat(t.low)||0,close:parseFloat(t.close)||0,volume:parseFloat(t.volume)||0}}),v=JSON.stringify(p),f=JSON.stringify(a||{}),g=v.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r"),m=f.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r"),y="\nimport json\nimport pandas as pd\nimport numpy as np\n\n# 递归清理 NaN 值的函数\ndef clean_nan(obj):\n if isinstance(obj, dict):\n return {k: clean_nan(v) for k, v in obj.items()}\n elif isinstance(obj, list):\n return [clean_nan(item) for item in obj]\n elif isinstance(obj, (pd.Series, np.ndarray)):\n return [None if (isinstance(x, float) and (np.isnan(x) or np.isinf(x))) else x for x in obj]\n elif isinstance(obj, (float, np.floating)):\n if np.isnan(obj) or np.isinf(obj):\n return None\n return float(obj)\n elif pd.isna(obj):\n return None\n else:\n return obj\n\n# 接收 JSON 数据\nraw_data = json.loads('".concat(g,"')\nparams = json.loads('").concat(m,"')\n\n# 将前端参数注入为指标代码可直接使用的变量(对齐回测/实盘执行环境)\n# 兼容多种命名(snake_case / camelCase\ndef _get_param(key, default=None):\n if key in params:\n return params.get(key, default)\n # camelCase fallback\n camel = ''.join([key.split('_')[0]] + [p.capitalize() for p in key.split('_')[1:]])\n return params.get(camel, default)\n\ntry:\n leverage = float(_get_param('leverage', 1) or 1)\nexcept Exception:\n leverage = 1\n\ntrade_direction = _get_param('trade_direction', _get_param('tradeDirection', 'both')) or 'both'\n\ntry:\n initial_position = int(_get_param('initial_position', 0) or 0)\nexcept Exception:\n initial_position = 0\n\ntry:\n initial_avg_entry_price = float(_get_param('initial_avg_entry_price', 0.0) or 0.0)\nexcept Exception:\n initial_avg_entry_price = 0.0\n\ntry:\n initial_position_count = int(_get_param('initial_position_count', 0) or 0)\nexcept Exception:\n initial_position_count = 0\n\ntry:\n initial_last_add_price = float(_get_param('initial_last_add_price', 0.0) or 0.0)\nexcept Exception:\n initial_last_add_price = 0.0\n\ntry:\n initial_highest_price = float(_get_param('initial_highest_price', 0.0) or 0.0)\nexcept Exception:\n initial_highest_price = 0.0\n\n# 转换为 DataFrame\ndf = pd.DataFrame(raw_data)\n\n# 转换数据类型\ndf['open'] = df['open'].astype(float)\ndf['high'] = df['high'].astype(float)\ndf['low'] = df['low'].astype(float)\ndf['close'] = df['close'].astype(float)\ndf['volume'] = df['volume'].astype(float)\n\n# 用户代码(已解密)\n").concat(c,"\n\n# 构造输出(如果用户没有定义 output,则尝试从 result_json 获取)\nif 'output' not in locals():\n if 'result_json' in locals():\n output = json.loads(result_json)\n else:\n output = {\"plots\": []}\nelse:\n # 确保 output 是字典格式\n if isinstance(output, str):\n output = json.loads(output)\n\n# 清理 output 中的所有 NaN 值\noutput = clean_nan(output)\n\n# 返回 JSON 字符串\njson.dumps(output)\n"),e.n=12,V.value.runPythonAsync(y);case 12:if(_=e.v,_&&"string"===typeof _){e.n=13;break}throw new Error("Python 代码执行后未返回有效的 JSON 字符串,返回类型: ".concat((0,o.A)(_)));case 13:e.p=13,b=JSON.parse(_),e.n=15;break;case 14:throw e.p=14,w=e.v,new Error("JSON 解析失败: ".concat(w.message,"。可能是数据中包含 NaN 或其他无效值。"));case 15:if(b){e.n=16;break}return e.a(2,{plots:[],signals:[],calculatedVars:{}});case 16:return b.plots&&Array.isArray(b.plots)||(b.plots=[]),b.plots=b.plots.map(function(t){return t.data&&Array.isArray(t.data)&&(t.data=t.data.map(function(t){return null===t||void 0===t||"number"===typeof t&&isNaN(t)?null:t})),t}),b.signals&&Array.isArray(b.signals)&&(b.signals=b.signals.map(function(t){return t.data&&Array.isArray(t.data)&&(t.data=t.data.map(function(t){return null===t||void 0===t||"number"===typeof t&&isNaN(t)?null:t})),t})),b.calculatedVars||(b.calculatedVars={}),e.a(2,b);case 17:throw e.p=17,S=e.v,new Error("Python 执行失败: ".concat(S.message));case 18:return e.a(2)}},e,null,[[13,14],[6,8],[5,17]])}));return function(t,i){return e.apply(this,arguments)}}();function G(t,e){for(var i=[],n=0;n<t.length;n++)if(n<e-1)i.push(null);else{for(var a=0,r=n-e+1;r<=n;r++)a+=t[r].close;i.push(a/e)}return i}function Z(t,e){for(var i=[],n=2/(e+1),a=null,r=0;r<t.length;r++)a=0===r?t[r].close:(t[r].close-a)*n+a,i.push(a);return i}function q(t,e,i){for(var n=[],a=0;a<t.length;a++)if(a<e-1)n.push(null);else{for(var r=0,o=a-e+1;o<=a;o++)r+=t[o].close;n.push(r/e)}for(var s=[],l=0;l<t.length;l++)if(l<e-1)s.push({upper:null,middle:null,lower:null});else{for(var c=0,u=l-e+1;u<=l;u++)c+=Math.pow(t[u].close-n[l],2);var d=Math.sqrt(c/e);s.push({upper:n[l]+i*d,middle:n[l],lower:n[l]-i*d})}return s}function J(t,e){for(var i=[],n=0;n<t.length;n++)if(0===n)i.push(t[n].high-t[n].low);else{var a=t[n].high-t[n].low,r=Math.abs(t[n].high-t[n-1].close),o=Math.abs(t[n].low-t[n-1].close);i.push(Math.max(a,r,o))}for(var s=[],l=0;l<t.length;l++)if(l<e-1)s.push(null);else{for(var c=0,u=l-e+1;u<=l;u++)c+=i[u];s.push(c/e)}return s}function Q(t,e){for(var i=[],n=function(){if(a<e-1)i.push(null);else{for(var n=[],r=a-e+1;r<=a;r++)n.push((t[r].high+t[r].low+t[r].close)/3);var o=n.reduce(function(t,e){return t+e},0)/e,s=n.reduce(function(t,e){return t+Math.abs(e-o)},0)/e,l=(t[a].high+t[a].low+t[a].close)/3,c=0===s?0:(l-o)/(.015*s);i.push(c)}},a=0;a<t.length;a++)n();return i}function tt(t,e){for(var i=[],n=0;n<t.length;n++)if(n<e-1)i.push(null);else{for(var a=-1/0,r=1/0,o=n-e+1;o<=n;o++)a=Math.max(a,t[o].high),r=Math.min(r,t[o].low);var s=a-r===0?-50:(a-t[n].close)/(a-r)*-100;i.push(s)}return i}function et(t,e){for(var i=[],n=0;n<t.length;n++)if(n<e)i.push(null);else{for(var a=0,r=0,o=n-e+1;o<=n;o++){var s=(t[o].high+t[o].low+t[o].close)/3,l=s*t[o].volume;if(o>n-e+1){var c=(t[o-1].high+t[o-1].low+t[o-1].close)/3;s>c?a+=l:s<c&&(r+=l)}}var u=0===r?100:a/r,d=100-100/(1+u);i.push(d)}return i}function it(t,e){for(var i=[],n=[],a=[],r=[],o=[],s=[],l=0;l<t.length;l++)if(0===l)r.push(t[l].high-t[l].low),o.push(0),s.push(0);else{var c=t[l].high-t[l].low,u=Math.abs(t[l].high-t[l-1].close),d=Math.abs(t[l].low-t[l-1].close);r.push(Math.max(c,u,d));var h=t[l].high-t[l-1].high,p=t[l-1].low-t[l].low;h>p&&h>0?o.push(h):o.push(0),p>h&&p>0?s.push(p):s.push(0)}for(var v=[],f=[],g=[],m=0;m<t.length;m++){if(m<e-1)v.push(null),f.push(null),g.push(null),i.push(null),n.push(null),a.push(null);else if(m===e-1){for(var y=0,_=0,b=0,x=0;x<=m;x++)y+=r[x],_+=o[x],b+=s[x];v.push(y),f.push(_),g.push(b)}else v.push(v[m-1]-v[m-1]/e+r[m]),f.push(f[m-1]-f[m-1]/e+o[m]),g.push(g[m-1]-g[m-1]/e+s[m]);if(m>=e-1){var w=v[m],S=f[m],C=g[m];if(0===w?(i.push(0),n.push(0)):(i.push(S/w*100),n.push(C/w*100)),m>=e-1){var k=i[m]+n[m],I=0===k?0:Math.abs(i[m]-n[m])/k*100;if(m===e-1)a.push(I);else if(m===e){var E=Math.abs(i[m-1]-n[m-1])/(i[m-1]+n[m-1])*100;a.push((E+I)/2)}else a.push((a[m-1]*(e-1)+I)/e)}}}return{adx:a,plusDI:i,minusDI:n}}function nt(t){for(var e=[],i=0,n=0;n<t.length;n++)0===n?i=t[n].volume:t[n].close>t[n-1].close?i+=t[n].volume:t[n].close<t[n-1].close&&(i-=t[n].volume),e.push(i);return e}function at(t){for(var e=[],i=0,n=0;n<t.length;n++){var a=t[n].high,r=t[n].low,o=t[n].close,s=t[n].volume;if(a!==r){var l=(o-r-(a-o))/(a-r);i+=l*s}e.push(i)}return e}function rt(t,e,i){for(var n=at(t),a=[],r=[],o=[],s=2/(e+1),l=2/(i+1),c=n[0],u=n[0],d=0;d<n.length;d++)0===d?(a.push(n[0]),r.push(n[0]),o.push(0)):(c=(n[d]-c)*s+c,u=(n[d]-u)*l+u,a.push(c),r.push(u),o.push(c-u));return o}function ot(t,e,i,n){for(var a=[],r=[],o=[],s=0;s<t.length;s++)if(s<e-1)a.push(null),r.push(null),o.push(null);else{for(var l=-1/0,c=1/0,u=s-e+1;u<=s;u++)l=Math.max(l,t[u].high),c=Math.min(c,t[u].low);var d=l-c===0?50:(t[s].close-c)/(l-c)*100;null===a[s-1]?a.push(d):a.push((2*d+a[s-1]*(i-2))/i),null===r[s-1]?r.push(a[s]):r.push((2*a[s]+r[s-1]*(n-2))/n),o.push(3*a[s]-2*r[s])}return{k:a,d:r,j:o}}Ni({name:"signalTag",totalStep:1,lock:!0,needDefaultPointFigure:!1,needDefaultXAxisFigure:!1,needDefaultYAxisFigure:!1,checkEventOn:function(){return!1},createPointFigures:function(t){var e,i,n,a=t.coordinates,r=t.overlay,o=r.extendData||{},s=o.text,l=(null===(e=r.extendData)||void 0===e?void 0:e.color)||"#555555";if(!a[0])return[];var c=a[0].x,u=a[0].y,d=a[1]?a[1].y:u,h=8,p=4,v=12,f=String(s||""),g=f.split("").reduce(function(t,e){return t+(e.charCodeAt(0)>255?12:7)},0),m=g+2*h,y=v+2*p,_=(null===(i=r.extendData)||void 0===i?void 0:i.side)||(null===(n=r.extendData)||void 0===n?void 0:n.type)||"buy",b="buy"===_,x=b?u:u-y,w=d,S=w,C=b?x:x+y;return[{type:"line",attrs:{coordinates:[{x:c,y:S},{x:c,y:C}]},styles:{style:"stroke",color:l,dashedValue:[2,2]},ignoreEvent:!0},{type:"circle",attrs:{x:c,y:w,r:4},styles:{style:"fill",color:l},ignoreEvent:!0},{type:"rect",attrs:{x:c-m/2,y:x,width:m,height:y,r:4},styles:{style:"fill",color:l,borderSize:0},ignoreEvent:!0},{type:"text",attrs:{x:c,y:x+y/2,text:f,align:"center",baseline:"middle"},styles:{color:"#ffffff",size:v,weight:"bold",backgroundColor:l,borderRadius:5},ignoreEvent:!0}]}}),Ni({name:"priceRangeMeasure",totalStep:2,lock:!1,needDefaultPointFigure:!1,needDefaultXAxisFigure:!1,needDefaultYAxisFigure:!1,createPointFigures:function(t){var e=t.coordinates,i=t.overlay,n=t.ctx;if(!e[0]||!e[1])return[];var a=i.points[0],r=i.points[1];if(!a||!r)return[];var o=a.value,s=r.value,l=s-o,c=l/o*100,u=a.timestamp,d=r.timestamp,h=Math.abs(d-u),p="",v=Math.floor(h/864e5),f=Math.floor(h%864e5/36e5),g=Math.floor(h%36e5/6e4),m=Math.floor(h%6e4/1e3);p=v>0?"".concat(v,"天").concat(f>0?f+"小时":""):f>0?"".concat(f,"小时").concat(g>0?g+"分钟":""):g>0?"".concat(g,"分钟"):"".concat(m,"秒");var y=0;try{if(n&&n.chart){var _=n.chart.getData();if(_&&Array.isArray(_)&&_.length>0){var b=_.findIndex(function(t){return Math.abs(t.timestamp-u)<1e3}),x=_.findIndex(function(t){return Math.abs(t.timestamp-d)<1e3});b>=0&&x>=0&&(y=Math.abs(x-b))}}}catch(z){}var w=c>=0?"+".concat(c.toFixed(2),"%"):"".concat(c.toFixed(2),"%"),S=l>=0?"+".concat(l.toFixed(2)):"".concat(l.toFixed(2)),C="".concat(w," ").concat(S);y>0?(C+=" (".concat(y,"根"),p&&(C+=" / ".concat(p)),C+=")"):p&&(C+=" (".concat(p,")"));var k=l>=0,I=k?"#0ecb81":"#f6465d",E=k?"#0ecb81":"#f6465d",A=k?"rgba(14, 203, 129, 0.1)":"rgba(246, 70, 93, 0.1)",P=e[0].x,M=e[0].y,D=e[1].x,T=e[1].y,B=(P+D)/2,F=(M+T)/2,R=-20,L=12,N=7*C.length+16,O=L+8;return[{type:"line",attrs:{coordinates:[{x:P,y:M},{x:D,y:T}]},styles:{style:"stroke",color:I,size:2,dashedValue:[4,4]},ignoreEvent:!1},{type:"circle",attrs:{x:P,y:M,r:4},styles:{style:"fill",color:I},ignoreEvent:!1},{type:"circle",attrs:{x:D,y:T,r:4},styles:{style:"fill",color:I},ignoreEvent:!1},{type:"rect",attrs:{x:B-N/2,y:F+R-O/2,width:N,height:O,r:4},styles:{style:"fill",color:A,borderSize:1,borderColor:I},ignoreEvent:!1},{type:"text",attrs:{x:B,y:F+R,text:C,align:"center",baseline:"middle"},styles:{color:E,size:L,weight:"bold"},ignoreEvent:!1}]}});var st=function(t){return t.map(function(t){var e=t.time||t.timestamp;return"string"===typeof e&&(e=parseInt(e)),e<1e10&&(e*=1e3),{timestamp:e,open:parseFloat(t.open),high:parseFloat(t.high),low:parseFloat(t.low),close:parseFloat(t.close),volume:parseFloat(t.volume||0)}}).filter(function(t){return t.timestamp&&!isNaN(t.open)&&!isNaN(t.high)&&!isNaN(t.low)&&!isNaN(t.close)}).sort(function(t,e){return t.timestamp-e.timestamp})},lt=function(t){if(t.length>0){var e=t[t.length-1];if(t.length>1){var n=t[t.length-2],a=e.close.toFixed(2),r=(e.close-n.close)/n.close*100;i("price-change",{price:a,change:r})}else{var o=e.close.toFixed(2);i("price-change",{price:o,change:0})}}},ct=function(t){return t.map(function(t){return{time:Math.floor(t.timestamp/1e3),open:t.open,high:t.high,low:t.low,close:t.close,volume:t.volume}})},ut=function(t,e,i){var n=new Date(1e3*t),a=new Date(1e3*e);switch(i){case"1m":return n.getFullYear()===a.getFullYear()&&n.getMonth()===a.getMonth()&&n.getDate()===a.getDate()&&n.getHours()===a.getHours()&&n.getMinutes()===a.getMinutes();case"5m":return n.getFullYear()===a.getFullYear()&&n.getMonth()===a.getMonth()&&n.getDate()===a.getDate()&&n.getHours()===a.getHours()&&Math.floor(n.getMinutes()/5)===Math.floor(a.getMinutes()/5);case"15m":return n.getFullYear()===a.getFullYear()&&n.getMonth()===a.getMonth()&&n.getDate()===a.getDate()&&n.getHours()===a.getHours()&&Math.floor(n.getMinutes()/15)===Math.floor(a.getMinutes()/15);case"30m":return n.getFullYear()===a.getFullYear()&&n.getMonth()===a.getMonth()&&n.getDate()===a.getDate()&&n.getHours()===a.getHours()&&Math.floor(n.getMinutes()/30)===Math.floor(a.getMinutes()/30);case"1H":return n.getFullYear()===a.getFullYear()&&n.getMonth()===a.getMonth()&&n.getDate()===a.getDate()&&n.getHours()===a.getHours();case"4H":return n.getFullYear()===a.getFullYear()&&n.getMonth()===a.getMonth()&&n.getDate()===a.getDate()&&Math.floor(n.getHours()/4)===Math.floor(a.getHours()/4);case"1D":return n.getFullYear()===a.getFullYear()&&n.getMonth()===a.getMonth()&&n.getDate()===a.getDate();case"1W":var r=Math.floor((n.getTime()-new Date(n.getFullYear(),0,1).getTime())/6048e5),o=Math.floor((a.getTime()-new Date(a.getFullYear(),0,1).getTime())/6048e5);return n.getFullYear()===a.getFullYear()&&r===o;default:return t===e}},dt=function(){var e=(0,c.A)((0,l.A)().m(function e(){var i,o,s,c,d,p,f,m=arguments;return(0,l.A)().w(function(e){while(1)switch(e.p=e.n){case 0:if(i=m.length>0&&void 0!==m[0]&&m[0],t.symbol){e.n=1;break}return e.a(2);case 1:if(!a.value||i){e.n=2;break}return e.a(2);case 2:return a.value=!0,r.value=null,e.p=3,o=[],e.p=4,e.n=5,(0,v.Ay)({url:"/api/indicator/kline",method:"get",params:{market:t.market,symbol:t.symbol,timeframe:t.timeframe,limit:500}});case 5:if(s=e.v,1!==s.code||!s.data||!Array.isArray(s.data)){e.n=6;break}o=st(s.data),e.n=7;break;case 6:throw c=s.msg||"获取K线数据失败","tiingo_subscription"===s.hint&&(c=M.$t("dashboard.indicator.error.tiingoSubscription")||"Forex 1-minute data requires Tiingo paid subscription"),new Error(c);case 7:e.n=9;break;case 8:throw e.p=8,p=e.v,p;case 9:if(o&&0!==o.length){e.n=10;break}throw new Error("未获取到K线数据");case 10:n.value=o,u.value=!0,d=ct(o),lt(d),(0,h.dY)(function(){if(g.value){var e=n.value.filter(function(t){return t.timestamp&&!isNaN(t.open)&&!isNaN(t.high)&&!isNaN(t.low)&&!isNaN(t.close)});if(e.length>0&&g.value){try{g.value.applyNewData(e)}catch(i){g.value.applyNewData(e)}setTimeout(function(){g.value&&xt()},100)}}else mt();t.realtimeEnabled&&(gt(),ft())}),e.n=12;break;case 11:if(e.p=11,f=e.v,r.value=M.$t("dashboard.indicator.error.loadDataFailed")+": "+(f.message||M.$t("dashboard.indicator.error.loadDataFailedDesc")),n.value=[],g.value)try{g.value.applyNewData([])}catch(l){}case 12:return e.p=12,a.value=!1,e.f(12);case 13:return e.a(2)}},e,null,[[4,8],[3,11,12,13]])}));return function(){return e.apply(this,arguments)}}(),ht=function(){var e=(0,c.A)((0,l.A)().m(function e(i){return(0,l.A)().w(function(e){while(1)switch(e.p=e.n){case 0:if(t.symbol&&n.value&&0!==n.value.length){e.n=1;break}return e.a(2);case 1:if(!s.value&&!p){e.n=6;break}if(!p){e.n=5;break}return e.p=2,e.n=3,p;case 3:e.n=5;break;case 4:e.p=4,e.v;case 5:return e.a(2);case 6:if(u.value){e.n=7;break}return g.value&&"function"===typeof g.value.noMoreData&&g.value.noMoreData(),e.a(2);case 7:return s.value=!0,p=(0,c.A)((0,l.A)().m(function e(){var a,r,o,c,d,f;return(0,l.A)().w(function(e){while(1)switch(e.p=e.n){case 0:return e.n=1,(0,h.dY)();case 1:return e.p=1,a=Math.floor(i/1e3),e.n=2,(0,v.Ay)({url:"/api/indicator/kline",method:"get",params:{market:t.market,symbol:t.symbol,timeframe:t.timeframe,limit:500,before_time:a}});case 2:if(r=e.v,1!==r.code||!r.data||!Array.isArray(r.data)){e.n=5;break}if(o=st(r.data),0!==o.length){e.n=3;break}return u.value=!1,g.value&&"function"===typeof g.value.noMoreData&&g.value.noMoreData(),e.a(2);case 3:if(c=o.filter(function(t){return t.timestamp<i}),0!==c.length){e.n=4;break}return u.value=!1,g.value&&"function"===typeof g.value.noMoreData&&g.value.noMoreData(),e.a(2);case 4:d=null;try{g.value&&"function"===typeof g.value.getVisibleRange&&(d=g.value.getVisibleRange())}catch(l){}f=c.length,n.value=[].concat((0,F.A)(c),(0,F.A)(n.value)),(0,h.dY)(function(){if(g.value){if(g.value.applyNewData(n.value),d&&"number"===typeof d.from){var t=d.from+f,e=d.to+f;setTimeout(function(){try{g.value&&("function"===typeof g.value.scrollToDataIndex?g.value.scrollToDataIndex(t):"function"===typeof g.value.setVisibleRange&&g.value.setVisibleRange(t,e))}catch(l){}},50)}xt()}}),e.n=6;break;case 5:g.value&&"function"===typeof g.value.noMoreData&&g.value.noMoreData();case 6:e.n=8;break;case 7:e.p=7,e.v,g.value&&"function"===typeof g.value.noMoreData&&g.value.noMoreData();case 8:return e.p=8,s.value=!1,p=null,e.f(8);case 9:return e.a(2)}},e,null,[[1,7,8,9]])}))(),e.p=8,e.n=9,p;case 9:e.n=11;break;case 10:e.p=10,e.v;case 11:return e.a(2)}},e,null,[[8,10],[2,4]])}));return function(t){return e.apply(this,arguments)}}(),pt=function(){var e=(0,c.A)((0,l.A)().m(function e(){var i,a,r,o,c;return(0,l.A)().w(function(e){while(1)switch(e.p=e.n){case 0:if(t.symbol&&n.value&&0!==n.value.length){e.n=1;break}return e.a(2);case 1:if(!s.value&&u.value){e.n=2;break}return e.a(2);case 2:return s.value=!0,e.p=3,i=n.value[0].timestamp,a=Math.floor(i/1e3),e.n=4,(0,v.Ay)({url:"/api/indicator/kline",method:"get",params:{market:t.market,symbol:t.symbol,timeframe:t.timeframe,limit:500,before_time:a}});case 4:if(r=e.v,1!==r.code||!r.data||!Array.isArray(r.data)){e.n=7;break}if(o=st(r.data),0!==o.length){e.n=5;break}return u.value=!1,s.value=!1,e.a(2);case 5:if(c=o.filter(function(t){return t.timestamp<i}),0!==c.length){e.n=6;break}return u.value=!1,s.value=!1,e.a(2);case 6:n.value=[].concat((0,F.A)(c),(0,F.A)(n.value)),(0,h.dY)(function(){g.value&&(g.value.applyNewData(n.value),xt())}),e.n=7;break;case 7:e.n=9;break;case 8:e.p=8,e.v;case 9:return e.p=9,s.value=!1,e.f(9);case 10:return e.a(2)}},e,null,[[3,8,9,10]])}));return function(){return e.apply(this,arguments)}}(),vt=function(){var e=(0,c.A)((0,l.A)().m(function e(){var i,a,r,o,s,c,u,d,h,p,f;return(0,l.A)().w(function(e){while(1)switch(e.p=e.n){case 0:if(t.symbol&&n.value&&0!==n.value.length){e.n=1;break}return e.a(2);case 1:return e.p=1,e.n=2,(0,v.Ay)({url:"/api/indicator/kline",method:"get",params:{market:t.market,symbol:t.symbol,timeframe:t.timeframe,limit:5}});case 2:i=e.v,1===i.code&&i.data&&Array.isArray(i.data)&&i.data.length>0&&(a=st(i.data),r=(0,F.A)(n.value),a.length>0&&(o=Math.floor(a[a.length-1].timestamp/1e3),s=Math.floor(r[r.length-1].timestamp/1e3),ut(o,s,t.timeframe)?(c=r[r.length-1],u=a[a.length-1],r[r.length-1]={timestamp:c.timestamp,open:c.open,high:Math.max(c.high,u.high),low:Math.min(c.low,u.low),close:u.close,volume:u.volume},n.value=r,d=ct(n.value),lt(d),g.value&&"function"===typeof g.value.updateData?(h=n.value.length-1,g.value.updateData(r[h]),C(!1)):g.value&&(g.value.applyNewData(n.value),C(!1))):o>s&&(p=a.filter(function(e){var i=Math.floor(e.timestamp/1e3);return!r.some(function(e){var n=Math.floor(e.timestamp/1e3);return ut(i,n,t.timeframe)})}),p.length>0&&(n.value=[].concat((0,F.A)(r),(0,F.A)(p)),n.value.length>500&&(n.value=n.value.slice(-500)),f=ct(n.value),lt(f),g.value&&"function"===typeof g.value.applyMoreData?(g.value.applyMoreData(p),C(!0)):g.value&&(g.value.applyNewData(n.value),C(!0)))))),e.n=4;break;case 3:e.p=3,e.v;case 4:return e.a(2)}},e,null,[[1,3]])}));return function(){return e.apply(this,arguments)}}(),ft=function(){y.value&&clearInterval(y.value);var e={"1m":5e3,"5m":1e4,"15m":15e3,"30m":3e4,"1H":6e4,"4H":3e5,"1D":6e5,"1W":18e5},i=e[t.timeframe]||1e4;b.value=Math.min(i,1e3),t.realtimeEnabled&&t.symbol&&n.value.length>0&&(y.value=setInterval(function(){!a.value&&t.symbol&&n.value&&n.value.length>0&&vt()},b.value))},gt=function(){y.value&&(clearInterval(y.value),y.value=null)},mt=function(){var t=document.getElementById("kline-chart-container");if(t)if(0!==t.clientWidth&&0!==t.clientHeight){if(g.value){try{g.value.destroy()}catch(y){}g.value=null}try{var e=document.getElementById("kline-chart-container");if(!e)throw new Error("容器元素不存在");try{g.value=Ia(e,{drawingBarVisible:!0,overlay:{visible:!0}})}catch(y){g.value=Ia(e)}if(g.value&&"function"===typeof g.value.setDrawingBarVisible?g.value.setDrawingBarVisible(!0):g.value&&"function"===typeof g.value.setDrawingBar?g.value.setDrawingBar(!0):g.value&&"function"===typeof g.value.enableDrawing&&g.value.enableDrawing(!0),!g.value)throw new Error("图表初始化失败:无法创建图表实例");if(g.value&&("function"===typeof g.value.setDrawingBarVisible&&g.value.setDrawingBarVisible(!0),"function"===typeof g.value.setDrawingBar&&g.value.setDrawingBar(!0),"function"===typeof g.value.enableDrawing&&g.value.enableDrawing(!0)),_t(),g.value&&"function"===typeof g.value.subscribeAction){if(g.value.subscribeAction("onOverlayCreated",function(t){if(A.value&&t&&t.id){var e={line:"segment",horizontalLine:"horizontalStraightLine",verticalLine:"verticalStraightLine",ray:"rayLine",straightLine:"straightLine",parallelStraightLine:"parallelStraightLine",priceLine:"priceLine",priceChannelLine:"priceChannelLine",fibonacciLine:"fibonacciLine",measure:"priceRangeMeasure"},i=e[A.value];if(!t.name||t.name===i||"priceRangeMeasure"===i){E.value.push(t.id),A.value=null;try{"function"===typeof g.value.overrideOverlay&&g.value.overrideOverlay(null)}catch(y){}}}}),"function"===typeof g.value.subscribeAction)try{g.value.subscribeAction("onOverlayComplete",function(t){A.value&&t&&t.id&&(E.value.push(t.id),A.value=null)})}catch(y){}g.value.subscribeAction("onOverlayRemoved",function(t){var e=E.value.indexOf(t);e>-1&&E.value.splice(e,1)})}if(g.value&&"function"===typeof g.value.subscribeAction){var i=null,a=!1;g.value.subscribeAction("onVisibleRangeChange",function(){var t=(0,c.A)((0,l.A)().m(function t(e){var r,o,c,d,h,v;return(0,l.A)().w(function(t){while(1)switch(t.n){case 0:if(!e||"number"!==typeof e.from){t.n=5;break}if(a){t.n=1;break}return i=e.from,a=!0,setTimeout(function(){f.value=!0},1e3),t.a(2);case 1:if(f.value){t.n=2;break}return i=e.from,t.a(2);case 2:if(!(s.value&&e.from<=0)){t.n=3;break}try{g.value&&"function"===typeof g.value.setVisibleRange&&(r=n.value.length,r>0&&(o=g.value.getVisibleRange(),o&&(c=Math.ceil((o.to-o.from)*r/100),d=.1,h=Math.min(100,d+c/r*100),g.value.setVisibleRange(d,h))))}catch(y){}return t.a(2);case 3:if(!(e.from<=5&&!s.value&&!p&&u.value&&f.value)){t.n=4;break}if(!(null!==i&&i>e.from)){t.n=4;break}if(!(n.value.length>0)){t.n=4;break}return v=n.value[0].timestamp,t.n=4,ht(v);case 4:i=e.from;case 5:return t.a(2)}},t)}));return function(e){return t.apply(this,arguments)}}())}if(n.value&&n.value.length>0){var o=n.value.filter(function(t){return t.timestamp&&!isNaN(t.open)&&!isNaN(t.high)&&!isNaN(t.low)&&!isNaN(t.close)});if(o.length>0){try{g.value.applyNewData(o)}catch(y){try{g.value.applyNewData(o)}catch(_){}}try{g.value.createIndicator("VOL",!1,{height:100,dragEnabled:!0})}catch(y){}(0,h.dY)(function(){xt()})}}window.addEventListener("resize",yt)}catch(r){r.value=M.$t("dashboard.indicator.error.chartInitFailed")+": "+(r.message||"未知错误")}}else{var d=0,v=10,m=function(){var t=document.getElementById("kline-chart-container");t&&t.clientWidth>0&&t.clientHeight>0?mt():d<v?(d++,setTimeout(m,200)):mt()};setTimeout(m,200)}},yt=function(){if(g.value)setTimeout(function(){g.value&&g.value.resize()},100);else{var t=document.getElementById("kline-chart-container");t&&t.clientWidth>0&&t.clientHeight>0&&mt()}},_t=function(){if(g.value){var t=K.value,e="dark"===m.value;g.value.setStyles({grid:{show:!0,horizontal:{show:!0,color:t.gridLineColor,style:"dashed",size:1},vertical:{show:!1}},candle:{priceMark:{show:!0,high:{show:!0,color:t.axisLabelColor},low:{show:!0,color:t.axisLabelColor}},tooltip:{showRule:"always",showType:"standard",labels:[M.$t("dashboard.indicator.tooltip.time"),M.$t("dashboard.indicator.tooltip.open"),M.$t("dashboard.indicator.tooltip.high"),M.$t("dashboard.indicator.tooltip.low"),M.$t("dashboard.indicator.tooltip.close"),M.$t("dashboard.indicator.tooltip.volume")],values:function(t){var e=new Date(t.timestamp);return["".concat(e.getFullYear(),"-").concat(e.getMonth()+1,"-").concat(e.getDate()," ").concat(e.getHours(),":").concat(e.getMinutes()),t.open.toFixed(2),t.high.toFixed(2),t.low.toFixed(2),t.close.toFixed(2),t.volume.toFixed(0)]}},bar:{upColor:e?"#0ecb81":"#13c2c2",downColor:e?"#f6465d":"#fa541c",noChangeColor:t.borderColor}},indicator:{tooltip:{showRule:"always",showType:"standard"}},xAxis:{show:!0,axisLine:{show:!0,color:t.borderColor}},yAxis:{show:!0,axisLine:{show:!1}},crosshair:{show:!0,horizontal:{show:!0,line:{show:!0,style:"dashed",color:t.gridLineColor,size:1}},vertical:{show:!0,line:{show:!0,style:"dashed",color:t.gridLineColor,size:1}}},watermark:{show:!1}})}},bt=function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2,r=arguments.length>5&&void 0!==arguments[5]&&arguments[5];try{var o={name:t,shortName:t,calc:e,figures:i,calcParams:n,precision:a,series:r?"price":"normal"};return ai(o),!0}catch(s){return!(!s.message||!s.message.includes("already registered"))}},xt=function(){var e=(0,c.A)((0,l.A)().m(function e(){var i,a,r,o;return(0,l.A)().w(function(e){while(1)switch(e.p=e.n){case 0:if(!x.value){e.n=1;break}return e.a(2);case 1:if(g.value&&0!==n.value.length){e.n=2;break}return e.a(2);case 2:x.value=!0,e.p=3;try{I.value.length>0&&g.value&&(I.value.forEach(function(t){try{"function"===typeof g.value.removeOverlay?g.value.removeOverlay(t):"function"===typeof g.value.removeOverlayById&&g.value.removeOverlayById(t)}catch(e){}}),I.value=[])}catch(s){}try{k.value.length>0&&(k.value.forEach(function(t){var e="string"===typeof t?t:t.name,i="string"===typeof t?void 0:t.paneId;i?g.value.removeIndicator(i,e):(g.value.removeIndicator("candle_pane",e),g.value.removeIndicator(e))}),k.value=[])}catch(s){}i=ct(n.value),a=(0,l.A)().m(function e(){var n,a,r,s,c,u,d,h,p,v,f,m,y,b,x,w,S,C,E,A,P,M,D,T,R,L,N,O,z,V,H,K,X,j,st,lt,ct,ut,dt,ht,pt,vt,ft,gt,mt,yt,_t,xt,wt,St,Ct,kt,It,Et,At,Pt,Mt,Dt,Tt,Bt,Ft,Rt,Lt,Nt,Ot,zt,Vt,Wt,Ht,$t,Kt,Yt,Xt,jt,Ut,Gt,Zt,qt,Jt,Qt,te,ee,ie,ne,ae,re,oe,se,le,ce,ue,de,he,pe,ve,fe,ge,me,ye,_e,be,xe,we,Se,Ce,ke,Ie,Ee,Ae,Pe,Me,De,Te,Be,Fe,Re,Le,Ne,Oe,ze,Ve,We,He,$e,Ke,Ye,Xe,je,Ue,Ge,Ze,qe,Je,Qe,ti,ei,ii,ni,ai,ri,oi,si,li,ci,ui,di,hi,pi,vi,fi,gi,mi,yi,_i;return(0,l.A)().w(function(e){while(1)switch(e.p=e.n){case 0:if(n=t.activeIndicators[o],e.p=1,"python"!==n.type){e.n=31;break}if(n.code){e.n=2;break}return e.a(2,0);case 2:if(e.p=2,!n.calculate||"function"!==typeof n.calculate){e.n=15;break}return e.n=3,n.calculate(i,n.params||{});case 3:if(a=e.v,r=[],a&&a.plots&&Array.isArray(a.plots)&&(r=(0,F.A)(a.plots)),!(a&&a.signals&&Array.isArray(a.signals))){e.n=14;break}s=(0,_.A)(a.signals),e.p=4,s.s();case 5:if((c=s.n()).done){e.n=11;break}if(u=c.value,!(u.data&&Array.isArray(u.data)&&u.data.length>0)){e.n=10;break}for(d=[],h=0;h<Math.min(u.data.length,20);h++)p=u.data[h],null===p||void 0===p||isNaN(p)||d.length<5&&d.push({index:h,value:p});v=[],f=0;case 6:if(!(f<u.data.length&&f<i.length)){e.n=9;break}if(m=u.data[f],null===m||void 0===m||isNaN(m)){e.n=8;break}if(y=i[f],b=y.timestamp||y.time,x=y.high,w=y.low,S=u.type||"buy",C=String(S).toLowerCase(),E=["buy","sell"],E.includes(C)){e.n=7;break}return e.a(3,8);case 7:A="buy"===C,P=u.text||(A?"B":"S"),u.textData&&null!=u.textData[f]&&(P=u.textData[f]),v.push({timestamp:b,price:m,anchorPrice:A?w:x,side:A?"buy":"sell",action:C,color:u.color||(A?"#00E676":"#FF5252"),text:P});case 8:f++,e.n=6;break;case 9:if(v.length>0&&g.value){M=(0,_.A)(v);try{for(M.s();!(D=M.n()).done;){T=D.value;try{R=T.timestamp,R<1e10&&(R*=1e3),L=T.text,"function"===typeof g.value.createOverlay&&(N=g.value.createOverlay({name:"signalTag",points:[{timestamp:R,value:T.price},{timestamp:R,value:T.anchorPrice}],extendData:{text:L,color:T.color,side:T.side,action:T.action,price:T.price},lock:!0},"candle_pane"),N&&I.value.push(N))}catch(l){}}}catch(bi){M.e(bi)}finally{M.f()}}case 10:e.n=5;break;case 11:e.n=13;break;case 12:e.p=12,mi=e.v,s.e(mi);case 13:return e.p=13,s.f(),e.f(13);case 14:if(r.length>0&&(O=r.filter(function(t){return t.data&&Array.isArray(t.data)&&t.data.length>0}),O.length>0)){for(z=[],V={},H=0;H<O.length;H++)K=O[H],X=K.name||"PLOT_".concat(H,"_").concat(o),j=X.toLowerCase().replace(/\s+/g,"_").replace(/[^a-z0-9_]/g,"_"),st=K.color||Y(H),lt=K.type||"line",z.push({key:j,title:K.name||X,type:lt,color:st}),V[j]=K.data;ct=O.every(function(t){return!1!==t.overlay}),ut="".concat(n.id,"_combined"),a&&a.name&&(ut=a.name);try{dt=bt(ut,function(t){for(var e=[],i=0;i<t.length;i++){var n={};for(var a in V){var r=V[a];n[a]=i<r.length?r[i]:null}e.push(n)}return e},z,[],2,ct),dt&&(ct?(ht=g.value.createIndicator(ut,!1,{id:"candle_pane"}),ht?k.value.push({paneId:ht,name:ut}):k.value.push({paneId:"candle_pane",name:ut})):(pt=g.value.createIndicator(ut,!1,{height:100,dragEnabled:!0}),pt&&k.value.push({paneId:pt,name:ut})))}catch(xi){}}e.n=28;break;case 15:return vt={id:n.originalId||n.id,user_id:n.user_id||n.userId,is_encrypted:n.is_encrypted||n.isEncrypted||0},e.n=16,U(n.code,i,n.params||{},vt);case 16:if(ft=e.v,gt=[],ft&&ft.plots&&Array.isArray(ft.plots)&&(gt=(0,F.A)(ft.plots)),!(ft&&ft.signals&&Array.isArray(ft.signals))){e.n=27;break}mt=(0,_.A)(ft.signals),e.p=17,mt.s();case 18:if((yt=mt.n()).done){e.n=24;break}if(_t=yt.value,!(_t.data&&Array.isArray(_t.data)&&_t.data.length>0)){e.n=23;break}for(xt=[],wt=0;wt<Math.min(_t.data.length,20);wt++)St=_t.data[wt],null===St||void 0===St||isNaN(St)||xt.length<5&&xt.push({index:wt,value:St});Ct=[],kt=0;case 19:if(!(kt<_t.data.length&&kt<i.length)){e.n=22;break}if(It=_t.data[kt],null===It||void 0===It||isNaN(It)){e.n=21;break}if(Et=i[kt],At=Et.timestamp||Et.time,Pt=Et.high,Mt=Et.low,Dt=_t.type||"buy",Tt=String(Dt).toLowerCase(),Bt=["buy","sell"],Bt.includes(Tt)){e.n=20;break}return e.a(3,21);case 20:Ft="buy"===Tt,Rt=_t.text||(Ft?"B":"S"),_t.textData&&null!=_t.textData[kt]&&(Rt=_t.textData[kt]),Ct.push({timestamp:At,price:It,anchorPrice:Ft?Mt:Pt,side:Ft?"buy":"sell",action:Tt,color:_t.color||(Ft?"#00E676":"#FF5252"),text:Rt});case 21:kt++,e.n=19;break;case 22:if(Ct.length>0&&g.value){Lt=(0,_.A)(Ct);try{for(Lt.s();!(Nt=Lt.n()).done;){Ot=Nt.value;try{zt=Ot.timestamp,zt<1e10&&(zt*=1e3),Vt=Ot.text,"function"===typeof g.value.createOverlay&&(Wt=g.value.createOverlay({name:"signalTag",points:[{timestamp:zt,value:Ot.price},{timestamp:zt,value:Ot.anchorPrice}],extendData:{text:Vt,color:Ot.color,side:Ot.side,action:Ot.action,price:Ot.price},lock:!0},"candle_pane"),Wt&&I.value.push(Wt))}catch(l){}}}catch(bi){Lt.e(bi)}finally{Lt.f()}}case 23:e.n=18;break;case 24:e.n=26;break;case 25:e.p=25,yi=e.v,mt.e(yi);case 26:return e.p=26,mt.f(),e.f(26);case 27:if(gt.length>0&&(Ht=gt.filter(function(t){return t.data&&Array.isArray(t.data)&&t.data.length>0}),Ht.length>0)){for($t=[],Kt={},Yt=0;Yt<Ht.length;Yt++)Xt=Ht[Yt],jt=Xt.name||"PLOT_".concat(Yt),Ut=jt.toLowerCase().replace(/\s+/g,"_").replace(/[^a-z0-9_]/g,"_"),Gt=Xt.color||Y(Yt),Zt=Xt.type||"line",$t.push({key:Ut,title:Xt.name||jt,type:Zt,color:Gt}),Kt[Ut]=Xt.data;qt=Ht.every(function(t){return!1!==t.overlay}),Jt="".concat(n.id,"_combined"),ft&&ft.name&&(Jt=ft.name);try{Qt=bt(Jt,function(t){for(var e=[],i=0;i<t.length;i++){var n={};for(var a in Kt){var r=Kt[a];n[a]=i<r.length?r[i]:null}e.push(n)}return e},$t,[],2,qt),Qt&&(qt?(te=g.value.createIndicator(Jt,!1,{id:"candle_pane"}),te?k.value.push({paneId:te,name:Jt}):k.value.push({paneId:"candle_pane",name:Jt})):(ee=g.value.createIndicator(Jt,!1,{height:100,dragEnabled:!0}),ee&&k.value.push({paneId:ee,name:Jt})))}catch(xi){}}case 28:e.n=30;break;case 29:e.p=29,_i=e.v,_i.message&&_i.message.includes("Python 引擎未就绪")&&(W.value||($.value=!0));case 30:return e.a(2,0);case 31:if(ie=Y(o),"sma"===n.id||"ema"===n.id){re="sma"===n.id?"SMA":"EMA",oe=(null===(ne=n.params)||void 0===ne?void 0:ne.length)||(null===(ae=n.params)||void 0===ae?void 0:ae.period)||20,se="".concat(re,"_").concat(oe),le=re.toLowerCase(),ce=oe;try{ue=bt(se,function(t,e){var i=e.calcParams[0]||ce,n="SMA"===re?G(t,i):Z(t,i);return n.map(function(t){return(0,B.A)({},le,t)})},[{key:le,title:"".concat(re,"(").concat(oe,")"),type:"line"}],[oe],2,!0),ue&&(de=g.value.createIndicator(se,!1,{id:"candle_pane"}),de?k.value.push({paneId:de,name:se}):k.value.push({paneId:"candle_pane",name:se}))}catch(bi){}}else if("macd"===n.id)he=g.value.createIndicator("MACD",!1,{height:100,dragEnabled:!0}),he&&k.value.push({paneId:he,name:"MACD"});else if("rsi"===n.id)pe=g.value.createIndicator("RSI",!1,{height:100,dragEnabled:!0}),pe&&k.value.push({paneId:pe,name:"RSI"});else if("bollinger_bands"===n.id||"bb"===n.id){ge=(null===(ve=n.params)||void 0===ve?void 0:ve.length)||20,me=(null===(fe=n.params)||void 0===fe?void 0:fe.mult)||2,ye="BOLL_".concat(ge,"_").concat(me);try{_e=bt(ye,function(t,e){for(var i=e.calcParams[0]||20,n=e.calcParams[1]||2,a=q(t,i,n),r=[],o=0;o<a.length;o++){var s,l,c,u,d,h;r.push({upper:null!==(s=null===(l=a[o])||void 0===l?void 0:l.upper)&&void 0!==s?s:null,middle:null!==(c=null===(u=a[o])||void 0===u?void 0:u.middle)&&void 0!==c?c:null,lower:null!==(d=null===(h=a[o])||void 0===h?void 0:h.lower)&&void 0!==d?d:null})}return r},[{key:"upper",title:"上轨(".concat(ge,",").concat(me,")"),type:"line"},{key:"middle",title:"中轨(".concat(ge,")"),type:"line"},{key:"lower",title:"下轨(".concat(ge,",").concat(me,")"),type:"line"}],[ge,me],2,!0),_e&&(be=g.value.createIndicator(ye,!1,{id:"candle_pane"}),be?k.value.push({paneId:be,name:ye}):k.value.push({paneId:"candle_pane",name:ye}))}catch(bi){}}else if("atr"===n.id){Se=(null===(xe=n.params)||void 0===xe?void 0:xe.period)||(null===(we=n.params)||void 0===we?void 0:we.length)||14,Ce="ATR_".concat(Se);try{ke=bt(Ce,function(t,e){var i=e.calcParams[0]||14,n=t.map(function(t){return{high:t.high,low:t.low,close:t.close}}),a=J(n,i);return a.map(function(t){return{atr:t}})},[{key:"atr",title:"ATR(".concat(Se,")"),type:"line",color:ie}],[Se]),ke&&(Ie=g.value.createIndicator(Ce,!1,{height:100,dragEnabled:!0}),Ie&&k.value.push({paneId:Ie,name:Ce}))}catch(bi){}}else if("williams"===n.id||"williams_r"===n.id){Ae=(null===(Ee=n.params)||void 0===Ee?void 0:Ee.length)||14,Pe="WPR_".concat(Ae);try{Me=bt(Pe,function(t,e){var i=e.calcParams[0]||14,n=t.map(function(t){return{high:t.high,low:t.low,close:t.close}}),a=tt(n,i);return a.map(function(t){return{wr:t}})},[{key:"wr",title:"W%R(".concat(Ae,")"),type:"line",color:ie}],[Ae]),Me&&(De=g.value.createIndicator(Pe,!1,{height:100,dragEnabled:!0}),De&&k.value.push({paneId:De,name:Pe}))}catch(bi){}}else if("mfi"===n.id){Be=(null===(Te=n.params)||void 0===Te?void 0:Te.length)||14,Fe="MFI_".concat(Be);try{Re=bt(Fe,function(t,e){var i=e.calcParams[0]||14,n=t.map(function(t){return{high:t.high,low:t.low,close:t.close,volume:t.volume}}),a=et(n,i);return a.map(function(t){return{mfi:t}})},[{key:"mfi",title:"MFI(".concat(Be,")"),type:"line",color:ie}],[Be]),Re&&(Le=g.value.createIndicator(Fe,!1,{height:100,dragEnabled:!0}),Le&&k.value.push({paneId:Le,name:Fe}))}catch(bi){}}else if("cci"===n.id){Oe=(null===(Ne=n.params)||void 0===Ne?void 0:Ne.length)||20,ze="CCI_".concat(Oe);try{Ve=bt(ze,function(t,e){var i=e.calcParams[0]||20,n=t.map(function(t){return{high:t.high,low:t.low,close:t.close}}),a=Q(n,i);return a.map(function(t){return{cci:t}})},[{key:"cci",title:"CCI(".concat(Oe,")"),type:"line",color:ie}],[Oe]),Ve&&(We=g.value.createIndicator(ze,!1,{height:100,dragEnabled:!0}),We&&k.value.push({paneId:We,name:ze}))}catch(bi){}}else if("adx"===n.id){$e=(null===(He=n.params)||void 0===He?void 0:He.length)||14,Ke="ADX_".concat($e);try{Ye=bt(Ke,function(t,e){var i=e.calcParams[0]||14,n=t.map(function(t){return{high:t.high,low:t.low,close:t.close}}),a=it(n,i);return a.adx.map(function(t){return{adx:t}})},[{key:"adx",title:"ADX(".concat($e,")"),type:"line",color:ie}],[$e]),Ye&&(Xe=g.value.createIndicator(Ke,!1,{height:100,dragEnabled:!0}),Xe&&k.value.push({paneId:Xe,name:Ke}))}catch(bi){}}else if("obv"===n.id){je="OBV";try{Ue=bt(je,function(t,e){var i=t.map(function(t){return{close:t.close,volume:t.volume||0}}),n=nt(i);return n.map(function(t){return{obv:t}})},[{key:"obv",title:"OBV",type:"line",color:ie}],[]),Ue&&(Ge=g.value.createIndicator(je,!1,{height:100,dragEnabled:!0}),Ge&&k.value.push({paneId:Ge,name:je}))}catch(bi){}}else if("adosc"===n.id){Je=(null===(Ze=n.params)||void 0===Ze?void 0:Ze.fast)||3,Qe=(null===(qe=n.params)||void 0===qe?void 0:qe.slow)||10,ti="ADOSC_".concat(Je,"_").concat(Qe);try{ei=bt(ti,function(t,e){var i=e.calcParams[0]||3,n=e.calcParams[1]||10,a=t.map(function(t){return{high:t.high,low:t.low,close:t.close,volume:t.volume||0}}),r=rt(a,i,n);return r.map(function(t){return{adosc:t}})},[{key:"adosc",title:"ADOSC(".concat(Je,",").concat(Qe,")"),type:"line",color:ie}],[Je,Qe]),ei&&(ii=g.value.createIndicator(ti,!1,{height:100,dragEnabled:!0}),ii&&k.value.push({paneId:ii,name:ti}))}catch(bi){}}else if("ad"===n.id){ni="AD";try{ai=bt(ni,function(t,e){var i=t.map(function(t){return{high:t.high,low:t.low,close:t.close,volume:t.volume||0}}),n=at(i);return n.map(function(t){return{ad:t}})},[{key:"ad",title:"AD",type:"line",color:ie}],[]),ai&&(ri=g.value.createIndicator(ni,!1,{height:100,dragEnabled:!0}),ri&&k.value.push({paneId:ri,name:ni}))}catch(bi){}}else if("kdj"===n.id){ci=(null===(oi=n.params)||void 0===oi?void 0:oi.period)||9,ui=(null===(si=n.params)||void 0===si?void 0:si.k)||3,di=(null===(li=n.params)||void 0===li?void 0:li.d)||3,hi="KDJ_".concat(ci,"_").concat(ui,"_").concat(di);try{pi=bt(hi,function(t,e){var i=e.calcParams[0]||9,n=e.calcParams[1]||3,a=e.calcParams[2]||3,r=t.map(function(t){return{high:t.high,low:t.low,close:t.close}}),o=ot(r,i,n,a);return o.k.map(function(t,e){return{k:t,d:o.d[e],j:o.j[e]}})},[{key:"k",title:"K(".concat(ci,",").concat(ui,")"),type:"line",color:"#FF6B6B"},{key:"d",title:"D(".concat(di,")"),type:"line",color:"#4ECDC4"},{key:"j",title:"J",type:"line",color:"#95E1D3"}],[ci,ui,di]),pi&&(vi=g.value.createIndicator(hi,!1,{height:100,dragEnabled:!0}),vi&&k.value.push({paneId:vi,name:hi}))}catch(bi){}}else try{fi=n.id.toUpperCase(),gi=g.value.createIndicator(fi,!1,{height:100,dragEnabled:!0}),gi&&k.value.push({paneId:gi,name:fi})}catch(bi){}e.n=33;break;case 32:e.p=32,e.v;case 33:return e.a(2)}},e,null,[[17,25,26,27],[4,12,13,14],[2,29],[1,32]])}),o=0;case 4:if(!(o<t.activeIndicators.length)){e.n=7;break}return e.d((0,T.A)(a()),5);case 5:if(r=e.v,0!==r){e.n=6;break}return e.a(3,6);case 6:o++,e.n=4;break;case 7:return e.p=7,x.value=!1,e.f(7);case 8:return e.a(2)}},e,null,[[3,,7,8]])}));return function(){return e.apply(this,arguments)}}(),wt=function(){dt()};return(0,h.wB)(function(){return t.symbol},function(){t.symbol&&dt()}),(0,h.wB)(function(){return t.theme},function(t){m.value=t,g.value&&(_t(),xt())}),(0,h.wB)(function(){return t.symbol},function(){t.symbol&&dt()}),(0,h.wB)(function(){return t.market},function(){t.symbol&&dt()}),(0,h.wB)(function(){return t.timeframe},function(){t.symbol&&dt(),t.realtimeEnabled&&(gt(),ft())}),(0,h.wB)(function(){return t.activeIndicators},function(t,e){g.value&&n.value.length>0&&(0,h.dY)(function(){g.value&&xt()})},{deep:!0}),(0,h.wB)(function(){return t.realtimeEnabled},function(t){t?ft():gt()}),(0,h.sV)((0,c.A)((0,l.A)().m(function e(){return(0,l.A)().w(function(e){while(1)switch(e.p=e.n){case 0:return e.n=1,(0,h.dY)();case 1:return!t.theme||"dark"!==t.theme&&"light"!==t.theme||(m.value=t.theme),e.p=2,e.n=3,X();case 3:e.n=5;break;case 4:e.p=4,e.v,$.value=!0;case 5:(0,h.dY)(function(){setTimeout(function(){!g.value&&t.symbol&&mt()},300)});case 6:return e.a(2)}},e,null,[[2,4]])}))),(0,h.xo)(function(){gt(),g.value&&(g.value.destroy(),g.value=null),window.removeEventListener("resize",yt)}),{klineData:n,loading:a,error:r,loadingHistory:s,chartRef:g,chartTheme:m,themeConfig:K,getIndicatorColor:Y,handleRetry:wt,loadingPython:W,pythonReady:H,pyodideLoadFailed:$,formatKlineData:st,updatePricePanel:lt,isSameTimeframe:ut,loadKlineData:dt,loadMoreHistoryData:pt,updateKlineRealtime:vt,startRealtime:ft,stopRealtime:gt,initChart:mt,handleResize:yt,updateChartTheme:_t,updateIndicators:xt,executePythonStrategy:U,parsePythonStrategy:j,indicatorButtons:R,isIndicatorActive:L,toggleIndicator:z,drawingTools:D,activeDrawingTool:A,selectDrawingTool:N,clearAllDrawings:O}}},La=Ra,Na=(0,E.A)(La,M,D,!1,null,"076675b8",null),Oa=Na.exports,za=i(18947),Va={name:"DashboardIndicator",components:{IndicatorEditor:P,KlineChart:Oa,QuickTradePanel:za.A},computed:(0,d.A)((0,d.A)({},(0,p.aH)({navTheme:function(t){return t.app.theme}})),{},{chartTheme:function(){return"dark"===this.navTheme||"realdark"===this.navTheme?"dark":"light"},isDarkTheme:function(){return"dark"===this.navTheme||"realdark"===this.navTheme}}),setup:function(){var t=(0,h.nI)(),e=t||{},i=e.proxy,n=(0,h.KR)(1),a=(0,h.KR)(!1),p=(0,h.KR)(void 0),m=(0,h.KR)([]),y=(0,h.KR)([]),_=(0,h.KR)(!1),b=(0,h.KR)(""),x=(0,h.KR)(!1),w=(0,h.KR)(!1),S=(0,h.KR)(!1),C=(0,h.KR)(""),k=(0,h.KR)(""),I=(0,h.KR)([]),E=(0,h.KR)(!1),A=(0,h.KR)([]),P=(0,h.KR)(!1),M=(0,h.KR)(null),D=(0,h.KR)(null),T=(0,h.KR)([]),B=(0,h.KR)(!1),F=(0,h.KR)(!1),R=(0,h.KR)(""),L=(0,h.KR)(""),N=(0,h.KR)(0),O=(0,h.EW)(function(){return"crypto"===(K.value||"").toLowerCase()}),z=function(){O.value?(R.value=$.value||"",N.value=parseFloat(Y.value)||0,L.value="",F.value=!0):u.A.warning(i.$t("quickTrade.cryptoOnly"))},V=function(){u.A.success(i.$t("quickTrade.orderSuccess"))},W=function(t){t&&O.value&&(R.value=t)},H=function(){i&&i.$router&&i.$router.push("/indicator-community")},$=(0,h.KR)(""),K=(0,h.KR)(""),Y=(0,h.KR)("--"),X=(0,h.KR)(0),j=(0,h.EW)(function(){return X.value>0?"color-up":X.value<0?"color-down":""}),U=(0,h.KR)("1D"),G=(0,h.KR)([]),Z=(0,h.KR)(!1),q=[{id:"sma5",name:"SMA5 (5日均线)",shortName:"SMA5",type:"line",defaultParams:{length:5}},{id:"sma10",name:"SMA10 (10日均线)",shortName:"SMA10",type:"line",defaultParams:{length:10}},{id:"sma20",name:"SMA20 (20日均线)",shortName:"SMA20",type:"line",defaultParams:{length:20}},{id:"sma30",name:"SMA30 (30日均线)",shortName:"SMA30",type:"line",defaultParams:{length:30}}],J=[{id:"ema5",name:"EMA5 (5日指数均线)",shortName:"EMA5",type:"line",defaultParams:{length:5}},{id:"ema10",name:"EMA10 (10日指数均线)",shortName:"EMA10",type:"line",defaultParams:{length:10}},{id:"ema20",name:"EMA20 (20日指数均线)",shortName:"EMA20",type:"line",defaultParams:{length:20}},{id:"ema30",name:"EMA30 (30日指数均线)",shortName:"EMA30",type:"line",defaultParams:{length:30}}],Q=(0,h.KR)([]),tt=(0,h.KR)([]),et=(0,h.KR)(!1),it=(0,h.KR)(!1),nt=(0,h.KR)(null),at=(0,h.KR)(""),rt=(0,h.KR)([]),ot=(0,h.KR)({}),st=(0,h.KR)(!1),lt=(0,h.KR)({}),ct=(0,h.KR)(!1),ut=(0,h.KR)(!1),dt=(0,h.KR)(!1),ht=(0,h.KR)(null),pt=(0,h.KR)(!1),vt=(0,h.KR)(null),ft=(0,h.KR)(!1),gt=(0,h.KR)(null),mt=(0,h.KR)(!1),yt=(0,h.KR)(null),_t=(0,h.KR)(!1),bt=(0,h.KR)(null),xt=(0,h.KR)(!1),wt=(0,h.KR)(!1),St=(0,h.KR)("free"),Ct=(0,h.KR)(10),kt=(0,h.KR)(""),It=(0,h.KR)(!1),Et={price:[{required:!0,message:"请输入价格",trigger:"blur",type:"number"}]},At=(0,h.KR)(!1),Pt=function(t){var e=t.price,i=t.change;Y.value=e,X.value=i},Mt=function(){},Dt=(0,h.KR)([]),Tt=(0,h.KR)([]),Bt=function(t){U.value=t},Ft=function(t){return t?Object.values(t).join(", "):""},Rt=function(){var t=(0,c.A)((0,l.A)().m(function t(){var e,i,r,o,s,c;return(0,l.A)().w(function(t){while(1)switch(t.p=t.n){case 0:if(a.value=!0,t.p=1,r=(0,h.nI)(),o=null===r||void 0===r||null===(e=r.proxy)||void 0===e?void 0:e.$store,s=(null===o||void 0===o||null===(i=o.getters)||void 0===i?void 0:i.userInfo)||{},!s||!s.email){t.n=2;break}return n.value=s.id,a.value=!1,Lt(),ae(),t.a(2);case 2:return t.n=3,(0,g.ug)();case 3:c=t.v,c&&1===c.code&&c.data&&(n.value=c.data.id,o&&o.commit("SET_INFO",c.data),Lt(),ae()),t.n=5;break;case 4:t.p=4,t.v;case 5:return t.p=5,a.value=!1,t.f(5);case 6:return t.a(2)}},t,null,[[1,4,5,6]])}));return function(){return t.apply(this,arguments)}}(),Lt=function(){var t=(0,c.A)((0,l.A)().m(function t(){var e,a;return(0,l.A)().w(function(t){while(1)switch(t.p=t.n){case 0:if(n.value){t.n=1;break}return t.a(2);case 1:return _.value=!0,t.p=2,t.n=3,(0,f.Qo)({userid:n.value});case 3:e=t.v,e&&1===e.code&&e.data&&(y.value=e.data.map(function(t){return(0,d.A)((0,d.A)({},t),{},{label:t.symbol+(t.name?" (".concat(t.name,")"):""),value:"".concat(t.market,":").concat(t.symbol)})}),Nt(),y.value.length>0&&!$.value&&(a=y.value[0],K.value=a.market,$.value=a.symbol,p.value=a.value)),t.n=5;break;case 4:t.p=4,t.v,u.A.error(i.$t("dashboard.indicator.error.loadWatchlistFailed"));case 5:return t.p=5,_.value=!1,t.f(5);case 6:return t.a(2)}},t,null,[[2,4,5,6]])}));return function(){return t.apply(this,arguments)}}(),Nt=function(){b.value?m.value=y.value.filter(function(t){return t.symbol.toLowerCase().includes(b.value.toLowerCase())||t.name&&t.name.toLowerCase().includes(b.value.toLowerCase())}):m.value=y.value},Ot=function(t){b.value=t,0===y.value.length&&t&&(x.value=!0),Nt()},zt=function(t){x.value=t,t||(b.value="")},Vt=function(t){if("__empty_watchlist_hint__"!==t){if("__add_stock_option__"===t)return w.value=!0,void setTimeout(function(){p.value=void 0},0);var e=y.value.find(function(e){return e.value===t});if(e||(e=m.value.find(function(e){return e.value===t})),!e&&t.includes(":")){var i=t.split(":"),n=(0,s.A)(i,2),a=n[0],r=n[1];e={market:a,symbol:r,value:t}}e&&(K.value=e.market,$.value=e.symbol,p.value=e.value)}},Wt=function(t,e){var i,n=(null===(i=e.componentOptions)||void 0===i||null===(i=i.propsData)||void 0===i?void 0:i.value)||"";return"__empty_watchlist_hint__"===n||"__add_stock_option__"===n||n.toLowerCase().includes(t.toLowerCase())},Ht=function(){var t=(0,c.A)((0,l.A)().m(function t(){var e;return(0,l.A)().w(function(t){while(1)switch(t.p=t.n){case 0:return t.p=0,t.n=1,(0,f.iO)();case 1:e=t.v,e&&1===e.code&&e.data&&Array.isArray(e.data)?T.value=e.data.map(function(t){return{value:t.value,i18nKey:t.i18nKey||"dashboard.analysis.market.".concat(t.value)}}):e&&1===e.code&&e.data&&"object"===(0,o.A)(e.data)?T.value=Object.keys(e.data).map(function(t){return{value:t,i18nKey:"dashboard.analysis.market.".concat(t)}}):T.value=[{value:"USStock",i18nKey:"dashboard.analysis.market.USStock"},{value:"CNStock",i18nKey:"dashboard.analysis.market.CNStock"},{value:"HKStock",i18nKey:"dashboard.analysis.market.HKStock"},{value:"Crypto",i18nKey:"dashboard.analysis.market.Crypto"},{value:"Forex",i18nKey:"dashboard.analysis.market.Forex"},{value:"Futures",i18nKey:"dashboard.analysis.market.Futures"}],T.value.length>0&&!C.value&&(C.value=T.value[0].value),t.n=3;break;case 2:t.p=2,t.v,T.value=[{value:"USStock",i18nKey:"dashboard.analysis.market.USStock"},{value:"CNStock",i18nKey:"dashboard.analysis.market.CNStock"},{value:"HKStock",i18nKey:"dashboard.analysis.market.HKStock"},{value:"Crypto",i18nKey:"dashboard.analysis.market.Crypto"},{value:"Forex",i18nKey:"dashboard.analysis.market.Forex"},{value:"Futures",i18nKey:"dashboard.analysis.market.Futures"}];case 3:return t.a(2)}},t,null,[[0,2]])}));return function(){return t.apply(this,arguments)}}(),$t=function(){w.value=!1,M.value=null,k.value="",I.value=[],B.value=!1,C.value=T.value.length>0?T.value[0].value:""},Kt=function(t){C.value=t,k.value="",I.value=[],M.value=null,B.value=!1,Zt(t)},Yt=function(t){var e=t.target.value;if(k.value=e,D.value&&clearTimeout(D.value),!e||""===e.trim())return I.value=[],B.value=!1,void(M.value=null);D.value=setTimeout(function(){jt(e)},500)},Xt=function(t){t&&t.trim()&&(C.value?I.value.length>0||(B.value&&0===I.value.length?Ut():jt(t)):u.A.warning(i.$t("dashboard.analysis.modal.addStock.pleaseSelectMarket")))},jt=function(){var t=(0,c.A)((0,l.A)().m(function t(e){var n;return(0,l.A)().w(function(t){while(1)switch(t.p=t.n){case 0:if(e&&""!==e.trim()){t.n=1;break}return I.value=[],B.value=!1,t.a(2);case 1:if(C.value){t.n=2;break}return u.A.warning(i.$t("dashboard.analysis.modal.addStock.pleaseSelectMarket")),t.a(2);case 2:return E.value=!0,B.value=!0,t.p=3,t.n=4,(0,f._3)({market:C.value,keyword:e.trim(),limit:20});case 4:n=t.v,n&&1===n.code&&n.data&&n.data.length>0?I.value=n.data:(I.value=[],M.value={market:C.value,symbol:e.trim().toUpperCase(),name:""}),t.n=6;break;case 5:t.p=5,t.v,I.value=[],M.value={market:C.value,symbol:e.trim().toUpperCase(),name:""};case 6:return t.p=6,E.value=!1,t.f(6);case 7:return t.a(2)}},t,null,[[3,5,6,7]])}));return function(e){return t.apply(this,arguments)}}(),Ut=function(){k.value&&k.value.trim()?C.value?M.value={market:C.value,symbol:k.value.trim().toUpperCase(),name:""}:u.A.warning(i.$t("dashboard.analysis.modal.addStock.pleaseSelectMarket")):u.A.warning(i.$t("dashboard.analysis.modal.addStock.pleaseEnterSymbol"))},Gt=function(t){M.value={market:t.market,symbol:t.symbol,name:t.name||t.symbol}},Zt=function(){var t=(0,c.A)((0,l.A)().m(function t(e){var i;return(0,l.A)().w(function(t){while(1)switch(t.p=t.n){case 0:if(e||(e=C.value||(T.value.length>0?T.value[0].value:"")),e){t.n=1;break}return t.a(2);case 1:return P.value=!0,t.p=2,t.n=3,(0,f.z6)({market:e,limit:10});case 3:i=t.v,i&&1===i.code&&i.data?A.value=i.data:A.value=[],t.n=5;break;case 4:t.p=4,t.v,A.value=[];case 5:return t.p=5,P.value=!1,t.f(5);case 6:return t.a(2)}},t,null,[[2,4,5,6]])}));return function(e){return t.apply(this,arguments)}}(),qt=function(){var t=(0,c.A)((0,l.A)().m(function t(){var e,a,r,o,s,c;return(0,l.A)().w(function(t){while(1)switch(t.p=t.n){case 0:if(e="",a="",!M.value){t.n=1;break}e=M.value.market,a=M.value.symbol.toUpperCase(),t.n=4;break;case 1:if(!k.value||!k.value.trim()){t.n=3;break}if(C.value){t.n=2;break}return u.A.warning(i.$t("dashboard.analysis.modal.addStock.pleaseSelectMarket")),t.a(2);case 2:e=C.value,a=k.value.trim().toUpperCase(),t.n=4;break;case 3:return u.A.warning(i.$t("dashboard.analysis.modal.addStock.pleaseSelectOrEnterSymbol")),t.a(2);case 4:return S.value=!0,t.p=5,t.n=6,(0,f.dp)({userid:n.value,market:e,symbol:a});case 6:if(r=t.v,!r||1!==r.code){t.n=8;break}return u.A.success(i.$t("dashboard.analysis.message.addStockSuccess")),$t(),t.n=7,Lt();case 7:t.n=9;break;case 8:u.A.error((null===r||void 0===r?void 0:r.msg)||i.$t("dashboard.analysis.message.addStockFailed"));case 9:t.n=11;break;case 10:t.p=10,c=t.v,s=(null===c||void 0===c||null===(o=c.response)||void 0===o||null===(o=o.data)||void 0===o?void 0:o.msg)||(null===c||void 0===c?void 0:c.message)||i.$t("dashboard.analysis.message.addStockFailed"),u.A.error(s);case 11:return t.p=11,S.value=!1,t.f(11);case 12:return t.a(2)}},t,null,[[5,10,11,12]])}));return function(){return t.apply(this,arguments)}}(),Jt=function(t){if(!ie(t.id)){var e=t.params||t.defaultParams||{};G.value.push((0,d.A)((0,d.A)({},t),{},{id:t.id,params:(0,d.A)({},e)}))}},Qt=function(t){G.value=G.value.filter(function(e){return e.id!==t})},te=function(t){var e=t.action,i=t.indicator;if("add"===e){var n=(0,d.A)((0,d.A)({},i),{},{calculate:ee(i.id)});Jt(n)}else"remove"===e&&Qt(i.id)},ee=function(t){return null},ie=function(t){return"sma"===t?q.some(function(t){return G.value.some(function(e){return e.id===t.id})}):"ema"===t?J.some(function(t){return G.value.some(function(e){return e.id===t.id})}):G.value.some(function(e){return e.id===t})},ne=function(){var t=new Set;return q.forEach(function(e){return t.add(e.id)}),J.forEach(function(e){return t.add(e.id)}),G.value.filter(function(e){return!t.has(e.id)})},ae=function(){var t=(0,c.A)((0,l.A)().m(function t(){var e,i,a;return(0,l.A)().w(function(t){while(1)switch(t.p=t.n){case 0:if(n.value){t.n=1;break}return t.a(2);case 1:return et.value=!0,t.p=2,t.n=3,(0,v.Ay)({url:"/api/indicator/getIndicators",method:"get",params:{userid:n.value}});case 3:e=t.v,1===e.code&&e.data&&(i=e.data.filter(function(t){return!t.is_buy||0===t.is_buy||"0"===t.is_buy}),a=e.data.filter(function(t){return 1===t.is_buy||"1"===t.is_buy}),Q.value=i.map(function(t){return(0,d.A)((0,d.A)({},t),{},{type:"python",source:"custom"})}),tt.value=a.map(function(t){return(0,d.A)((0,d.A)({},t),{},{type:"python",source:"purchased"})})),t.n=5;break;case 4:t.p=4,t.v;case 5:return t.p=5,et.value=!1,t.f(5);case 6:return t.a(2)}},t,null,[[2,4,5,6]])}));return function(){return t.apply(this,arguments)}}(),re=(0,h.KR)(null),oe=function(){var t=(0,c.A)((0,l.A)().m(function t(e,n){var a,r,o,s,c,h,p,v,f;return(0,l.A)().w(function(t){while(1)switch(t.p=t.n){case 0:if(a="".concat(n,"-").concat(e.id),!ie(a)){t.n=1;break}return Qt(a),t.a(2);case 1:if(t.p=1,r=e.code||"",re.value){t.n=2;break}return u.A.error(i.$t("dashboard.indicator.error.chartNotReady")),t.a(2);case 2:if("function"===typeof re.value.parsePythonStrategy){t.n=3;break}return u.A.error(i.$t("dashboard.indicator.error.chartMethodNotReady")),t.a(2);case 3:if("function"===typeof re.value.executePythonStrategy){t.n=4;break}return u.A.error(i.$t("dashboard.indicator.error.chartExecuteNotReady")),t.a(2);case 4:if(o=re.value.parsePythonStrategy(r),o){t.n=5;break}return u.A.error(i.$t("dashboard.indicator.error.parseFailed")),t.a(2);case 5:s=e.userParams||{},c=r,h=(0,d.A)({},s),p={id:a,name:e.name,type:"python",code:c,description:e.description,parsed:o,userParams:h,originalId:e.id,user_id:e.user_id||e.userId,is_encrypted:e.is_encrypted||e.isEncrypted||0,calculate:function(t,i){return re.value.executePythonStrategy(c,t,(0,d.A)((0,d.A)({},i),h),{id:e.id,user_id:e.user_id||e.userId,is_encrypted:e.is_encrypted||e.isEncrypted||0})}},v=(0,d.A)((0,d.A)({},o.params),s),G.value.push((0,d.A)((0,d.A)({},p),{},{params:v})),t.n=7;break;case 6:t.p=6,f=t.v,u.A.error(i.$t("dashboard.indicator.error.addIndicatorFailed")+": "+(f.message||"未知错误"));case 7:return t.a(2)}},t,null,[[1,6]])}));return function(e,i){return t.apply(this,arguments)}}(),se=function(){var t=(0,c.A)((0,l.A)().m(function t(e,n){var a,r,o,s,c;return(0,l.A)().w(function(t){while(1)switch(t.p=t.n){case 0:if(a="".concat(n,"-").concat(e.id),!ie(a)){t.n=1;break}Qt(a),t.n=5;break;case 1:return t.p=1,st.value=!0,t.n=2,i.$http.get("/api/indicator/getIndicatorParams",{params:{indicator_id:e.id}});case 2:r=t.v,r&&1===r.code&&Array.isArray(r.data)&&r.data.length>0?(rt.value=r.data,o="".concat(n,"-").concat(e.id),s=lt.value[o],c={},r.data.forEach(function(t){var e=s&&void 0!==s[t.name]?s[t.name]:t.default;e="int"===t.type?parseInt(e)||0:"float"===t.type?parseFloat(e)||0:"bool"===t.type?!0===e||"true"===e||1===e||"1"===e:e||"",c[t.name]=e}),ot.value=c,nt.value=e,at.value=n,it.value=!0):oe(e,n),t.n=4;break;case 3:t.p=3,t.v,oe(e,n);case 4:return t.p=4,st.value=!1,t.f(4);case 5:return t.a(2)}},t,null,[[1,3,4,5]])}));return function(e,i){return t.apply(this,arguments)}}(),le=function(){if(nt.value){var t="".concat(at.value,"-").concat(nt.value.id);lt.value[t]=(0,d.A)({},ot.value);var e=(0,d.A)((0,d.A)({},nt.value),{},{userParams:(0,d.A)({},ot.value)});oe(e,at.value)}it.value=!1,nt.value=null,at.value=""},ce=function(){ue(),it.value=!1,setTimeout(function(){nt.value=null,at.value=""},100)},ue=function(){if(nt.value&&at.value){var t="".concat(at.value,"-").concat(nt.value.id);lt.value[t]=JSON.parse(JSON.stringify(ot.value))}},de=function(){ue()},he=function(t){var e=t.code,n=t.name;if(e&&e.trim())try{if(!re.value)return void u.A.error(i.$t("dashboard.indicator.error.chartNotReady"));if("function"!==typeof re.value.parsePythonStrategy)return void u.A.error(i.$t("dashboard.indicator.error.chartMethodNotReady"));if("function"!==typeof re.value.executePythonStrategy)return void u.A.error(i.$t("dashboard.indicator.error.chartExecuteNotReady"));var a=re.value.parsePythonStrategy(e);if(!a)return void u.A.error(i.$t("dashboard.indicator.error.parseFailedCheck"));var r={id:"temp-editor-indicator",name:n||"临时指标",type:"python",code:e,description:"",parsed:a,calculate:function(t,i){var n=e;return re.value.executePythonStrategy(n,t,i)}},o=G.value.findIndex(function(t){return"temp-editor-indicator"===t.id});o>=0&&G.value.splice(o,1),G.value.push((0,d.A)((0,d.A)({},r),{},{params:(0,d.A)({},a.params)})),u.A.success(i.$t("dashboard.indicator.success.runIndicator"))}catch(s){u.A.error(i.$t("dashboard.indicator.error.runIndicatorFailed")+": "+(s.message||"未知错误"))}else u.A.warning(i.$t("dashboard.indicator.warning.enterCode"))},pe=function(){ht.value=null,dt.value=!0},ve=function(t){ht.value=t,dt.value=!0},fe=function(){ct.value=!ct.value},ge=function(t){r.A.confirm({title:i.$t("dashboard.indicator.delete.confirmTitle"),content:i.$t("dashboard.indicator.delete.confirmContent",{name:t.name}),okText:i.$t("dashboard.indicator.delete.confirmOk"),okType:"danger",cancelText:i.$t("dashboard.indicator.delete.confirmCancel"),onOk:function(){var e=(0,c.A)((0,l.A)().m(function e(){var a,r,o;return(0,l.A)().w(function(e){while(1)switch(e.p=e.n){case 0:return e.p=0,e.n=1,(0,v.Ay)({url:"/api/indicator/deleteIndicator",method:"post",data:{id:t.id,userid:n.value}});case 1:if(a=e.v,1!==a.code){e.n=3;break}return u.A.success(i.$t("dashboard.indicator.delete.success")),r="custom-"+t.id,ie(r)&&Qt(r),e.n=2,ae();case 2:e.n=4;break;case 3:u.A.error(a.msg||i.$t("dashboard.indicator.delete.failed"));case 4:e.n=6;break;case 5:e.p=5,o=e.v,u.A.error(i.$t("dashboard.indicator.delete.failed")+": "+(o.message||"未知错误"));case 6:return e.a(2)}},e,null,[[0,5]])}));function a(){return e.apply(this,arguments)}return a}()})},me=function(t){i.$router.push({path:"/backtest-center",query:{tab:"indicator",indicator_id:String(t.id)}})},ye=function(t){i.$router.push({path:"/backtest-center",query:{tab:"indicator",indicator_id:String(t.id),view:"history"}})},_e=function(t){},be=function(t){bt.value=(0,d.A)({},t),St.value=t.pricing_type||"free",Ct.value=t.price||10,kt.value=t.description||"",It.value=!!t.vip_free,_t.value=!0},xe=function(t){i.$router.push({path:"/trading-assistant",query:{mode:"create",indicator_id:String(t.id),indicator_name:t.name||"",indicator_desc:t.description||""}})},we=function(){var t=(0,c.A)((0,l.A)().m(function t(){var e,a;return(0,l.A)().w(function(t){while(1)switch(t.p=t.n){case 0:if(n.value){t.n=1;break}return u.A.error(i.$t("dashboard.indicator.error.pleaseLogin")),t.a(2);case 1:return xt.value=!0,t.p=2,t.n=3,(0,v.Ay)({url:"/api/indicator/saveIndicator",method:"post",data:{userid:n.value,id:bt.value.id,code:bt.value.code,name:bt.value.name,description:kt.value,publishToCommunity:!0,pricingType:St.value,price:"paid"===St.value?Ct.value:0,vipFree:"paid"===St.value&&It.value}});case 3:if(e=t.v,1!==e.code){t.n=5;break}return u.A.success(i.$t("dashboard.indicator.publish.success")),_t.value=!1,bt.value=null,t.n=4,ae();case 4:t.n=6;break;case 5:u.A.error(e.msg||i.$t("dashboard.indicator.publish.failed"));case 6:t.n=8;break;case 7:t.p=7,a=t.v,u.A.error(i.$t("dashboard.indicator.publish.failed")+": "+(a.message||""));case 8:return t.p=8,xt.value=!1,t.f(8);case 9:return t.a(2)}},t,null,[[2,7,8,9]])}));return function(){return t.apply(this,arguments)}}(),Se=function(){var t=(0,c.A)((0,l.A)().m(function t(){var e;return(0,l.A)().w(function(t){while(1)switch(t.p=t.n){case 0:if(n.value&&bt.value){t.n=1;break}return t.a(2);case 1:return wt.value=!0,t.p=2,t.n=3,(0,v.Ay)({url:"/api/indicator/saveIndicator",method:"post",data:{userid:n.value,id:bt.value.id,code:bt.value.code,name:bt.value.name,description:bt.value.description,publishToCommunity:!1,pricingType:"free",price:0,vipFree:!1}});case 3:if(e=t.v,1!==e.code){t.n=5;break}return u.A.success(i.$t("dashboard.indicator.publish.unpublishSuccess")),_t.value=!1,bt.value=null,t.n=4,ae();case 4:t.n=6;break;case 5:u.A.error(e.msg||i.$t("dashboard.indicator.publish.unpublishFailed"));case 6:t.n=8;break;case 7:t.p=7,t.v,u.A.error(i.$t("dashboard.indicator.publish.unpublishFailed"));case 8:return t.p=8,wt.value=!1,t.f(8);case 9:return t.a(2)}},t,null,[[2,7,8,9]])}));return function(){return t.apply(this,arguments)}}(),Ce=function(){var t=(0,c.A)((0,l.A)().m(function t(e){var a,r,o;return(0,l.A)().w(function(t){while(1)switch(t.p=t.n){case 0:if(n.value){t.n=1;break}return u.A.error(i.$t("dashboard.indicator.error.pleaseLogin")),t.a(2);case 1:return a=i.$refs.indicatorEditor,a&&(a.saving=!0),t.p=2,t.n=3,(0,v.Ay)({url:"/api/indicator/saveIndicator",method:"post",data:{userid:n.value,id:e.id||0,code:e.code}});case 3:if(r=t.v,1!==r.code){t.n=5;break}return u.A.success(i.$t("dashboard.indicator.save.success")),dt.value=!1,ht.value=null,t.n=4,ae();case 4:t.n=6;break;case 5:u.A.error(r.msg||i.$t("dashboard.indicator.save.failed"));case 6:t.n=8;break;case 7:t.p=7,o=t.v,u.A.error(i.$t("dashboard.indicator.save.failed")+": "+(o.message||"未知错误"));case 8:return t.p=8,a&&(a.saving=!1),t.f(8);case 9:return t.a(2)}},t,null,[[2,7,8,9]])}));return function(e){return t.apply(this,arguments)}}(),ke=function(t){var e=t.end_time;if(1===e||"1"===e)return i.$t("dashboard.indicator.status.normalPermanent");if(!e||0===e)return i.$t("dashboard.indicator.status.normal");var n=Math.floor(Date.now()/1e3);return e<n?i.$t("dashboard.indicator.status.expired"):i.$t("dashboard.indicator.status.normal")},Ie=function(t){var e=t.end_time;if(1===e||"1"===e)return"check-circle";if(!e||0===e)return"check-circle";var i=Math.floor(Date.now()/1e3);return e<i?"close-circle":"check-circle"},Ee=function(t){var e=t.end_time;if(1===e||"1"===e)return"status-normal";if(!e||0===e)return"status-normal";var i=Math.floor(Date.now()/1e3);return e<i?"status-expired":"status-normal"},Ae=function(t){var e=t.end_time;if(1===e||"1"===e)return i.$t("dashboard.indicator.expiry.permanent");if(!e||0===e)return i.$t("dashboard.indicator.expiry.noExpiry");var n=Math.floor(Date.now()/1e3),a=new Date(1e3*e).toLocaleString("zh-CN"===i.$i18n.locale?"zh-CN":"zh-TW"===i.$i18n.locale?"zh-TW":"en-US");return e<n?i.$t("dashboard.indicator.expiry.expired",{date:a}):i.$t("dashboard.indicator.expiry.expiresOn",{date:a})},Pe=function(t){var e={USStock:"dashboard.indicator.market.USStock",CNStock:"dashboard.indicator.market.CNStock",HKStock:"dashboard.indicator.market.HKStock",Crypto:"dashboard.indicator.market.Crypto",Forex:"dashboard.indicator.market.Forex",Futures:"dashboard.indicator.market.Futures"},n=e[t];return n&&null!==i&&void 0!==i&&i.$t?i.$t(n):t},Me=function(t){var e={USStock:"green",CNStock:"blue",HKStock:"geekblue",Crypto:"purple",Forex:"gold",Futures:"cyan"};return e[t]||"default"},De=function(){At.value=!At.value,localStorage.setItem("realtimeEnabled",At.value.toString())},Te=function(){Z.value=window.innerWidth<=768};return(0,h.sV)(function(){var t=localStorage.getItem("realtimeEnabled");null!==t&&(At.value="true"===t),Te(),window.addEventListener("resize",Te),Ht(),Rt(),Lt(),ae()}),(0,h.xo)(function(){window.removeEventListener("resize",Te),D.value&&clearTimeout(D.value)}),(0,h.wB)(w,function(t){t?(T.value.length>0&&!C.value&&(C.value=T.value[0].value),C.value&&Zt(C.value)):(M.value=null,k.value="",I.value=[],B.value=!1,D.value&&(clearTimeout(D.value),D.value=null))}),(0,h.wB)(function(){return ot.value},function(t){if(it.value&&nt.value&&at.value){var e="".concat(at.value,"-").concat(nt.value.id);lt.value[e]=JSON.parse(JSON.stringify(t))}},{deep:!0,immediate:!1}),(0,h.wB)(it,function(t){t||ue()}),{userId:n,klineChart:re,searchSymbol:p,symbolSuggestions:m,watchlist:y,symbolSearchValue:b,symbolSearchOpen:x,currentSymbol:$,currentMarket:K,currentPrice:Y,priceChange:X,priceChangeClass:j,timeframe:U,loadingWatchlist:_,activeIndicators:G,trendIndicators:Dt,oscillatorIndicators:Tt,customIndicators:Q,purchasedIndicators:tt,loadingIndicators:et,realtimeEnabled:At,toggleRealtime:De,handleSymbolSearch:Ot,handleSymbolSelect:Vt,handleDropdownVisibleChange:zt,filterSymbolOption:Wt,getMarketName:Pe,getMarketColor:Me,setTimeframe:Bt,addIndicator:Jt,removeIndicator:Qt,isIndicatorActive:ie,loadIndicators:ae,addPythonIndicator:oe,toggleIndicator:se,getIndicatorStatus:ke,getIndicatorStatusIcon:Ie,getIndicatorStatusClass:Ee,getExpiryTimeText:Ae,formatParams:Ft,loadWatchlist:Lt,getCustomActiveIndicators:ne,showIndicatorEditor:dt,editingIndicator:ht,handleCreateIndicator:pe,handleRunIndicator:he,handleSaveIndicator:Ce,handleEditIndicator:ve,handleDeleteIndicator:ge,toggleCustomSection:fe,customSectionCollapsed:ct,purchasedSectionCollapsed:ut,handlePriceChange:Pt,handleChartRetry:Mt,handleIndicatorToggle:te,showParamsModal:it,pendingIndicator:nt,indicatorParams:rt,indicatorParamValues:ot,loadingParams:st,confirmIndicatorParams:le,cancelIndicatorParams:ce,handleParamsModalAfterClose:de,showBacktestModal:pt,backtestIndicator:vt,handleOpenBacktest:me,showBacktestHistoryDrawer:ft,backtestHistoryIndicator:gt,handleOpenBacktestHistory:ye,showBacktestRunViewer:mt,selectedBacktestRun:yt,handleViewBacktestRun:_e,showPublishModal:_t,publishIndicator:bt,publishing:xt,unpublishing:wt,publishPricingType:St,publishPrice:Ct,publishDescription:kt,publishVipFree:It,publishRules:Et,handlePublishIndicator:be,handleCreateStrategyFromIndicator:xe,handleConfirmPublish:we,handleUnpublish:Se,selectedSymbol:$,selectedMarket:K,selectedTimeframe:U,isMobile:Z,showAddStockModal:w,addingStock:S,selectedMarketTab:C,symbolSearchKeyword:k,symbolSearchResults:I,searchingSymbols:E,hotSymbols:A,loadingHotSymbols:P,selectedSymbolForAdd:M,marketTypes:T,hasSearched:B,handleCloseAddStockModal:$t,handleMarketTabChange:Kt,handleSymbolSearchInput:Yt,handleSearchOrInput:Xt,searchSymbolsInModal:jt,selectSymbol:Gt,loadHotSymbols:Zt,handleAddStock:qt,handleDirectAdd:Ut,loadMarketTypes:Ht,showQuickTrade:F,qtSymbol:R,qtSide:L,qtPrice:N,isCryptoMarket:O,openQuickTrade:z,onQuickTradeSuccess:V,handleQuickTradeSymbolChange:W,goToIndicatorMarket:H}}},Wa=Va,Ha=(0,E.A)(Wa,n,a,!1,null,"11d8a5e2",null),$a=Ha.exports},40955:function(t,e,i){(function(e,n){t.exports=n(i(19021),i(80754),i(84636),i(39506),i(57165))})(0,function(t){return function(){var e=t,i=e.lib,n=i.BlockCipher,a=e.algo,r=[],o=[],s=[],l=[],c=[],u=[],d=[],h=[],p=[],v=[];(function(){for(var t=[],e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;var i=0,n=0;for(e=0;e<256;e++){var a=n^n<<1^n<<2^n<<3^n<<4;a=a>>>8^255&a^99,r[i]=a,o[a]=i;var f=t[i],g=t[f],m=t[g],y=257*t[a]^16843008*a;s[i]=y<<24|y>>>8,l[i]=y<<16|y>>>16,c[i]=y<<8|y>>>24,u[i]=y;y=16843009*m^65537*g^257*f^16843008*i;d[a]=y<<24|y>>>8,h[a]=y<<16|y>>>16,p[a]=y<<8|y>>>24,v[a]=y,i?(i=f^t[t[t[m^f]]],n^=t[t[n]]):i=n=1}})();var f=[0,1,2,4,8,16,32,64,128,27,54],g=a.AES=n.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,e=t.words,i=t.sigBytes/4,n=this._nRounds=i+6,a=4*(n+1),o=this._keySchedule=[],s=0;s<a;s++)s<i?o[s]=e[s]:(u=o[s-1],s%i?i>6&&s%i==4&&(u=r[u>>>24]<<24|r[u>>>16&255]<<16|r[u>>>8&255]<<8|r[255&u]):(u=u<<8|u>>>24,u=r[u>>>24]<<24|r[u>>>16&255]<<16|r[u>>>8&255]<<8|r[255&u],u^=f[s/i|0]<<24),o[s]=o[s-i]^u);for(var l=this._invKeySchedule=[],c=0;c<a;c++){s=a-c;if(c%4)var u=o[s];else u=o[s-4];l[c]=c<4||s<=4?u:d[r[u>>>24]]^h[r[u>>>16&255]]^p[r[u>>>8&255]]^v[r[255&u]]}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,s,l,c,u,r)},decryptBlock:function(t,e){var i=t[e+1];t[e+1]=t[e+3],t[e+3]=i,this._doCryptBlock(t,e,this._invKeySchedule,d,h,p,v,o);i=t[e+1];t[e+1]=t[e+3],t[e+3]=i},_doCryptBlock:function(t,e,i,n,a,r,o,s){for(var l=this._nRounds,c=t[e]^i[0],u=t[e+1]^i[1],d=t[e+2]^i[2],h=t[e+3]^i[3],p=4,v=1;v<l;v++){var f=n[c>>>24]^a[u>>>16&255]^r[d>>>8&255]^o[255&h]^i[p++],g=n[u>>>24]^a[d>>>16&255]^r[h>>>8&255]^o[255&c]^i[p++],m=n[d>>>24]^a[h>>>16&255]^r[c>>>8&255]^o[255&u]^i[p++],y=n[h>>>24]^a[c>>>16&255]^r[u>>>8&255]^o[255&d]^i[p++];c=f,u=g,d=m,h=y}f=(s[c>>>24]<<24|s[u>>>16&255]<<16|s[d>>>8&255]<<8|s[255&h])^i[p++],g=(s[u>>>24]<<24|s[d>>>16&255]<<16|s[h>>>8&255]<<8|s[255&c])^i[p++],m=(s[d>>>24]<<24|s[h>>>16&255]<<16|s[c>>>8&255]<<8|s[255&u])^i[p++],y=(s[h>>>24]<<24|s[c>>>16&255]<<16|s[u>>>8&255]<<8|s[255&d])^i[p++];t[e]=f,t[e+1]=g,t[e+2]=m,t[e+3]=y},keySize:8});e.AES=n._createHelper(g)}(),t.AES})},43128:function(t,e,i){(function(e,n){t.exports=n(i(19021),i(80754),i(84636),i(39506),i(57165))})(0,function(t){return function(){var e=t,i=e.lib,n=i.BlockCipher,a=e.algo;const r=16,o=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],s=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var l={pbox:[],sbox:[]};function c(t,e){let i=e>>24&255,n=e>>16&255,a=e>>8&255,r=255&e,o=t.sbox[0][i]+t.sbox[1][n];return o^=t.sbox[2][a],o+=t.sbox[3][r],o}function u(t,e,i){let n,a=e,o=i;for(let s=0;s<r;++s)a^=t.pbox[s],o=c(t,a)^o,n=a,a=o,o=n;return n=a,a=o,o=n,o^=t.pbox[r],a^=t.pbox[r+1],{left:a,right:o}}function d(t,e,i){let n,a=e,o=i;for(let s=r+1;s>1;--s)a^=t.pbox[s],o=c(t,a)^o,n=a,a=o,o=n;return n=a,a=o,o=n,o^=t.pbox[1],a^=t.pbox[0],{left:a,right:o}}function h(t,e,i){for(let r=0;r<4;r++){t.sbox[r]=[];for(let e=0;e<256;e++)t.sbox[r][e]=s[r][e]}let n=0;for(let s=0;s<r+2;s++)t.pbox[s]=o[s]^e[n],n++,n>=i&&(n=0);let a=0,l=0,c=0;for(let o=0;o<r+2;o+=2)c=u(t,a,l),a=c.left,l=c.right,t.pbox[o]=a,t.pbox[o+1]=l;for(let r=0;r<4;r++)for(let e=0;e<256;e+=2)c=u(t,a,l),a=c.left,l=c.right,t.sbox[r][e]=a,t.sbox[r][e+1]=l;return!0}var p=a.Blowfish=n.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var t=this._keyPriorReset=this._key,e=t.words,i=t.sigBytes/4;h(l,e,i)}},encryptBlock:function(t,e){var i=u(l,t[e],t[e+1]);t[e]=i.left,t[e+1]=i.right},decryptBlock:function(t,e){var i=d(l,t[e],t[e+1]);t[e]=i.left,t[e+1]=i.right},blockSize:2,keySize:4,ivSize:2});e.Blowfish=n._createHelper(p)}(),t.Blowfish})},57165:function(t,e,i){(function(e,n){t.exports=n(i(19021),i(39506))})(0,function(t){t.lib.Cipher||function(e){var i=t,n=i.lib,a=n.Base,r=n.WordArray,o=n.BufferedBlockAlgorithm,s=i.enc,l=(s.Utf8,s.Base64),c=i.algo,u=c.EvpKDF,d=n.Cipher=o.extend({cfg:a.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,i){this.cfg=this.cfg.extend(i),this._xformMode=t,this._key=e,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){t&&this._append(t);var e=this._doFinalize();return e},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function t(t){return"string"==typeof t?S:b}return function(e){return{encrypt:function(i,n,a){return t(n).encrypt(e,i,n,a)},decrypt:function(i,n,a){return t(n).decrypt(e,i,n,a)}}}}()}),h=(n.StreamCipher=d.extend({_doFinalize:function(){var t=this._process(!0);return t},blockSize:1}),i.mode={}),p=n.BlockCipherMode=a.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}}),v=h.CBC=function(){var t=p.extend();function i(t,i,n){var a,r=this._iv;r?(a=r,this._iv=e):a=this._prevBlock;for(var o=0;o<n;o++)t[i+o]^=a[o]}return t.Encryptor=t.extend({processBlock:function(t,e){var n=this._cipher,a=n.blockSize;i.call(this,t,e,a),n.encryptBlock(t,e),this._prevBlock=t.slice(e,e+a)}}),t.Decryptor=t.extend({processBlock:function(t,e){var n=this._cipher,a=n.blockSize,r=t.slice(e,e+a);n.decryptBlock(t,e),i.call(this,t,e,a),this._prevBlock=r}}),t}(),f=i.pad={},g=f.Pkcs7={pad:function(t,e){for(var i=4*e,n=i-t.sigBytes%i,a=n<<24|n<<16|n<<8|n,o=[],s=0;s<n;s+=4)o.push(a);var l=r.create(o,n);t.concat(l)},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},m=(n.BlockCipher=d.extend({cfg:d.cfg.extend({mode:v,padding:g}),reset:function(){var t;d.reset.call(this);var e=this.cfg,i=e.iv,n=e.mode;this._xformMode==this._ENC_XFORM_MODE?t=n.createEncryptor:(t=n.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==t?this._mode.init(this,i&&i.words):(this._mode=t.call(n,this,i&&i.words),this._mode.__creator=t)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t,e=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t},blockSize:4}),n.CipherParams=a.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}})),y=i.format={},_=y.OpenSSL={stringify:function(t){var e,i=t.ciphertext,n=t.salt;return e=n?r.create([1398893684,1701076831]).concat(n).concat(i):i,e.toString(l)},parse:function(t){var e,i=l.parse(t),n=i.words;return 1398893684==n[0]&&1701076831==n[1]&&(e=r.create(n.slice(2,4)),n.splice(0,4),i.sigBytes-=16),m.create({ciphertext:i,salt:e})}},b=n.SerializableCipher=a.extend({cfg:a.extend({format:_}),encrypt:function(t,e,i,n){n=this.cfg.extend(n);var a=t.createEncryptor(i,n),r=a.finalize(e),o=a.cfg;return m.create({ciphertext:r,key:i,iv:o.iv,algorithm:t,mode:o.mode,padding:o.padding,blockSize:t.blockSize,formatter:n.format})},decrypt:function(t,e,i,n){n=this.cfg.extend(n),e=this._parse(e,n.format);var a=t.createDecryptor(i,n).finalize(e.ciphertext);return a},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),x=i.kdf={},w=x.OpenSSL={execute:function(t,e,i,n,a){if(n||(n=r.random(8)),a)o=u.create({keySize:e+i,hasher:a}).compute(t,n);else var o=u.create({keySize:e+i}).compute(t,n);var s=r.create(o.words.slice(e),4*i);return o.sigBytes=4*e,m.create({key:o,iv:s,salt:n})}},S=n.PasswordBasedCipher=b.extend({cfg:b.cfg.extend({kdf:w}),encrypt:function(t,e,i,n){n=this.cfg.extend(n);var a=n.kdf.execute(i,t.keySize,t.ivSize,n.salt,n.hasher);n.iv=a.iv;var r=b.encrypt.call(this,t,e,a.key,n);return r.mixIn(a),r},decrypt:function(t,e,i,n){n=this.cfg.extend(n),e=this._parse(e,n.format);var a=n.kdf.execute(i,t.keySize,t.ivSize,e.salt,n.hasher);n.iv=a.iv;var r=b.decrypt.call(this,t,e,a.key,n);return r}})}()})},19021:function(t,e,i){(function(e,i){t.exports=i()})(0,function(){var t=t||function(t,e){var n;if("undefined"!==typeof window&&window.crypto&&(n=window.crypto),"undefined"!==typeof self&&self.crypto&&(n=self.crypto),"undefined"!==typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!==typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&"undefined"!==typeof i.g&&i.g.crypto&&(n=i.g.crypto),!n)try{n=i(50477)}catch(g){}var a=function(){if(n){if("function"===typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(g){}if("function"===typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(g){}}throw new Error("Native crypto module could not be used to get secure random number.")},r=Object.create||function(){function t(){}return function(e){var i;return t.prototype=e,i=new t,t.prototype=null,i}}(),o={},s=o.lib={},l=s.Base=function(){return{extend:function(t){var e=r(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),c=s.WordArray=l.extend({init:function(t,i){t=this.words=t||[],this.sigBytes=i!=e?i:4*t.length},toString:function(t){return(t||d).stringify(this)},concat:function(t){var e=this.words,i=t.words,n=this.sigBytes,a=t.sigBytes;if(this.clamp(),n%4)for(var r=0;r<a;r++){var o=i[r>>>2]>>>24-r%4*8&255;e[n+r>>>2]|=o<<24-(n+r)%4*8}else for(var s=0;s<a;s+=4)e[n+s>>>2]=i[s>>>2];return this.sigBytes+=a,this},clamp:function(){var e=this.words,i=this.sigBytes;e[i>>>2]&=4294967295<<32-i%4*8,e.length=t.ceil(i/4)},clone:function(){var t=l.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],i=0;i<t;i+=4)e.push(a());return new c.init(e,t)}}),u=o.enc={},d=u.Hex={stringify:function(t){for(var e=t.words,i=t.sigBytes,n=[],a=0;a<i;a++){var r=e[a>>>2]>>>24-a%4*8&255;n.push((r>>>4).toString(16)),n.push((15&r).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,i=[],n=0;n<e;n+=2)i[n>>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new c.init(i,e/2)}},h=u.Latin1={stringify:function(t){for(var e=t.words,i=t.sigBytes,n=[],a=0;a<i;a++){var r=e[a>>>2]>>>24-a%4*8&255;n.push(String.fromCharCode(r))}return n.join("")},parse:function(t){for(var e=t.length,i=[],n=0;n<e;n++)i[n>>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new c.init(i,e)}},p=u.Utf8={stringify:function(t){try{return decodeURIComponent(escape(h.stringify(t)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(t){return h.parse(unescape(encodeURIComponent(t)))}},v=s.BufferedBlockAlgorithm=l.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=p.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var i,n=this._data,a=n.words,r=n.sigBytes,o=this.blockSize,s=4*o,l=r/s;l=e?t.ceil(l):t.max((0|l)-this._minBufferSize,0);var u=l*o,d=t.min(4*u,r);if(u){for(var h=0;h<u;h+=o)this._doProcessBlock(a,h);i=a.splice(0,u),n.sigBytes-=d}return new c.init(i,d)},clone:function(){var t=l.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),f=(s.Hasher=v.extend({cfg:l.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){v.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){t&&this._append(t);var e=this._doFinalize();return e},blockSize:16,_createHelper:function(t){return function(e,i){return new t.init(i).finalize(e)}},_createHmacHelper:function(t){return function(e,i){return new f.HMAC.init(t,i).finalize(e)}}}),o.algo={});return o}(Math);return t})},80754:function(t,e,i){(function(e,n){t.exports=n(i(19021))})(0,function(t){return function(){var e=t,i=e.lib,n=i.WordArray,a=e.enc;a.Base64={stringify:function(t){var e=t.words,i=t.sigBytes,n=this._map;t.clamp();for(var a=[],r=0;r<i;r+=3)for(var o=e[r>>>2]>>>24-r%4*8&255,s=e[r+1>>>2]>>>24-(r+1)%4*8&255,l=e[r+2>>>2]>>>24-(r+2)%4*8&255,c=o<<16|s<<8|l,u=0;u<4&&r+.75*u<i;u++)a.push(n.charAt(c>>>6*(3-u)&63));var d=n.charAt(64);if(d)while(a.length%4)a.push(d);return a.join("")},parse:function(t){var e=t.length,i=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var a=0;a<i.length;a++)n[i.charCodeAt(a)]=a}var o=i.charAt(64);if(o){var s=t.indexOf(o);-1!==s&&(e=s)}return r(t,e,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function r(t,e,i){for(var a=[],r=0,o=0;o<e;o++)if(o%4){var s=i[t.charCodeAt(o-1)]<<o%4*2,l=i[t.charCodeAt(o)]>>>6-o%4*2,c=s|l;a[r>>>2]|=c<<24-r%4*8,r++}return n.create(a,r)}}(),t.enc.Base64})},64725:function(t,e,i){(function(e,n){t.exports=n(i(19021))})(0,function(t){return function(){var e=t,i=e.lib,n=i.WordArray,a=e.enc;a.Base64url={stringify:function(t,e){void 0===e&&(e=!0);var i=t.words,n=t.sigBytes,a=e?this._safe_map:this._map;t.clamp();for(var r=[],o=0;o<n;o+=3)for(var s=i[o>>>2]>>>24-o%4*8&255,l=i[o+1>>>2]>>>24-(o+1)%4*8&255,c=i[o+2>>>2]>>>24-(o+2)%4*8&255,u=s<<16|l<<8|c,d=0;d<4&&o+.75*d<n;d++)r.push(a.charAt(u>>>6*(3-d)&63));var h=a.charAt(64);if(h)while(r.length%4)r.push(h);return r.join("")},parse:function(t,e){void 0===e&&(e=!0);var i=t.length,n=e?this._safe_map:this._map,a=this._reverseMap;if(!a){a=this._reverseMap=[];for(var o=0;o<n.length;o++)a[n.charCodeAt(o)]=o}var s=n.charAt(64);if(s){var l=t.indexOf(s);-1!==l&&(i=l)}return r(t,i,a)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function r(t,e,i){for(var a=[],r=0,o=0;o<e;o++)if(o%4){var s=i[t.charCodeAt(o-1)]<<o%4*2,l=i[t.charCodeAt(o)]>>>6-o%4*2,c=s|l;a[r>>>2]|=c<<24-r%4*8,r++}return n.create(a,r)}}(),t.enc.Base64url})},45503:function(t,e,i){(function(e,n){t.exports=n(i(19021))})(0,function(t){return function(){var e=t,i=e.lib,n=i.WordArray,a=e.enc;a.Utf16=a.Utf16BE={stringify:function(t){for(var e=t.words,i=t.sigBytes,n=[],a=0;a<i;a+=2){var r=e[a>>>2]>>>16-a%4*8&65535;n.push(String.fromCharCode(r))}return n.join("")},parse:function(t){for(var e=t.length,i=[],a=0;a<e;a++)i[a>>>1]|=t.charCodeAt(a)<<16-a%2*16;return n.create(i,2*e)}};function r(t){return t<<8&4278255360|t>>>8&16711935}a.Utf16LE={stringify:function(t){for(var e=t.words,i=t.sigBytes,n=[],a=0;a<i;a+=2){var o=r(e[a>>>2]>>>16-a%4*8&65535);n.push(String.fromCharCode(o))}return n.join("")},parse:function(t){for(var e=t.length,i=[],a=0;a<e;a++)i[a>>>1]|=r(t.charCodeAt(a)<<16-a%2*16);return n.create(i,2*e)}}}(),t.enc.Utf16})},39506:function(t,e,i){(function(e,n){t.exports=n(i(19021),i(45471),i(51025))})(0,function(t){return function(){var e=t,i=e.lib,n=i.Base,a=i.WordArray,r=e.algo,o=r.MD5,s=r.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:o,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){var i,n=this.cfg,r=n.hasher.create(),o=a.create(),s=o.words,l=n.keySize,c=n.iterations;while(s.length<l){i&&r.update(i),i=r.update(t).finalize(e),r.reset();for(var u=1;u<c;u++)i=r.finalize(i),r.reset();o.concat(i)}return o.sigBytes=4*l,o}});e.EvpKDF=function(t,e,i){return s.create(i).compute(t,e)}}(),t.EvpKDF})},70025:function(t,e,i){(function(e,n){t.exports=n(i(19021),i(57165))})(0,function(t){return function(){var e=t,i=e.lib,n=i.CipherParams,a=e.enc,r=a.Hex,o=e.format;o.Hex={stringify:function(t){return t.ciphertext.toString(r)},parse:function(t){var e=r.parse(t);return n.create({ciphertext:e})}}}(),t.format.Hex})},51025:function(t,e,i){(function(e,n){t.exports=n(i(19021))})(0,function(t){(function(){var e=t,i=e.lib,n=i.Base,a=e.enc,r=a.Utf8,o=e.algo;o.HMAC=n.extend({init:function(t,e){t=this._hasher=new t.init,"string"==typeof e&&(e=r.parse(e));var i=t.blockSize,n=4*i;e.sigBytes>n&&(e=t.finalize(e)),e.clamp();for(var a=this._oKey=e.clone(),o=this._iKey=e.clone(),s=a.words,l=o.words,c=0;c<i;c++)s[c]^=1549556828,l[c]^=909522486;a.sigBytes=o.sigBytes=n,this.reset()},reset:function(){var t=this._hasher;t.reset(),t.update(this._iKey)},update:function(t){return this._hasher.update(t),this},finalize:function(t){var e=this._hasher,i=e.finalize(t);e.reset();var n=e.finalize(this._oKey.clone().concat(i));return n}})})()})},21396:function(t,e,i){(function(e,n){t.exports=n(i(19021),i(43240),i(6440),i(45503),i(80754),i(64725),i(84636),i(45471),i(63009),i(36308),i(81380),i(89557),i(45953),i(78056),i(51025),i(70019),i(39506),i(57165),i(82169),i(96939),i(6372),i(73797),i(38454),i(42073),i(54905),i(10482),i(52155),i(58124),i(70025),i(40955),i(7628),i(77193),i(96298),i(22696),i(43128))})(0,function(t){return t})},6440:function(t,e,i){(function(e,n){t.exports=n(i(19021))})(0,function(t){return function(){if("function"==typeof ArrayBuffer){var e=t,i=e.lib,n=i.WordArray,a=n.init,r=n.init=function(t){if(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),(t instanceof Int8Array||"undefined"!==typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array)&&(t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength)),t instanceof Uint8Array){for(var e=t.byteLength,i=[],n=0;n<e;n++)i[n>>>2]|=t[n]<<24-n%4*8;a.call(this,i,e)}else a.apply(this,arguments)};r.prototype=n}}(),t.lib.WordArray})},84636:function(t,e,i){(function(e,n){t.exports=n(i(19021))})(0,function(t){return function(e){var i=t,n=i.lib,a=n.WordArray,r=n.Hasher,o=i.algo,s=[];(function(){for(var t=0;t<64;t++)s[t]=4294967296*e.abs(e.sin(t+1))|0})();var l=o.MD5=r.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var i=0;i<16;i++){var n=e+i,a=t[n];t[n]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}var r=this._hash.words,o=t[e+0],l=t[e+1],p=t[e+2],v=t[e+3],f=t[e+4],g=t[e+5],m=t[e+6],y=t[e+7],_=t[e+8],b=t[e+9],x=t[e+10],w=t[e+11],S=t[e+12],C=t[e+13],k=t[e+14],I=t[e+15],E=r[0],A=r[1],P=r[2],M=r[3];E=c(E,A,P,M,o,7,s[0]),M=c(M,E,A,P,l,12,s[1]),P=c(P,M,E,A,p,17,s[2]),A=c(A,P,M,E,v,22,s[3]),E=c(E,A,P,M,f,7,s[4]),M=c(M,E,A,P,g,12,s[5]),P=c(P,M,E,A,m,17,s[6]),A=c(A,P,M,E,y,22,s[7]),E=c(E,A,P,M,_,7,s[8]),M=c(M,E,A,P,b,12,s[9]),P=c(P,M,E,A,x,17,s[10]),A=c(A,P,M,E,w,22,s[11]),E=c(E,A,P,M,S,7,s[12]),M=c(M,E,A,P,C,12,s[13]),P=c(P,M,E,A,k,17,s[14]),A=c(A,P,M,E,I,22,s[15]),E=u(E,A,P,M,l,5,s[16]),M=u(M,E,A,P,m,9,s[17]),P=u(P,M,E,A,w,14,s[18]),A=u(A,P,M,E,o,20,s[19]),E=u(E,A,P,M,g,5,s[20]),M=u(M,E,A,P,x,9,s[21]),P=u(P,M,E,A,I,14,s[22]),A=u(A,P,M,E,f,20,s[23]),E=u(E,A,P,M,b,5,s[24]),M=u(M,E,A,P,k,9,s[25]),P=u(P,M,E,A,v,14,s[26]),A=u(A,P,M,E,_,20,s[27]),E=u(E,A,P,M,C,5,s[28]),M=u(M,E,A,P,p,9,s[29]),P=u(P,M,E,A,y,14,s[30]),A=u(A,P,M,E,S,20,s[31]),E=d(E,A,P,M,g,4,s[32]),M=d(M,E,A,P,_,11,s[33]),P=d(P,M,E,A,w,16,s[34]),A=d(A,P,M,E,k,23,s[35]),E=d(E,A,P,M,l,4,s[36]),M=d(M,E,A,P,f,11,s[37]),P=d(P,M,E,A,y,16,s[38]),A=d(A,P,M,E,x,23,s[39]),E=d(E,A,P,M,C,4,s[40]),M=d(M,E,A,P,o,11,s[41]),P=d(P,M,E,A,v,16,s[42]),A=d(A,P,M,E,m,23,s[43]),E=d(E,A,P,M,b,4,s[44]),M=d(M,E,A,P,S,11,s[45]),P=d(P,M,E,A,I,16,s[46]),A=d(A,P,M,E,p,23,s[47]),E=h(E,A,P,M,o,6,s[48]),M=h(M,E,A,P,y,10,s[49]),P=h(P,M,E,A,k,15,s[50]),A=h(A,P,M,E,g,21,s[51]),E=h(E,A,P,M,S,6,s[52]),M=h(M,E,A,P,v,10,s[53]),P=h(P,M,E,A,x,15,s[54]),A=h(A,P,M,E,l,21,s[55]),E=h(E,A,P,M,_,6,s[56]),M=h(M,E,A,P,I,10,s[57]),P=h(P,M,E,A,m,15,s[58]),A=h(A,P,M,E,C,21,s[59]),E=h(E,A,P,M,f,6,s[60]),M=h(M,E,A,P,w,10,s[61]),P=h(P,M,E,A,p,15,s[62]),A=h(A,P,M,E,b,21,s[63]),r[0]=r[0]+E|0,r[1]=r[1]+A|0,r[2]=r[2]+P|0,r[3]=r[3]+M|0},_doFinalize:function(){var t=this._data,i=t.words,n=8*this._nDataBytes,a=8*t.sigBytes;i[a>>>5]|=128<<24-a%32;var r=e.floor(n/4294967296),o=n;i[15+(a+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),i[14+(a+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),t.sigBytes=4*(i.length+1),this._process();for(var s=this._hash,l=s.words,c=0;c<4;c++){var u=l[c];l[c]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return s},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t}});function c(t,e,i,n,a,r,o){var s=t+(e&i|~e&n)+a+o;return(s<<r|s>>>32-r)+e}function u(t,e,i,n,a,r,o){var s=t+(e&n|i&~n)+a+o;return(s<<r|s>>>32-r)+e}function d(t,e,i,n,a,r,o){var s=t+(e^i^n)+a+o;return(s<<r|s>>>32-r)+e}function h(t,e,i,n,a,r,o){var s=t+(i^(e|~n))+a+o;return(s<<r|s>>>32-r)+e}i.MD5=r._createHelper(l),i.HmacMD5=r._createHmacHelper(l)}(Math),t.MD5})},82169:function(t,e,i){(function(e,n){t.exports=n(i(19021),i(57165))})(0,function(t){return t.mode.CFB=function(){var e=t.lib.BlockCipherMode.extend();function i(t,e,i,n){var a,r=this._iv;r?(a=r.slice(0),this._iv=void 0):a=this._prevBlock,n.encryptBlock(a,0);for(var o=0;o<i;o++)t[e+o]^=a[o]}return e.Encryptor=e.extend({processBlock:function(t,e){var n=this._cipher,a=n.blockSize;i.call(this,t,e,a,n),this._prevBlock=t.slice(e,e+a)}}),e.Decryptor=e.extend({processBlock:function(t,e){var n=this._cipher,a=n.blockSize,r=t.slice(e,e+a);i.call(this,t,e,a,n),this._prevBlock=r}}),e}(),t.mode.CFB})},6372:function(t,e,i){(function(e,n){t.exports=n(i(19021),i(57165))})(0,function(t){
/** @preserve
* Counter block mode compatible with Dr Brian Gladman fileenc.c
* derived from CryptoJS.mode.CTR
* Jan Hruby jhruby.web@gmail.com
*/
return t.mode.CTRGladman=function(){var e=t.lib.BlockCipherMode.extend();function i(t){if(255===(t>>24&255)){var e=t>>16&255,i=t>>8&255,n=255&t;255===e?(e=0,255===i?(i=0,255===n?n=0:++n):++i):++e,t=0,t+=e<<16,t+=i<<8,t+=n}else t+=1<<24;return t}function n(t){return 0===(t[0]=i(t[0]))&&(t[1]=i(t[1])),t}var a=e.Encryptor=e.extend({processBlock:function(t,e){var i=this._cipher,a=i.blockSize,r=this._iv,o=this._counter;r&&(o=this._counter=r.slice(0),this._iv=void 0),n(o);var s=o.slice(0);i.encryptBlock(s,0);for(var l=0;l<a;l++)t[e+l]^=s[l]}});return e.Decryptor=a,e}(),t.mode.CTRGladman})},96939:function(t,e,i){(function(e,n){t.exports=n(i(19021),i(57165))})(0,function(t){return t.mode.CTR=function(){var e=t.lib.BlockCipherMode.extend(),i=e.Encryptor=e.extend({processBlock:function(t,e){var i=this._cipher,n=i.blockSize,a=this._iv,r=this._counter;a&&(r=this._counter=a.slice(0),this._iv=void 0);var o=r.slice(0);i.encryptBlock(o,0),r[n-1]=r[n-1]+1|0;for(var s=0;s<n;s++)t[e+s]^=o[s]}});return e.Decryptor=i,e}(),t.mode.CTR})},38454:function(t,e,i){(function(e,n){t.exports=n(i(19021),i(57165))})(0,function(t){return t.mode.ECB=function(){var e=t.lib.BlockCipherMode.extend();return e.Encryptor=e.extend({processBlock:function(t,e){this._cipher.encryptBlock(t,e)}}),e.Decryptor=e.extend({processBlock:function(t,e){this._cipher.decryptBlock(t,e)}}),e}(),t.mode.ECB})},73797:function(t,e,i){(function(e,n){t.exports=n(i(19021),i(57165))})(0,function(t){return t.mode.OFB=function(){var e=t.lib.BlockCipherMode.extend(),i=e.Encryptor=e.extend({processBlock:function(t,e){var i=this._cipher,n=i.blockSize,a=this._iv,r=this._keystream;a&&(r=this._keystream=a.slice(0),this._iv=void 0),i.encryptBlock(r,0);for(var o=0;o<n;o++)t[e+o]^=r[o]}});return e.Decryptor=i,e}(),t.mode.OFB})},42073:function(t,e,i){(function(e,n){t.exports=n(i(19021),i(57165))})(0,function(t){return t.pad.AnsiX923={pad:function(t,e){var i=t.sigBytes,n=4*e,a=n-i%n,r=i+a-1;t.clamp(),t.words[r>>>2]|=a<<24-r%4*8,t.sigBytes+=a},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},t.pad.Ansix923})},54905:function(t,e,i){(function(e,n){t.exports=n(i(19021),i(57165))})(0,function(t){return t.pad.Iso10126={pad:function(e,i){var n=4*i,a=n-e.sigBytes%n;e.concat(t.lib.WordArray.random(a-1)).concat(t.lib.WordArray.create([a<<24],1))},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},t.pad.Iso10126})},10482:function(t,e,i){(function(e,n){t.exports=n(i(19021),i(57165))})(0,function(t){return t.pad.Iso97971={pad:function(e,i){e.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(e,i)},unpad:function(e){t.pad.ZeroPadding.unpad(e),e.sigBytes--}},t.pad.Iso97971})},58124:function(t,e,i){(function(e,n){t.exports=n(i(19021),i(57165))})(0,function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding})},52155:function(t,e,i){(function(e,n){t.exports=n(i(19021),i(57165))})(0,function(t){return t.pad.ZeroPadding={pad:function(t,e){var i=4*e;t.clamp(),t.sigBytes+=i-(t.sigBytes%i||i)},unpad:function(t){var e=t.words,i=t.sigBytes-1;for(i=t.sigBytes-1;i>=0;i--)if(e[i>>>2]>>>24-i%4*8&255){t.sigBytes=i+1;break}}},t.pad.ZeroPadding})},70019:function(t,e,i){(function(e,n){t.exports=n(i(19021),i(63009),i(51025))})(0,function(t){return function(){var e=t,i=e.lib,n=i.Base,a=i.WordArray,r=e.algo,o=r.SHA256,s=r.HMAC,l=r.PBKDF2=n.extend({cfg:n.extend({keySize:4,hasher:o,iterations:25e4}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){var i=this.cfg,n=s.create(i.hasher,t),r=a.create(),o=a.create([1]),l=r.words,c=o.words,u=i.keySize,d=i.iterations;while(l.length<u){var h=n.update(e).finalize(o);n.reset();for(var p=h.words,v=p.length,f=h,g=1;g<d;g++){f=n.finalize(f),n.reset();for(var m=f.words,y=0;y<v;y++)p[y]^=m[y]}r.concat(h),c[0]++}return r.sigBytes=4*u,r}});e.PBKDF2=function(t,e,i){return l.create(i).compute(t,e)}}(),t.PBKDF2})},22696:function(t,e,i){(function(e,n){t.exports=n(i(19021),i(80754),i(84636),i(39506),i(57165))})(0,function(t){return function(){var e=t,i=e.lib,n=i.StreamCipher,a=e.algo,r=[],o=[],s=[],l=a.RabbitLegacy=n.extend({_doReset:function(){var t=this._key.words,e=this.cfg.iv,i=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],n=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];this._b=0;for(var a=0;a<4;a++)c.call(this);for(a=0;a<8;a++)n[a]^=i[a+4&7];if(e){var r=e.words,o=r[0],s=r[1],l=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),d=l>>>16|4294901760&u,h=u<<16|65535&l;n[0]^=l,n[1]^=d,n[2]^=u,n[3]^=h,n[4]^=l,n[5]^=d,n[6]^=u,n[7]^=h;for(a=0;a<4;a++)c.call(this)}},_doProcessBlock:function(t,e){var i=this._X;c.call(this),r[0]=i[0]^i[5]>>>16^i[3]<<16,r[1]=i[2]^i[7]>>>16^i[5]<<16,r[2]=i[4]^i[1]>>>16^i[7]<<16,r[3]=i[6]^i[3]>>>16^i[1]<<16;for(var n=0;n<4;n++)r[n]=16711935&(r[n]<<8|r[n]>>>24)|4278255360&(r[n]<<24|r[n]>>>8),t[e+n]^=r[n]},blockSize:4,ivSize:2});function c(){for(var t=this._X,e=this._C,i=0;i<8;i++)o[i]=e[i];e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0<o[0]>>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0<o[1]>>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0<o[2]>>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0<o[3]>>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0<o[4]>>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0<o[5]>>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0<o[6]>>>0?1:0)|0,this._b=e[7]>>>0<o[7]>>>0?1:0;for(i=0;i<8;i++){var n=t[i]+e[i],a=65535&n,r=n>>>16,l=((a*a>>>17)+a*r>>>15)+r*r,c=((4294901760&n)*n|0)+((65535&n)*n|0);s[i]=l^c}t[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,t[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,t[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,t[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,t[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,t[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,t[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,t[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.RabbitLegacy=n._createHelper(l)}(),t.RabbitLegacy})},96298:function(t,e,i){(function(e,n){t.exports=n(i(19021),i(80754),i(84636),i(39506),i(57165))})(0,function(t){return function(){var e=t,i=e.lib,n=i.StreamCipher,a=e.algo,r=[],o=[],s=[],l=a.Rabbit=n.extend({_doReset:function(){for(var t=this._key.words,e=this.cfg.iv,i=0;i<4;i++)t[i]=16711935&(t[i]<<8|t[i]>>>24)|4278255360&(t[i]<<24|t[i]>>>8);var n=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],a=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];this._b=0;for(i=0;i<4;i++)c.call(this);for(i=0;i<8;i++)a[i]^=n[i+4&7];if(e){var r=e.words,o=r[0],s=r[1],l=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),d=l>>>16|4294901760&u,h=u<<16|65535&l;a[0]^=l,a[1]^=d,a[2]^=u,a[3]^=h,a[4]^=l,a[5]^=d,a[6]^=u,a[7]^=h;for(i=0;i<4;i++)c.call(this)}},_doProcessBlock:function(t,e){var i=this._X;c.call(this),r[0]=i[0]^i[5]>>>16^i[3]<<16,r[1]=i[2]^i[7]>>>16^i[5]<<16,r[2]=i[4]^i[1]>>>16^i[7]<<16,r[3]=i[6]^i[3]>>>16^i[1]<<16;for(var n=0;n<4;n++)r[n]=16711935&(r[n]<<8|r[n]>>>24)|4278255360&(r[n]<<24|r[n]>>>8),t[e+n]^=r[n]},blockSize:4,ivSize:2});function c(){for(var t=this._X,e=this._C,i=0;i<8;i++)o[i]=e[i];e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0<o[0]>>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0<o[1]>>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0<o[2]>>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0<o[3]>>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0<o[4]>>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0<o[5]>>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0<o[6]>>>0?1:0)|0,this._b=e[7]>>>0<o[7]>>>0?1:0;for(i=0;i<8;i++){var n=t[i]+e[i],a=65535&n,r=n>>>16,l=((a*a>>>17)+a*r>>>15)+r*r,c=((4294901760&n)*n|0)+((65535&n)*n|0);s[i]=l^c}t[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,t[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,t[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,t[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,t[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,t[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,t[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,t[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.Rabbit=n._createHelper(l)}(),t.Rabbit})},77193:function(t,e,i){(function(e,n){t.exports=n(i(19021),i(80754),i(84636),i(39506),i(57165))})(0,function(t){return function(){var e=t,i=e.lib,n=i.StreamCipher,a=e.algo,r=a.RC4=n.extend({_doReset:function(){for(var t=this._key,e=t.words,i=t.sigBytes,n=this._S=[],a=0;a<256;a++)n[a]=a;a=0;for(var r=0;a<256;a++){var o=a%i,s=e[o>>>2]>>>24-o%4*8&255;r=(r+n[a]+s)%256;var l=n[a];n[a]=n[r],n[r]=l}this._i=this._j=0},_doProcessBlock:function(t,e){t[e]^=o.call(this)},keySize:8,ivSize:0});function o(){for(var t=this._S,e=this._i,i=this._j,n=0,a=0;a<4;a++){e=(e+1)%256,i=(i+t[e])%256;var r=t[e];t[e]=t[i],t[i]=r,n|=t[(t[e]+t[i])%256]<<24-8*a}return this._i=e,this._j=i,n}e.RC4=n._createHelper(r);var s=a.RC4Drop=r.extend({cfg:r.cfg.extend({drop:192}),_doReset:function(){r._doReset.call(this);for(var t=this.cfg.drop;t>0;t--)o.call(this)}});e.RC4Drop=n._createHelper(s)}(),t.RC4})},78056:function(t,e,i){(function(e,n){t.exports=n(i(19021))})(0,function(t){
/** @preserve
(c) 2012 by Cédric Mesnil. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
return function(){var e=t,i=e.lib,n=i.WordArray,a=i.Hasher,r=e.algo,o=n.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),s=n.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),l=n.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),c=n.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),u=n.create([0,1518500249,1859775393,2400959708,2840853838]),d=n.create([1352829926,1548603684,1836072691,2053994217,0]),h=r.RIPEMD160=a.extend({_doReset:function(){this._hash=n.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var i=0;i<16;i++){var n=e+i,a=t[n];t[n]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}var r,h,_,b,x,w,S,C,k,I,E,A=this._hash.words,P=u.words,M=d.words,D=o.words,T=s.words,B=l.words,F=c.words;w=r=A[0],S=h=A[1],C=_=A[2],k=b=A[3],I=x=A[4];for(i=0;i<80;i+=1)E=r+t[e+D[i]]|0,E+=i<16?p(h,_,b)+P[0]:i<32?v(h,_,b)+P[1]:i<48?f(h,_,b)+P[2]:i<64?g(h,_,b)+P[3]:m(h,_,b)+P[4],E|=0,E=y(E,B[i]),E=E+x|0,r=x,x=b,b=y(_,10),_=h,h=E,E=w+t[e+T[i]]|0,E+=i<16?m(S,C,k)+M[0]:i<32?g(S,C,k)+M[1]:i<48?f(S,C,k)+M[2]:i<64?v(S,C,k)+M[3]:p(S,C,k)+M[4],E|=0,E=y(E,F[i]),E=E+I|0,w=I,I=k,k=y(C,10),C=S,S=E;E=A[1]+_+k|0,A[1]=A[2]+b+I|0,A[2]=A[3]+x+w|0,A[3]=A[4]+r+S|0,A[4]=A[0]+h+C|0,A[0]=E},_doFinalize:function(){var t=this._data,e=t.words,i=8*this._nDataBytes,n=8*t.sigBytes;e[n>>>5]|=128<<24-n%32,e[14+(n+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),t.sigBytes=4*(e.length+1),this._process();for(var a=this._hash,r=a.words,o=0;o<5;o++){var s=r[o];r[o]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return a},clone:function(){var t=a.clone.call(this);return t._hash=this._hash.clone(),t}});function p(t,e,i){return t^e^i}function v(t,e,i){return t&e|~t&i}function f(t,e,i){return(t|~e)^i}function g(t,e,i){return t&i|e&~i}function m(t,e,i){return t^(e|~i)}function y(t,e){return t<<e|t>>>32-e}e.RIPEMD160=a._createHelper(h),e.HmacRIPEMD160=a._createHmacHelper(h)}(Math),t.RIPEMD160})},45471:function(t,e,i){(function(e,n){t.exports=n(i(19021))})(0,function(t){return function(){var e=t,i=e.lib,n=i.WordArray,a=i.Hasher,r=e.algo,o=[],s=r.SHA1=a.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var i=this._hash.words,n=i[0],a=i[1],r=i[2],s=i[3],l=i[4],c=0;c<80;c++){if(c<16)o[c]=0|t[e+c];else{var u=o[c-3]^o[c-8]^o[c-14]^o[c-16];o[c]=u<<1|u>>>31}var d=(n<<5|n>>>27)+l+o[c];d+=c<20?1518500249+(a&r|~a&s):c<40?1859775393+(a^r^s):c<60?(a&r|a&s|r&s)-1894007588:(a^r^s)-899497514,l=s,s=r,r=a<<30|a>>>2,a=n,n=d}i[0]=i[0]+n|0,i[1]=i[1]+a|0,i[2]=i[2]+r|0,i[3]=i[3]+s|0,i[4]=i[4]+l|0},_doFinalize:function(){var t=this._data,e=t.words,i=8*this._nDataBytes,n=8*t.sigBytes;return e[n>>>5]|=128<<24-n%32,e[14+(n+64>>>9<<4)]=Math.floor(i/4294967296),e[15+(n+64>>>9<<4)]=i,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=a.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA1=a._createHelper(s),e.HmacSHA1=a._createHmacHelper(s)}(),t.SHA1})},36308:function(t,e,i){(function(e,n){t.exports=n(i(19021),i(63009))})(0,function(t){return function(){var e=t,i=e.lib,n=i.WordArray,a=e.algo,r=a.SHA256,o=a.SHA224=r.extend({_doReset:function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=r._doFinalize.call(this);return t.sigBytes-=4,t}});e.SHA224=r._createHelper(o),e.HmacSHA224=r._createHmacHelper(o)}(),t.SHA224})},63009:function(t,e,i){(function(e,n){t.exports=n(i(19021))})(0,function(t){return function(e){var i=t,n=i.lib,a=n.WordArray,r=n.Hasher,o=i.algo,s=[],l=[];(function(){function t(t){for(var i=e.sqrt(t),n=2;n<=i;n++)if(!(t%n))return!1;return!0}function i(t){return 4294967296*(t-(0|t))|0}var n=2,a=0;while(a<64)t(n)&&(a<8&&(s[a]=i(e.pow(n,.5))),l[a]=i(e.pow(n,1/3)),a++),n++})();var c=[],u=o.SHA256=r.extend({_doReset:function(){this._hash=new a.init(s.slice(0))},_doProcessBlock:function(t,e){for(var i=this._hash.words,n=i[0],a=i[1],r=i[2],o=i[3],s=i[4],u=i[5],d=i[6],h=i[7],p=0;p<64;p++){if(p<16)c[p]=0|t[e+p];else{var v=c[p-15],f=(v<<25|v>>>7)^(v<<14|v>>>18)^v>>>3,g=c[p-2],m=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;c[p]=f+c[p-7]+m+c[p-16]}var y=s&u^~s&d,_=n&a^n&r^a&r,b=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),x=(s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25),w=h+x+y+l[p]+c[p],S=b+_;h=d,d=u,u=s,s=o+w|0,o=r,r=a,a=n,n=w+S|0}i[0]=i[0]+n|0,i[1]=i[1]+a|0,i[2]=i[2]+r|0,i[3]=i[3]+o|0,i[4]=i[4]+s|0,i[5]=i[5]+u|0,i[6]=i[6]+d|0,i[7]=i[7]+h|0},_doFinalize:function(){var t=this._data,i=t.words,n=8*this._nDataBytes,a=8*t.sigBytes;return i[a>>>5]|=128<<24-a%32,i[14+(a+64>>>9<<4)]=e.floor(n/4294967296),i[15+(a+64>>>9<<4)]=n,t.sigBytes=4*i.length,this._process(),this._hash},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t}});i.SHA256=r._createHelper(u),i.HmacSHA256=r._createHmacHelper(u)}(Math),t.SHA256})},45953:function(t,e,i){(function(e,n){t.exports=n(i(19021),i(43240))})(0,function(t){return function(e){var i=t,n=i.lib,a=n.WordArray,r=n.Hasher,o=i.x64,s=o.Word,l=i.algo,c=[],u=[],d=[];(function(){for(var t=1,e=0,i=0;i<24;i++){c[t+5*e]=(i+1)*(i+2)/2%64;var n=e%5,a=(2*t+3*e)%5;t=n,e=a}for(t=0;t<5;t++)for(e=0;e<5;e++)u[t+5*e]=e+(2*t+3*e)%5*5;for(var r=1,o=0;o<24;o++){for(var l=0,h=0,p=0;p<7;p++){if(1&r){var v=(1<<p)-1;v<32?h^=1<<v:l^=1<<v-32}128&r?r=r<<1^113:r<<=1}d[o]=s.create(l,h)}})();var h=[];(function(){for(var t=0;t<25;t++)h[t]=s.create()})();var p=l.SHA3=r.extend({cfg:r.cfg.extend({outputLength:512}),_doReset:function(){for(var t=this._state=[],e=0;e<25;e++)t[e]=new s.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(t,e){for(var i=this._state,n=this.blockSize/2,a=0;a<n;a++){var r=t[e+2*a],o=t[e+2*a+1];r=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8);var s=i[a];s.high^=o,s.low^=r}for(var l=0;l<24;l++){for(var p=0;p<5;p++){for(var v=0,f=0,g=0;g<5;g++){s=i[p+5*g];v^=s.high,f^=s.low}var m=h[p];m.high=v,m.low=f}for(p=0;p<5;p++){var y=h[(p+4)%5],_=h[(p+1)%5],b=_.high,x=_.low;for(v=y.high^(b<<1|x>>>31),f=y.low^(x<<1|b>>>31),g=0;g<5;g++){s=i[p+5*g];s.high^=v,s.low^=f}}for(var w=1;w<25;w++){s=i[w];var S=s.high,C=s.low,k=c[w];k<32?(v=S<<k|C>>>32-k,f=C<<k|S>>>32-k):(v=C<<k-32|S>>>64-k,f=S<<k-32|C>>>64-k);var I=h[u[w]];I.high=v,I.low=f}var E=h[0],A=i[0];E.high=A.high,E.low=A.low;for(p=0;p<5;p++)for(g=0;g<5;g++){w=p+5*g,s=i[w];var P=h[w],M=h[(p+1)%5+5*g],D=h[(p+2)%5+5*g];s.high=P.high^~M.high&D.high,s.low=P.low^~M.low&D.low}s=i[0];var T=d[l];s.high^=T.high,s.low^=T.low}},_doFinalize:function(){var t=this._data,i=t.words,n=(this._nDataBytes,8*t.sigBytes),r=32*this.blockSize;i[n>>>5]|=1<<24-n%32,i[(e.ceil((n+1)/r)*r>>>5)-1]|=128,t.sigBytes=4*i.length,this._process();for(var o=this._state,s=this.cfg.outputLength/8,l=s/8,c=[],u=0;u<l;u++){var d=o[u],h=d.high,p=d.low;h=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),c.push(p),c.push(h)}return new a.init(c,s)},clone:function(){for(var t=r.clone.call(this),e=t._state=this._state.slice(0),i=0;i<25;i++)e[i]=e[i].clone();return t}});i.SHA3=r._createHelper(p),i.HmacSHA3=r._createHmacHelper(p)}(Math),t.SHA3})},89557:function(t,e,i){(function(e,n){t.exports=n(i(19021),i(43240),i(81380))})(0,function(t){return function(){var e=t,i=e.x64,n=i.Word,a=i.WordArray,r=e.algo,o=r.SHA512,s=r.SHA384=o.extend({_doReset:function(){this._hash=new a.init([new n.init(3418070365,3238371032),new n.init(1654270250,914150663),new n.init(2438529370,812702999),new n.init(355462360,4144912697),new n.init(1731405415,4290775857),new n.init(2394180231,1750603025),new n.init(3675008525,1694076839),new n.init(1203062813,3204075428)])},_doFinalize:function(){var t=o._doFinalize.call(this);return t.sigBytes-=16,t}});e.SHA384=o._createHelper(s),e.HmacSHA384=o._createHmacHelper(s)}(),t.SHA384})},81380:function(t,e,i){(function(e,n){t.exports=n(i(19021),i(43240))})(0,function(t){return function(){var e=t,i=e.lib,n=i.Hasher,a=e.x64,r=a.Word,o=a.WordArray,s=e.algo;function l(){return r.create.apply(r,arguments)}var c=[l(1116352408,3609767458),l(1899447441,602891725),l(3049323471,3964484399),l(3921009573,2173295548),l(961987163,4081628472),l(1508970993,3053834265),l(2453635748,2937671579),l(2870763221,3664609560),l(3624381080,2734883394),l(310598401,1164996542),l(607225278,1323610764),l(1426881987,3590304994),l(1925078388,4068182383),l(2162078206,991336113),l(2614888103,633803317),l(3248222580,3479774868),l(3835390401,2666613458),l(4022224774,944711139),l(264347078,2341262773),l(604807628,2007800933),l(770255983,1495990901),l(1249150122,1856431235),l(1555081692,3175218132),l(1996064986,2198950837),l(2554220882,3999719339),l(2821834349,766784016),l(2952996808,2566594879),l(3210313671,3203337956),l(3336571891,1034457026),l(3584528711,2466948901),l(113926993,3758326383),l(338241895,168717936),l(666307205,1188179964),l(773529912,1546045734),l(1294757372,1522805485),l(1396182291,2643833823),l(1695183700,2343527390),l(1986661051,1014477480),l(2177026350,1206759142),l(2456956037,344077627),l(2730485921,1290863460),l(2820302411,3158454273),l(3259730800,3505952657),l(3345764771,106217008),l(3516065817,3606008344),l(3600352804,1432725776),l(4094571909,1467031594),l(275423344,851169720),l(430227734,3100823752),l(506948616,1363258195),l(659060556,3750685593),l(883997877,3785050280),l(958139571,3318307427),l(1322822218,3812723403),l(1537002063,2003034995),l(1747873779,3602036899),l(1955562222,1575990012),l(2024104815,1125592928),l(2227730452,2716904306),l(2361852424,442776044),l(2428436474,593698344),l(2756734187,3733110249),l(3204031479,2999351573),l(3329325298,3815920427),l(3391569614,3928383900),l(3515267271,566280711),l(3940187606,3454069534),l(4118630271,4000239992),l(116418474,1914138554),l(174292421,2731055270),l(289380356,3203993006),l(460393269,320620315),l(685471733,587496836),l(852142971,1086792851),l(1017036298,365543100),l(1126000580,2618297676),l(1288033470,3409855158),l(1501505948,4234509866),l(1607167915,987167468),l(1816402316,1246189591)],u=[];(function(){for(var t=0;t<80;t++)u[t]=l()})();var d=s.SHA512=n.extend({_doReset:function(){this._hash=new o.init([new r.init(1779033703,4089235720),new r.init(3144134277,2227873595),new r.init(1013904242,4271175723),new r.init(2773480762,1595750129),new r.init(1359893119,2917565137),new r.init(2600822924,725511199),new r.init(528734635,4215389547),new r.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var i=this._hash.words,n=i[0],a=i[1],r=i[2],o=i[3],s=i[4],l=i[5],d=i[6],h=i[7],p=n.high,v=n.low,f=a.high,g=a.low,m=r.high,y=r.low,_=o.high,b=o.low,x=s.high,w=s.low,S=l.high,C=l.low,k=d.high,I=d.low,E=h.high,A=h.low,P=p,M=v,D=f,T=g,B=m,F=y,R=_,L=b,N=x,O=w,z=S,V=C,W=k,H=I,$=E,K=A,Y=0;Y<80;Y++){var X,j,U=u[Y];if(Y<16)j=U.high=0|t[e+2*Y],X=U.low=0|t[e+2*Y+1];else{var G=u[Y-15],Z=G.high,q=G.low,J=(Z>>>1|q<<31)^(Z>>>8|q<<24)^Z>>>7,Q=(q>>>1|Z<<31)^(q>>>8|Z<<24)^(q>>>7|Z<<25),tt=u[Y-2],et=tt.high,it=tt.low,nt=(et>>>19|it<<13)^(et<<3|it>>>29)^et>>>6,at=(it>>>19|et<<13)^(it<<3|et>>>29)^(it>>>6|et<<26),rt=u[Y-7],ot=rt.high,st=rt.low,lt=u[Y-16],ct=lt.high,ut=lt.low;X=Q+st,j=J+ot+(X>>>0<Q>>>0?1:0),X+=at,j=j+nt+(X>>>0<at>>>0?1:0),X+=ut,j=j+ct+(X>>>0<ut>>>0?1:0),U.high=j,U.low=X}var dt=N&z^~N&W,ht=O&V^~O&H,pt=P&D^P&B^D&B,vt=M&T^M&F^T&F,ft=(P>>>28|M<<4)^(P<<30|M>>>2)^(P<<25|M>>>7),gt=(M>>>28|P<<4)^(M<<30|P>>>2)^(M<<25|P>>>7),mt=(N>>>14|O<<18)^(N>>>18|O<<14)^(N<<23|O>>>9),yt=(O>>>14|N<<18)^(O>>>18|N<<14)^(O<<23|N>>>9),_t=c[Y],bt=_t.high,xt=_t.low,wt=K+yt,St=$+mt+(wt>>>0<K>>>0?1:0),Ct=(wt=wt+ht,St=St+dt+(wt>>>0<ht>>>0?1:0),wt=wt+xt,St=St+bt+(wt>>>0<xt>>>0?1:0),wt=wt+X,St=St+j+(wt>>>0<X>>>0?1:0),gt+vt),kt=ft+pt+(Ct>>>0<gt>>>0?1:0);$=W,K=H,W=z,H=V,z=N,V=O,O=L+wt|0,N=R+St+(O>>>0<L>>>0?1:0)|0,R=B,L=F,B=D,F=T,D=P,T=M,M=wt+Ct|0,P=St+kt+(M>>>0<wt>>>0?1:0)|0}v=n.low=v+M,n.high=p+P+(v>>>0<M>>>0?1:0),g=a.low=g+T,a.high=f+D+(g>>>0<T>>>0?1:0),y=r.low=y+F,r.high=m+B+(y>>>0<F>>>0?1:0),b=o.low=b+L,o.high=_+R+(b>>>0<L>>>0?1:0),w=s.low=w+O,s.high=x+N+(w>>>0<O>>>0?1:0),C=l.low=C+V,l.high=S+z+(C>>>0<V>>>0?1:0),I=d.low=I+H,d.high=k+W+(I>>>0<H>>>0?1:0),A=h.low=A+K,h.high=E+$+(A>>>0<K>>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,i=8*this._nDataBytes,n=8*t.sigBytes;e[n>>>5]|=128<<24-n%32,e[30+(n+128>>>10<<5)]=Math.floor(i/4294967296),e[31+(n+128>>>10<<5)]=i,t.sigBytes=4*e.length,this._process();var a=this._hash.toX32();return a},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32});e.SHA512=n._createHelper(d),e.HmacSHA512=n._createHmacHelper(d)}(),t.SHA512})},7628:function(t,e,i){(function(e,n){t.exports=n(i(19021),i(80754),i(84636),i(39506),i(57165))})(0,function(t){return function(){var e=t,i=e.lib,n=i.WordArray,a=i.BlockCipher,r=e.algo,o=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],l=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],u=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],d=r.DES=a.extend({_doReset:function(){for(var t=this._key,e=t.words,i=[],n=0;n<56;n++){var a=o[n]-1;i[n]=e[a>>>5]>>>31-a%32&1}for(var r=this._subKeys=[],c=0;c<16;c++){var u=r[c]=[],d=l[c];for(n=0;n<24;n++)u[n/6|0]|=i[(s[n]-1+d)%28]<<31-n%6,u[4+(n/6|0)]|=i[28+(s[n+24]-1+d)%28]<<31-n%6;u[0]=u[0]<<1|u[0]>>>31;for(n=1;n<7;n++)u[n]=u[n]>>>4*(n-1)+3;u[7]=u[7]<<5|u[7]>>>27}var h=this._invSubKeys=[];for(n=0;n<16;n++)h[n]=r[15-n]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(t,e,i){this._lBlock=t[e],this._rBlock=t[e+1],h.call(this,4,252645135),h.call(this,16,65535),p.call(this,2,858993459),p.call(this,8,16711935),h.call(this,1,1431655765);for(var n=0;n<16;n++){for(var a=i[n],r=this._lBlock,o=this._rBlock,s=0,l=0;l<8;l++)s|=c[l][((o^a[l])&u[l])>>>0];this._lBlock=o,this._rBlock=r^s}var d=this._lBlock;this._lBlock=this._rBlock,this._rBlock=d,h.call(this,1,1431655765),p.call(this,8,16711935),p.call(this,2,858993459),h.call(this,16,65535),h.call(this,4,252645135),t[e]=this._lBlock,t[e+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function h(t,e){var i=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=i,this._lBlock^=i<<t}function p(t,e){var i=(this._rBlock>>>t^this._lBlock)&e;this._lBlock^=i,this._rBlock^=i<<t}e.DES=a._createHelper(d);var v=r.TripleDES=a.extend({_doReset:function(){var t=this._key,e=t.words;if(2!==e.length&&4!==e.length&&e.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var i=e.slice(0,2),a=e.length<4?e.slice(0,2):e.slice(2,4),r=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=d.createEncryptor(n.create(i)),this._des2=d.createEncryptor(n.create(a)),this._des3=d.createEncryptor(n.create(r))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=a._createHelper(v)}(),t.TripleDES})},43240:function(t,e,i){(function(e,n){t.exports=n(i(19021))})(0,function(t){return function(e){var i=t,n=i.lib,a=n.Base,r=n.WordArray,o=i.x64={};o.Word=a.extend({init:function(t,e){this.high=t,this.low=e}}),o.WordArray=a.extend({init:function(t,i){t=this.words=t||[],this.sigBytes=i!=e?i:8*t.length},toX32:function(){for(var t=this.words,e=t.length,i=[],n=0;n<e;n++){var a=t[n];i.push(a.high),i.push(a.low)}return r.create(i,this.sigBytes)},clone:function(){for(var t=a.clone.call(this),e=t.words=this.words.slice(0),i=e.length,n=0;n<i;n++)e[n]=e[n].clone();return t}})}(),t})},35038:function(t,e,i){"use strict";i.d(e,{Qo:function(){return r},_3:function(){return u},dp:function(){return o},iO:function(){return c},mk:function(){return s},ms:function(){return l},z6:function(){return d}});var n=i(75769),a={GetWatchlist:"/api/market/watchlist/get",AddWatchlist:"/api/market/watchlist/add",RemoveWatchlist:"/api/market/watchlist/remove",GetWatchlistPrices:"/api/market/watchlist/prices",MultiAnalysis:"/api/analysis/multiAnalysis",CreateAnalysisTask:"/api/analysis/createTask",GetAnalysisTaskStatus:"/api/analysis/getTaskStatus",GetAnalysisHistoryList:"/api/analysis/getHistoryList",DeleteAnalysisTask:"/api/analysis/deleteTask",ReflectAnalysis:"/api/analysis/reflect",ChatMessage:"/api/ai/chat/message",GetChatHistory:"/api/ai/chat/history",SaveChatHistory:"/api/ai/chat/history/save",GetConfig:"/api/market/config",GetMenuFooterConfig:"/api/market/menuFooterConfig",GetMarketTypes:"/api/market/types",SearchSymbols:"/api/market/symbols/search",GetHotSymbols:"/api/market/symbols/hot"};function r(t){return(0,n.Ay)({url:a.GetWatchlist,method:"get",params:t})}function o(t){return(0,n.Ay)({url:a.AddWatchlist,method:"post",data:t})}function s(t){return(0,n.Ay)({url:a.RemoveWatchlist,method:"post",data:t})}function l(t){return(0,n.Ay)({url:a.GetWatchlistPrices,method:"get",params:{watchlist:JSON.stringify(t.watchlist||[])}})}function c(){return(0,n.Ay)({url:a.GetMarketTypes,method:"get"})}function u(t){return(0,n.Ay)({url:a.SearchSymbols,method:"get",params:t})}function d(t){return(0,n.Ay)({url:a.GetHotSymbols,method:"get",params:t})}},50477:function(){},21560:function(t,e,i){"use strict";i.d(e,{A:function(){return a}});var n=i(44735);function a(t){if(null!=t){var e=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],i=0;if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}}}throw new TypeError((0,n.A)(t)+" is not iterable")}}}]);