From 9271ff94390b9d3cd1b0001fce30e967f0ff15a4 Mon Sep 17 00:00:00 2001 From: Hossein Date: Mon, 11 Jul 2022 17:32:58 +0430 Subject: [PATCH 01/27] Add main components --- .../bundles/library.e964cdc99937c68d0389.js | 2 +- .../study-market.ff409c6c02ba9edc0151.js | 4 +- public/index.html | 11 + src/components/ActionSheet/ActionSheet.js | 1 - .../FullWidthError/FullWidthError.js | 2 +- src/components/HeaderBuilder/HeaderBuilder.js | 6 +- src/components/Popup/Popup.js | 4 +- .../ProtectedRoute/ProtectedRoute.js | 2 +- src/main/Browser/Browser.js | 4 - src/main/Mobile/Mobile.js | 110 +++++++--- src/{pages => main/Mobile/Pages}/404/index.js | 0 src/main/Mobile/Pages/AllMarket/AllMarket.js | 12 + .../AllMarket/AllMarket.module.css} | 0 src/main/Mobile/Pages/Guide/Guide.js | 11 + .../Guide/Guide.module.css} | 0 src/main/Mobile/Pages/Landing/Landing.js | 23 ++ .../Landing/Landing.module.css} | 0 src/main/Mobile/Pages/Login/Login.js | 12 + .../Mobile/Pages/Login/Login.module.css} | 0 src/{pages => main/Mobile/Pages}/User/User.js | 0 .../Mobile/Pages}/User/User.module.css | 0 .../ForgetPassword/ForgetPassword.js | 12 + .../ForgetPassword/ForgetPassword.module.css} | 0 .../Pages/User/components/Verify/Verify.js | 12 + .../User/components/Verify/Verify.module.css | 0 .../UserPanel/Secttions/Content/Content.js | 51 +++++ .../Secttions/Content/Content.module.css | 0 .../Content/components/Dashboard/Dashboard.js | 33 +-- .../components/Dashboard/Dashboard.module.css | 0 .../components/LastTrades/LastTrades.js | 0 .../LastTrades/LastTrades.module.css | 0 .../Dashboard/components/Market/Market.js | 0 .../components/Market/Market.module.css | 0 .../Dashboard/components/MyOrder/MyOrder.js | 0 .../components/MyOrder/MyOrder.module.css | 0 .../Dashboard/components/NavMenu/NavMenu.js | 4 +- .../components/NavMenu/NavMenu.module.css | 0 .../Dashboard/components/Order/Order.js | 6 +- .../components/Order/Order.module.css | 0 .../Dashboard/components/Order/api/order.js | 0 .../Order/components/BuyOrder/BuyOrder.js | 14 +- .../Order/components/SellOrder/SellOrder.js | 0 .../components/OrderBook/OrderBook.js | 6 +- .../components/OrderBook/OrderBook.module.css | 0 .../components/OrderBook/api/orderBook.js | 0 .../OrderBookTable/OrderBookTable.js | 6 +- .../OrderBookTable/OrderBookTable.module.css | 0 .../OrderBookTableSafari.js | 6 +- .../OrderBookTableSafari.module.css | 0 .../Dashboard/components/Overview/Overview.js | 2 +- .../components/Overview/Overview.module.css | 0 .../components/Overview/api/overview.js | 0 .../InformationBlock/InformationBlock.js | 4 +- .../components/TradingView/TradingView.js | 2 +- .../TradingView/TradingView.module.css | 0 .../components/TradingView/api/tradingView.js | 0 .../components/MarketChart/MarketChart.js | 2 +- .../Content/components/Settings/Settings.js | 4 +- .../TechnicalChart/TechnicalChart.js | 0 .../Content/components/Wallet/Wallet.js | 0 .../UserPanel}/Secttions/Header/Header.js | 6 +- .../Secttions/Header/Header.module.css | 0 .../UserPanel}/Secttions/Menu/Menu.js | 42 +--- .../UserPanel}/Secttions/Menu/Menu.module.css | 0 .../Secttions/SubHeader/SubHeader.js | 2 +- .../Secttions/SubHeader/SubHeader.module.css | 0 src/main/Mobile/Pages/UserPanel/UserPanel.js | 27 +++ src/{routes => main/Mobile/Routes}/routes.js | 38 ++-- src/main/Mobile/Secttions/Content/Content.js | 36 --- src/main/Mobile/{ => Styles}/Mobille.css | 12 +- .../ForgetPassword/ForgetPassword.js | 206 ------------------ src/pages/User/components/Verify/Verify.js | 52 ----- 72 files changed, 333 insertions(+), 456 deletions(-) rename src/{pages => main/Mobile/Pages}/404/index.js (100%) create mode 100644 src/main/Mobile/Pages/AllMarket/AllMarket.js rename src/main/Mobile/{Secttions/Content/components/Dashboard/components/LastTrades/LastTrades.module.css => Pages/AllMarket/AllMarket.module.css} (100%) create mode 100644 src/main/Mobile/Pages/Guide/Guide.js rename src/main/Mobile/{Secttions/Content/components/Dashboard/components/Market/Market.module.css => Pages/Guide/Guide.module.css} (100%) create mode 100644 src/main/Mobile/Pages/Landing/Landing.js rename src/main/Mobile/{Secttions/Content/components/Dashboard/components/MyOrder/MyOrder.module.css => Pages/Landing/Landing.module.css} (100%) create mode 100644 src/main/Mobile/Pages/Login/Login.js rename src/{pages/User/components/ForgetPassword/ForgetPassword.module.css => main/Mobile/Pages/Login/Login.module.css} (100%) rename src/{pages => main/Mobile/Pages}/User/User.js (100%) rename src/{pages => main/Mobile/Pages}/User/User.module.css (100%) create mode 100644 src/main/Mobile/Pages/User/components/ForgetPassword/ForgetPassword.js rename src/{pages/User/components/Verify/Verify.module.css => main/Mobile/Pages/User/components/ForgetPassword/ForgetPassword.module.css} (100%) create mode 100644 src/main/Mobile/Pages/User/components/Verify/Verify.js create mode 100644 src/main/Mobile/Pages/User/components/Verify/Verify.module.css create mode 100644 src/main/Mobile/Pages/UserPanel/Secttions/Content/Content.js rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/Content/Content.module.css (100%) rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/Content/components/Dashboard/Dashboard.js (90%) rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/Content/components/Dashboard/Dashboard.module.css (100%) rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/Content/components/Dashboard/components/LastTrades/LastTrades.js (100%) create mode 100644 src/main/Mobile/Pages/UserPanel/Secttions/Content/components/Dashboard/components/LastTrades/LastTrades.module.css rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/Content/components/Dashboard/components/Market/Market.js (100%) create mode 100644 src/main/Mobile/Pages/UserPanel/Secttions/Content/components/Dashboard/components/Market/Market.module.css rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/Content/components/Dashboard/components/MyOrder/MyOrder.js (100%) create mode 100644 src/main/Mobile/Pages/UserPanel/Secttions/Content/components/Dashboard/components/MyOrder/MyOrder.module.css rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/Content/components/Dashboard/components/NavMenu/NavMenu.js (94%) rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/Content/components/Dashboard/components/NavMenu/NavMenu.module.css (100%) rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/Content/components/Dashboard/components/Order/Order.js (86%) rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/Content/components/Dashboard/components/Order/Order.module.css (100%) rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/Content/components/Dashboard/components/Order/api/order.js (100%) rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/Content/components/Dashboard/components/Order/components/BuyOrder/BuyOrder.js (96%) rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/Content/components/Dashboard/components/Order/components/SellOrder/SellOrder.js (100%) rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/Content/components/Dashboard/components/OrderBook/OrderBook.js (92%) rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/Content/components/Dashboard/components/OrderBook/OrderBook.module.css (100%) rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/Content/components/Dashboard/components/OrderBook/api/orderBook.js (100%) rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/Content/components/Dashboard/components/OrderBook/components/OrderBookTable/OrderBookTable.js (95%) rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/Content/components/Dashboard/components/OrderBook/components/OrderBookTable/OrderBookTable.module.css (100%) rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/Content/components/Dashboard/components/OrderBook/components/OrderBookTableSafari/OrderBookTableSafari.js (96%) rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/Content/components/Dashboard/components/OrderBook/components/OrderBookTableSafari/OrderBookTableSafari.module.css (100%) rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/Content/components/Dashboard/components/Overview/Overview.js (90%) rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/Content/components/Dashboard/components/Overview/Overview.module.css (100%) rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/Content/components/Dashboard/components/Overview/api/overview.js (100%) rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/Content/components/Dashboard/components/Overview/components/InformationBlock/InformationBlock.js (93%) rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/Content/components/Dashboard/components/TradingView/TradingView.js (89%) rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/Content/components/Dashboard/components/TradingView/TradingView.module.css (100%) rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/Content/components/Dashboard/components/TradingView/api/tradingView.js (100%) rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/Content/components/Dashboard/components/TradingView/components/MarketChart/MarketChart.js (98%) rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/Content/components/Settings/Settings.js (82%) rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/Content/components/TechnicalChart/TechnicalChart.js (100%) rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/Content/components/Wallet/Wallet.js (100%) rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/Header/Header.js (88%) rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/Header/Header.module.css (100%) rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/Menu/Menu.js (54%) rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/Menu/Menu.module.css (100%) rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/SubHeader/SubHeader.js (94%) rename src/main/Mobile/{ => Pages/UserPanel}/Secttions/SubHeader/SubHeader.module.css (100%) create mode 100644 src/main/Mobile/Pages/UserPanel/UserPanel.js rename src/{routes => main/Mobile/Routes}/routes.js (64%) delete mode 100644 src/main/Mobile/Secttions/Content/Content.js rename src/main/Mobile/{ => Styles}/Mobille.css (89%) delete mode 100644 src/pages/User/components/ForgetPassword/ForgetPassword.js delete mode 100644 src/pages/User/components/Verify/Verify.js diff --git a/public/charting_library/static/bundles/library.e964cdc99937c68d0389.js b/public/charting_library/static/bundles/library.e964cdc99937c68d0389.js index 8572ba7..d7f9239 100644 --- a/public/charting_library/static/bundles/library.e964cdc99937c68d0389.js +++ b/public/charting_library/static/bundles/library.e964cdc99937c68d0389.js @@ -435,7 +435,7 @@ o.length&&(this._quoteApi.quoteAddSymbols(o,{forcePermission:!0}),this._delayUpd var t,i,n,s,a,l,c,u,h=this._model.timeScale().indexToCoordinate(e.index),d=e.price,p=this.ownerSource().firstValue(),_=this.priceScale().priceToCoordinate(d,p),f=5;if(this._points.length>0){if(t=this._points[this._points.length-1],i=this._model.timeScale().indexToCoordinate(t.index),n=t.price,s=this.priceScale().priceToCoordinate(n,p),new o(h,_).subtract(new o(i,s)).length()0&&(this._value=e),this._listeners=[]}t.prototype.value=function(){return this._owner?this._owner._value:this._value},t.prototype.setValue=function(e,t){var i,n,o,r=this._owner?this._owner:this;if("function"==typeof r.hook&&(e=r.hook(e)),r.writeLock)return r._value;if(!t&&r._value===e&&r.hasOwnProperty("_value"))return e;for(r._value=e,i=r._listeners.slice(),n=0,o=0;o\n\t\t\t\t'+i+'\n\t\t\t\t\n\t\t\t'),this._$input=this._$field.find("input"),this._error=s}return n(e,[{key:"appendTo",value:function(e){e.append(this._$field)}},{key:"focus",value:function(){return this._$input.focus()}},{key:"select",value:function(){return this.focus().select()}},{key:"value",set:function(e){this._$input.val(e)},get:function(){return this._$input.val()}},{key:"name",get:function(){return this._name}},{key:"valid",get:function(){return!!this._$input.val().trim()}},{key:"error",set:function(e){this._error=e},get:function(){return this._error}}]),e}()},hsV8:function(e,t,i){"use strict";function n(e){var t,i;if(""===e)return Promise.resolve(null);if(t=JSON.parse(e),!Object(o.isObject)(t)||"function"==typeof t)return Promise.reject(new Error("Non-object content in the non-series envelope"));if(Object(o.hasProperty)(t,"indexes_replace"))return Promise.resolve({indexes_replace:!0});if(i={indexes_replace:!1},Object(o.hasProperty)(t,"offsets")&&(i.offsets=t.offsets),Object(o.hasProperty)(t,"isUpdate")){if("boolean"!=typeof t.isUpdate)return Promise.reject(new Error('Invalid type of "isUpdate" field'));i.isUpdate=t.isUpdate}return Object(o.hasProperty)(t,"data")&&(i.data=t.data),Object(o.hasProperty)(t,"graphicsCmds")&&(i.graphicsCmds=Object(r.b)(t.graphicsCmds)),Promise.resolve(i)}var o,r;i.r(t),i.d(t,"unpackNonSeriesData",function(){return n}),i("mrSG"),o=i("JmuD"),r=i("qySK")},htUT:function(e,t,i){"use strict";var n,o,r;i.r(t),i.d(t,"ChartChangesWatcher",function(){return r}),n=i("aIyQ"),o=i.n(n),r=function(){function e(e,t,i){this._hasChanges=!1,this._undoHistory=e,this._chartSaver=t,this._globalEvents=i,this._onValueChanged=new o.a,this._subscribe()}return e.prototype.destroy=function(){this._unsubscribe(),this._onValueChanged.destroy()},e.prototype.hasChanges=function(){return this._hasChanges},e.prototype.getOnChange=function(){return this._onValueChanged},e.prototype._subscribe=function(){this._globalEvents.subscribe("chart_loaded",this._handleChartLoaded,this),this._undoHistory.undoStack().onChange().subscribe(this,this._handleChangeUndoStack),this._chartSaver.chartSaved().subscribe(this,this._handleChartSaved)},e.prototype._unsubscribe=function(){this._globalEvents.unsubscribe("chart_loaded",this._handleChartLoaded,this),this._undoHistory.undoStack().onChange().unsubscribe(this,this._handleChangeUndoStack),this._chartSaver.chartSaved().unsubscribe(this,this._handleChartSaved)},e.prototype._setChanges=function(e){this._hasChanges=e,this._onValueChanged.fire(e)},e.prototype._handleChartLoaded=function(){this._setChanges(!1)},e.prototype._handleChangeUndoStack=function(){var e=this._undoHistory.undoStack().head();e&&!e.customFlag("doesnt_affect_save")&&this._setChanges(!0)},e.prototype._handleChartSaved=function(e){e&&this._setChanges(!1)},e}()},"hyq/":function(e,t,i){"use strict";function n(e,t){ e.setUTCMonth(e.getUTCMonth()+t)}function o(e,t){var i;return s.Std.ismonthly(e)?((i=new Date(t)).getUTCDay()=1&&t<=15?"1D":"1W"}throw new Error("Unexpected resolution type: "+e.symbol.resolution)}(e);case"Daily":return"1D";case"Weekly":return"1W";case"Monthly":return"1M";case"Yearly":return"12M";default:throw new Error("No such pivTimeFrame: "+t)}}var s,a,l,c,u,h;i.r(t),i.d(t,"pivotPointsStandardStudyItem",function(){return h}),s=i("ocLq"),a=i("LxhU"),l=function(){return function(){this.p=NaN,this.r1=NaN,this.s1=NaN,this.r2=NaN,this.s2=NaN,this.r3=NaN,this.s3=NaN,this.r4=NaN,this.s4=NaN,this.r5=NaN,this.s5=NaN,this.startIndex__t=NaN,this.endIndex__t=NaN}}(),c=function(){return function(){this.pivots=[]}}(),u=function(){function e(){this._secondaryRes="1D",this._firstMainSeriesBarTime=NaN}return e.prototype.init=function(e,t){var i,n=t(0),o=t(1),a=t(2),l=t(3);this._data=new c,this._firstMainSeriesBarTime=NaN,this._kindPP=function(e){switch(e){case"Traditional":return 0;case"Fibonacci":return 1;case"Woodie":return 2;case"Classic":return 3;case"DeMark":return 4;case"Camarilla":return 5;default:throw new Error("Unknown kind "+e)}}(n),this._showHistoricalPivots=o,this._historicalPivotsToKeep=l,this._pivTimeFrame=a,this._isValidResolution=function(e,t){return!(s.Std.isdaily(e)&&"Daily"===t||s.Std.isweekly(e)&&("Daily"===t||"Weekly"===t)||s.Std.ismonthly(e)&&("Daily"===t||"Weekly"===t||"Monthly"===t))}(e,this._pivTimeFrame),this._isValidResolution||s.Std.error("You cannot see this pivot timeframe on this resolution"),this._isValidResolution&&(this._secondaryRes=r(e,this._pivTimeFrame)),i=""===e.symbol.resolution?String(Math.max(30,2*parseInt(e.symbol.interval))):e.symbol.period,e.new_sym(e.symbol.tickerid,this._secondaryRes,this._secondaryRes,i)},e.prototype.main=function(e){var t,i,n,r,a,c,u,h,d,p,_,f,m,y,g;return this._isValidResolution?e.symbol.time?(isNaN(this._firstMainSeriesBarTime)&&(this._firstMainSeriesBarTime=e.symbol.time,this._removeUnusedPivots()),e.symbol.isLastBar&&e.symbol.isNewBar?this._createResponse():null):(e.select_sym(1),t=e.new_var(s.Std.open(e)),i=e.new_var(s.Std.high(e)),n=e.new_var(s.Std.low(e)),r=e.new_var(s.Std.close(e)),a=e.new_var(s.Std.time(e)),c=this._data,u=t.get(0),h=a.get(0),d=t.get(1),p=i.get(1),_=n.get(1),f=r.get(1),m=e.symbol.isLastBar,0!==c.pivots.length&&e.symbol.isNewBar&&(y=c.pivots[c.pivots.length-1]).endIndex__t!==h&&(y.endIndex__t=h),0!==e.symbol.index&&e.symbol.isNewBar?(g=function(e,t,i,n,o,r,a,c){var u,h=new l,d=NaN,p=i-n;switch(c){case 0:d=(i+n+o)/3,h.p=d,h.r1=2*d-n, h.s1=2*d-i,h.r2=d+(i-n),h.s2=d-(i-n),h.r3=2*d+(i-2*n),h.s3=2*d-(2*i-n),h.r4=3*d+(i-3*n),h.s4=3*d-(3*i-n),h.r5=4*d+(i-4*n),h.s5=4*d-(4*i-n);break;case 1:d=(i+n+o)/3,h.p=d,h.r1=d+.382*p,h.s1=d-.382*p,h.r2=d+.618*p,h.s2=d-.618*p,h.r3=d+p,h.s3=d-p;break;case 2:d=(i+n+2*e)/4,h.p=d,h.r1=2*d-n,h.s1=2*d-i,h.r2=d+p,h.s2=d-p,h.r3=i+2*(d-n),h.s3=n-2*(i-d),h.r4=h.r3+p,h.s4=h.s3-p;break;case 3:d=(i+n+o)/3,h.p=d,h.r1=2*d-n,h.s1=2*d-i,h.r2=d+p,h.s2=d-p,h.r3=d+2*p,h.s3=d-2*p,h.r4=d+3*p,h.s4=d-3*p;break;case 4:u=NaN,d=(u=s.Std.equal(t,o)?i+n+2*o:s.Std.greater(o,t)?2*i+n+o:2*n+i+o)/4,h.p=d,h.r1=u/2-n,h.s1=u/2-i;break;case 5:d=(i+n+o)/3,h.p=d,h.r1=o+1.1*p/12,h.s1=o-1.1*p/12,h.r2=o+1.1*p/6,h.s2=o-1.1*p/6,h.r3=o+1.1*p/4,h.s3=o-1.1*p/4,h.r4=o+1.1*p/2,h.s4=o-1.1*p/2;break;default:throw new Error("Unknown kind")}return h.startIndex__t=r,h.endIndex__t=a,h}(u,d,p,_,f,h,o(e,h),this._kindPP),e.select_sym(0),this._showHistoricalPivots||(c.pivots=[]),c.pivots.push(g),c.pivots.length>this._historicalPivotsToKeep&&c.pivots.shift(),m?this._createResponse():null):(e.select_sym(0),null)):null},e.prototype._createResponse=function(){return 0===this._data.pivots.length?null:{nonseries:!0,type:"non_series_data",data:{data:this._data}}},e.prototype._removeUnusedPivots=function(){var e=this,t=Math.max(this._data.pivots.findIndex(function(t){return t.startIndex__t>e._firstMainSeriesBarTime})-1,0);t>0&&this._data.pivots.splice(0,t)},e}(),h={name:"Pivot Points Standard",metainfo:{_metainfoVersion:44,defaults:{inputs:{kind:"Traditional",lookBack:15,pivTimeFrame:"Auto",showHistoricalPivots:!0},precision:"4"},description:"Pivot Points Standard",id:"PivotPointsStandard@tv-basicstudies-80",inputs:[{defval:"Traditional",id:"kind",name:"Type",options:["Traditional","Fibonacci","Woodie","Classic","DeMark","Camarilla"],type:"text"},{defval:!0,id:"showHistoricalPivots",name:"Show historical pivots",type:"bool"},{defval:"Auto",id:"pivTimeFrame",name:"Pivots Timeframe",options:["Auto","Daily","Weekly","Monthly","Yearly"],type:"text"},{defval:15,id:"lookBack",max:5e3,min:2,name:"Number of Pivots Back",type:"integer"}],is_price_study:!0,linkedToSeries:!0,shortDescription:"Pivots"},constructor:u}},i126:function(e,t,i){"use strict";var n,o,r,s,a,l,c;i.r(t),i.d(t,"StudyColorRotatorFactory",function(){return c}),n=i("eJTA"),o=i("6Kf3"),r=i("3ClC"), diff --git a/public/charting_library/static/bundles/study-market.ff409c6c02ba9edc0151.js b/public/charting_library/static/bundles/study-market.ff409c6c02ba9edc0151.js index 5770b2d..34d4e71 100644 --- a/public/charting_library/static/bundles/study-market.ff409c6c02ba9edc0151.js +++ b/public/charting_library/static/bundles/study-market.ff409c6c02ba9edc0151.js @@ -1,6 +1,6 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([["study-market"],{"24k8":function(t,e,i){"use strict";(function(e,s){function a(t,i){this.HIGHLIGHT_STUDY_NUM_FLICKS=2,this.SCROLL_TOLERANCE=10,this._BASIC_STUDIES_PACKAGE_NAME="tv-basicstudies",this._CUSTOM_STUDIES_PACKAGE_NAME="Script$USER",this._PUBLISHED_STUDIES_PACKAGE_NAME="Script$PUB",this._STANDARD_STUDIES_PACKAGE_NAME="Script$STD",this._SCRIPTING_PACKAGE_NAME="tv-scripting",this._BASIC_STUDIES_PAGE_NAME=n.enabled("plain_studymarket")?$.t("Technical Analysis"):$.t("Built-ins"),this._dialog=null,this._selectedStudy=null,this._keyDownListener=null,this._shortCutsLockId=null,this.visibilityChanged=new e,this._trialAddonDialogShown=!1,this._chartWidgetCollection=t,this._chart=t.activeChartWidget.value(),this._options=$.extend({},this.DEFAULT_OPTIONS,i||{}),this.concretizeOptions(),this._user=window.user,this.setup(),this.favsModel=m.getInstance(),this.favsModel.favoritesChanged().subscribe(this,this.updateFavorites)}var n,r,o,d,h,c,l,u,_,p,g,v,f,y,S,m,b,E,C,A,w;i("pfXf"),n=i("Kxc7"),r=i("Eyy1").assert,o=i("FQhm"),d=i("sFgq").SidebarCustomScroll,h=i("0YCj"),c=i("cBZt").extractStudyId,i("TcSq").extractPineId,l=i("YDhE").createDialog,i("oNDq").createConfirmDialog,u=i("UIZs").createSearchControl,_=i("j1f4"),p=i("Vdly"),g=i("33OQ"),v=i("6et/"),f=i("wmOI"),y=i("1hzI").KeyboardListener,S=i("Bruo"),m=i("LiyS").FavoriteScriptsModel,b=i("GVHu").Study,E=i("mMWL"),i("uOxu").getLogger("Chart.StudyMarketDialog"),i("xUY+"),i("IwoD"),i("m/4m"),C='
{{^minimized}}
{{/minimized}}
{{#minimized}}{{#withSearch}}
{{/withSearch}}{{/minimized}}
',A='
{{title}}
',w='
{{#withFavorites}}
'+i("HHbT")+''+i("GWvR")+'
{{/withFavorites}}
{{{title}}}
', +(window.webpackJsonp=window.webpackJsonp||[]).push([["study-market"],{"24k8":function(t,e,i){"use strict";(function(e,s){function a(t,i){this.HIGHLIGHT_STUDY_NUM_FLICKS=2,this.SCROLL_TOLERANCE=10,this._BASIC_STUDIES_PACKAGE_NAME="tv-basicstudies",this._CUSTOM_STUDIES_PACKAGE_NAME="Script$USER",this._PUBLISHED_STUDIES_PACKAGE_NAME="Script$PUB",this._STANDARD_STUDIES_PACKAGE_NAME="Script$STD",this._SCRIPTING_PACKAGE_NAME="tv-scripting",this._BASIC_STUDIES_PAGE_NAME=n.enabled("plain_studymarket")?$.t("Technical Analysis"):$.t("Built-ins"),this._dialog=null,this._selectedStudy=null,this._keyDownListener=null,this._shortCutsLockId=null,this.visibilityChanged=new e,this._trialAddonDialogShown=!1,this._chartWidgetCollection=t,this._chart=t.activeChartWidget.value(),this._options=$.extend({},this.DEFAULT_OPTIONS,i||{}),this.concretizeOptions(),this._user=window.user,this.setup(),this.favsModel=m.getInstance(),this.favsModel.favoritesChanged().subscribe(this,this.updateFavorites)}var n,r,o,d,h,c,l,u,_,p,g,v,f,y,S,m,b,E,C,A,w;i("pfXf"),n=i("Kxc7"),r=i("Eyy1").assert,o=i("FQhm"),d=i("sFgq").SidebarCustomScroll,h=i("0YCj"),c=i("cBZt").extractStudyId,i("TcSq").extractPineId,l=i("YDhE").createDialog,i("oNDq").createConfirmDialog,u=i("UIZs").createSearchControl,_=i("j1f4"),p=i("Vdly"),g=i("33OQ"),v=i("6et/"),f=i("wmOI"),y=i("1hzI").KeyboardListener,S=i("Bruo"),m=i("LiyS").FavoriteScriptsModel,b=i("GVHu").Study,E=i("mMWL"),i("uOxu").getLogger("Chart.StudyMarketDialog"),i("xUY+"),i("IwoD"),i("m/4m"),C='
{{^minimized}}
{{/minimized}}
{{#minimized}}{{#withSearch}}
{{/withSearch}}{{/minimized}}
',A='
{{title}}
',w='
{{#withFavorites}}
'+i("HHbT")+''+i("GWvR")+'
{{/withFavorites}}
{{{title}}}
', a.prototype.destroy=function(){},a.prototype.setup=function(){this._initialized=!1,this._loadMore=null,this._$symbolSearchPopup=null,this._market=null,this._studies=null,this._packagesWithTabNames={},this._pages={},this._tabs={},this._subProductIds={},this.favsChanged=new e,this._previousInviteOnlyStudiesIds=[],this.studiesReady=new $.Deferred,this.marketPagesReady=new $.Deferred,this._pubSearchCount=[0,0,0],this._pubSearchCanLoad=[!0,!0,!0],this._pubSearchEntries=[],this._pubSearchCache=[],this._pubSearchDfd=null,this._pubSearchPageShown=!1,this._w_market_tabs=null,this._w_technical_tabs=null},a.prototype.init=function(){var t,e=this;return this._initialized?this.getStudyInfo():(t=function(){e.setupMarketInfo(),e.getStudyInfo(),e.setUser(e._user),e.prepareLayout(),e.attachHandlers(),e._initialized=!0},new Promise(function(e){return t(),e()}))},a.prototype.DEFAULT_OPTIONS={onWidget:!1,hideMarketPages:!1,selectBasicPage:!0,minimized:!1,searchKeywords:{earning:new RegExp("EPS"),earnings:new RegExp("EPS"),"trailing twelve months":new RegExp("TTM")}},a.prototype._PAGE_KEY="studyMarket.page",a.prototype._PUB_SEARCH_ENTRIES_ON_PAGE=20,a.prototype.loadFavorites=function(){this.favsModel.loadFavs()},a.prototype.concretizeOptions=function(){n.enabled("study_market_minimized")&&(this._options.hideMarketPages=!0,this._options.selectBasicPage=!0,this._options.minimized=!0),this._options.onWidget&&(this._options.hideMarketPages=!0)},a.prototype.setupMarketInfo=function(){},a.prototype.getStudyInfo=function(){var t=this;return new Promise(function(e,i){t._chart.withModel(t,function(){t.setupStudyInfo().then(function(){e()}).catch(function(t){i(t)})})})},a.prototype.setupStudyInfo=function(){var t=this._chartWidgetCollection.activeChartWidget.value().metaInfoRepository();return t.findAll().then(function(e){return(e=e.concat(t.getAllStubs())).length,this._studies={},(e=e.filter(function(t){return!this.isHidedStudy(t)},this)).forEach(function(t){var e,i=this.getStudyPackageName(t.id),s=!(this._options.minimized&&i!==this._BASIC_STUDIES_PACKAGE_NAME||this._options.onWidget&&(h.isScriptStrategy(t)||i===this._CUSTOM_STUDIES_PACKAGE_NAME));s&&(e=this.resolvePackageName(i),r(void 0!==e,"Cannot resolve packageName "+i),this._studies[e]=this._studies[e]||[],this._studies[e].push(t))}.bind(this),this),this.studiesReady.resolve()}.bind(this))},a.prototype.setupAddonsInfo=function(){var t,e,i,s,a=[],n={};for(t in this._market.products)e=this._market.products[t],pro.hasPackage(t)&&e.subproduct_ids&&e.subproduct_ids[0]&&(i=e.subproduct_ids[0].split("$")[1],n[i]=t,a.push(ScriptLib.requestPineAddons(i)));return s=this,Promise.all(a).then(function(t){return t.reduce(function(t,e){var i,a;return e&&e.length?(i=e[0].scriptIdPart.split("_")[0],a=[],s._fillScriptsMetainfo(e,a),t[n[i]]=a,t):t},{})})},a.prototype.resolvePackageName=function(t){return t in this._subProductIds?this._subProductIds[t]:t},a.prototype.setUser=function(t){window.is_authenticated?this.setupUserData(t):this.setAnonymous()},a.prototype.setupUserData=function(t){this._user=t, -this.loadFavorites(),this.updateMarketPages()},a.prototype.setAnonymous=function(){this.setupUserData(null),this.favsChanged.fire()},a.prototype.isHidedStudy=function(t){var e=!1,i=!1;return!!t.is_hidden_study||e&&!i},a._breakpointDevice="phone-vertical",a.prototype._switchPagesContainer=function(t,e){this._options.minimized||this._options.onWidget||(t===a._breakpointDevice?this._w_pages.detach().appendTo(this._widget.find(".js-left-panel-wrapper")):e===a._breakpointDevice&&this._w_pages.detach().appendTo(this._widget.find(".js-right-panel")))},a.prototype.prepareLayout=function(){this._widget=$(s.render(C,{withSearch:n.enabled("study_dialog_search_control")||this._options.onWidget,minimized:this._options.minimized||this._options.onWidget})),this._w_tabs=this._widget.find(".js-tabs-container"),this._w_pages=this._widget.find(".js-pages"),this._loadMore=null,this.preparePages(),this._options.selectBasicPage&&this.selectPage(this._BASIC_STUDIES_PAGE_NAME),this._scroll=new d(this._widget.find(".js-tabs-viewport"),this._w_tabs,{showBottomShadow:!1});var t='
'+i("MjtL")+'
{{{ title }}}
';this._dialog=l({title:" ",titleTemplate:t,contentWrapTemplate:this._widget,addClass:"tv-insert-indicator-dialog "+(this._options.onWidget||this._options.minimized?"i-minimized":""),width:this._options.onWidget||this._options.minimized?490:842,height:630,withScroll:!1,focusFirstControl:!1,closeOnClickAtOtherDialogs:!1,isClickOutFn:function(t){var e,s;return!this._trialAddonDialogShown&&((e=i.c.wv8n)&&(s=e.exports.instance())?s.isEventOut(t):this._$symbolSearchPopup?this._$symbolSearchPopup[0]!==t.target&&!this._$symbolSearchPopup[0].contains(t.target)&&void 0:void 0)}.bind(this)}),this._dialog.on("afterClose",this._onDialogClosed.bind(this)),this._dialog.$title.find(".js-back-button").on(Modernizr.mobiletouch?"touchend":"click",this.selectPage.bind(this,"")),g.on("changeDevice",function(t,e){t===a._breakpointDevice&&this.currentPage()&&this.currentPage().hasClass("js-marketplace-page")&&this.selectPage(""),t===a._breakpointDevice&&(this._scroll.scrollToStart(),this._updateDialogTitleText()),this._switchPagesContainer(t,e)}.bind(this)),this._switchPagesContainer(g.device,""),this._showHideBackButton(),this.hide()},a.prototype.scrollHandler=function(){var t,e;this._loadMore?(t=$.map(this._w_pages.children(":visible"),function(t){return $(t).outerHeight(!0)}).reduce(function(t,e){return t+e},0),e=this._widget.find(".js-right-panel").height(),this._w_pages.scrollTop()>t-e-this.SCROLL_TOLERANCE&&(this._w_pages.off("scroll.loadMoreOnEnd"),this._loadMore())):this._w_pages.off("scroll.loadMoreOnEnd")},a.prototype._updateDialogTitleText=function(){var t +this.loadFavorites(),this.updateMarketPages()},a.prototype.setAnonymous=function(){this.setupUserData(null),this.favsChanged.fire()},a.prototype.isHidedStudy=function(t){var e=!1,i=!1;return!!t.is_hidden_study||e&&!i},a._breakpointDevice="phone-vertical",a.prototype._switchPagesContainer=function(t,e){this._options.minimized||this._options.onWidget||(t===a._breakpointDevice?this._w_pages.detach().appendTo(this._widget.find(".js-left-panel-wrapper")):e===a._breakpointDevice&&this._w_pages.detach().appendTo(this._widget.find(".js-right-panel")))},a.prototype.prepareLayout=function(){this._widget=$(s.render(C,{withSearch:n.enabled("study_dialog_search_control")||this._options.onWidget,minimized:this._options.minimized||this._options.onWidget})),this._w_tabs=this._widget.find(".js-tabs-container"),this._w_pages=this._widget.find(".js-Pages"),this._loadMore=null,this.preparePages(),this._options.selectBasicPage&&this.selectPage(this._BASIC_STUDIES_PAGE_NAME),this._scroll=new d(this._widget.find(".js-tabs-viewport"),this._w_tabs,{showBottomShadow:!1});var t='
'+i("MjtL")+'
{{{ title }}}
';this._dialog=l({title:" ",titleTemplate:t,contentWrapTemplate:this._widget,addClass:"tv-insert-indicator-dialog "+(this._options.onWidget||this._options.minimized?"i-minimized":""),width:this._options.onWidget||this._options.minimized?490:842,height:630,withScroll:!1,focusFirstControl:!1,closeOnClickAtOtherDialogs:!1,isClickOutFn:function(t){var e,s;return!this._trialAddonDialogShown&&((e=i.c.wv8n)&&(s=e.exports.instance())?s.isEventOut(t):this._$symbolSearchPopup?this._$symbolSearchPopup[0]!==t.target&&!this._$symbolSearchPopup[0].contains(t.target)&&void 0:void 0)}.bind(this)}),this._dialog.on("afterClose",this._onDialogClosed.bind(this)),this._dialog.$title.find(".js-back-button").on(Modernizr.mobiletouch?"touchend":"click",this.selectPage.bind(this,"")),g.on("changeDevice",function(t,e){t===a._breakpointDevice&&this.currentPage()&&this.currentPage().hasClass("js-marketplace-page")&&this.selectPage(""),t===a._breakpointDevice&&(this._scroll.scrollToStart(),this._updateDialogTitleText()),this._switchPagesContainer(t,e)}.bind(this)),this._switchPagesContainer(g.device,""),this._showHideBackButton(),this.hide()},a.prototype.scrollHandler=function(){var t,e;this._loadMore?(t=$.map(this._w_pages.children(":visible"),function(t){return $(t).outerHeight(!0)}).reduce(function(t,e){return t+e},0),e=this._widget.find(".js-right-panel").height(),this._w_pages.scrollTop()>t-e-this.SCROLL_TOLERANCE&&(this._w_pages.off("scroll.loadMoreOnEnd"),this._loadMore())):this._w_pages.off("scroll.loadMoreOnEnd")},a.prototype._updateDialogTitleText=function(){var t ;this._dialog&&(!(""!==this._currentPageTitle)||this._options.onWidget||this._options.minimized||"phone-vertical"!==g.device?this._dialog.setTitleText(this._dialogTitleText):(t=this.currentPage(),this._dialog.setTitleText(t.data("fullTitle"))))},a.prototype.currentPage=function(){return this._pages[this._currentPageTitle]},a.prototype.preparePages=function(){this.addSearchPage(),n.enabled("items_favoriting")&&this.addFavoritesPage(),this.prepareBasicPage()},a.prototype.addFavoritesPage=function(){this.addPage("Favorites",{localizedTitle:$.t("Favorites")}),this.loadFavorites(),this.updateFavorites()},a.prototype.addInvitesOnlyPage=function(){this.addPage("invitesOnly",{localizedTitle:$.t("Invite-Only Scripts")})},a.prototype.prepareBasicPage=function(){var t=this.addPage(this._BASIC_STUDIES_PAGE_NAME,{packageName:this._BASIC_STUDIES_PACKAGE_NAME});this._basicPage=t,this.studiesReady.done(function(){this.resetBasicPage()}.bind(this))},a.prototype._applyGlobalFilter=function(t){return this._parentSource&&(t=t.filter(h.canBeChild)),t},a.prototype._applyStrategiesFilter=function(t){var e=this._parentSource?"not_strategies":"none";return"not_strategies"!==e&&"only_strategies"!==e||(t=t.filter(function(t){var i=h.isScriptStrategy(t);return"not_strategies"===e?!i:i})),t},a.prototype.resetBasicPage=function(){var t,e,i=this.getPage(this._BASIC_STUDIES_PAGE_NAME);this._studies&&(t=this._studies[this._BASIC_STUDIES_PACKAGE_NAME]||[],e=this._studies[this._STANDARD_STUDIES_PACKAGE_NAME]||[],t=t.concat(e),t=this._applyStrategiesFilter(t),t=this._applyGlobalFilter(t),this.preparePageStudies(i,t),this._renderStudiesPage(i))},a.prototype.resetAllPages=function(){this.resetBasicPage(),this.resetCustomScriptPage(),this.resetPublishedScriptPage(),this.resetInvitesOnlyPage()},a.prototype._fillScriptsMetainfo=function(t,e){var i,s,a;for(i=0;i')},a.prototype._createSubGroupItem=function(t){return $('
').text(t)},a.prototype._createItemsGroup=function(t,e,i){var s,a=this._createItemsList();return this.fillStudies(a,t,i),s=$('
'),e.length&&s.append(this._createSubGroupItem(e)),s.append(a),s},a.prototype.addSearchPage=function(){var t,e,i=u({addClass:"tv-insert-indicator-dialog__search-control"});this._tabs.search=i.$control.data("title","search"),this._pages.search=$('