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D,MAEA,GAFiC,E,SAAA,GAAgB,EAAQ,CAAC,CAAC,SHLpD,SAAgBlB,EAAMC,EAAQC,EAAQC,EAAQC,EAAOC,GACxD,IAAImB,GAAoB,QAAkB,UAAU,GACpD,OAAQ,WAAc,QAAaA,EAAmB,CAClDC,QAASzB,EAAKgB,KACdU,UAAW,OACZ,CACCjD,SAAS,SAAS,WAAc,MAAO,EACnC,IAAAZ,GAAoB,IAAKJ,GAAY,QAAiBuC,EAAKiB,MAAO,GACnE,IACHpD,EAAG,GACJ,EAAe,CAAC,WACvB,I","sources":["webpack://skagenfondene.no/./src/components/popper.vue?3a91","webpack://skagenfondene.no/./src/shared/Calculator/fundInvestmentReturnData.ts","webpack://skagenfondene.no/./src/shared/Calculator/createWeekdayDate.ts","webpack://skagenfondene.no/./src/shared/Calculator/tableRow.ts","webpack://skagenfondene.no/./src/components/InputWithStepButtons.vue?2339","webpack://skagenfondene.no/./src/components/InputWithStepButtons.vue?f6bf","webpack://skagenfondene.no/./src/components/InputWithStepButtons.vue","webpack://skagenfondene.no/./src/components/popper.vue?1cf3","webpack://skagenfondene.no/./src/components/popper.vue?8dc1","webpack://skagenfondene.no/./src/components/popper.vue?5d1e","webpack://skagenfondene.no/./src/components/popper.vue"],"sourcesContent":["// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \"\\n.popper {\\n font-size: 16px;\\n font-weight: normal;\\n}\\n:root {\\n --popper-theme-background-color: #ececec;\\n --popper-theme-background-color-hover: #ececec;\\n --popper-theme-text-color: #333;\\n --popper-theme-border-width: 0px;\\n --popper-theme-border-style: solid;\\n --popper-theme-border-radius: 0;\\n --popper-theme-padding: 12px 16px;\\n --popper-theme-box-shadow: 0 6px 30px -6px rgba(0, 0, 0, 0.25);\\n}\\n\", \"\",{\"version\":3,\"sources\":[\"webpack://./src/components/popper.vue\"],\"names\":[],\"mappings\":\";AAqBA;EACE,eAAe;EACf,mBAAmB;AACrB;AACA;EACE,wCAAwC;EACxC,8CAA8C;EAC9C,+BAA+B;EAC/B,gCAAgC;EAChC,kCAAkC;EAClC,+BAA+B;EAC/B,iCAAiC;EACjC,8DAA8D;AAChE\",\"sourcesContent\":[\"\\n\\n\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","import { getDate, getMonth, getYear, isEqual } from 'date-fns';\nimport { createWeekdayDate, createWeekdayDateHelper, } from './createWeekdayDate';\nimport { createTableRow, TransactionType, TransactionValueType, } from './tableRow';\nexport var ReturnDataError;\n(function (ReturnDataError) {\n ReturnDataError[\"YearError\"] = \"YearError\";\n ReturnDataError[\"NoNavs\"] = \"NoNavs\";\n})(ReturnDataError || (ReturnDataError = {}));\nexport var fundInvestmentReturnData = function (fundStartDate, navs, currency, startAmount, transactionType, transactionValueType, transactionValue, transactionDay, fromDate, toDate, estimatedFundReturn) {\n var returnData = {\n currency: currency,\n fromDate: fromDate,\n toDate: toDate,\n invested: 0,\n withDrawTotal: 0,\n totalUnits: 0,\n totalInProfile: 0,\n transactionCount: 0,\n rows: [],\n estimatedFundReturn: estimatedFundReturn,\n errors: [],\n };\n // Check if fund is active in given period. If fund started after from date we can not calculate real values for this fund\n if (fundStartDate > fromDate) {\n returnData.errors.push(ReturnDataError.YearError);\n return returnData;\n }\n // We have no navs to calculate on\n if (navs.length === 0) {\n returnData.errors.push(ReturnDataError.NoNavs);\n return returnData;\n }\n // If we have estimated return we only need lastest nav (that nav is used as starting price)\n var filteredNavs = [navs[navs.length - 1]];\n // Navs is required for historical calulations\n // Reduce navs to only navs in given period (we do this to improve performance)\n if (estimatedFundReturn === undefined) {\n filteredNavs = navs.filter(function (item) { return item.date >= fromDate && item.date <= toDate; });\n }\n var totalInvested = 0;\n var withDrawTotal = 0;\n var totalUnits = 0;\n var totalInProfile = 0;\n var transactionCount = 0;\n var prevTableRow;\n if (startAmount > 0) {\n var buyDate = createWeekdayDateHelper(fromDate);\n var holdingsOnStartRow = createTableRow(prevTableRow, filteredNavs, true, buyDate, TransactionType.Buy, TransactionValueType.Amount, startAmount, 0, 0, totalInProfile, 0, estimatedFundReturn);\n returnData.rows.push(holdingsOnStartRow);\n totalInvested = holdingsOnStartRow.invested;\n withDrawTotal = holdingsOnStartRow.withdrawn;\n totalUnits = holdingsOnStartRow.totalUnits;\n totalInProfile = holdingsOnStartRow.marketValue;\n prevTableRow = holdingsOnStartRow;\n }\n // find next transaction date\n var nextTransactionDate = createWeekdayDate(getYear(fromDate), getMonth(fromDate) + 1, transactionDay);\n // Check if we missed upcomming transaction date\n if (getDate(fromDate) > getDate(nextTransactionDate)) {\n // We can not a a buy this month savingsagreement day is past\n nextTransactionDate = createWeekdayDate(getYear(fromDate), getMonth(fromDate) + 2, // Get month returns 0-11 as months and method expects 1-12. thats why we add 2 to get next month.\n transactionDay);\n }\n // On estimate return we need to count the number of days between transactions\n var currentDate = nextTransactionDate;\n while (currentDate < toDate && transactionValue > 0) {\n // It's time for a transaction\n if (isEqual(currentDate, nextTransactionDate)) {\n // eslint-disable-next-line no-plusplus\n transactionCount++;\n var createRow = true;\n // Check if we have units to sell\n if ((transactionType === TransactionType.Sell ||\n transactionType === TransactionType.WithdrawalAgreement) &&\n totalUnits === 0) {\n // We can not sell if we have no units\n createRow = false;\n }\n if (createRow) {\n var transactionRow = createTableRow(prevTableRow, filteredNavs, false, currentDate, transactionType, transactionValueType, transactionValue, totalUnits, totalInvested, totalInProfile, withDrawTotal, estimatedFundReturn);\n // How mutch have the customer put in to this so far. (accumulated values)\n totalInvested = transactionRow.invested;\n withDrawTotal = transactionRow.withdrawn;\n totalUnits = transactionRow.totalUnits;\n totalInProfile = transactionRow.marketValue;\n returnData.rows.push(transactionRow);\n // Set previous row to current row\n prevTableRow = transactionRow;\n // Find next transaction date\n // It does not matter if this date does not have NAV.\n var tmpMonth = getMonth(nextTransactionDate);\n if (tmpMonth === 11) {\n nextTransactionDate = createWeekdayDate(getYear(nextTransactionDate) + 1, 1, transactionDay);\n }\n else {\n nextTransactionDate = createWeekdayDate(getYear(nextTransactionDate), getMonth(nextTransactionDate) + 2, // Get month returns 0-11 as months and method expects 1-12. thats why we add 2 to get next month.\n transactionDay);\n }\n }\n else {\n // We have no more units to sell\n nextTransactionDate = toDate;\n }\n }\n // Go to next transaction date\n currentDate = nextTransactionDate;\n }\n // Time to check status\n var statusRow = createTableRow(prevTableRow, filteredNavs, true, toDate, TransactionType.Status, TransactionValueType.None, 0, totalUnits, totalInvested, totalInProfile, withDrawTotal, estimatedFundReturn);\n returnData.rows.push(statusRow);\n // Update main object with accumulated values\n returnData.invested = statusRow.invested;\n returnData.withDrawTotal = statusRow.withdrawn;\n returnData.totalUnits = statusRow.totalUnits;\n returnData.totalInProfile = statusRow.marketValue;\n returnData.transactionCount = transactionCount;\n return returnData;\n};\n","import { addDays, getDate, getDay, getDaysInMonth, getMonth, getYear, } from 'date-fns';\n/**\n * createWeekdayDate\n * @constructor\n * @param {number} year - Year\n * @param {number} month - Legal value is 1-12.\n * @param {number} day - Day number.\n * @return weekday date within current year and month. As close as possible to given day.\n */\nexport var createWeekdayDate = function (year, month, day) {\n var jsMonth = month - 1; // january is 0, stupid i know.\n var daysInMonth = getDaysInMonth(new Date(year, jsMonth));\n var savingDay = day <= daysInMonth ? day : daysInMonth;\n var savingDate = new Date(year, jsMonth, savingDay);\n var dayOfWeek = getDay(savingDate);\n // If between monday and friday we just return the date\n if (dayOfWeek > 0 && dayOfWeek <= 5) {\n return savingDate;\n }\n // If we are at end of month and not in start of month we must go back to find a date in this month\n if (savingDay > daysInMonth - 2 && savingDay > 2) {\n // If day is Saturday or Sunday we will return friday. Since we are at the end of the month its not possible to select monday.\n return dayOfWeek === 6 ? addDays(savingDate, -1) : addDays(savingDate, -2);\n }\n // will return monday, if saturday add 2 days and 1 day for sunday.\n return dayOfWeek === 6 ? addDays(savingDate, 2) : addDays(savingDate, 1);\n};\nexport var createWeekdayDateHelper = function (date) {\n var realMonthNumber = getMonth(date) + 1;\n return createWeekdayDate(getYear(date), realMonthNumber, getDate(date));\n};\n","import { differenceInDays, getYear, isAfter } from 'date-fns';\nimport { getNavHistoryByDate } from './findNav';\nexport var TransactionType;\n(function (TransactionType) {\n TransactionType[\"Buy\"] = \"Buy\";\n TransactionType[\"SavingsAgreement\"] = \"SavingsAgreement\";\n TransactionType[\"Sell\"] = \"Sell\";\n TransactionType[\"WithdrawalAgreement\"] = \"WithdrawalAgreement\";\n TransactionType[\"Status\"] = \"Status\";\n})(TransactionType || (TransactionType = {}));\nexport var TransactionValueType;\n(function (TransactionValueType) {\n TransactionValueType[\"Amount\"] = \"Amount\";\n TransactionValueType[\"Percent\"] = \"Percent\";\n TransactionValueType[\"Units\"] = \"Units\";\n TransactionValueType[\"None\"] = \"None\";\n})(TransactionValueType || (TransactionValueType = {}));\nexport var createTableRow = function (prevTableRow, navs, findPrevNav, date, transactionType, transactionValueType, transactionValue, units, invested, totalInProfile, withdrawn, estimatedReturn) {\n // If fund is not active in given period we can not calculate real values for this fund\n var latestNav = navs[navs.length - 1];\n var latestNavDate = latestNav.date;\n var useEstimatedReturn = isAfter(date, latestNavDate) && estimatedReturn !== undefined;\n var currentDateNav = useEstimatedReturn\n ? latestNav\n : getNavHistoryByDate(navs, date, findPrevNav);\n var price = currentDateNav.price;\n if (useEstimatedReturn) {\n var yearsReturn = prevTableRow\n ? differenceInDays(date, prevTableRow.date) / 365.0\n : 0;\n var returnInPeriod = Math.pow((1 + estimatedReturn), yearsReturn);\n // On first item we need to add the start amount to totalInProfile\n var realTotalInProfile = totalInProfile === 0 && units === 0\n ? totalInProfile + transactionValue\n : totalInProfile;\n var estimatedTotalInProfile = Math.round(realTotalInProfile * returnInPeriod * 100) / 100;\n // If we do not have any units we use latest known nav as price\n var estimatedPrice = units > 0 ? estimatedTotalInProfile / units : currentDateNav.price;\n price = Math.round(estimatedPrice * 100) / 100;\n }\n var currentDate = useEstimatedReturn ? date : currentDateNav.date;\n if (transactionType === TransactionType.Sell ||\n transactionType === TransactionType.WithdrawalAgreement) {\n var sellUnits = 0;\n if (transactionValueType === TransactionValueType.Amount) {\n sellUnits = transactionValue / price;\n }\n else if (transactionValueType === TransactionValueType.Percent) {\n sellUnits = (transactionValue / 100) * units;\n }\n else if (transactionValueType === TransactionValueType.Units) {\n sellUnits = transactionValue;\n }\n // Check if we have enough units to sell\n if (sellUnits > units) {\n // If we do not have enough units to sell, then we sell all units\n sellUnits = units;\n }\n // Current withdrawal amount\n var currentWithdrawalAmount = Math.round(sellUnits * price);\n // How much have the customer withdrawal so far\n var withdrawnTotal = withdrawn + currentWithdrawalAmount;\n // How many units does the customer currently holds\n var totalUnits = units - sellUnits;\n // what is todays market value\n var totalFundValue_1 = Math.round(totalUnits * price);\n var tableRow_1 = {\n transactionType: transactionType,\n date: currentDate,\n year: getYear(currentDate),\n amount: transactionType === TransactionType.WithdrawalAgreement\n ? currentWithdrawalAmount\n : 0,\n invested: invested,\n withdrawn: withdrawnTotal,\n units: sellUnits,\n totalUnits: totalUnits,\n price: price,\n marketValue: totalFundValue_1,\n estimated: useEstimatedReturn,\n };\n return tableRow_1;\n }\n if (transactionType === TransactionType.Buy ||\n transactionType === TransactionType.SavingsAgreement) {\n // How many units did the customer get for buy amount\n // At the moment we only support amount on buy\n if (transactionValueType !== TransactionValueType.Amount) {\n throw new Error('Only amount is supported on buy');\n }\n var buyUnits = transactionValue / price;\n // How many units does the customer currently holds\n var totalUnits = units + buyUnits;\n // what is todays market value\n var totalFundValue_2 = Math.round(totalUnits * price);\n // How much have the customer put in to this so far.\n var totalinvested = invested + transactionValue;\n var tableRow_2 = {\n transactionType: transactionType,\n date: currentDate,\n year: getYear(currentDate),\n amount: transactionValue,\n invested: totalinvested,\n withdrawn: withdrawn,\n units: buyUnits,\n totalUnits: totalUnits,\n price: price,\n marketValue: totalFundValue_2,\n estimated: useEstimatedReturn,\n };\n return tableRow_2;\n }\n // what is todays market value\n var totalFundValue = Math.round(units * price);\n // Just a status check on current Date\n var tableRow = {\n transactionType: transactionType,\n date: useEstimatedReturn ? date : currentDateNav.date,\n year: useEstimatedReturn ? getYear(date) : getYear(currentDateNav.date),\n amount: transactionValue,\n invested: invested,\n withdrawn: withdrawn,\n units: 0,\n totalUnits: units,\n price: price,\n marketValue: totalFundValue,\n estimated: useEstimatedReturn,\n };\n return tableRow;\n};\n","import { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\";\nvar _hoisted_1 = { class: \"value-label\" };\nvar _hoisted_2 = { class: \"value-wrapper\" };\nvar _hoisted_3 = /*#__PURE__*/ _createElementVNode(\"i\", { class: \"material-icons value-icon\" }, \"remove\", -1 /* HOISTED */);\nvar _hoisted_4 = [\n _hoisted_3\n];\nvar _hoisted_5 = { class: \"input-wrapper\" };\nvar _hoisted_6 = [\"value\", \"min\", \"step\"];\nvar _hoisted_7 = { class: \"value-display\" };\nvar _hoisted_8 = { class: \"value-input-display\" };\nvar _hoisted_9 = /*#__PURE__*/ _createElementVNode(\"i\", { class: \"material-icons value-icon\" }, \"add\", -1 /* HOISTED */);\nvar _hoisted_10 = [\n _hoisted_9\n];\nexport function render(_ctx, _cache, $props, $setup, $data, $options) {\n return (_openBlock(), _createElementBlock(\"div\", null, [\n _createElementVNode(\"label\", _hoisted_1, _toDisplayString(_ctx.$t($props.labelT)), 1 /* TEXT */),\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"a\", {\n onClick: _cache[0] || (_cache[0] = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return ($options.valueDecrease && $options.valueDecrease.apply($options, args));\n }),\n class: \"value-adjust value-decrease\"\n }, _hoisted_4),\n _createElementVNode(\"div\", _hoisted_5, [\n _createElementVNode(\"input\", {\n type: \"text\",\n class: \"form-control value-input\",\n value: $props.amount,\n onChange: _cache[1] || (_cache[1] = function (event) { return $options.valueChange(event); }),\n min: $props.minAmount,\n step: $props.step\n }, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_6),\n _createElementVNode(\"div\", _hoisted_7, [\n _createElementVNode(\"span\", _hoisted_8, _toDisplayString($options.getDisplayAmount), 1 /* TEXT */)\n ])\n ]),\n _createElementVNode(\"a\", {\n onClick: _cache[2] || (_cache[2] = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return ($options.valueIncrease && $options.valueIncrease.apply($options, args));\n }),\n class: \"value-adjust value-increase\"\n }, _hoisted_10)\n ])\n ]));\n}\n","import { formatAmount, formatPercent, formatWith2Decimals, } from \"../Common/numeralAmount\";\nexport default {\n name: \"InputWithStepButtons\",\n components: {},\n props: {\n locale: { type: String, default: \"no\" },\n suffix: { type: String, default: \"NOK\" },\n labelT: { type: String },\n formatAsPercent: { type: Boolean, default: false },\n formatAsUnits: { type: Boolean, default: false },\n amount: { type: Number, default: 1000 },\n minAmount: { type: Number, default: 0 },\n step: { type: Number, default: 250 },\n },\n computed: {\n getDisplayAmount: function () {\n if (this.formatAsUnits) {\n return formatWith2Decimals(this.amount) + \" \" + this.suffix;\n }\n if (this.formatAsPercent) {\n return formatPercent(this.amount);\n }\n return formatAmount(this.amount) + \" \" + this.suffix;\n },\n },\n methods: {\n valueDecrease: function () {\n var newAmount = this.amount - this.step;\n if (this.formatAsUnits || this.formatAsPercent) {\n newAmount = Math.round(newAmount * 10) / 10;\n }\n if (newAmount <= this.minAmount) {\n newAmount = this.minAmount;\n this.disableDecrease = true;\n }\n this.$emit(\"amountChange\", newAmount);\n },\n valueIncrease: function () {\n var newAmount = this.amount + this.step;\n if (this.formatAsUnits || this.formatAsPercent) {\n newAmount = Math.round(newAmount * 10) / 10;\n }\n this.$emit(\"amountChange\", newAmount);\n },\n valueChange: function (e) {\n var newAmount = Number(e.target.value);\n if (Number.isNaN(newAmount)) {\n this.$emit(\"amountChange\", this.minAmount);\n return;\n }\n if (newAmount < this.minAmount) {\n newAmount = this.minAmount;\n }\n this.$emit(\"amountChange\", newAmount);\n },\n },\n};\n","import { render } from \"./InputWithStepButtons.vue?vue&type=template&id=5ebce8ca\"\nimport script from \"./InputWithStepButtons.vue?vue&type=script&lang=js\"\nexport * from \"./InputWithStepButtons.vue?vue&type=script&lang=js\"\n\nimport exportComponent from \"../../node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from \"vue\";\nvar _hoisted_1 = { class: \"material-icons\" };\nexport function render(_ctx, _cache, $props, $setup, $data, $options) {\n var _component_Popper = _resolveComponent(\"Popper\", true);\n return (_openBlock(), _createBlock(_component_Popper, {\n content: _ctx.text,\n placement: \"top\"\n }, {\n default: _withCtx(function () { return [\n _createElementVNode(\"i\", _hoisted_1, _toDisplayString(_ctx.icon), 1 /* TEXT */)\n ]; }),\n _: 1 /* STABLE */\n }, 8 /* PROPS */, [\"content\"]));\n}\n","import { defineComponent } from \"vue\";\nimport Popper from \"vue3-popper\";\nexport default defineComponent({\n name: \"SkagenPopper\",\n components: {\n Popper: Popper,\n },\n props: {\n text: { type: String },\n icon: { type: String, default: \"info\" },\n },\n});\n","\n import API from \"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/vue-loader/dist/stylePostLoader.js!../../node_modules/vue-loader/dist/index.js??ruleSet[1].rules[8].use[0]!./popper.vue?vue&type=style&index=0&id=c4625a50&lang=css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/vue-loader/dist/stylePostLoader.js!../../node_modules/vue-loader/dist/index.js??ruleSet[1].rules[8].use[0]!./popper.vue?vue&type=style&index=0&id=c4625a50&lang=css\";\n export default content && content.locals ? content.locals : undefined;\n","import { render } from \"./popper.vue?vue&type=template&id=c4625a50\"\nimport script from \"./popper.vue?vue&type=script&lang=js\"\nexport * from \"./popper.vue?vue&type=script&lang=js\"\n\nimport \"./popper.vue?vue&type=style&index=0&id=c4625a50&lang=css\"\n\nimport exportComponent from \"../../node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__"],"names":["___CSS_LOADER_EXPORT___","push","module","id","ReturnDataError","createWeekdayDate","year","month","day","jsMonth","daysInMonth","getDaysInMonth","Date","savingDay","savingDate","dayOfWeek","getDay","addDays","fundInvestmentReturnData","fundStartDate","navs","currency","startAmount","transactionType","transactionValueType","transactionValue","transactionDay","fromDate","toDate","estimatedFundReturn","returnData","invested","withDrawTotal","totalUnits","totalInProfile","transactionCount","rows","errors","YearError","length","NoNavs","filteredNavs","undefined","filter","item","date","prevTableRow","realMonthNumber","totalInvested","buyDate","getMonth","getYear","getDate","holdingsOnStartRow","withdrawn","marketValue","nextTransactionDate","currentDate","isEqual","createRow","transactionRow","statusRow","TransactionType","TransactionValueType","createTableRow","findPrevNav","units","estimatedReturn","latestNav","latestNavDate","useEstimatedReturn","currentDateNav","price","yearsReturn","returnInPeriod","Math","pow","realTotalInProfile","estimatedTotalInProfile","round","estimatedPrice","Sell","WithdrawalAgreement","sellUnits","Amount","Percent","Units","currentWithdrawalAmount","withdrawnTotal","totalFundValue_1","amount","estimated","Buy","SavingsAgreement","Error","buyUnits","totalFundValue_2","totalinvested","totalFundValue","_hoisted_1","class","_hoisted_2","_hoisted_4","_","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_10","name","components","props","locale","type","String","default","suffix","labelT","formatAsPercent","Boolean","formatAsUnits","Number","minAmount","step","computed","getDisplayAmount","this","methods","valueDecrease","newAmount","disableDecrease","$emit","valueIncrease","valueChange","e","target","value","isNaN","_ctx","_cache","$props","$setup","$data","$options","$t","onClick","args","_i","arguments","apply","onChange","event","min","Popper","text","icon","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","_component_Popper","content","placement"],"sourceRoot":""}