This repository has been archived by the owner on May 29, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
/
dist.js
2 lines (2 loc) · 192 KB
/
dist.js
1
2
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("source-map-support"),require("node-fetch"),require("cloudscraper")):"function"==typeof define&&define.amd?define(["source-map-support","node-fetch","cloudscraper"],t):"object"==typeof exports?exports["wstrade-api"]=t(require("source-map-support"),require("node-fetch"),require("cloudscraper")):e["wstrade-api"]=t(e._,e._,e._)}(global,(function(e,t,r){return(()=>{var n={228:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}},858:e=>{e.exports=function(e){if(Array.isArray(e))return e}},646:(e,t,r)=>{var n=r(228);e.exports=function(e){if(Array.isArray(e))return n(e)}},926:e=>{function t(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise((function(i,a){var o=e.apply(r,n);function s(e){t(o,i,a,s,u,"next",e)}function u(e){t(o,i,a,s,u,"throw",e)}s(void 0)}))}}},575:e=>{e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},913:e=>{function t(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}},713:e=>{e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},860:e=>{e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},884:e=>{e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return r}}},521:e=>{e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},206:e=>{e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},38:(e,t,r)=>{var n=r(858),i=r(884),a=r(379),o=r(521);e.exports=function(e,t){return n(e)||i(e,t)||a(e,t)||o()}},319:(e,t,r)=>{var n=r(646),i=r(860),a=r(379),o=r(206);e.exports=function(e){return n(e)||i(e)||a(e)||o()}},379:(e,t,r)=>{var n=r(228);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}},757:(e,t,r)=>{e.exports=r(666)},391:(e,t,r)=>{"use strict";r.d(t,{Z:()=>v});var n=r(319),i=r.n(n),a=r(757),o=r.n(a),s=r(926),u=r.n(s),c=r(575),l=r.n(c),h=r(913),p=r.n(h),f=r(726),d=99,y=["sell","deposit","withdrawal","dividend","institutional_transfer","internal_transfer","refund","referral_bonus","affiliate","buy"];const v=function(){function e(t){l()(this,e),this.worker=t}var t,r,n,a,s,c,h,v,m;return p()(e,[{key:"all",value:(m=u()(o().mark((function e(){var t;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.worker.handleRequest(f.Z.ACCOUNT_IDS,{});case 2:return t=e.sent,e.abrupt("return",{tfsa:t.find((function(e){return e.startsWith("tfsa")})),rrsp:t.find((function(e){return e.startsWith("rrsp")})),crypto:t.find((function(e){return e.startsWith("non-registered-crypto")})),personal:t.find((function(e){return e.startsWith("non-registered")&&!e.startsWith("non-registered-crypto")}))});case 4:case"end":return e.stop()}}),e,this)}))),function(){return m.apply(this,arguments)})},{key:"data",value:(v=u()(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.worker.handleRequest(f.Z.LIST_ACCOUNT,{}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return v.apply(this,arguments)})},{key:"me",value:(h=u()(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.worker.handleRequest(f.Z.ME,{}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"person",value:(c=u()(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.worker.handleRequest(f.Z.PERSON,{}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"history",value:(s=u()(o().mark((function e(t,r){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.worker.handleRequest(f.Z.HISTORY_ACCOUNT,{interval:t,accountId:r}));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"activities",value:(a=u()(o().mark((function e(){var t,r,n,a,s,u,c,l,h,p,v=arguments;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(null!=(s=v.length>0&&void 0!==v[0]?v[0]:{})&&s.limit&&s.limit>d)){e.next=3;break}throw new Error("filters.limit can not exceed 99! Leave filters.limit undefined if you want to retrieve all.");case 3:if(null==s||!s.accounts||Array.isArray(s.accounts)){e.next=5;break}throw new Error("filters.accounts must be an array!");case 5:if(null==s||!s.type||Array.isArray(s.type)){e.next=7;break}throw new Error("filters.type must be an array!");case 7:return u=[],e.next=10,this.worker.handleRequest(f.Z.ACTIVITIES,{limit:null!==(t=null==s?void 0:s.limit)&&void 0!==t?t:d,accountIds:null!==(r=null==s||null===(n=s.accounts)||void 0===n?void 0:n.join())&&void 0!==r?r:"",bookmark:"",type:null!==(a=null==s?void 0:s.type)&&void 0!==a?a:y});case 10:if(c=e.sent,u.push.apply(u,i()(c.results)),null!=s&&s.limit){e.next=22;break}case 13:if(u.length%d!=0){e.next=22;break}return e.next=16,this.worker.handleRequest(f.Z.ACTIVITIES,{limit:d,accountIds:null!==(l=null==s||null===(h=s.accounts)||void 0===h?void 0:h.join())&&void 0!==l?l:"",bookmark:c.bookmark,type:null!==(p=null==s?void 0:s.type)&&void 0!==p?p:y});case 16:if(0!==(c=e.sent).results.length){e.next=19;break}return e.abrupt("break",22);case 19:u.push.apply(u,i()(c.results)),e.next=13;break;case 22:return e.abrupt("return",u);case 23:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"getBankAccounts",value:(n=u()(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.worker.handleRequest(f.Z.BANK_ACCOUNTS,{}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"deposits",value:(r=u()(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.worker.handleRequest(f.Z.DEPOSITS,{}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"positions",value:(t=u()(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.worker.handleRequest(f.Z.POSITIONS,{accountId:t}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}()},726:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n={onFailure:function(e){return{status:e.statusCode,reason:e.statusMessage,body:e.body}},onSuccess:function(e){return e.body}};const i={LOGIN:{method:"POST",url:"https://trade-service.wealthsimple.com/auth/login",authenticated:!1,onSuccess:function(e){return{tokens:{access:e.headers["x-access-token"],refresh:e.headers["x-refresh-token"],expires:parseInt(e.headers["x-access-token-expires"],10)},accountInfo:e.body}},onFailure:n.onFailure},REFRESH:{method:"POST",url:"https://trade-service.wealthsimple.com/auth/refresh",authenticated:!1,onSuccess:function(e){return{tokens:{access:e.headers["x-access-token"],refresh:e.headers["x-refresh-token"],expires:parseInt(e.headers["x-access-token-expires"],10)}}},onFailure:n.onFailure},ACCOUNT_IDS:{method:"GET",url:"https://trade-service.wealthsimple.com/account/list",authenticated:!0,onSuccess:function(e){return e.body.results.map((function(e){return e.id}))},onFailure:n.onFailure},LIST_ACCOUNT:{method:"GET",url:"https://trade-service.wealthsimple.com/account/list",authenticated:!0,onSuccess:function(e){return e.body.results},onFailure:n.onFailure},ME:{method:"GET",url:"https://trade-service.wealthsimple.com/me",authenticated:!0,onSuccess:n.onSuccess,onFailure:n.onFailure},PERSON:{method:"GET",url:"https://trade-service.wealthsimple.com/person",authenticated:!0,onSuccess:n.onSuccess,onFailure:n.onFailure},HISTORY_ACCOUNT:{method:"GET",url:"https://trade-service.wealthsimple.com/account/history/{0}?account_id={1}",authenticated:!0,parameters:{0:"interval",1:"accountId"},onSuccess:n.onSuccess,onFailure:n.onFailure},ACTIVITIES:{method:"GET",url:"https://trade-service.wealthsimple.com/account/activities?limit={0}&account_ids={1}&[2]&bookmark={3}",authenticated:!0,parameters:{0:"limit",1:"accountIds",2:"type",3:"bookmark"},onSuccess:n.onSuccess,onFailure:n.onFailure},DEPOSITS:{method:"GET",url:"https://trade-service.wealthsimple.com/deposits",authenticated:!0,onSuccess:function(e){return e.body.results},onFailure:n.onFailure},BANK_ACCOUNTS:{method:"GET",url:"https://trade-service.wealthsimple.com/bank-accounts",authenticated:!0,onSuccess:function(e){return e.body.results},onFailure:n.onFailure},EXCHANGE_RATES:{method:"GET",url:"https://trade-service.wealthsimple.com/forex",authenticated:!0,onSuccess:n.onSuccess,onFailure:n.onFailure},SECURITY:{method:"GET",url:"https://trade-service.wealthsimple.com/securities?query={0}",authenticated:!0,parameters:{0:"ticker"},onSuccess:function(e){var t=e.body;if(0===t.results.length)throw new Error("Security does not exist");return t.results},onFailure:n.onFailure},EXTENSIVE_SECURITY_DETAILS:{method:"GET",url:"https://trade-service.wealthsimple.com/securities/{0}",authenticated:!0,parameters:{0:"id"},onSuccess:n.onSuccess,onFailure:n.onFailure},SECURITY_GROUPS:{method:"GET",url:"https://trade-service.wealthsimple.com/security-groups?limit=99",authenticated:!0,onSuccess:function(e){return e.body.results},onFailure:n.onFailure},SECURITY_GROUP:{method:"GET",url:"https://trade-service.wealthsimple.com/security-groups/{0}/securities",authenticated:!0,parameters:{0:"groupId"},onSuccess:function(e){return e.body.results},onFailure:n.onFailure},QUOTES_HISTORY:{method:"GET",url:"https://trade-service.wealthsimple.com/securities/{0}/historical_quotes/{1}?mic=XNAS",authenticated:!0,parameters:{0:"id",1:"interval"},onSuccess:n.onSuccess,onFailure:n.onFailure},POSITIONS:{method:"GET",url:"https://trade-service.wealthsimple.com/account/positions?account_id={0}",authenticated:!0,parameters:{0:"accountId"},onSuccess:function(e){return e.body.results},onFailure:n.onFailure},ORDERS_BY_PAGE:{method:"GET",url:"https://trade-service.wealthsimple.com/orders?offset={0}&account_id={1}",authenticated:!0,parameters:{0:"offset",1:"accountId"},onSuccess:function(e){var t=e.body;return{total:t.total,orders:t.results}},onFailure:n.onFailure},CANCEL_ORDER:{method:"DELETE",url:"https://trade-service.wealthsimple.com/orders/{0}",authenticated:!0,parameters:{0:"orderId"},onSuccess:n.onSuccess,onFailure:n.onFailure},PLACE_ORDER:{method:"POST",url:"https://trade-service.wealthsimple.com/orders",authenticated:!0,onSuccess:n.onSuccess,onFailure:n.onFailure}}},464:(e,t,r)=>{"use strict";r.d(t,{Z:()=>h});var n=r(757),i=r.n(n),a=r(926),o=r.n(a),s=r(575),u=r.n(s),c=r(913),l=r.n(c);const h=function(){function e(t){u()(this,e),this.worker=t}var t,r;return l()(e,[{key:"on",value:function(e,t){this.worker.on(e,t)}},{key:"use",value:function(e){this.worker.tokens.store(e)}},{key:"tokens",value:function(){return{access:this.worker.tokens.access,refresh:this.worker.tokens.refresh,expires:this.worker.tokens.expires}}},{key:"login",value:(r=o()(i().mark((function e(t,r){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.worker.login(t,r));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"refresh",value:(t=o()(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.worker.refreshAuthentication());case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}()},500:(e,t,r)=>{"use strict";r.d(t,{e:()=>a,Z:()=>o});var n=["implicit_token_refresh","securities_cache"],i=["securities_cache"],a=function(e){return!i.includes(e)};function o(e){if(!function(e){return null!=e&&e.startsWith("no_")?n.includes(e.substring("no_".length)):n.includes(e)}(e))throw new Error("'".concat(e,"' is not supported!"));if(null!=e&&e.startsWith("no_")){var t=e.substring(e.indexOf("_")+1);a(t)&&i.push(t)}else a(e)||i.splice(i.indexOf(e),1)}},657:(e,t,r)=>{"use strict";r.d(t,{Z:()=>l});var n=r(38),i=r.n(n),a=r(575),o=r.n(a),s=r(913),u=r.n(s),c=["NASDAQ","NYSE","TSX","TSX-V","AEQUITAS NEO EXCHANGE","CC"];const l=function(){function e(t){var r;if(o()(this,e),this.symbol=null,this.exchange=null,this.id=null,this.crypto=!1,"string"==typeof t){if(""===t)throw new Error("Empty ticker");var n=t.split(":"),a=i()(n,2);this.symbol=a[0],this.exchange=a[1]}else{if(!t.symbol&&!t.id)throw new Error("Invalid ticker '".concat(t,"'"));this.symbol=t.symbol||null,this.exchange=t.exchange||null,this.id=t.id||null}if("NEO"===this.exchange&&(this.exchange="AEQUITAS NEO EXCHANGE"),this.exchange&&!c.includes(this.exchange))throw new Error("Invalid exchange '".concat(this.exchange,"'!"));("CC"===this.exchange||null!==(r=this.id)&&void 0!==r&&r.startsWith("sec-z"))&&(this.crypto=!0)}return u()(e,[{key:"format",value:function(){return this.id?this.id:"AEQUITAS NEO EXCHANGE"===this.exchange?"".concat(this.symbol,":NEO"):"".concat(this.symbol).concat(this.exchange?":".concat(this.exchange):"")}},{key:"weakEquals",value:function(e){return!(!this.id||this.id!==e.id)||!(!this.symbol||this.symbol!==e.symbol||this.crypto!==e.crypto)}}]),e}()},752:(e,t,r)=>{"use strict";r.d(t,{Z:()=>g});var n=r(713),i=r.n(n),a=r(38),o=r.n(a),s=r(757),u=r.n(s),c=r(926),l=r.n(c),h=r(575),p=r.n(h),f=r(913),d=r.n(f),y=r(726),v=r(657),m=r(500),w=new(function(){function e(t){p()(this,e),this.cache=new Map,this.size=t}return d()(e,[{key:"insert",value:function(e,t){this.cache.size>=this.size&&this.cache.delete(this.cache.keys().next().value),this.cache.set(e,t)}},{key:"get",value:function(e){return this.cache.get(e)}}]),e}())(10);const k=function(e){var t=w.get(new v.Z(e).format());return void 0===t?null:t};function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?x(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const g=function(){function e(t){p()(this,e),this.worker=t}var t,r,n,a;return d()(e,[{key:"exchangeRates",value:(a=l()(u().mark((function e(){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.worker.handleRequest(y.Z.EXCHANGE_RATES,{}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"getSecurity",value:(n=l()(u().mark((function e(t,r){var n,i,a,s;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=null,i=new v.Z(t),r||!(0,m.e)("securities_cache")){e.next=6;break}if(!(n=k(i))){e.next=6;break}return e.abrupt("return",n);case 6:if(!i.id){e.next=12;break}return e.next=9,this.worker.handleRequest(y.Z.EXTENSIVE_SECURITY_DETAILS,{id:i.id});case 9:n=e.sent,e.next=28;break;case 12:return e.next=14,this.worker.handleRequest(y.Z.SECURITY,{ticker:i.symbol});case 14:if(n=(n=e.sent).filter((function(e){return e.stock.symbol===i.symbol})),i.crypto?n=n.filter((function(e){return"cryptocurrency"===e.security_type})):i.exchange&&(n=n.filter((function(e){return e.stock.primary_exchange===i.exchange}))),!(n.length>1)){e.next=19;break}throw new Error("Multiple securities matched query.");case 19:if(0!==n.length){e.next=21;break}throw new Error("No securities matched query.");case 21:if(a=n,s=o()(a,1),n=s[0],!r){e.next=28;break}return e.next=27,this.worker.handleRequest(y.Z.EXTENSIVE_SECURITY_DETAILS,{id:n.id});case 27:n=e.sent;case 28:return(0,m.e)("securities_cache")&&null===k(i)&&(u=i,c=n,w.insert(new v.Z(u).format(),c)),e.abrupt("return",n);case 30:case"end":return e.stop()}var u,c}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"securityGroups",value:(r=l()(u().mark((function e(){var t;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.worker.handleRequest(y.Z.SECURITY_GROUPS,{});case 2:return t=e.sent,e.abrupt("return",t.reduce((function(e,t){return b(b({},e),{},i()({},t.name,t.external_security_group_id))}),{}));case 4:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"getSecurityGroup",value:(t=l()(u().mark((function e(t){var r,n;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t,null!=t&&t.startsWith("security-group")){e.next=8;break}return e.next=4,this.securityGroups();case 4:if(n=e.sent,t in n){e.next=7;break}throw new Error("'".concat(t,"' is not a valid group name!"));case 7:r=n[t];case 8:return e.abrupt("return",this.worker.handleRequest(y.Z.SECURITY_GROUP,{groupId:r}));case 9:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}()},568:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(319),i=r.n(n),a=new(r(545).Headers);const o={add:function(e,t){return a.append(e,t)},remove:function(e){return a.delete(e)},clear:function(){return i()(a).forEach((function(e){return a.delete(e[0])}))},values:function(){return i()(a)}}},352:(e,t,r)=>{r(949).install();var n=r(464).Z,i=r(568).Z,a=r(391).Z,o=r(764).Z,s=r(752).Z,u=r(889).Z,c=r(500).Z,l=r(190).Z,h=function(){var e=new l,t=new s(e);return{auth:new n(e),headers:i,accounts:new a(e),orders:new o(e,t),quotes:new u(e,t),data:t,config:c}},p=new h;p.Session=function(){return new h},e.exports=p},190:(e,t,r)=>{"use strict";r.d(t,{Z:()=>S});var n=r(757),i=r.n(n),a=r(38),o=r.n(a),s=r(926),u=r.n(s),c=r(575),l=r.n(c),h=r(913),p=r.n(h),f=r(713),d=r.n(f),y=r(214),v=r.n(y),m=r(568),w=r(726),k=r(500);const x=function(){function e(){l()(this,e),this.access=null,this.refresh=null,this.expires=null}return p()(e,[{key:"store",value:function(e){this.access=e.access,this.refresh=e.refresh,this.expires=e.expires}},{key:"expired",value:function(){return this.expires&&parseInt(Date.now()/1e3,10)>=this.expires}}]),e}();function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var g=200,E=201;function _(e,t){var r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){d()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},t),n=e.url;if(e.parameters)for(var i=0;i<Object.keys(e.parameters).length;i++){var a=e.parameters[i];if(null===r[a]||void 0===r[a])throw new Error("URL parameter '".concat(a,"' missing!"));if(n.indexOf("{".concat(i,"}"))>=0)n=n.replace("{".concat(i,"}"),r[e.parameters[i]]);else{if(!(n.indexOf("[".concat(i,"]"))>=0))throw new Error("Malformed URL! This is an internal error: raise an issue!");!function(){var t=e.parameters[i],a=r[t].map((function(e){return"".concat(t,"=").concat(e)})).join("&");n=n.replace("[".concat(i,"]"),a)}()}delete r[e.parameters[i]]}return["GET","HEAD"].includes(e.method)?{url:n,payload:void 0}:{url:n,payload:JSON.stringify(r)}}const S=function(){function e(){l()(this,e),this.tokens=new x,this.events={otp:null,refresh:null}}var t,r,n,a,s;return p()(e,[{key:"on",value:function(e,t){if(!(e in this.events))throw new Error("Unsupported authentication event '".concat(e,"'!"));this.events[e]=t}},{key:"talk",value:(s=u()(i().mark((function e(t,r){var n,a,s,u,c;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n={"Content-type":"application/json"},!t.authenticated){e.next=8;break}if(this.tokens.access){e.next=4;break}throw new Error("Authentication required for '".concat(t.url,"'"));case 4:if(!(0,k.e)("implicit_token_refresh")){e.next=7;break}return e.next=7,this.implicitTokenRefresh();case 7:n.Authorization=this.tokens.access;case 8:return m.Z.values().forEach((function(e){var t=o()(e,2),r=t[0],i=t[1];n[r]=i})),a=_(t,r),s=a.url,u=a.payload,c=null,e.next=13,v()({url:s,body:u,method:t.method,headers:n,callback:function(e,t){c=t}}).catch((function(){}));case 13:try{c.body=JSON.parse(c.body)}catch(e){}return e.abrupt("return",c);case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"handleRequest",value:(a=u()(i().mark((function e(t,r){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.talk(t,r);case 2:if(n=e.sent,![g,E].includes(n.statusCode)){e.next=5;break}return e.abrupt("return",t.onSuccess(n));case 5:return e.abrupt("return",Promise.reject(t.onFailure(n)));case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"login",value:(n=u()(i().mark((function e(t,r){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=null,"function"!=typeof this.events.otp){e.next=4;break}return e.next=4,this.handleRequest(w.Z.LOGIN,{email:t,password:r}).catch((function(){}));case 4:if(e.prev=4,e.t0=this,e.t1=w.Z.LOGIN,e.t2=t,e.t3=r,"function"!=typeof this.events.otp){e.next=15;break}return e.next=12,this.events.otp();case 12:e.t4=e.sent,e.next=16;break;case 15:e.t4=this.events.otp;case 16:return e.t5=e.t4,e.t6={email:e.t2,password:e.t3,otp:e.t5},e.next=20,e.t0.handleRequest.call(e.t0,e.t1,e.t6);case 20:n=e.sent,e.next=28;break;case 23:if(e.prev=23,e.t7=e.catch(4),this.events.otp){e.next=27;break}throw new Error("OTP not provided!");case 27:throw e.t7;case 28:this.tokens.store(n.tokens);case 29:case"end":return e.stop()}}),e,this,[[4,23]])}))),function(e,t){return n.apply(this,arguments)})},{key:"refreshAuthentication",value:(r=u()(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.handleRequest(w.Z.REFRESH,{refresh_token:this.tokens.refresh});case 2:if(t=e.sent,this.tokens.store(t.tokens),e.prev=4,"function"!=typeof this.events.refresh){e.next=8;break}return e.next=8,this.events.refresh(this.tokens);case 8:e.next=13;break;case 10:throw e.prev=10,e.t0=e.catch(4),new Error("Error in auth.on() handler for 'refresh': ".concat(e.t0));case 13:case"end":return e.stop()}}),e,this,[[4,10]])}))),function(){return r.apply(this,arguments)})},{key:"implicitTokenRefresh",value:(t=u()(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.tokens.expired()){e.next=13;break}if(!this.tokens.refresh){e.next=12;break}return e.prev=2,e.next=5,this.refreshAuthentication();case 5:e.next=10;break;case 7:throw e.prev=7,e.t0=e.catch(2),new Error("Unable to refresh expired token: ".concat(e.t0));case 10:e.next=13;break;case 12:throw new Error("Access token expired");case 13:case"end":return e.stop()}}),e,this,[[2,7]])}))),function(){return t.apply(this,arguments)})}]),e}()},764:(e,t,r)=>{"use strict";r.d(t,{Z:()=>m});var n=r(319),i=r.n(n),a=r(757),o=r.n(a),s=r(926),u=r.n(s),c=r(575),l=r.n(c),h=r(913),p=r.n(h),f=r(726),d=r(657),y=function(e){return["TSX","TSX-V"].includes(e)};function v(e,t,r){var n=e.orders.filter((function(e){if(t){var n=new d.Z({symbol:e.symbol,id:e.security_id});if(!new d.Z(t).weakEquals(n))return!1}return e.status===r}));return{orders:n,total:n.length}}const m=function(){function e(t,r){l()(this,e),this.worker=t,this.data=r}var t,r,n,a,s,c,h,m,w,k,x,b,g;return p()(e,[{key:"page",value:(g=u()(o().mark((function e(t,r){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.worker.handleRequest(f.Z.ORDERS_BY_PAGE,{offset:20*(r-1),accountId:t}));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"all",value:(b=u()(o().mark((function e(t){var r,n,a,s;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.page(t,1);case 2:if(r=e.sent,!((n=Math.ceil(r.total/20))>1)){e.next=12;break}for(a=[],s=2;s<=n;s++)a.push(this.page(t,s).then((function(e){return e.orders})));return e.next=9,Promise.all(a);case 9:e.sent.forEach((function(e){var t;return(t=r.orders).push.apply(t,i()(e))})),r.total=r.orders.length;case 12:return e.abrupt("return",r);case 13:case"end":return e.stop()}}),e,this)}))),function(e){return b.apply(this,arguments)})},{key:"pending",value:(x=u()(o().mark((function e(t,r){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.all(t);case 2:return n=e.sent,e.abrupt("return",v(n,r,"submitted"));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return x.apply(this,arguments)})},{key:"filled",value:(k=u()(o().mark((function e(t,r){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.all(t);case 2:return n=e.sent,e.abrupt("return",v(n,r,"posted"));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return k.apply(this,arguments)})},{key:"cancelled",value:(w=u()(o().mark((function e(t,r){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.all(t);case 2:return n=e.sent,e.abrupt("return",v(n,r,"cancelled"));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return w.apply(this,arguments)})},{key:"cancel",value:(m=u()(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=t,e.next=3,this.worker.handleRequest(f.Z.CANCEL_ORDER,{orderId:t});case 3:return e.t1=e.sent,e.abrupt("return",{order:e.t0,response:e.t1});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return m.apply(this,arguments)})},{key:"cancelPending",value:(h=u()(o().mark((function e(t){var r,n=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.pending(t);case 2:return r=e.sent,e.abrupt("return",Promise.all(r.orders.map(function(){var e=u()(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n.cancel(t.order_id));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)})},{key:"marketBuy",value:(c=u()(o().mark((function e(t,r,n){var i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.data.getSecurity(r,!0);case 2:return i=e.sent,e.abrupt("return",this.worker.handleRequest(f.Z.PLACE_ORDER,{security_id:i.id,limit_price:new d.Z(r).crypto?void 0:i.quote.amount,quantity:n,order_type:"buy_quantity",order_sub_type:"market",time_in_force:"day",account_id:t}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return c.apply(this,arguments)})},{key:"limitBuy",value:(s=u()(o().mark((function e(t,r,n,i){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=this.worker,e.t1=f.Z.PLACE_ORDER,e.next=4,this.data.getSecurity(r);case 4:return e.t2=e.sent.id,e.t3=n,e.t4=i,e.t5=t,e.t6={security_id:e.t2,limit_price:e.t3,quantity:e.t4,order_type:"buy_quantity",order_sub_type:"limit",time_in_force:"day",account_id:e.t5},e.abrupt("return",e.t0.handleRequest.call(e.t0,e.t1,e.t6));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return s.apply(this,arguments)})},{key:"stopLimitBuy",value:(a=u()(o().mark((function e(t,r,n,i,a){var s;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.data.getSecurity(r);case 2:if(s=e.sent,!y(s.stock.primary_exchange)||n===i){e.next=5;break}throw new Error("TSX/TSX-V securities must have an equivalent stop and limit price.");case 5:return e.abrupt("return",this.worker.handleRequest(f.Z.PLACE_ORDER,{security_id:s.id,stop_price:n,limit_price:i,quantity:a,order_type:"buy_quantity",order_sub_type:"stop_limit",time_in_force:"day",account_id:t}));case 6:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n,i){return a.apply(this,arguments)})},{key:"marketSell",value:(n=u()(o().mark((function e(t,r,n){var i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.data.getSecurity(r,!0);case 2:return i=e.sent,e.abrupt("return",this.worker.handleRequest(f.Z.PLACE_ORDER,{security_id:i.id,market_value:new d.Z(r).crypto?void 0:i.quote.amount,quantity:n,order_type:"sell_quantity",order_sub_type:"market",time_in_force:"day",account_id:t}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"limitSell",value:(r=u()(o().mark((function e(t,r,n,i){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=this.worker,e.t1=f.Z.PLACE_ORDER,e.next=4,this.data.getSecurity(r);case 4:return e.t2=e.sent.id,e.t3=n,e.t4=i,e.t5=t,e.t6={security_id:e.t2,limit_price:e.t3,quantity:e.t4,order_type:"sell_quantity",order_sub_type:"limit",time_in_force:"day",account_id:e.t5},e.abrupt("return",e.t0.handleRequest.call(e.t0,e.t1,e.t6));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t,n,i){return r.apply(this,arguments)})},{key:"stopLimitSell",value:(t=u()(o().mark((function e(t,r,n,i,a){var s;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.data.getSecurity(r);case 2:if(s=e.sent,!y(s.stock.primary_exchange)||n===i){e.next=5;break}throw new Error("TSX/TSX-V securities must have an equivalent stop and limit price.");case 5:return e.abrupt("return",this.worker.handleRequest(f.Z.PLACE_ORDER,{security_id:s.id,stop_price:n,limit_price:i,quantity:a,order_type:"sell_quantity",order_sub_type:"stop_limit",time_in_force:"day",account_id:t}));case 6:case"end":return e.stop()}}),e,this)}))),function(e,r,n,i,a){return t.apply(this,arguments)})}]),e}()},889:(e,t,r)=>{"use strict";r.d(t,{Z:()=>d});var n=r(757),i=r.n(n),a=r(926),o=r.n(a),s=r(575),u=r.n(s),c=r(913),l=r.n(c);const h=function(e){return{quote:function(t){return o()(i().mark((function r(){var n;return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.getSecurity(t,!0);case 2:return n=r.sent,r.abrupt("return",n.quote.amount);case 4:case"end":return r.stop()}}),r)})))()}}};var p=r(657),f=r(726);const d=function(){function e(t,r){u()(this,e),this.defaultProvider=new h(r),this.providers={},this.worker=t,this.data=r}var t,r;return l()(e,[{key:"use",value:function(e,t){if("function"!=typeof t.quote)throw new Error("Invalid quote provider for ".concat(e,"!"));this.providers[e]=t}},{key:"get",value:(r=o()(i().mark((function e(t){var r,n,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=null,!(n=new p.Z(t)).exchange){e.next=6;break}r=n.exchange,e.next=15;break;case 6:if(!n.crypto||!n.id){e.next=10;break}r="CC",e.next=15;break;case 10:if(!(Object.keys(this.providers).length>0)){e.next=15;break}return e.next=13,this.data.getSecurity(n,!1);case 13:a=e.sent,r=a.stock.primary_exchange;case 15:if(!(r in this.providers)){e.next=17;break}return e.abrupt("return",this.providers[r].quote(n));case 17:return e.abrupt("return",this.defaultProvider.quote(n));case 18:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"history",value:(t=o()(i().mark((function e(t,r){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=new p.Z(t)).id){e.next=5;break}return e.next=4,this.data.getSecurity(n);case 4:n.id=e.sent.id;case 5:return e.abrupt("return",this.worker.handleRequest(f.Z.QUOTES_HISTORY,{id:n.id,interval:r}));case 6:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}()},666:e=>{var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(e,t,r,n){var i=t&&t.prototype instanceof y?t:y,a=Object.create(i.prototype),o=new T(n||[]);return a._invoke=function(e,t,r){var n=l;return function(i,a){if(n===p)throw new Error("Generator is already running");if(n===f){if("throw"===i)throw a;return I()}for(r.method=i,r.arg=a;;){var o=r.delegate;if(o){var s=_(o,r);if(s){if(s===d)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===l)throw n=f,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var u=c(e,t,r);if("normal"===u.type){if(n=r.done?f:h,u.arg===d)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=f,r.method="throw",r.arg=u.arg)}}}(e,r,o),a}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var l="suspendedStart",h="suspendedYield",p="executing",f="completed",d={};function y(){}function v(){}function m(){}var w={};w[a]=function(){return this};var k=Object.getPrototypeOf,x=k&&k(k(R([])));x&&x!==r&&n.call(x,a)&&(w=x);var b=m.prototype=y.prototype=Object.create(w);function g(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function E(e,t){function r(i,a,o,s){var u=c(e[i],e,a);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&n.call(h,"__await")?t.resolve(h.__await).then((function(e){r("next",e,o,s)}),(function(e){r("throw",e,o,s)})):t.resolve(h).then((function(e){l.value=e,o(l)}),(function(e){return r("throw",e,o,s)}))}s(u.arg)}var i;this._invoke=function(e,n){function a(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(a,a):a()}}function _(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,_(e,r),"throw"===r.method))return d;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var i=c(n,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,d;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function R(e){if(e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}return{next:I}}function I(){return{value:t,done:!0}}return v.prototype=b.constructor=m,m.constructor=v,m[s]=v.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,s in e||(e[s]="GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},g(E.prototype),E.prototype[o]=function(){return this},e.AsyncIterator=E,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new E(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},g(b),b[s]="Generator",b[a]=function(){return this},b.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=R,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(O),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var u=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(u&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,d):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;O(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}},214:e=>{"use strict";e.exports=r},545:e=>{"use strict";e.exports=t},949:t=>{"use strict";t.exports=e}},i={};function a(e){if(i[e])return i[e].exports;var t=i[e]={exports:{}};return n[e](t,t.exports,a),t.exports}return a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a(352)})()}));
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly93c3RyYWRlLWFwaS93ZWJwYWNrL3VuaXZlcnNhbE1vZHVsZURlZmluaXRpb24iLCJ3ZWJwYWNrOi8vd3N0cmFkZS1hcGkvLi9ub2RlX21vZH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b3JkLnR5cGUgPT09IFwibm9ybWFsXCIpIHtcbiAgICAgICAgICAvLyBJZiBhbiBleGNlcHRpb24gaXMgdGhyb3duIGZyb20gaW5uZXJGbiwgd2UgbGVhdmUgc3RhdGUgPT09XG4gICAgICAgICAgLy8gR2VuU3RhdGVFeGVjdXRpbmcgYW5kIGxvb3AgYmFjayBmb3IgYW5vdGhlciBpbnZvY2F0aW9uLlxuICAgICAgICAgIHN0YXRlID0gY29udGV4dC5kb25lXG4gICAgICAgICAgICA/IEdlblN0YXRlQ29tcGxldGVkXG4gICAgICAgICAgICA6IEdlblN0YXRlU3VzcGVuZGVkWWllbGQ7XG5cbiAgICAgICAgICBpZiAocmVjb3JkLmFyZyA9PT0gQ29udGludWVTZW50aW5lbCkge1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIHZhbHVlOiByZWNvcmQuYXJnLFxuICAgICAgICAgICAgZG9uZTogY29udGV4dC5kb25lXG4gICAgICAgICAgfTtcblxuICAgICAgICB9IGVsc2UgaWYgKHJlY29yZC50eXBlID09PSBcInRocm93XCIpIHtcbiAgICAgICAgICBzdGF0ZSA9IEdlblN0YXRlQ29tcGxldGVkO1xuICAgICAgICAgIC8vIERpc3BhdGNoIHRoZSBleGNlcHRpb24gYnkgbG9vcGluZyBiYWNrIGFyb3VuZCB0byB0aGVcbiAgICAgICAgICAvLyBjb250ZXh0LmRpc3BhdGNoRXhjZXB0aW9uKGNvbnRleHQuYXJnKSBjYWxsIGFib3ZlLlxuICAgICAgICAgIGNvbnRleHQubWV0aG9kID0gXCJ0aHJvd1wiO1xuICAgICAgICAgIGNvbnRleHQuYXJnID0gcmVjb3JkLmFyZztcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH07XG4gIH1cblxuICAvLyBDYWxsIGRlbGVnYXRlLml0ZXJhdG9yW2NvbnRleHQubWV0aG9kXShjb250ZXh0LmFyZykgYW5kIGhhbmR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2QgPSBcInJldHVyblwiO1xuICAgICAgICAgIGNvbnRleHQuYXJnID0gdW5kZWZpbmVkO1xuICAgICAgICAgIG1heWJlSW52b2tlRGVsZWdhdGUoZGVsZWdhdGUsIGNvbnRleHQpO1xuXG4gICAgICAgICAgaWYgKGNvbnRleHQubWV0aG9kID09PSBcInRocm93XCIpIHtcbiAgICAgICAgICAgIC8vIElmIG1heWJlSW52b2tlRGVsZWdhdGUoY29udGV4dCkgY2hhbmdlZCBjb250ZXh0Lm1ldGhvZCBmcm9tXG4gICAgICAgICAgICAvLyBcInJldHVyblwiIHRvIFwidGhyb3dcIiwgbGV0IHRoYXQgb3ZlcnJpZGUgdGhlIFR5cGVFcnJvciBiZWxvdy5cbiAgICAgICAgICAgIHJldHVybiBDb250aW51ZVNlbnRpbmVsO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGNvbnRleHQubWV0aG9kID0gXCJ0aHJvd1wiO1xuICAgICAgICBjb250ZXh0LmFyZyA9IG5ldyBUeXBlRXJyb3IoXG4gICAgICAgICAgXCJUaGUgaXRlcmF0b3IgZG9lcyBub3QgcHJvdmlkZSBhICd0aHJvdycgbWV0aG9kXCIpO1xuICAgICAgfVxuXG4gICAgICByZXR1cm4gQ29udGludWVTZW50aW5lbDtcbiAgICB9XG5cbiAgICB2YXIgcmVjb3JkID0gdHJ5Q2F0Y2gobWV0aG9kLCBkZWxlZ2F0ZS5pdGVyYXRvciwgY29udGV4dC5hcmcpO1xuXG4gICAgaWYgKHJlY29yZC50eXBlID09PSBcInRocm93XCIpIHtcbiAgICAgIGNvbnRleHQubWV0aG9kID0gXCJ0aHJvd1wiO1xuICAgICAgY29udGV4dC5hcmcgPSByZWNvcmQuYXJnO1xuICAgICAgY29udGV4dC5kZWxlZ2F0ZSA9IG51bGw7XG4gICAgICByZXR1cm4gQ29udGludWVTZW50aW5lbDtcbiAgICB9XG5cbiAgICB2YXIgaW5mbyA9IHJlY29yZC5hcmc7XG5cbiAgICBp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BudWxsO1xuXG4gICAgICB0aGlzLm1ldGhvZCA9IFwibmV4dFwiO1xuICAgICAgdGhpcy5hcmcgPSB1bmRlZmluZWQ7XG5cbiAgICAgIHRoaXMudHJ5RW50cmllcy5mb3JFYWNoKHJlc2V0VHJ5RW50cnkpO1xuXG4gICAgICBpZiAoIXNraXBUZW1wUmVzZXQpIHtcbiAgICAgICAgZm9yICh2YXIgbmFtZSBpbiB0aGlzKSB7XG4gICAgICAgICAgLy8gTm90IHN1cmUgYWJvdXQgdGhlIG9wdGltYWwgb3JkZXIgb2YgdGhlc2UgY29uZGl0aW9uczpcbiAgICAgICAgICBpZiAobmFtZS5jaGFyQXQoMCkgPT09IFwidFwiICYmXG4gICAgICAgICAgICAgIGhhc093bi5jYWxsKHRoaXMsIG5hbWUpICYmXG4gICAgICAgICAgICAgICFpc05hTigrbmFtZS5zbGljZSgxKSkpIHtcbiAgICAgICAgICAgIHRoaXNbbmFtZV0gPSB1bmRlZmluZWQ7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfSxcblxuICAgIHN0b3A6IGZ1bmN0aW9uKCkge1xuICAgICAgdGhpcy5kb25lID0gdHJ1ZTtcblxuICAgICAgdmFyIHJvb3RFbnRyeSA9IHRoaXMudHJ5RW50cmllc1swXTtcbiAgICAgIHZhciByb290UmVjb3JkID0gcm9vdEVudHJ5LmNvbXBsZXRpb247XG4gICAgICBpZiAocm9vdFJlY29yZC50eXBlID09PSBcInRocm93XCIpIHtcbiAgICAgICAgdGhyb3cgcm9vdFJlY29yZC5hcmc7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiB0aGlzLnJ2YWw7XG4gICAgfSxcblxuICAgIGRpc3BhdGNoRXhjZXB0aW9uOiBmdW5jdGlvbihleGNlcHRpb24pIHtcbiAgICAgIGlmICh0aGlzLmRvbmUpIHtcbiAgICAgICAgdGhyb3cgZXhjZXB0aW9uO1xuICAgICAgfVxuXG4gICAgICB2YXIgY29udGV4dCA9IHRoa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gfVxuXG4gICAgICAgIGlmIChlbnRyeS50cnlMb2MgPD0gdGhpcy5wcmV2KSB7XG4gICAgICAgICAgdmFyIGhhc0NhdGNoID0gaGFzT3duLmNhbGwoZW50cnksIFwiY2F0Y2hMb2NcIik7XG4gICAgICAgICAgdmFyIGhhc0ZpbmFsbHkgPSBoYXNPd24uY2FsbChlbnRyeSwgXCJmaW5hbGx5TG9jXCIpO1xuXG4gICAgICAgICAgaWYgKGhhc0NhdGNoICYmIGhhc0ZpbmFsbHkpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLnByZXYgPCBlbnRyeS5jYXRjaExvYykge1xuICAgICAgICAgICAgICByZXR1cm4gaGFuZGxlKGVudHJ5LmNhdGNoTG9jLCB0cnVlKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5wcmV2IDwgZW50cnkuZmluYWxseUxvYykge1xuICAgICAgICAgICAgICByZXR1cm4gaGFuZGxlKGVudHJ5LmZpbmFsbHlMb2MpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgfSBlbHNlIGlmIChoYXNDYXRjaCkge1xuICAgICAgICAgICAgaWYgKHRoaXMucHJldiA8IGVudHJ5LmNhdGNoTG9jKSB7XG4gICAgICAgICAgICAgIHJldHVybiBoYW5kbGUoZW50cnkuY2F0Y2hMb2MsIHRydWUpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgfSBlbHNlIGlmIChoYXNGaW5hbGx5KSB7XG4gICAgICAgICAgICBpZiAodGhpcy5wcmV2IDwgZW50cnkuZmluYWxseUxvYykge1xuICAgICAgICAgICAgICByZXR1cm4gaGFuZGxlKGVudHJ5LmZpbmFsbHlMb2MpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcInRyeSBzdGF0ZW1lbnQgd2l0aG91dCBjYXRjaCBvciBmaW5hbGx5XCIpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0sXG5cbiAgICBhYnJ1cHQ6IGZ1bmN0aW9uKHR5cGUsIGFyZykge1xuICAgICAgZm9yICh2YXIgaSA9IHRoaXMudHJ5RW50cmllcy5sZW5ndGggLSAxOyBpID49IDA7IC0taSkge1xuICAgICAgICB2YXIgZW50cnkgPSB0aGlzLnRyeUVudHJpZXNbaV07XG4gICAgICAgIGlmIChlbnRyeS50cnlMb2MgPD0gdGhpcy5wcmV2ICYmXG4gICAgICAgICAgICBoYXNPd24uY2FsbChlbnRyeSwgXCJmaW5hbGx5TG9jXCIpICYmXG4gICAgICAgICAgICB0aGlzLnByZXYgPCBlbnRyeS5maW5hbGx5TG9jKSB7XG4gICAgICAgICAgdmFyIGZpbmFsbHlFbnRyeSA9IGVudHJ5O1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGlmIChmaW5hbGx5RW50cnkgJiZcbiAgICAgICAgICAodHlwZSA9PT0gXCJicmVha1wiIHx8XG4gICAgICAgICAgIHR5cGUgPT09IFwiY29udGludWVcIikgJiZcbiAgICAgICAgICBmaW5hbGx5RW50cnkudHJ5TG9jIDw9IGFyZyAmJlxuICAgICAgICAgIGFyZyA8PSBmaW5hbGx5RW50cnkuZmluYWxseUxvYykge1xuICAgICAgICAvLyBJZ25vcmUgdGhlIGZpbmFsbHkgZW50cnkgaWYgY29udHJvbCBpcyBub3QganVtcGluZyB0byBhXG4gICAgICAgIC8vIGxvY2F0aW9uIG91dHNpZGUgdGhlIHRyeS9jYXRjaCBibG9jay5cbiAgICAgICAgZmluYWxseUVudHJ5ID0gbnVsbDtcbiAgICAgIH1cblxuICAgICAgdmFyIHJlY29yZCA9IGZpbmFsbHlFbnRyeSA/IGZpbmFsbHlFbnRyeS5jb21wbGV0aW9uIDoge307XG4gICAgICByZWNvcmQudHlwZSA9IHR5cGU7XG4gICAgICByZWNvcmQuYXJnID0gYXJnO1xuXG4gICAgICBpZiAoZmluYWxseUVudHJ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5ID0gdGhpcy50cnlFbnRyaWVzW2ldO1xuICAgICAgICBpZiAoZW50cnkuZmluYWxseUxvYyA9PT0gZmluYWxseUxvYykge1xuICAgICAgICAgIHRoaXMuY29tcGxldGUoZW50cnkuY29tcGxldGlvbiwgZW50cnkuYWZ0ZXJMb2MpO1xuICAgICAgICAgIHJlc2V0VHJ5RW50cnkoZW50cnkpO1xuICAgICAgICAgIHJldHVybiBDb250aW51ZVNlbnRpbmVsO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSxcblxuICAgIFwiY2F0Y2hcIjogZnVuY3Rpb24odHJ5TG9jKSB7XG4gICAgICBmb3IgKHZhciBpID0gdGhpcy50cnlFbnRyaWVzLmxlbmd0aCAtIDE7IGkgPj0gMDsgLS1pKSB7XG4gICAgICAgIHZhciBlbnRyeSA9IHRoaXMudHJ5RW50cmllc1tpXTtcbiAgICAgICAgaWYgKGVudHJ5LnRyeUxvYyA9PT0gdHJ5TG9jKSB7XG4gICAgICAgICAgdmFyIHJlY29yZCA9IGVudHJ5LmNvbXBsZXRpb247XG4gICAgICAgICAgaWYgKHJlY29yZC50eXBlID09PSBcInRocm93XCIpIHtcbiAgICAgICAgICAgIHZhciB0aHJvd24gPSByZWNvcmQuYXJnO1xuICAgICAgICAgICAgcmVzZXRUcnlFbnRyeShlbnRyeSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiB0aHJvd247XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgLy8gVGhlIGNvbnRleHQuY2F0Y2ggbWV0aG9kIG11c3Qgb25seSBiZSBjYWxsZWQgd2l0aCBhIGxvY2F0aW9uXG4gICAgICAvLyBhcmd1bWVudCB0aGF0IGNvcnJlc3BvbmRzIHRvIGEga25vd24gY2F0Y2ggYmxvY2suXG4gICAgICB0aHJvdyBuZXcgRXJyb3IoXCJpbGxlZ2FsIGNhdGNoIGF0dGVtcHRcIik7XG4gICAgfSxcblxuICAgIGRlbGVnYXRlWWllbGQ6IGZ1bm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