"use strict";sap.ui.define(["sap/ui/model/json/JSONModel","./BaseController"],function(t,e){"use strict";function o(t){return t&&t.__esModule&&typeof t.default!=="undefined"?t.default:t}const n=o(e);const s=n.extend("com.optrabot.ui.controller.Settings",{onInit:function e(){console.log("Settings controller initialized");this.oViewModel=new t({tastytradeSandbox:false,tastytradeClientId:""});this.getView().setModel(this.oViewModel,"oViewModel")},onAuthorizePress:function t(){const e=this.getOwnerComponent().getModel("global");const o=`${e.getProperty("/backendBaseUrl")}/auth/tasty_callback`;const n=this.oViewModel.getProperty("/tastytradeClientId");const s=`${this.getTastytradeAuthUrl()}?client_id=${n}&redirect_uri=${encodeURIComponent(o)}&response_type=code`;window.open(s,"tastyauth","width=500,height=500")},getTastytradeAuthUrl:function t(){const e=this.oViewModel.getProperty("/tastytradeSandbox");return e?"https://cert-my.staging-tasty.works/auth.html":"https://my.tastytrade.com/auth.html"}});return s});
//# sourceMappingURL=Settings.controller.js.map