{"version":3,"sources":["webpack:///./src/helpers/debounce.ts","webpack:///./src/helpers/copyToClipboard.ts","webpack:///./src/helpers/transformation/price.ts"],"names":["debounce","fn","delay","cov_2irbpckthq","b","immediate","timeout","f","s","args","clearTimeout","setTimeout","toast","cov_149vqvmelg","useToast","copyToClipboard","text","toastText","navigator","clipboard","writeText","then","success","cov_243ma3iy2q","actualCoverage","formatPrice","price","showCurrency","_priceArray$0$toStrin","priceArray","split","toString","match","join","formatStripePrice","value","string","String","slice","lastTwo","substr","length","firstCharacter","formatPriceToNumber","parseFloat","replace","formatPriceTrim","trimText","formatPorcentageTrim","porcentage","max","integerValue","decimalValue","includes","porcentageParts","trimPorcentage","updatePriceInput","e","form","priceField","preventDefault","target"],"mappings":"wvGAAO,MAAMA,EAAWA,CAACC,EAASC,GAAKC,IAAAC,EAAA,QAAG,KAAKC,GAASF,IAAAC,EAAA,SAAG,MACzD,IAAIE,EACJ,OAFkEH,IAAAI,EAAA,KAClCJ,IAAAK,EAAA,KACzB,IAAIC,KAAeN,IAAAI,EAAA,KAAAJ,IAAAK,EAAA,KACpBL,IAAAC,EAAA,QAAAC,IAASF,IAAAC,EAAA,SAAKE,IAASH,IAAAC,EAAA,QAAAD,IAAAK,EAAA,KAAAP,KAAMQ,IAAMN,IAAAC,EAAA,QAAAD,IAAAK,EAAA,KACvCE,aAAaJ,GAASH,IAAAK,EAAA,KAEtBF,EAAUK,WAAW,KAAKR,IAAAI,EAAA,KAAAJ,IAAAK,EAAA,KACxBP,KAAMQ,IACLP,M,4rECNP,MAAMU,GAAKC,IAAAL,EAAA,KAAGM,kBAER,SAAUC,EACdC,EACAC,GAASJ,IAAAT,EAAA,QAAG,iCAA8BS,IAAAN,EAAA,KAAAM,IAAAL,EAAA,KAE1CU,UAAUC,UACPC,UAAUJ,GACVK,KAAK,KAAMR,IAAAN,EAAA,KAAAM,IAAAL,EAAA,KAAAI,EAAMU,QAAQL,EAAW,CAAEX,QAAS,W,w3XCWhD,OAAAiB,EAAA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AAA,SAAA8C,IAAG3B,IAAAnB,EAAA,SAAImD,EAAeV,QAAQ,KAAM,KAA4BK,IAAK3B,IAAAnB,EAAA,SAAAmB,IAAAf,EAAA,MAC/D0C,EAAInB,aACZR,IAAAnB,EAAA,SAAAmB,IAAAf,EAAA,MACM2C,EAAeC,KANF7B,IAAAnB,EAAA,SAAAmB,IAAAf,EAAA,MACX,QAMTe,IAAAf,EAAA,MAEK,MAAMgD,EAAmBA,CAACC,EAAWC,EAA+BC,KAAsBpC,IAAAhB,EAAA,KAAAgB,IAAAf,EAAA,MAC/FiD,EAAEG,iBACF,MAAMC,GAAMtC,IAAAf,EAAA,MAAGiD,EAAEI,QACX1B,GAAKZ,IAAAf,EAAA,MAAGsC,EAAgBe,EAAO1B,QAAOZ,IAAAf,EAAA,MAC5CkD,EAAKC,GAAchB,EAAoBR","file":"js/admin10~admin8~admin9~landowner-profile.cd2efc66.js","sourcesContent":["export const debounce = (fn: any, delay = 400, immediate = false) => {\n let timeout: number | undefined;\n return (...args: any[]) => {\n if (immediate && !timeout) fn(...args);\n clearTimeout(timeout);\n\n timeout = setTimeout(() => {\n fn(...args);\n }, delay);\n };\n};\n","import { useToast } from \"vue-toastification\";\n\nconst toast = useToast();\n\nexport function copyToClipboard(\n text: string,\n toastText = \"Data was copied to clipboard\"\n) {\n navigator.clipboard\n .writeText(text)\n .then(() => toast.success(toastText, { timeout: 1500 }));\n}\n","export function formatPrice(\n price: number | string = 0,\n showCurrency = true\n): string {\n const priceArray = `${price}`.split(\".\");\n return (\n (showCurrency ? \"$\" : \"\") +\n priceArray[0]\n .toString()\n .match(/.{1,3}(?=(.{3})*$)/g)\n ?.join(\",\") +\n (priceArray[1] ? \".\" + priceArray[1] : \"\")\n );\n}\n\nexport const formatStripePrice = (value = 0, showCurrency = true): string => {\n let string = String(value);\n string = string.slice(0, -2) + \".\" + string.slice(-2);\n const lastTwo = string.substr(string.length - 2);\n const firstCharacter = string.substr(0, 1);\n if (firstCharacter === \".\") {\n string = \"0\" + string;\n }\n if (lastTwo === \"00\") {\n return formatPrice(string.slice(0, -3), showCurrency);\n }\n return formatPrice(string, showCurrency);\n};\n\nexport const formatPriceToNumber = (price: string): number => {\n return parseFloat(price.replace(/,/g, '').replace(/\\$/g, ''));\n}\n\n\nexport const formatPriceTrim = (price: number | string = 0,) : string => {\n const trimText = price ? price.toString()\n .replace(/[^\\d.]/g, '')\n : undefined;\n if(!trimText || trimText === '$') {\n return '$0';\n }\n return formatPrice(trimText);\n};\n\nexport const formatPorcentageTrim = (porcentage: number | string = 0, max ?: number) : string => {\n let integerValue = porcentage;\n let decimalValue = '';\n if(typeof porcentage === 'string' && porcentage.includes('.')) {\n const porcentageParts = porcentage.split('.');\n integerValue = porcentageParts[0];\n decimalValue = '.' + porcentageParts[1];\n }\n const trimPorcentage = formatPriceTrim(integerValue).replace(/\\$/g, '');\n if(!trimPorcentage) {\n return '0.0';\n }\n if(max && trimPorcentage.replace(/,/g, '') as unknown as number >= max) {\n return max.toString();\n }\n return integerValue + decimalValue;\n};\n\nexport const updatePriceInput = (e : Event, form: Record, priceField: string) => {\n e.preventDefault();\n const target = e.target as HTMLInputElement;\n const value = formatPriceTrim(target.value);\n form[priceField] = formatPriceToNumber(value);\n}\n"],"sourceRoot":""}