Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Auto commit for release 'develop' on 2024-02-15
github-actionsb13a4e101639
diff --git a/app/Services/FireflyIIIOrg/Update/UpdateRequest.php b/app/Services/FireflyIIIOrg/Update/UpdateRequest.phpindex 16f56f4393..27629a99c4 100644--- a/app/Services/FireflyIIIOrg/Update/UpdateRequest.php+++ b/app/Services/FireflyIIIOrg/Update/UpdateRequest.php@@ -131,10 +131,6 @@ class UpdateRequest implements UpdateRequestInterface/*** TODO make shorter- *- * @param array $information- *- * @return array*/private function parseResult(array $information): array{@@ -150,6 +146,7 @@ class UpdateRequest implements UpdateRequestInterfaceif (str_starts_with($current, 'develop')) {Log::debug(sprintf('User is running develop version "%s"', $current));$parts = explode('/', $current);+/** @var Carbon $devDate */$devDate = Carbon::createFromFormat('Y-m-d', $parts[1]);diff --git a/composer.lock b/composer.lockindex 8d51023dc6..470d251fed 100644--- a/composer.lock+++ b/composer.lock@@ -542,16 +542,16 @@},{"name": "doctrine/dbal",- "version": "3.8.1",+ "version": "3.8.2","source": {"type": "git","url": "https://github.com/doctrine/dbal.git",- "reference": "c9ea252cdce4da324ede3d6c5913dd89f769afd2"+ "reference": "a19a1d05ca211f41089dffcc387733a6875196cb"},"dist": {"type": "zip",- "url": "https://api.github.com/repos/doctrine/dbal/zipball/c9ea252cdce4da324ede3d6c5913dd89f769afd2",- "reference": "c9ea252cdce4da324ede3d6c5913dd89f769afd2",+ "url": "https://api.github.com/repos/doctrine/dbal/zipball/a19a1d05ca211f41089dffcc387733a6875196cb",+ "reference": "a19a1d05ca211f41089dffcc387733a6875196cb","shasum": ""},"require": {@@ -635,7 +635,7 @@],"support": {"issues": "https://github.com/doctrine/dbal/issues",- "source": "https://github.com/doctrine/dbal/tree/3.8.1"+ "source": "https://github.com/doctrine/dbal/tree/3.8.2"},"funding": [{@@ -651,7 +651,7 @@"type": "tidelift"}],- "time": "2024-02-03T17:33:49+00:00"+ "time": "2024-02-12T18:36:36+00:00"},{"name": "doctrine/deprecations",@@ -2219,16 +2219,16 @@},{"name": "laravel/passport",- "version": "v11.10.4",+ "version": "v11.10.5","source": {"type": "git","url": "https://github.com/laravel/passport.git",- "reference": "8a75495f431e52df2ffa178851c402d7a5e8f037"+ "reference": "4d81207941d6efc198857847d9e4c17520f28d75"},"dist": {"type": "zip",- "url": "https://api.github.com/repos/laravel/passport/zipball/8a75495f431e52df2ffa178851c402d7a5e8f037",- "reference": "8a75495f431e52df2ffa178851c402d7a5e8f037",+ "url": "https://api.github.com/repos/laravel/passport/zipball/4d81207941d6efc198857847d9e4c17520f28d75",+ "reference": "4d81207941d6efc198857847d9e4c17520f28d75","shasum": ""},"require": {@@ -2293,7 +2293,7 @@"issues": "https://github.com/laravel/passport/issues","source": "https://github.com/laravel/passport"},- "time": "2024-01-30T15:44:09+00:00"+ "time": "2024-02-09T16:27:49+00:00"},{"name": "laravel/prompts",@@ -8990,36 +8990,36 @@"packages-dev": [{"name": "barryvdh/laravel-debugbar",- "version": "v3.9.2",+ "version": "v3.10.4","source": {"type": "git","url": "https://github.com/barryvdh/laravel-debugbar.git",- "reference": "bfd0131c146973cab164e50f5cdd8a67cc60cab1"+ "reference": "09d3dc77d7dc1b063e3728a6029c39ee0fbebf1d"},"dist": {"type": "zip",- "url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/bfd0131c146973cab164e50f5cdd8a67cc60cab1",- "reference": "bfd0131c146973cab164e50f5cdd8a67cc60cab1",+ "url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/09d3dc77d7dc1b063e3728a6029c39ee0fbebf1d",+ "reference": "09d3dc77d7dc1b063e3728a6029c39ee0fbebf1d","shasum": ""},"require": {- "illuminate/routing": "^9|^10",- "illuminate/session": "^9|^10",- "illuminate/support": "^9|^10",- "maximebf/debugbar": "^1.18.2",+ "illuminate/routing": "^9|^10|^11",+ "illuminate/session": "^9|^10|^11",+ "illuminate/support": "^9|^10|^11",+ "maximebf/debugbar": "~1.20.1","php": "^8.0",- "symfony/finder": "^6"+ "symfony/finder": "^6|^7"},"require-dev": {"mockery/mockery": "^1.3.3",- "orchestra/testbench-dusk": "^5|^6|^7|^8",+ "orchestra/testbench-dusk": "^5|^6|^7|^8|^9","phpunit/phpunit": "^8.5.30|^9.0","squizlabs/php_codesniffer": "^3.5"},"type": "library","extra": {"branch-alias": {- "dev-master": "3.8-dev"+ "dev-master": "3.10-dev"},"laravel": {"providers": [@@ -9058,7 +9058,7 @@],"support": {"issues": "https://github.com/barryvdh/laravel-debugbar/issues",- "source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.9.2"+ "source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.10.4"},"funding": [{@@ -9070,43 +9070,43 @@"type": "github"}],- "time": "2023-08-25T18:43:57+00:00"+ "time": "2024-02-14T08:52:12+00:00"},{"name": "barryvdh/laravel-ide-helper",- "version": "v2.14.0",+ "version": "v2.15.0","source": {"type": "git","url": "https://github.com/barryvdh/laravel-ide-helper.git",- "reference": "485c756f6cff408d6b273274c5e86112c3973d98"+ "reference": "dca3ebe81ea385632651791cb8b3db42153c380c"},"dist": {"type": "zip",- "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/485c756f6cff408d6b273274c5e86112c3973d98",- "reference": "485c756f6cff408d6b273274c5e86112c3973d98",+ "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/dca3ebe81ea385632651791cb8b3db42153c380c",+ "reference": "dca3ebe81ea385632651791cb8b3db42153c380c","shasum": ""},"require": {"barryvdh/reflection-docblock": "^2.0.6","composer/class-map-generator": "^1.0",- "doctrine/dbal": "^2.6 || ^3",+ "doctrine/dbal": "^2.6 || ^3.1.4","ext-json": "*",- "illuminate/console": "^8 || ^9 || ^10",- "illuminate/filesystem": "^8 || ^9 || ^10",- "illuminate/support": "^8 || ^9 || ^10",+ "illuminate/console": "^9 || ^10",+ "illuminate/filesystem": "^9 || ^10",+ "illuminate/support": "^9 || ^10","nikic/php-parser": "^4.18 || ^5",- "php": "^7.3 || ^8.0",+ "php": "^8.0","phpdocumentor/type-resolver": "^1.1.0"},"require-dev": {"ext-pdo_sqlite": "*",- "friendsofphp/php-cs-fixer": "^2",- "illuminate/config": "^8 || ^9 || ^10",- "illuminate/view": "^8 || ^9 || ^10",+ "friendsofphp/php-cs-fixer": "^3",+ "illuminate/config": "^9 || ^10",+ "illuminate/view": "^9 || ^10","mockery/mockery": "^1.4",- "orchestra/testbench": "^6 || ^7 || ^8",- "phpunit/phpunit": "^8.5 || ^9",- "spatie/phpunit-snapshot-assertions": "^3 || ^4",+ "orchestra/testbench": "^7 || ^8",+ "phpunit/phpunit": "^9",+ "spatie/phpunit-snapshot-assertions": "^4","vimeo/psalm": "^5.4"},"suggest": {@@ -9115,7 +9115,7 @@"type": "library","extra": {"branch-alias": {- "dev-master": "2.14-dev"+ "dev-master": "2.15-dev"},"laravel": {"providers": [@@ -9152,7 +9152,7 @@],"support": {"issues": "https://github.com/barryvdh/laravel-ide-helper/issues",- "source": "https://github.com/barryvdh/laravel-ide-helper/tree/v2.14.0"+ "source": "https://github.com/barryvdh/laravel-ide-helper/tree/v2.15.0"},"funding": [{@@ -9164,7 +9164,7 @@"type": "github"}],- "time": "2024-02-05T08:16:36+00:00"+ "time": "2024-02-14T11:19:26+00:00"},{"name": "barryvdh/reflection-docblock",@@ -9550,16 +9550,16 @@},{"name": "larastan/larastan",- "version": "v2.8.1",+ "version": "v2.9.0","source": {"type": "git","url": "https://github.com/larastan/larastan.git",- "reference": "b7cc6a29c457a7d4f3de90466392ae9ad3e17022"+ "reference": "35fa9cbe1895e76215bbe74571a344f2705fbe01"},"dist": {"type": "zip",- "url": "https://api.github.com/repos/larastan/larastan/zipball/b7cc6a29c457a7d4f3de90466392ae9ad3e17022",- "reference": "b7cc6a29c457a7d4f3de90466392ae9ad3e17022",+ "url": "https://api.github.com/repos/larastan/larastan/zipball/35fa9cbe1895e76215bbe74571a344f2705fbe01",+ "reference": "35fa9cbe1895e76215bbe74571a344f2705fbe01","shasum": ""},"require": {@@ -9627,7 +9627,7 @@],"support": {"issues": "https://github.com/larastan/larastan/issues",- "source": "https://github.com/larastan/larastan/tree/v2.8.1"+ "source": "https://github.com/larastan/larastan/tree/v2.9.0"},"funding": [{@@ -9647,26 +9647,26 @@"type": "patreon"}],- "time": "2024-01-08T09:11:17+00:00"+ "time": "2024-02-13T11:49:22+00:00"},{"name": "maximebf/debugbar",- "version": "v1.19.1",+ "version": "v1.20.1","source": {"type": "git","url": "https://github.com/maximebf/php-debugbar.git",- "reference": "03dd40a1826f4d585ef93ef83afa2a9874a00523"+ "reference": "06ebf922ccedfa4cc43015825697ee8c1fb80f7e"},"dist": {"type": "zip",- "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/03dd40a1826f4d585ef93ef83afa2a9874a00523",- "reference": "03dd40a1826f4d585ef93ef83afa2a9874a00523",+ "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/06ebf922ccedfa4cc43015825697ee8c1fb80f7e",+ "reference": "06ebf922ccedfa4cc43015825697ee8c1fb80f7e","shasum": ""},"require": {"php": "^7.1|^8","psr/log": "^1|^2|^3",- "symfony/var-dumper": "^4|^5|^6"+ "symfony/var-dumper": "^4|^5|^6|^7"},"require-dev": {"phpunit/phpunit": ">=7.5.20 <10.0",@@ -9680,7 +9680,7 @@"type": "library","extra": {"branch-alias": {- "dev-master": "1.18-dev"+ "dev-master": "1.20-dev"}},"autoload": {@@ -9711,9 +9711,9 @@],"support": {"issues": "https://github.com/maximebf/php-debugbar/issues",- "source": "https://github.com/maximebf/php-debugbar/tree/v1.19.1"+ "source": "https://github.com/maximebf/php-debugbar/tree/v1.20.1"},- "time": "2023-10-12T08:10:52+00:00"+ "time": "2024-02-13T19:03:14+00:00"},{"name": "mockery/mockery",@@ -10318,16 +10318,16 @@},{"name": "phpstan/phpstan",- "version": "1.10.57",+ "version": "1.10.58","source": {"type": "git","url": "https://github.com/phpstan/phpstan.git",- "reference": "1627b1d03446904aaa77593f370c5201d2ecc34e"+ "reference": "a23518379ec4defd9e47cbf81019526861623ec2"},"dist": {"type": "zip",- "url": "https://api.github.com/repos/phpstan/phpstan/zipball/1627b1d03446904aaa77593f370c5201d2ecc34e",- "reference": "1627b1d03446904aaa77593f370c5201d2ecc34e",+ "url": "https://api.github.com/repos/phpstan/phpstan/zipball/a23518379ec4defd9e47cbf81019526861623ec2",+ "reference": "a23518379ec4defd9e47cbf81019526861623ec2","shasum": ""},"require": {@@ -10376,7 +10376,7 @@"type": "tidelift"}],- "time": "2024-01-24T11:51:34+00:00"+ "time": "2024-02-12T20:02:57+00:00"},{"name": "phpstan/phpstan-deprecation-rules",diff --git a/package-lock.json b/package-lock.jsonindex 706ec44c44..354a918aa3 100644--- a/package-lock.json+++ b/package-lock.json@@ -530,9 +530,9 @@"integrity": "sha512-6Z7vzlVBJduPUi7U1MPRBzoXmJf8ob9tGcUNxxos6qU1bbjPX7Li30r1Dhtk55hSBfPmVuN7p6zahF7G38xtWA=="},"node_modules/bootstrap5-tags": {- "version": "1.7.0",- "resolved": "https://registry.npmjs.org/bootstrap5-tags/-/bootstrap5-tags-1.7.0.tgz",- "integrity": "sha512-FyOKAvC1nYMIrTMhyx7KbiBDGkOQETU5ozJwUf+jCIwyuy/QcRnaq3jCFOl7KhYRySbZXGr1zbAZ/fmtGitMLQ=="+ "version": "1.7.1",+ "resolved": "https://registry.npmjs.org/bootstrap5-tags/-/bootstrap5-tags-1.7.1.tgz",+ "integrity": "sha512-qBgtw8E4b+zNfNGPNZAaiC4oR2QSI2OWQYx523S03+ZFXPFUU7fJyMA4ynTYG2CE6hpy3e8HB5Lx9nWn1jrlNA=="},"node_modules/braces": {"version": "3.0.2",diff --git a/public/build/assets/create-af0e6c17.js b/public/build/assets/create-6378bb8a.jssimilarity index 97%rename from public/build/assets/create-af0e6c17.jsrename to public/build/assets/create-6378bb8a.jsindex 2f84867264..d70fe0fa9c 100644--- a/public/build/assets/create-af0e6c17.js+++ b/public/build/assets/create-6378bb8a.js@@ -1 +1 @@-import{a as m,d as y,f as d}from"./format-money-03f73825.js";import{d as w,c as b}from"./create-empty-split-d82bb341.js";import{l as v,a as C,b as T,c as _,p as E,d as P,s as L,e as c,f as S,g as D,h as A,i as x,j as k,k as h,m as p}from"./splice-errors-into-transactions-e53c1920.js";import{l,i as r,m as B}from"./vendor-cc723e37.js";import"./get-7f8692a5.js";class M{post(t){let s="/api/v2/transactions";return m.post(s,t)}}let n=[],u=[];document.addEventListener("location-remove",e=>{u[e.detail.index].remove()});function O(e){let t=0;if(document.querySelector("#form")._x_dataStack[0].$data.entries[t].hasLocation===!1){u[t]=new l.marker(e.latlng,{draggable:!0}),u[t].on("dragend",U),u[t].addTo(n[t]);const i=new CustomEvent("location-set",{detail:{latitude:e.latlng.lat,longitude:e.latlng.lng,index:t,zoomLevel:n[t].getZoom()}});document.dispatchEvent(i)}}function F(e){let t=0;const s=new CustomEvent("location-zoom",{detail:{index:t,zoomLevel:n[t].getZoom()}});document.dispatchEvent(s)}function U(e){let t=e.target,s=t.getLatLng();t.setLatLng(new l.LatLng(s.lat,s.lng),{draggable:"true"});const i=new CustomEvent("location-move",{detail:{latitude:s.lat,longitude:s.lng,index:0}});document.dispatchEvent(i)}function z(e){if(e>0){console.warn("Corwardly refuse to add a map on split #"+(e+1));return}if(typeof n[e]>"u"){let t=document.getElementById("location_map");t&&(n[e]=l.map(t).setView([t.dataset.latitude,t.dataset.longitude],t.dataset.zoomLevel),l.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{maxZoom:19,attribution:'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}).addTo(n[e]),n[e].on("click",O),n[e].on("zoomend",F))}}const a=k();let I=function(){return{entries:[],formStates:{loadingCurrencies:!0,loadingBudgets:!0,loadingPiggyBanks:!0,loadingSubscriptions:!0,isSubmitting:!1,returnHereButton:!1,saveAsNewButton:!1,resetButton:!0,rulesButton:!0,webhooksButton:!0},formBehaviour:{formType:"create",foreignCurrencyEnabled:!0},formData:{defaultCurrency:null,enabledCurrencies:[],nativeCurrencies:[],foreignCurrencies:[],budgets:[],piggyBanks:[],subscriptions:[]},groupProperties:{transactionType:"unknown",title:null,id:null,totalAmount:0},notifications:{error:{show:!1,text:"",url:""},success:{show:!1,text:"",url:""},wait:{show:!1,text:""}},filters:{source:[],destination:[]},changedDateTime(e){console.warn("changedDateTime, event is not used")},changedDescription(e){console.warn("changedDescription, event is not used")},changedDestinationAccount(e){this.detectTransactionType()},changedSourceAccount(e){this.detectTransactionType()},detectTransactionType(){const e=this.entries[0].source_account.type??"unknown",t=this.entries[0].destination_account.type??"unknown";if(e==="unknown"&&t==="unknown"){this.groupProperties.transactionType="unknown",console.warn("Cannot infer transaction type from two unknown accounts.");return}if(e===t&&["Asset account","Loan","Debt","Mortgage"].includes(e)){this.groupProperties.transactionType="transfer",console.log('Transaction type is detected to be "'+this.groupProperties.transactionType+'".'),console.log("filter down currencies for transfer."),this.filterNativeCurrencies(this.entries[0].source_account.currency_code),this.filterForeignCurrencies(this.entries[0].destination_account.currency_code);return}if(e==="Asset account"&&["Expense account","Debt","Loan","Mortgage"].includes(t)){this.groupProperties.transactionType="withdrawal",console.log('[a] Transaction type is detected to be "'+this.groupProperties.transactionType+'".'),this.filterNativeCurrencies(this.entries[0].source_account.currency_code);return}if(e==="Asset account"&&t==="unknown"){this.groupProperties.transactionType="withdrawal",console.log('[b] Transaction type is detected to be "'+this.groupProperties.transactionType+'".'),console.log(this.entries[0].source_account),this.filterNativeCurrencies(this.entries[0].source_account.currency_code);return}if(["Debt","Loan","Mortgage"].includes(e)&&t==="Expense account"){this.groupProperties.transactionType="withdrawal",console.log('[c] Transaction type is detected to be "'+this.groupProperties.transactionType+'".'),this.filterNativeCurrencies(this.entries[0].source_account.currency_code);return}if(e==="Revenue account"&&["Asset account","Debt","Loan","Mortgage"].includes(t)){this.groupProperties.transactionType="deposit",console.log('Transaction type is detected to be "'+this.groupProperties.transactionType+'".');return}if(["Debt","Loan","Mortgage"].includes(e)&&t==="Asset account"){this.groupProperties.transactionType="deposit",console.log('Transaction type is detected to be "'+this.groupProperties.transactionType+'".');return}console.warn('Unknown account combination between "'+e+'" and "'+t+'".')},formattedTotalAmount(){return this.entries.length===0?d(this.groupProperties.totalAmount,"EUR"):d(this.groupProperties.totalAmount,this.entries[0].currency_code??"EUR")},filterForeignCurrencies(e){let t=[],s;for(let i in this.formData.enabledCurrencies)if(this.formData.enabledCurrencies.hasOwnProperty(i)){let o=this.formData.enabledCurrencies[i];o.code===e&&(s=o)}t.push(s),this.formData.foreignCurrencies=t,t.length===1&&t[0].code===this.entries[0].source_account.currency_code&&(console.log("Foreign currency is same as source currency. Disable foreign amount."),this.formBehaviour.foreignCurrencyEnabled=!1),t.length===1&&t[0].code!==this.entries[0].source_account.currency_code&&(console.log("Foreign currency is NOT same as source currency. Enable foreign amount."),this.formBehaviour.foreignCurrencyEnabled=!0);for(let i in this.entries)this.entries.hasOwnProperty(i)&&(this.entries[i].foreign_currency_code=e)},filterNativeCurrencies(e){let t=[],s;for(let i in this.formData.enabledCurrencies)if(this.formData.enabledCurrencies.hasOwnProperty(i)){let o=this.formData.enabledCurrencies[i];o.code===e&&(s=o)}t.push(s),this.formData.nativeCurrencies=t;for(let i in this.entries)this.entries.hasOwnProperty(i)&&(this.entries[i].currency_code=e)},changedAmount(e){const t=parseInt(e.target.dataset.index);this.entries[t].amount=parseFloat(e.target.value),this.groupProperties.totalAmount=0;for(let s in this.entries)this.entries.hasOwnProperty(s)&&(this.groupProperties.totalAmount=this.groupProperties.totalAmount+parseFloat(this.entries[s].amount))},addedSplit(){},processUpload(e){this.showMessageOrRedirectUser()},processUploadError(e){this.notifications.success.show=!1,this.notifications.wait.show=!1,this.notifications.error.show=!0,this.formStates.isSubmitting=!1,this.notifications.error.text=r.t("firefly.errors_upload"),console.error(e)},init(){this.addSplit(),v().then(e=>{this.formStates.loadingCurrencies=!1,this.formData.defaultCurrency=e.defaultCurrency,this.formData.enabledCurrencies=e.enabledCurrencies,this.formData.nativeCurrencies=e.nativeCurrencies,this.formData.foreignCurrencies=e.foreignCurrencies}),C().then(e=>{this.formData.budgets=e,this.formStates.loadingBudgets=!1}),T().then(e=>{this.formData.piggyBanks=e,this.formStates.loadingPiggyBanks=!1}),_().then(e=>{this.formData.subscriptions=e,this.formStates.loadingSubscriptions=!1}),document.addEventListener("upload-success",e=>{this.processUpload(e),document.querySelectorAll("input[type=file]").value=""}),document.addEventListener("upload-error",e=>{this.processUploadError(e)}),document.addEventListener("location-move",e=>{this.entries[e.detail.index].latitude=e.detail.latitude,this.entries[e.detail.index].longitude=e.detail.longitude}),document.addEventListener("location-set",e=>{this.entries[e.detail.index].hasLocation=!0,this.entries[e.detail.index].latitude=e.detail.latitude,this.entries[e.detail.index].longitude=e.detail.longitude,this.entries[e.detail.index].zoomLevel=e.detail.zoomLevel}),document.addEventListener("location-zoom",e=>{this.entries[e.detail.index].hasLocation=!0,this.entries[e.detail.index].zoomLevel=e.detail.zoomLevel}),this.filters.source=["Asset account","Loan","Debt","Mortgage","Revenue account"],this.filters.destination=["Expense account","Loan","Debt","Mortgage","Asset account"]},submitTransaction(){this.notifications.error.show=!1,this.notifications.success.show=!1,this.notifications.wait.show=!1;for(let i in this.entries)this.entries.hasOwnProperty(i)&&(this.entries[i].errors=w());this.formStates.isSubmitting=!0,this.detectTransactionType();let e=E(this.entries,null,this.groupProperties.transactionType),t={group_title:this.groupProperties.title,fire_webhooks:this.formStates.webhooksButton,apply_rules:this.formStates.rulesButton,transactions:e};this.groupProperties.title===null&&e.length>1&&(t.group_title=e[0].description);let s=new M;console.log(t),s.post(t).then(i=>{const o=i.data.data;if(this.groupProperties.id=parseInt(o.id),this.groupProperties.title=o.attributes.group_title??o.attributes.transactions[0].description,P(this.groupProperties.id,o.attributes.transactions)>0){this.notifications.wait.show=!0,this.notifications.wait.text=r.t("firefly.wait_attachments");return}this.showMessageOrRedirectUser()}).catch(i=>{this.submitting=!1,console.log(i),typeof i.response<"u"&&this.parseErrors(i.response.data)})},showMessageOrRedirectUser(){if(this.notifications.error.show=!1,this.notifications.success.show=!1,this.notifications.wait.show=!1,this.formStates.returnHereButton){this.notifications.success.show=!0,this.notifications.success.url="transactions/show/"+this.groupProperties.id,this.notifications.success.text=r.t("firefly.stored_journal_js",{description:this.groupProperties.title}),this.formStates.resetButton&&(this.entries=[],this.addSplit(),this.groupProperties.totalAmount=0);return}window.location="transactions/show/"+this.groupProperties.id+"?transaction_group_id="+this.groupProperties.id+"&message=created"},parseErrors(e){this.notifications.error.show=!0,this.notifications.success.show=!1,this.notifications.wait.show=!1,this.formStates.isSubmitting=!1,this.notifications.error.text=r.t("firefly.errors_submission_v2",{errorMessage:e.message}),e.hasOwnProperty("errors")&&(this.entries=L(e.errors,this.entries))},addSplit(){this.entries.push(b()),setTimeout(()=>{B.init("select.ac-tags",{allowClear:!0,server:a.tag,liveServer:!0,clearEnd:!0,allowNew:!0,notFoundMessage:r.t("firefly.nothing_found"),noCache:!0,fetchOptions:{headers:{"X-CSRF-TOKEN":document.head.querySelector('meta[name="csrf-token"]').content}}});const e=this.entries.length-1;z(e);const t=function(s,i,o){return s.name_with_balance+'<br><small class="text-muted">'+r.t("firefly.account_type_"+s.type)+"</small>"};c({selector:"input.ac-source",serverUrl:a.account,onChange:S,onSelectItem:D,hiddenValue:this.entries[e].source_account.alpine_name}),c({selector:"input.ac-dest",serverUrl:a.account,filters:this.filters.destination,onRenderItem:t,onChange:A,onSelectItem:x}),c({selector:"input.ac-category",serverUrl:a.category,valueField:"id",labelField:"name",onChange:h,onSelectItem:h}),c({selector:"input.ac-description",serverUrl:a.description,valueField:"id",labelField:"description",onChange:p,onSelectItem:p})},150)},removeSplit(e){this.entries.splice(e,1),document.querySelector("#split-0-tab").click()},clearLocation(e){e.preventDefault();const t=e.currentTarget,s=parseInt(t.attributes["data-index"].value);this.entries[s].hasLocation=!1,this.entries[s].latitude=null,this.entries[s].longitude=null,this.entries[s].zoomLevel=null;const i=new CustomEvent("location-remove",{detail:{index:s}});return document.dispatchEvent(i),!1}}},f={transactions:I,dates:y};function g(){Object.keys(f).forEach(e=>{console.log(`Loading page component "${e}"`);let t=f[e]();Alpine.data(e,()=>t)}),Alpine.start()}document.addEventListener("firefly-iii-bootstrapped",()=>{console.log("Loaded through event listener."),g()});window.bootstrapped&&(console.log("Loaded through window variable."),g());+import{a as m,d as y,f as d}from"./format-money-62afb78b.js";import{d as w,c as b}from"./create-empty-split-aae839d5.js";import{l as v,a as C,b as T,c as _,p as E,d as P,s as L,e as c,f as S,g as D,h as A,i as x,j as k,k as h,m as p}from"./splice-errors-into-transactions-528a3749.js";import{l,i as r,m as B}from"./vendor-2609b2c9.js";import"./get-5b4283ca.js";class M{post(t){let s="/api/v2/transactions";return m.post(s,t)}}let n=[],u=[];document.addEventListener("location-remove",e=>{u[e.detail.index].remove()});function O(e){let t=0;if(document.querySelector("#form")._x_dataStack[0].$data.entries[t].hasLocation===!1){u[t]=new l.marker(e.latlng,{draggable:!0}),u[t].on("dragend",U),u[t].addTo(n[t]);const i=new CustomEvent("location-set",{detail:{latitude:e.latlng.lat,longitude:e.latlng.lng,index:t,zoomLevel:n[t].getZoom()}});document.dispatchEvent(i)}}function F(e){let t=0;const s=new CustomEvent("location-zoom",{detail:{index:t,zoomLevel:n[t].getZoom()}});document.dispatchEvent(s)}function U(e){let t=e.target,s=t.getLatLng();t.setLatLng(new l.LatLng(s.lat,s.lng),{draggable:"true"});const i=new CustomEvent("location-move",{detail:{latitude:s.lat,longitude:s.lng,index:0}});document.dispatchEvent(i)}function z(e){if(e>0){console.warn("Corwardly refuse to add a map on split #"+(e+1));return}if(typeof n[e]>"u"){let t=document.getElementById("location_map");t&&(n[e]=l.map(t).setView([t.dataset.latitude,t.dataset.longitude],t.dataset.zoomLevel),l.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{maxZoom:19,attribution:'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}).addTo(n[e]),n[e].on("click",O),n[e].on("zoomend",F))}}const a=k();let I=function(){return{entries:[],formStates:{loadingCurrencies:!0,loadingBudgets:!0,loadingPiggyBanks:!0,loadingSubscriptions:!0,isSubmitting:!1,returnHereButton:!1,saveAsNewButton:!1,resetButton:!0,rulesButton:!0,webhooksButton:!0},formBehaviour:{formType:"create",foreignCurrencyEnabled:!0},formData:{defaultCurrency:null,enabledCurrencies:[],nativeCurrencies:[],foreignCurrencies:[],budgets:[],piggyBanks:[],subscriptions:[]},groupProperties:{transactionType:"unknown",title:null,id:null,totalAmount:0},notifications:{error:{show:!1,text:"",url:""},success:{show:!1,text:"",url:""},wait:{show:!1,text:""}},filters:{source:[],destination:[]},changedDateTime(e){console.warn("changedDateTime, event is not used")},changedDescription(e){console.warn("changedDescription, event is not used")},changedDestinationAccount(e){this.detectTransactionType()},changedSourceAccount(e){this.detectTransactionType()},detectTransactionType(){const e=this.entries[0].source_account.type??"unknown",t=this.entries[0].destination_account.type??"unknown";if(e==="unknown"&&t==="unknown"){this.groupProperties.transactionType="unknown",console.warn("Cannot infer transaction type from two unknown accounts.");return}if(e===t&&["Asset account","Loan","Debt","Mortgage"].includes(e)){this.groupProperties.transactionType="transfer",console.log('Transaction type is detected to be "'+this.groupProperties.transactionType+'".'),console.log("filter down currencies for transfer."),this.filterNativeCurrencies(this.entries[0].source_account.currency_code),this.filterForeignCurrencies(this.entries[0].destination_account.currency_code);return}if(e==="Asset account"&&["Expense account","Debt","Loan","Mortgage"].includes(t)){this.groupProperties.transactionType="withdrawal",console.log('[a] Transaction type is detected to be "'+this.groupProperties.transactionType+'".'),this.filterNativeCurrencies(this.entries[0].source_account.currency_code);return}if(e==="Asset account"&&t==="unknown"){this.groupProperties.transactionType="withdrawal",console.log('[b] Transaction type is detected to be "'+this.groupProperties.transactionType+'".'),console.log(this.entries[0].source_account),this.filterNativeCurrencies(this.entries[0].source_account.currency_code);return}if(["Debt","Loan","Mortgage"].includes(e)&&t==="Expense account"){this.groupProperties.transactionType="withdrawal",console.log('[c] Transaction type is detected to be "'+this.groupProperties.transactionType+'".'),this.filterNativeCurrencies(this.entries[0].source_account.currency_code);return}if(e==="Revenue account"&&["Asset account","Debt","Loan","Mortgage"].includes(t)){this.groupProperties.transactionType="deposit",console.log('Transaction type is detected to be "'+this.groupProperties.transactionType+'".');return}if(["Debt","Loan","Mortgage"].includes(e)&&t==="Asset account"){this.groupProperties.transactionType="deposit",console.log('Transaction type is detected to be "'+this.groupProperties.transactionType+'".');return}console.warn('Unknown account combination between "'+e+'" and "'+t+'".')},formattedTotalAmount(){return this.entries.length===0?d(this.groupProperties.totalAmount,"EUR"):d(this.groupProperties.totalAmount,this.entries[0].currency_code??"EUR")},filterForeignCurrencies(e){let t=[],s;for(let i in this.formData.enabledCurrencies)if(this.formData.enabledCurrencies.hasOwnProperty(i)){let o=this.formData.enabledCurrencies[i];o.code===e&&(s=o)}t.push(s),this.formData.foreignCurrencies=t,t.length===1&&t[0].code===this.entries[0].source_account.currency_code&&(console.log("Foreign currency is same as source currency. Disable foreign amount."),this.formBehaviour.foreignCurrencyEnabled=!1),t.length===1&&t[0].code!==this.entries[0].source_account.currency_code&&(console.log("Foreign currency is NOT same as source currency. Enable foreign amount."),this.formBehaviour.foreignCurrencyEnabled=!0);for(let i in this.entries)this.entries.hasOwnProperty(i)&&(this.entries[i].foreign_currency_code=e)},filterNativeCurrencies(e){let t=[],s;for(let i in this.formData.enabledCurrencies)if(this.formData.enabledCurrencies.hasOwnProperty(i)){let o=this.formData.enabledCurrencies[i];o.code===e&&(s=o)}t.push(s),this.formData.nativeCurrencies=t;for(let i in this.entries)this.entries.hasOwnProperty(i)&&(this.entries[i].currency_code=e)},changedAmount(e){const t=parseInt(e.target.dataset.index);this.entries[t].amount=parseFloat(e.target.value),this.groupProperties.totalAmount=0;for(let s in this.entries)this.entries.hasOwnProperty(s)&&(this.groupProperties.totalAmount=this.groupProperties.totalAmount+parseFloat(this.entries[s].amount))},addedSplit(){},processUpload(e){this.showMessageOrRedirectUser()},processUploadError(e){this.notifications.success.show=!1,this.notifications.wait.show=!1,this.notifications.error.show=!0,this.formStates.isSubmitting=!1,this.notifications.error.text=r.t("firefly.errors_upload"),console.error(e)},init(){this.addSplit(),v().then(e=>{this.formStates.loadingCurrencies=!1,this.formData.defaultCurrency=e.defaultCurrency,this.formData.enabledCurrencies=e.enabledCurrencies,this.formData.nativeCurrencies=e.nativeCurrencies,this.formData.foreignCurrencies=e.foreignCurrencies}),C().then(e=>{this.formData.budgets=e,this.formStates.loadingBudgets=!1}),T().then(e=>{this.formData.piggyBanks=e,this.formStates.loadingPiggyBanks=!1}),_().then(e=>{this.formData.subscriptions=e,this.formStates.loadingSubscriptions=!1}),document.addEventListener("upload-success",e=>{this.processUpload(e),document.querySelectorAll("input[type=file]").value=""}),document.addEventListener("upload-error",e=>{this.processUploadError(e)}),document.addEventListener("location-move",e=>{this.entries[e.detail.index].latitude=e.detail.latitude,this.entries[e.detail.index].longitude=e.detail.longitude}),document.addEventListener("location-set",e=>{this.entries[e.detail.index].hasLocation=!0,this.entries[e.detail.index].latitude=e.detail.latitude,this.entries[e.detail.index].longitude=e.detail.longitude,this.entries[e.detail.index].zoomLevel=e.detail.zoomLevel}),document.addEventListener("location-zoom",e=>{this.entries[e.detail.index].hasLocation=!0,this.entries[e.detail.index].zoomLevel=e.detail.zoomLevel}),this.filters.source=["Asset account","Loan","Debt","Mortgage","Revenue account"],this.filters.destination=["Expense account","Loan","Debt","Mortgage","Asset account"]},submitTransaction(){this.notifications.error.show=!1,this.notifications.success.show=!1,this.notifications.wait.show=!1;for(let i in this.entries)this.entries.hasOwnProperty(i)&&(this.entries[i].errors=w());this.formStates.isSubmitting=!0,this.detectTransactionType();let e=E(this.entries,null,this.groupProperties.transactionType),t={group_title:this.groupProperties.title,fire_webhooks:this.formStates.webhooksButton,apply_rules:this.formStates.rulesButton,transactions:e};this.groupProperties.title===null&&e.length>1&&(t.group_title=e[0].description);let s=new M;console.log(t),s.post(t).then(i=>{const o=i.data.data;if(this.groupProperties.id=parseInt(o.id),this.groupProperties.title=o.attributes.group_title??o.attributes.transactions[0].description,P(this.groupProperties.id,o.attributes.transactions)>0){this.notifications.wait.show=!0,this.notifications.wait.text=r.t("firefly.wait_attachments");return}this.showMessageOrRedirectUser()}).catch(i=>{this.submitting=!1,console.log(i),typeof i.response<"u"&&this.parseErrors(i.response.data)})},showMessageOrRedirectUser(){if(this.notifications.error.show=!1,this.notifications.success.show=!1,this.notifications.wait.show=!1,this.formStates.returnHereButton){this.notifications.success.show=!0,this.notifications.success.url="transactions/show/"+this.groupProperties.id,this.notifications.success.text=r.t("firefly.stored_journal_js",{description:this.groupProperties.title}),this.formStates.resetButton&&(this.entries=[],this.addSplit(),this.groupProperties.totalAmount=0);return}window.location="transactions/show/"+this.groupProperties.id+"?transaction_group_id="+this.groupProperties.id+"&message=created"},parseErrors(e){this.notifications.error.show=!0,this.notifications.success.show=!1,this.notifications.wait.show=!1,this.formStates.isSubmitting=!1,this.notifications.error.text=r.t("firefly.errors_submission_v2",{errorMessage:e.message}),e.hasOwnProperty("errors")&&(this.entries=L(e.errors,this.entries))},addSplit(){this.entries.push(b()),setTimeout(()=>{B.init("select.ac-tags",{allowClear:!0,server:a.tag,liveServer:!0,clearEnd:!0,allowNew:!0,notFoundMessage:r.t("firefly.nothing_found"),noCache:!0,fetchOptions:{headers:{"X-CSRF-TOKEN":document.head.querySelector('meta[name="csrf-token"]').content}}});const e=this.entries.length-1;z(e);const t=function(s,i,o){return s.name_with_balance+'<br><small class="text-muted">'+r.t("firefly.account_type_"+s.type)+"</small>"};c({selector:"input.ac-source",serverUrl:a.account,onChange:S,onSelectItem:D,hiddenValue:this.entries[e].source_account.alpine_name}),c({selector:"input.ac-dest",serverUrl:a.account,filters:this.filters.destination,onRenderItem:t,onChange:A,onSelectItem:x}),c({selector:"input.ac-category",serverUrl:a.category,valueField:"id",labelField:"name",onChange:h,onSelectItem:h}),c({selector:"input.ac-description",serverUrl:a.description,valueField:"id",labelField:"description",onChange:p,onSelectItem:p})},150)},removeSplit(e){this.entries.splice(e,1),document.querySelector("#split-0-tab").click()},clearLocation(e){e.preventDefault();const t=e.currentTarget,s=parseInt(t.attributes["data-index"].value);this.entries[s].hasLocation=!1,this.entries[s].latitude=null,this.entries[s].longitude=null,this.entries[s].zoomLevel=null;const i=new CustomEvent("location-remove",{detail:{index:s}});return document.dispatchEvent(i),!1}}},f={transactions:I,dates:y};function g(){Object.keys(f).forEach(e=>{console.log(`Loading page component "${e}"`);let t=f[e]();Alpine.data(e,()=>t)}),Alpine.start()}document.addEventListener("firefly-iii-bootstrapped",()=>{console.log("Loaded through event listener."),g()});window.bootstrapped&&(console.log("Loaded through window variable."),g());diff --git a/public/build/assets/create-empty-split-d82bb341.js b/public/build/assets/create-empty-split-aae839d5.jssimilarity index 93%rename from public/build/assets/create-empty-split-d82bb341.jsrename to public/build/assets/create-empty-split-aae839d5.jsindex 03624d4c6d..7c0e917984 100644--- a/public/build/assets/create-empty-split-d82bb341.js+++ b/public/build/assets/create-empty-split-aae839d5.js@@ -1 +1 @@-import{f as n}from"./vendor-cc723e37.js";function e(){return{id:"",name:"",alpine_name:""}}function o(){return{description:[],amount:[],currency_code:[],foreign_amount:[],foreign_currency_code:[],source_account:[],destination_account:[],budget_id:[],category_name:[],piggy_bank_id:[],bill_id:[],tags:[],notes:[],internal_reference:[],external_url:[],latitude:[],longitude:[],zoom_level:[],date:[],interest_date:[],book_date:[],process_date:[],due_date:[],payment_date:[],invoice_date:[]}}function d(){let t=n(new Date,"yyyy-MM-dd HH:mm");return{description:"",amount:"",currency_code:"EUR",foreign_amount:"",foreign_currency_code:"",source_account:e(),destination_account:e(),budget_id:null,category_name:"",piggy_bank_id:null,bill_id:null,tags:[],notes:"",internal_reference:"",external_url:"",hasLocation:!1,latitude:null,longitude:null,zoomLevel:null,date:t,interest_date:"",book_date:"",process_date:"",due_date:"",payment_date:"",invoice_date:"",errors:o()}}export{d as c,o as d};+import{f as n}from"./vendor-2609b2c9.js";function e(){return{id:"",name:"",alpine_name:""}}function o(){return{description:[],amount:[],currency_code:[],foreign_amount:[],foreign_currency_code:[],source_account:[],destination_account:[],budget_id:[],category_name:[],piggy_bank_id:[],bill_id:[],tags:[],notes:[],internal_reference:[],external_url:[],latitude:[],longitude:[],zoom_level:[],date:[],interest_date:[],book_date:[],process_date:[],due_date:[],payment_date:[],invoice_date:[]}}function d(){let t=n(new Date,"yyyy-MM-dd HH:mm");return{description:"",amount:"",currency_code:"EUR",foreign_amount:"",foreign_currency_code:"",source_account:e(),destination_account:e(),budget_id:null,category_name:"",piggy_bank_id:null,bill_id:null,tags:[],notes:"",internal_reference:"",external_url:"",hasLocation:!1,latitude:null,longitude:null,zoomLevel:null,date:t,interest_date:"",book_date:"",process_date:"",due_date:"",payment_date:"",invoice_date:"",errors:o()}}export{d as c,o as d};diff --git a/public/build/assets/dashboard-d1d540db.js b/public/build/assets/dashboard-5ef2eea4.jssimilarity index 98%rename from public/build/assets/dashboard-d1d540db.jsrename to public/build/assets/dashboard-5ef2eea4.jsindex 2a9ef8c06a..13d03f11f7 100644--- a/public/build/assets/dashboard-d1d540db.js+++ b/public/build/assets/dashboard-5ef2eea4.js@@ -1 +1 @@-import{a as O,f,g as v,P as bt,d as wt}from"./format-money-03f73825.js";import{f as g,C as m,a as S,i as p,S as vt,F as mt,L as Ct,b as kt,A as Pt,B as Dt,T as xt,P as Ot,c as Mt,d as Ft,p as St,e as At,g as Bt,h as jt,j as Wt,k as It}from"./vendor-cc723e37.js";import{G as $t}from"./get-10f1237b.js";import{G as Vt,a as Kt}from"./get-7f8692a5.js";class Lt{get(e,n,a){return O.get("/api/v2/summary/basic",{params:{start:e,end:n,code:a}})}}function P(t,e,n){const a=g(e,"y-MM-dd")+"_"+g(n,"y-MM-dd")+"_"+t;return console.log("getCacheKey: "+a),String(a)}let U=!1;const Et=()=>({balanceBox:{amounts:[],subtitles:[]},billBox:{paid:[],unpaid:[]},leftBox:{left:[],perDay:[]},netBox:{net:[]},autoConversion:!1,loading:!1,boxData:null,boxOptions:null,getFreshData(){const t=new Date(window.store.get("start")),e=new Date(window.store.get("end")),n=P("dashboard-boxes-data",t,e),a=window.store.get("cacheValid");let r=window.store.get(n);if(a&&typeof r<"u"){this.boxData=r,this.generateOptions(this.boxData);return}new Lt().get(g(t,"yyyy-MM-dd"),g(e,"yyyy-MM-dd"),null).then(i=>{this.boxData=i.data,window.store.set(n,i.data),this.generateOptions(this.boxData)})},generateOptions(t){this.balanceBox={amounts:[],subtitles:[]},this.billBox={paid:[],unpaid:[]},this.leftBox={left:[],perDay:[]},this.netBox={net:[]};let e={};for(const n in t)if(t.hasOwnProperty(n)){const a=t[n];if(!a.hasOwnProperty("key"))continue;let r=a.key;if(this.autoConversion){if(r.startsWith("balance-in-native")){this.balanceBox.amounts.push(f(a.value,a.currency_code)),e.hasOwnProperty(a.currency_code)||(e[a.currency_code]="");continue}if(r.startsWith("spent-in-native")){e.hasOwnProperty(a.currency_code)||(e[a.currency_code]=""),e[a.currency_code]=e[a.currency_code]+f(a.value,a.currency_code);continue}if(r.startsWith("earned-in-native")){e.hasOwnProperty(a.currency_code)||(e[a.currency_code]=""),e[a.currency_code]=f(a.value,a.currency_code)+" + "+e[a.currency_code];continue}if(r.startsWith("bills-unpaid-in-native")){this.billBox.unpaid.push(f(a.value,a.currency_code));continue}if(r.startsWith("bills-paid-in-native")){this.billBox.paid.push(f(a.value,a.currency_code));continue}if(r.startsWith("left-to-spend-in-native")){this.leftBox.left.push(f(a.value,a.currency_code));continue}if(r.startsWith("left-per-day-to-spend-in-native")){this.leftBox.perDay.push(f(a.value,a.currency_code));continue}if(r.startsWith("net-worth-in-native")){this.netBox.net.push(f(a.value,a.currency_code));continue}}if(!this.autoConversion&&!r.endsWith("native")){if(r.startsWith("balance-in-")){this.balanceBox.amounts.push(f(a.value,a.currency_code));continue}if(r.startsWith("spent-in-")){e.hasOwnProperty(a.currency_code)||(e[a.currency_code]=""),e[a.currency_code]=e[a.currency_code]+f(a.value,a.currency_code);continue}if(r.startsWith("earned-in-")){e.hasOwnProperty(a.currency_code)||(e[a.currency_code]=""),e[a.currency_code]=f(a.value,a.currency_code)+" + "+e[a.currency_code];continue}if(r.startsWith("bills-unpaid-in-")){this.billBox.unpaid.push(f(a.value,a.currency_code));continue}if(r.startsWith("bills-paid-in-")){this.billBox.paid.push(f(a.value,a.currency_code));continue}if(r.startsWith("left-to-spend-in-")){this.leftBox.left.push(f(a.value,a.currency_code));continue}if(r.startsWith("left-per-day-to-spend-in-")){this.leftBox.perDay.push(f(a.value,a.currency_code));continue}r.startsWith("net-worth-in-")&&this.netBox.net.push(f(a.value,a.currency_code))}}for(let n in e)e.hasOwnProperty(n)&&this.balanceBox.subtitles.push(e[n]);this.loading=!1},loadBoxes(){if(this.loading!==!0){if(this.loading=!0,this.boxData===null){this.getFreshData();return}this.generateOptions(this.boxData),this.loading=!1}},init(){Promise.all([v("viewRange"),v("autoConversion",!1)]).then(t=>{U=!0,this.autoConversion=t[1],this.loadBoxes()}),window.store.observe("end",()=>{U&&(this.boxData=null,this.loadBoxes())}),window.store.observe("autoConversion",t=>{U&&(this.autoConversion=t,this.loadBoxes())})}});class Gt{put(e,n){let a="/api/v1/preferences/"+e;return O.put(a,{data:n})}}function Tt(t,e=null){window.store.set(t,e),new Gt().put(t,e).then(a=>{}).catch(()=>{new bt().post(t,e).then(r=>{})})}let Rt=class{dashboard(e,n){let a=g(e,"y-MM-dd"),r=g(n,"y-MM-dd");return O.get("/api/v2/chart/account/dashboard",{params:{start:a,end:r}})}expense(e,n){let a=g(e,"y-MM-dd"),r=g(n,"y-MM-dd");return O.get("/api/v2/chart/account/expense-dashboard",{params:{start:a,end:r}})}};class st{get(e,n){let a={date:g(n,"y-MM-dd").slice(0,10)};return n?O.get("/api/v2/accounts/"+e,{params:a}):O.get("/api/v2/accounts/"+e)}transactions(e,n){const a={page:n.page??1};return n.hasOwnProperty("start")&&(a.start=g(n.start,"y-MM-dd")),n.hasOwnProperty("end")&&(a.end=g(n.end,"y-MM-dd")),O.get("/api/v2/accounts/"+e+"/transactions",{params:a})}}function N(t){return t==="sankey"?{type:"sankey",data:{datasets:[]},options:{animations:!1}}:t==="pie"?{type:"pie",data:{datasets:[]}}:t==="column"?{type:"bar",data:{labels:[],datasets:[]},options:{plugins:{tooltip:{callbacks:{label:function(e){let n=e.dataset.currency_code;return f(e.raw,n)}}}},maintainAspectRatio:!1,scales:{}}}:t==="line"?{options:{plugins:{tooltip:{callbacks:{label:function(e){let n=e.dataset.currency_code;return f(e.raw,n)}}}},maintainAspectRatio:!1,scales:{x:{type:"time",time:{tooltipFormat:"PP"}}}},type:"line",data:{labels:[],datasets:[]}}:{}}let q=new m("#36a2eb"),I=new m("#ff6384"),G=new m("#4bc0c0"),ft=new m("#ff9f40"),qt=new m("#9966ff"),Nt=new m("#ffcd56"),Yt=new m("#c9cbcf"),lt=0;window.theme==="dark"&&(I.darken(.3).desaturate(.3),G.darken(.3).desaturate(.3),q.darken(.3).desaturate(.3),ft.darken(.3).desaturate(.3));let z=[I,ft,q,G,qt,Nt,Yt,G];function j(t,e){let n={borderColor:I.rgbString(),backgroundColor:I.rgbString()},a;switch(t){default:let o=Math.floor(lt/2)%z.length;a=new m(z[o].rgbString()),a.lighten(.38),n={borderColor:z[o].hexString(),backgroundColor:a.hexString()};break;case"spent":a=new m(q.rgbString()),a.lighten(.38),n={borderColor:q.rgbString(),backgroundColor:a.rgbString()};break;case"left":a=new m(G.rgbString()),a.lighten(.38),n={borderColor:G.rgbString(),backgroundColor:a.rgbString()};break;case"overspent":a=new m(I.rgbString()),a.lighten(.22),n={borderColor:I.rgbString(),backgroundColor:a.rgbString()};break}return lt++,e==="border"?n.borderColor:e==="background"?n.backgroundColor:"#FF0000"}let A=[],$=null,H=null,J=!1;const Ut=()=>({loading:!1,loadingAccounts:!1,accountList:[],autoConversion:!1,chartOptions:null,switchAutoConversion(){this.autoConversion=!this.autoConversion,Tt("autoConversion",this.autoConversion)},getFreshData(){const t=new Date(window.store.get("start")),e=new Date(window.store.get("end")),n=P("dashboard-accounts-chart",t,e),a=window.store.get("cacheValid");let r=window.store.get(n);if(a&&typeof r<"u"){console.log(r),this.drawChart(this.generateOptions(r)),this.loading=!1;return}new Rt().dashboard(t,e,null).then(i=>{this.chartData=i.data,window.store.set(n,i.data),console.log(i.data),this.drawChart(this.generateOptions(this.chartData)),this.loading=!1})},generateOptions(t){A=[];let e=N("line");for(let n=0;n<t.length;n++)if(t.hasOwnProperty(n)){let a="y",r=t[n],o={},i=[];n===0&&(e.data.labels=Object.keys(r.entries)),o.label=r.label,this.autoConversion&&(A.push(r.native_currency_code),o.currency_code=r.native_currency_code,i=Object.values(r.native_entries),a="y"+r.native_currency_code),this.autoConversion||(a="y"+r.currency_code,o.currency_code=r.currency_code,A.push(r.currency_code),i=Object.values(r.entries)),o.yAxisID=a,o.data=i,e.data.datasets.push(o)}for(let n in A)if(A.hasOwnProperty(n)){let a="y"+A[n];e.options.scales.hasOwnProperty(a)||(e.options.scales[a]={id:n,type:"linear",position:parseInt(n)===1?"right":"left",ticks:{callback:function(r,o,i){return f(r,A[n])}}})}return e},loadChart(){if(this.loading!==!0){if(this.loading=!0,H===null){this.getFreshData();return}this.drawChart(this.generateOptions(H)),this.loading=!1}},drawChart(t){if($!==null){$.options=t.options,$.data=t.data,$.update();return}$=new S(document.querySelector("#account-chart"),t)},loadAccounts(){if(this.loadingAccounts===!0)return;if(this.loadingAccounts=!0,this.accountList.length>0){this.loadingAccounts=!1;return}const t=new Date(window.store.get("start")),e=new Date(window.store.get("end")),n=P("dashboard-accounts-data",t,e),a=window.store.get("cacheValid");let r=window.store.get(n);if(a&&typeof r<"u"){this.accountList=r,this.loadingAccounts=!1;return}const o=10;let i=0,l=0,u=[];Promise.all([v("frontpageAccounts")]).then(d=>{i=d[0].length;for(let h in d[0]){let c=d[0];if(c.hasOwnProperty(h)){let _=c[h];new st().get(_,new Date(window.store.get("end"))).then(w=>{let C=w.data.data;const yt={page:1,start:new Date(window.store.get("start")),end:new Date(window.store.get("end"))};new st().transactions(C.id,yt).then(at=>{let nt=[];for(let B=0;B<at.data.data.length&&!(B>=o);B++){let M=at.data.data[B],rt={title:M.attributes.group_title===null?"":M.attributes.group_title,id:M.id,transactions:[]};for(let Y=0;Y<M.attributes.transactions.length;Y++){let k=M.attributes.transactions[Y];const ot=k.type==="withdrawal"?parseFloat(k.native_amount)*-1:parseFloat(k.native_amount),it=k.type==="withdrawal"?parseFloat(k.amount)*-1:parseFloat(k.amount);rt.transactions.push({description:k.description,id:M.id,type:k.type,amount_raw:it,amount:f(it,k.currency_code),native_amount_raw:ot,native_amount:f(ot,k.native_currency_code)})}nt.push(rt)}u.push({name:C.attributes.name,order:C.attributes.order,id:C.id,balance_raw:parseFloat(C.attributes.current_balance),balance:f(C.attributes.current_balance,C.attributes.currency_code),native_balance_raw:parseFloat(C.attributes.native_current_balance),native_balance:f(C.attributes.native_current_balance,C.attributes.native_currency_code),groups:nt}),l++,l===i&&(u.sort((B,M)=>B.order-M.order),this.accountList=u,this.loadingAccounts=!1,window.store.set(n,u))})})}}})},init(){Promise.all([v("viewRange","1M"),v("autoConversion",!1),v("language","en_US")]).then(t=>{this.autoConversion=t[1],J=!0,this.loadChart(),this.loadAccounts()}),window.store.observe("end",()=>{J&&(H=null,this.accountList=[],this.loadChart(),this.loadAccounts())}),window.store.observe("autoConversion",()=>{J&&(this.loadChart(),this.loadAccounts())})}});let zt=class{dashboard(e,n){let a=g(e,"y-MM-dd"),r=g(n,"y-MM-dd");return O.get("/api/v2/chart/budget/dashboard",{params:{start:a,end:r}})}},V=[],T=null,F=null,Z=!1;const Ht=()=>({loading:!1,autoConversion:!1,loadChart(){if(this.loading!==!0){if(this.loading=!0,F!==null){this.drawChart(this.generateOptions(F)),this.loading=!1;return}this.getFreshData()}},drawChart(t){if(T!==null){T.data.datasets=t.data.datasets,T.update();return}T=new S(document.querySelector("#budget-chart"),t)},getFreshData(){const t=new Date(window.store.get("start")),e=new Date(window.store.get("end")),n=P("dashboard-budgets-chart",t,e),a=window.store.get("cacheValid");let r=window.store.get(n);if(a&&typeof r<"u"){F=r,this.drawChart(this.generateOptions(F)),this.loading=!1;return}new zt().dashboard(t,e,null).then(i=>{F=i.data,this.drawChart(this.generateOptions(F)),window.store.set(n,F),this.loading=!1})},generateOptions(t){V=[];let e=N("column");e.options.locale=window.store.get("locale").replace("_","-"),e.options.plugins={tooltip:{callbacks:{title:function(n){return n.label},label:function(n){let a=n.dataset.label||"";return a&&(a+=": "),a+" "+f(n.parsed.y,V[n.parsed.x]??"EUR")}}}},e.data={labels:[],datasets:[{label:p.t("firefly.spent"),data:[],borderWidth:1,stack:1,backgroundColor:j("spent","background"),borderColor:j("spent","border")},{label:p.t("firefly.left"),data:[],borderWidth:1,stack:1,backgroundColor:j("left","background"),borderColor:j("left","border")},{label:p.t("firefly.overspent"),data:[],borderWidth:1,stack:1,backgroundColor:j("overspent","background"),borderColor:j("overspent","border")}]};for(const n in t)if(t.hasOwnProperty(n)){let a=t[n],r=a.label+" ("+a.currency_code+")";e.data.labels.push(r),this.autoConversion&&(V.push(a.native_currency_code),e.data.datasets[0].data.push(parseFloat(a.native_entries.spent)*-1),e.data.datasets[1].data.push(parseFloat(a.native_entries.left)),e.data.datasets[2].data.push(parseFloat(a.native_entries.overspent))),this.autoConversion||(V.push(a.currency_code),e.data.datasets[0].data.push(parseFloat(a.entries.spent)*-1),e.data.datasets[1].data.push(parseFloat(a.entries.left)),e.data.datasets[2].data.push(parseFloat(a.entries.overspent)))}return e.options.scales={y:{ticks:{callback:function(n){return f(n,V[0]??"EUR")}}}},e},init(){Promise.all([v("autoConversion",!1)]).then(t=>{this.autoConversion=t[0],Z=!0,this.loading===!1&&this.loadChart()}),window.store.observe("end",()=>{Z&&this.loading===!1&&(F=null,this.loadChart())}),window.store.observe("autoConversion",t=>{Z&&(this.autoConversion=t,this.loading===!1&&this.loadChart())})}});class Jt{dashboard(e,n){let a=g(e,"y-MM-dd"),r=g(n,"y-MM-dd");return O.get("/api/v2/chart/category/dashboard",{params:{start:a,end:r}})}}let ut=[],K=null,W=null,Q=!1;const Zt=()=>({loading:!1,autoConversion:!1,generateOptions(t){ut=[];let e=N("column"),n={};for(const r in t)if(t.hasOwnProperty(r)){let o=t[r],i=o.currency_code;this.autoConversion&&(i=o.native_currency_code),n.hasOwnProperty(i)||(n[i]={name:i,yAxisID:"",data:{}},ut.push(i))}for(const r in t)if(t.hasOwnProperty(r)){let o=t[r],i=o.currency_code;this.autoConversion&&(i=o.native_currency_code);for(const l in n)if(n.hasOwnProperty(l)){let u=0;i===l&&(u=parseFloat(o.amount),""+o.currency_code,this.autoConversion&&(u=parseFloat(o.native_amount),""+o.native_currency_code)),n[l].data.hasOwnProperty(o.label)&&(n[l].data[o.label]=n[l].data[o.label]+u),n[l].data.hasOwnProperty(o.label)||(n[l].data[o.label]=u)}e.data.labels.includes(o.label)||e.data.labels.push(o.label)}let a=0;for(const r in n){let o="y"+r,i={label:r,currency_code:r,yAxisID:o,data:[]};for(const l in n[r].data)i.data.push(n[r].data[l]);e.data.datasets.push(i),e.options.scales.hasOwnProperty(o)||(e.options.scales[o]={beginAtZero:!0,type:"linear",position:a===1?"right":"left",ticks:{callback:function(l,u,d){return f(l,r)}}},a++)}return e},drawChart(t){if(K!==null){K.options=t.options,K.data=t.data,K.update();return}K=new S(document.querySelector("#category-chart"),t)},getFreshData(){const t=new Date(window.store.get("start")),e=new Date(window.store.get("end")),n=P("dashboard-categories-chart",t,e),a=window.store.get("cacheValid");let r=window.store.get(n);if(a&&typeof r<"u"){W=r,this.drawChart(this.generateOptions(W)),this.loading=!1;return}new Jt().dashboard(t,e,null).then(i=>{W=i.data,this.drawChart(this.generateOptions(i.data)),window.store.set(n,W),this.loading=!1})},loadChart(){if(this.loading!==!0){if(this.loading=!0,W!==null){this.drawChart(this.generateOptions(W)),this.loading=!1;return}this.getFreshData()}},init(){Promise.all([v("autoConversion",!1)]).then(t=>{this.autoConversion=t[0],Q=!0,this.loadChart()}),window.store.observe("end",()=>{Q&&(this.chartData=null,this.loadChart())}),window.store.observe("autoConversion",t=>{Q&&(this.autoConversion=t,this.loadChart())})}});S.register({SankeyController:vt,Flow:mt});const ct="dashboard-sankey-data";let X=!1,R=null,D=[],y=!1,s={category:null,unknown_category:null,in:null,out:null,unknown_source:null,unknown_dest:null,unknown_account:null,expense_account:null,revenue_account:null,budget:null,unknown_budget:null,all_money:null};const dt=function(t){return t.includes(s.revenue_account)?"forestgreen":t.includes("("+s.in+",")?"green":t.includes(s.budget)||t.includes(s.unknown_budget)?"Orchid":t.includes("("+s.out+",")?"MediumOrchid":t.includes(s.all_money)?"blue":"red"};function L(t,e,n,a){if(t==="category"&&e!==null&&n==="in")return s.category+' "'+e+'" ('+s.in+(y?", "+a+")":")");if(t==="category"&&e===null&&n==="in")return s.unknown_category+" ("+s.in+(y?", "+a+")":")");if(t==="category"&&e!==null&&n==="out")return s.category+' "'+e+'" ('+s.out+(y?", "+a+")":")");if(t==="category"&&e===null&&n==="out")return s.unknown_category+" ("+s.out+(y?", "+a+")":")");if(t==="account"&&e===null&&n==="in")return s.unknown_source+(y?" ("+a+")":"");if(t==="account"&&e!==null&&n==="in")return s.revenue_account+'"'+e+'"'+(y?" ("+a+")":"");if(t==="account"&&e===null&&n==="out")return s.unknown_dest+(y?" ("+a+")":"");if(t==="account"&&e!==null&&n==="out")return s.expense_account+' "'+e+'"'+(y?" ("+a+")":"");if(t==="budget"&&e!==null)return s.budget+' "'+e+'"'+(y?" ("+a+")":"");if(t==="budget"&&e===null)return s.unknown_budget+(y?" ("+a+")":"");console.error('Cannot handle: type:"'+t+'", dir: "'+n+'"')}function E(t,e,n){if(t==="category"&&e!==null)return s.category+' "'+e+'"'+(y?" ("+n+")":"");if(t==="category"&&e===null)return s.unknown_category+(y?" ("+n+")":"");if(t==="account"&&e===null)return s.unknown_account+(y?" ("+n+")":"");if(t==="account"&&e!==null)return e+(y?" ("+n+")":"");if(t==="budget"&&e!==null)return s.budget+' "'+e+'"'+(y?" ("+n+")":"");if(t==="budget"&&e===null)return s.unknown_budget+(y?" ("+n+")":"");console.error('Cannot handle: type:"'+t+'"')}const Qt=()=>({loading:!1,autoConversion:!1,generateOptions(){let t=N("sankey"),e={},n={};for(let r in D)if(D.hasOwnProperty(r)){let o=D[r];for(let i in o.attributes.transactions)if(o.attributes.transactions.hasOwnProperty(i)){let l=o.attributes.transactions[i],u=this.autoConversion?l.native_currency_code:l.currency_code,d=this.autoConversion?parseFloat(l.native_amount):parseFloat(l.amount),h;if(l.type==="deposit"){let c=L("category",l.category_name,"in",u),_=L("account",l.source_name,"in",u);n[c]=E("category",l.category_name,u),n[_]=E("account",l.source_name,u),h=_+"-"+c+"-"+u,e.hasOwnProperty(h)||(e[h]={from:_,to:c,amount:0}),e[h].amount+=d,h=c+"-"+s.all_money+"-"+u,e.hasOwnProperty(h)||(e[h]={from:c,to:s.all_money+(this.autoConversion?" ("+u+")":""),amount:0}),e[h].amount+=d}if(l.type==="withdrawal"){let c=L("budget",l.budget_name,"out",u);n[c]=E("budget",l.budget_name,u),h=s.all_money+"-"+c+"-"+u,e.hasOwnProperty(h)||(e[h]={from:s.all_money+(this.autoConversion?" ("+u+")":""),to:c,amount:0}),e[h].amount+=d;let _=L("category",l.category_name,"out",u);n[_]=E("category",l.category_name,u),h=c+"-"+_+"-"+u,e.hasOwnProperty(h)||(e[h]={from:c,to:_,amount:0}),e[h].amount+=d;let w=L("account",l.destination_name,"out",u);n[w]=E("account",l.destination_name,u),h=_+"-"+w+"-"+u,e.hasOwnProperty(h)||(e[h]={from:_,to:w,amount:0}),e[h].amount+=d}}}let a={label:"Firefly III dashboard sankey chart",data:[],colorFrom:r=>dt(r.dataset.data[r.dataIndex]?r.dataset.data[r.dataIndex].from:""),colorTo:r=>dt(r.dataset.data[r.dataIndex]?r.dataset.data[r.dataIndex].to:""),colorMode:"gradient",labels:n,size:"min"};for(let r in e)if(e.hasOwnProperty(r)){let o=e[r];a.data.push({from:o.from,to:o.to,flow:o.amount})}return t.data.datasets.push(a),t},drawChart(t){if(R!==null){R.data.datasets=t.data.datasets,R.update();return}R=new S(document.querySelector("#sankey-chart"),t)},getFreshData(){const t=new Date(window.store.get("start")),e=new Date(window.store.get("end")),n=P(ct,t,e),a=window.store.get("cacheValid");let r=window.store.get(n);if(a&&typeof r<"u"){D=r,this.drawChart(this.generateOptions()),this.loading=!1;return}let o={start:g(t,"y-MM-dd"),end:g(e,"y-MM-dd"),type:"withdrawal,deposit",page:1};this.downloadTransactions(o)},downloadTransactions(t){const e=new Date(window.store.get("start")),n=new Date(window.store.get("end")),a=P(ct,e,n);new $t().list(t).then(o=>{if(D=[...D,...o.data.data],parseInt(o.data.meta.pagination.total_pages)>t.page){t.page++,this.downloadTransactions(t);return}window.store.set(a,D),this.drawChart(this.generateOptions()),this.loading=!1})},loadChart(){if(this.loading!==!0){if(this.loading=!0,D.length!==0){this.drawChart(this.generateOptions()),this.loading=!1;return}this.getFreshData()}},init(){D=[],Promise.all([v("autoConversion",!1)]).then(t=>{this.autoConversion=t[0],y=t[0],s.all_money=p.t("firefly.all_money"),s.category=p.t("firefly.category"),s.in=p.t("firefly.money_flowing_in"),s.out=p.t("firefly.money_flowing_out"),s.unknown_category=p.t("firefly.unknown_category_plain"),s.unknown_source=p.t("firefly.unknown_source_plain"),s.unknown_dest=p.t("firefly.unknown_dest_plain"),s.unknown_account=p.t("firefly.unknown_any_plain"),s.unknown_budget=p.t("firefly.unknown_budget_plain"),s.expense_account=p.t("firefly.expense_account"),s.revenue_account=p.t("firefly.revenue_account"),s.budget=p.t("firefly.budget"),X=!0,this.loadChart()}),window.store.observe("end",()=>{X&&(this.transactions=[],this.loadChart())}),window.store.observe("autoConversion",t=>{X&&(this.autoConversion=t,this.loadChart())})}});let tt=!1,b={};function gt(t){return new Vt().list(t).then(n=>{let a=n.data.data;for(let r in a)if(a.hasOwnProperty(r)){let o=a[r];if(o.attributes.active&&o.attributes.pay_dates.length>0){let i=o.attributes.object_group_id===null?0:o.attributes.object_group_id,l=o.attributes.object_group_title===null?p.t("firefly.default_group_title_name_plain"):o.attributes.object_group_title,u=o.attributes.object_group_order===null?0:o.attributes.object_group_order;b.hasOwnProperty(i)||(b[i]={id:i,title:l,order:u,payment_info:{},bills:[]});let d={id:o.id,name:o.attributes.name,amount_min:o.attributes.amount_min,amount_max:o.attributes.amount_max,amount:(parseFloat(o.attributes.amount_max)+parseFloat(o.attributes.amount_min))/2,currency_code:o.attributes.currency_code,native_amount_min:o.attributes.native_amount_min,native_amount_max:o.attributes.native_amount_max,native_amount:(parseFloat(o.attributes.native_amount_max)+parseFloat(o.attributes.native_amount_min))/2,native_currency_code:o.attributes.native_currency_code,transactions:[],pay_dates:o.attributes.pay_dates,paid:o.attributes.paid_dates.length>0};d.expected_amount=t.autoConversion?f(d.native_amount,d.native_currency_code):f(d.amount,d.currency_code),d.expected_times=p.t("firefly.subscr_expected_x_times",{times:o.attributes.pay_dates.length,amount:d.expected_amount});for(let h in o.attributes.paid_dates)if(o.attributes.paid_dates.hasOwnProperty(h)){const c=o.attributes.paid_dates[h];let _=100;t.autoConversion&&(_=Math.round(-100+parseFloat(c.native_amount)*-1/parseFloat(d.native_amount)*100)),t.autoConversion||(_=Math.round(-100+parseFloat(c.amount)*-1/parseFloat(d.amount)*100));let w={amount:t.autoConversion?f(c.native_amount,c.native_currency_code):f(c.amount,c.currency_code),percentage:_,date:g(new Date(c.date),"PP"),foreign_amount:null};c.foreign_currency_code!==null&&(w.foreign_amount=t.autoConversion?c.foreign_native_amount:c.foreign_amount,w.foreign_currency_code=t.autoConversion?c.native_currency_code:c.foreign_currency_code),d.transactions.push(w)}if(b[i].bills.push(d),o.attributes.paid_dates.length===0){const h=o.attributes.pay_dates.length*d.amount,c=o.attributes.pay_dates.length*d.native_amount;b[i].payment_info.hasOwnProperty(d.currency_code)||(b[i].payment_info[d.currency_code]={currency_code:d.currency_code,paid:0,unpaid:0,native_currency_code:d.native_currency_code,native_paid:0,native_unpaid:0}),b[i].payment_info[d.currency_code].unpaid+=h,b[i].payment_info[d.currency_code].native_unpaid+=c}if(o.attributes.paid_dates.length>0){for(let h in o.attributes.paid_dates)if(o.attributes.paid_dates.hasOwnProperty(h)){let c=o.attributes.paid_dates[h];b[i].payment_info.hasOwnProperty(c.currency_code)||(b[i].payment_info[c.currency_code]={currency_code:d.currency_code,paid:0,unpaid:0,native_currency_code:d.native_currency_code,native_paid:0,native_unpaid:0});const _=parseFloat(c.amount)*-1,w=parseFloat(c.native_amount)*-1;b[i].payment_info[c.currency_code].paid+=_,b[i].payment_info[c.currency_code].native_paid+=w}}}}return parseInt(n.data.meta.pagination.total_pages)>t.page?(t.page++,gt(t)):Promise.resolve()})}const Xt=()=>({loading:!1,autoConversion:!1,subscriptions:[],startSubscriptions(){this.loading=!0;let t=new Date(window.store.get("start")),e=new Date(window.store.get("end"));const n=window.store.get("cacheValid");let a=window.store.get(P("subscriptions-data-dashboard",t,e));n&&typeof a<"u",b={},this.subscriptions=[];let r={start:g(t,"y-MM-dd"),end:g(e,"y-MM-dd"),autoConversion:this.autoConversion,page:1};gt(r).then(()=>{let o=Object.values(b);for(let i in o)if(o.hasOwnProperty(i)){let l=o[i];const u=Object.keys(l.payment_info);l.col_size=u.length===1?"col-6 offset-3":"col-6",l.chart_width=u.length===1?"50%":"100%",l.payment_length=u.length,this.subscriptions.push(l)}this.loading=!1})},drawPieChart(t,e,n){let a="#pie_"+t+"_"+n.currency_code;const r=this.autoConversion?n.native_unpaid:n.unpaid,o=this.autoConversion?n.native_paid:n.paid,i=this.autoConversion?n.native_currency_code:n.currency_code,u={type:"doughnut",data:{labels:[p.t("firefly.paid"),p.t("firefly.unpaid")],datasets:[{label:p.t("firefly.subscriptions_in_group",{title:e}),data:[o,r],backgroundColor:["rgb(54, 162, 235)","rgb(255, 99, 132)"],hoverOffset:4}]},options:{plugins:{tooltip:{callbacks:{label:function(h){return h.dataset.label+": "+f(h.raw,i)}}}}}};var d=S.getChart(document.querySelector(a));typeof d<"u"&&d.destroy(),new S(document.querySelector(a),u)},init(){Promise.all([v("autoConversion",!1)]).then(t=>{this.autoConversion=t[0],tt=!0,this.loading===!1&&this.startSubscriptions()}),window.store.observe("end",()=>{tt&&this.loading===!1&&this.startSubscriptions()}),window.store.observe("autoConversion",t=>{tt&&(this.autoConversion=t,this.loading===!1&&this.startSubscriptions())})}});let x={},et=!1;const ht="dashboard-piggies-data",te=()=>({loading:!1,autoConversion:!1,sankeyGrouping:"account",piggies:[],getFreshData(){const t=new Date(window.store.get("start")),e=new Date(window.store.get("end")),n=P(ht,t,e),a=window.store.get("cacheValid");let r=window.store.get(n);if(a&&typeof r<"u"){x=r,this.parsePiggies(),this.loading=!1;return}let o={start:g(t,"y-MM-dd"),end:g(e,"y-MM-dd"),page:1};this.downloadPiggyBanks(o)},downloadPiggyBanks(t){const e=new Date(window.store.get("start")),n=new Date(window.store.get("end")),a=P(ht,e,n);new Kt().list(t).then(o=>{if(x=[...x,...o.data.data],parseInt(o.data.meta.pagination.total_pages)>t.page){t.page++,this.downloadPiggyBanks(t);return}window.store.set(a,x),this.parsePiggies(),this.loading=!1})},parsePiggies(){let t=[];for(let e in x)if(x.hasOwnProperty(e)){let n=x[e];if(n.attributes.percentage>=100||n.attributes.percentage===0)continue;let a=n.object_group_title??p.t("firefly.default_group_title_name_plain");t.hasOwnProperty(a)||(t[a]={id:n.object_group_id??0,title:a,order:n.object_group_order??0,piggies:[]});let r={id:n.id,name:n.attributes.name,percentage:parseInt(n.attributes.percentage),amount:this.autoConversion?n.attributes.native_current_amount:n.attributes.current_amount,left_to_save:this.autoConversion?n.attributes.native_left_to_save:n.attributes.left_to_save,target_amount:this.autoConversion?n.attributes.native_target_amount:n.attributes.target_amount,save_per_month:this.autoConversion?n.attributes.native_save_per_month:n.attributes.save_per_month,currency_code:this.autoConversion?n.attributes.native_currency_code:n.attributes.currency_code};t[a].piggies.push(r)}this.piggies=Object.values(t)},loadPiggyBanks(){if(this.loading!==!0){if(this.loading=!0,this.piggies.length!==0){this.parsePiggies(),this.loading=!1;return}this.getFreshData()}},init(){x=[],Promise.all([v("autoConversion",!1)]).then(t=>{et=!0,this.autoConversion=t[0],this.loadPiggyBanks()}),window.store.observe("end",()=>{et&&(x=[],this.loadPiggyBanks())}),window.store.observe("autoConversion",t=>{et&&(this.autoConversion=t,this.loadPiggyBanks())})}});S.register({LineController:Ct,LineElement:kt,ArcElement:Pt,BarController:Dt,TimeScale:xt,PieController:Ot,BarElement:Mt,Filler:Ft,Colors:St,LinearScale:At,CategoryScale:Bt,PointElement:jt,Tooltip:Wt,Legend:It});const pt={dates:wt,boxes:Et,accounts:Ut,budgets:Ht,categories:Zt,sankey:Qt,subscriptions:Xt,piggies:te};function _t(t){Object.keys(t).forEach(e=>{let n=t[e]();Alpine.data(e,()=>n)}),Alpine.start()}document.addEventListener("firefly-iii-bootstrapped",()=>{console.log("Loaded through event listener."),_t(pt)});window.bootstrapped&&(console.log("Loaded through window variable."),_t(pt));+import{a as O,f,g as v,P as bt,d as wt}from"./format-money-62afb78b.js";import{f as g,C as m,a as S,i as p,S as vt,F as mt,L as Ct,b as kt,A as Pt,B as Dt,T as xt,P as Ot,c as Mt,d as Ft,p as St,e as At,g as Bt,h as jt,j as Wt,k as It}from"./vendor-2609b2c9.js";import{G as $t}from"./get-ea675e30.js";import{G as Vt,a as Kt}from"./get-5b4283ca.js";class Lt{get(e,n,a){return O.get("/api/v2/summary/basic",{params:{start:e,end:n,code:a}})}}function P(t,e,n){const a=g(e,"y-MM-dd")+"_"+g(n,"y-MM-dd")+"_"+t;return console.log("getCacheKey: "+a),String(a)}let U=!1;const Et=()=>({balanceBox:{amounts:[],subtitles:[]},billBox:{paid:[],unpaid:[]},leftBox:{left:[],perDay:[]},netBox:{net:[]},autoConversion:!1,loading:!1,boxData:null,boxOptions:null,getFreshData(){const t=new Date(window.store.get("start")),e=new Date(window.store.get("end")),n=P("dashboard-boxes-data",t,e),a=window.store.get("cacheValid");let r=window.store.get(n);if(a&&typeof r<"u"){this.boxData=r,this.generateOptions(this.boxData);return}new Lt().get(g(t,"yyyy-MM-dd"),g(e,"yyyy-MM-dd"),null).then(i=>{this.boxData=i.data,window.store.set(n,i.data),this.generateOptions(this.boxData)})},generateOptions(t){this.balanceBox={amounts:[],subtitles:[]},this.billBox={paid:[],unpaid:[]},this.leftBox={left:[],perDay:[]},this.netBox={net:[]};let e={};for(const n in t)if(t.hasOwnProperty(n)){const a=t[n];if(!a.hasOwnProperty("key"))continue;let r=a.key;if(this.autoConversion){if(r.startsWith("balance-in-native")){this.balanceBox.amounts.push(f(a.value,a.currency_code)),e.hasOwnProperty(a.currency_code)||(e[a.currency_code]="");continue}if(r.startsWith("spent-in-native")){e.hasOwnProperty(a.currency_code)||(e[a.currency_code]=""),e[a.currency_code]=e[a.currency_code]+f(a.value,a.currency_code);continue}if(r.startsWith("earned-in-native")){e.hasOwnProperty(a.currency_code)||(e[a.currency_code]=""),e[a.currency_code]=f(a.value,a.currency_code)+" + "+e[a.currency_code];continue}if(r.startsWith("bills-unpaid-in-native")){this.billBox.unpaid.push(f(a.value,a.currency_code));continue}if(r.startsWith("bills-paid-in-native")){this.billBox.paid.push(f(a.value,a.currency_code));continue}if(r.startsWith("left-to-spend-in-native")){this.leftBox.left.push(f(a.value,a.currency_code));continue}if(r.startsWith("left-per-day-to-spend-in-native")){this.leftBox.perDay.push(f(a.value,a.currency_code));continue}if(r.startsWith("net-worth-in-native")){this.netBox.net.push(f(a.value,a.currency_code));continue}}if(!this.autoConversion&&!r.endsWith("native")){if(r.startsWith("balance-in-")){this.balanceBox.amounts.push(f(a.value,a.currency_code));continue}if(r.startsWith("spent-in-")){e.hasOwnProperty(a.currency_code)||(e[a.currency_code]=""),e[a.currency_code]=e[a.currency_code]+f(a.value,a.currency_code);continue}if(r.startsWith("earned-in-")){e.hasOwnProperty(a.currency_code)||(e[a.currency_code]=""),e[a.currency_code]=f(a.value,a.currency_code)+" + "+e[a.currency_code];continue}if(r.startsWith("bills-unpaid-in-")){this.billBox.unpaid.push(f(a.value,a.currency_code));continue}if(r.startsWith("bills-paid-in-")){this.billBox.paid.push(f(a.value,a.currency_code));continue}if(r.startsWith("left-to-spend-in-")){this.leftBox.left.push(f(a.value,a.currency_code));continue}if(r.startsWith("left-per-day-to-spend-in-")){this.leftBox.perDay.push(f(a.value,a.currency_code));continue}r.startsWith("net-worth-in-")&&this.netBox.net.push(f(a.value,a.currency_code))}}for(let n in e)e.hasOwnProperty(n)&&this.balanceBox.subtitles.push(e[n]);this.loading=!1},loadBoxes(){if(this.loading!==!0){if(this.loading=!0,this.boxData===null){this.getFreshData();return}this.generateOptions(this.boxData),this.loading=!1}},init(){Promise.all([v("viewRange"),v("autoConversion",!1)]).then(t=>{U=!0,this.autoConversion=t[1],this.loadBoxes()}),window.store.observe("end",()=>{U&&(this.boxData=null,this.loadBoxes())}),window.store.observe("autoConversion",t=>{U&&(this.autoConversion=t,this.loadBoxes())})}});class Gt{put(e,n){let a="/api/v1/preferences/"+e;return O.put(a,{data:n})}}function Tt(t,e=null){window.store.set(t,e),new Gt().put(t,e).then(a=>{}).catch(()=>{new bt().post(t,e).then(r=>{})})}let Rt=class{dashboard(e,n){let a=g(e,"y-MM-dd"),r=g(n,"y-MM-dd");return O.get("/api/v2/chart/account/dashboard",{params:{start:a,end:r}})}expense(e,n){let a=g(e,"y-MM-dd"),r=g(n,"y-MM-dd");return O.get("/api/v2/chart/account/expense-dashboard",{params:{start:a,end:r}})}};class st{get(e,n){let a={date:g(n,"y-MM-dd").slice(0,10)};return n?O.get("/api/v2/accounts/"+e,{params:a}):O.get("/api/v2/accounts/"+e)}transactions(e,n){const a={page:n.page??1};return n.hasOwnProperty("start")&&(a.start=g(n.start,"y-MM-dd")),n.hasOwnProperty("end")&&(a.end=g(n.end,"y-MM-dd")),O.get("/api/v2/accounts/"+e+"/transactions",{params:a})}}function N(t){return t==="sankey"?{type:"sankey",data:{datasets:[]},options:{animations:!1}}:t==="pie"?{type:"pie",data:{datasets:[]}}:t==="column"?{type:"bar",data:{labels:[],datasets:[]},options:{plugins:{tooltip:{callbacks:{label:function(e){let n=e.dataset.currency_code;return f(e.raw,n)}}}},maintainAspectRatio:!1,scales:{}}}:t==="line"?{options:{plugins:{tooltip:{callbacks:{label:function(e){let n=e.dataset.currency_code;return f(e.raw,n)}}}},maintainAspectRatio:!1,scales:{x:{type:"time",time:{tooltipFormat:"PP"}}}},type:"line",data:{labels:[],datasets:[]}}:{}}let q=new m("#36a2eb"),I=new m("#ff6384"),G=new m("#4bc0c0"),ft=new m("#ff9f40"),qt=new m("#9966ff"),Nt=new m("#ffcd56"),Yt=new m("#c9cbcf"),lt=0;window.theme==="dark"&&(I.darken(.3).desaturate(.3),G.darken(.3).desaturate(.3),q.darken(.3).desaturate(.3),ft.darken(.3).desaturate(.3));let z=[I,ft,q,G,qt,Nt,Yt,G];function j(t,e){let n={borderColor:I.rgbString(),backgroundColor:I.rgbString()},a;switch(t){default:let o=Math.floor(lt/2)%z.length;a=new m(z[o].rgbString()),a.lighten(.38),n={borderColor:z[o].hexString(),backgroundColor:a.hexString()};break;case"spent":a=new m(q.rgbString()),a.lighten(.38),n={borderColor:q.rgbString(),backgroundColor:a.rgbString()};break;case"left":a=new m(G.rgbString()),a.lighten(.38),n={borderColor:G.rgbString(),backgroundColor:a.rgbString()};break;case"overspent":a=new m(I.rgbString()),a.lighten(.22),n={borderColor:I.rgbString(),backgroundColor:a.rgbString()};break}return lt++,e==="border"?n.borderColor:e==="background"?n.backgroundColor:"#FF0000"}let A=[],$=null,H=null,J=!1;const Ut=()=>({loading:!1,loadingAccounts:!1,accountList:[],autoConversion:!1,chartOptions:null,switchAutoConversion(){this.autoConversion=!this.autoConversion,Tt("autoConversion",this.autoConversion)},getFreshData(){const t=new Date(window.store.get("start")),e=new Date(window.store.get("end")),n=P("dashboard-accounts-chart",t,e),a=window.store.get("cacheValid");let r=window.store.get(n);if(a&&typeof r<"u"){console.log(r),this.drawChart(this.generateOptions(r)),this.loading=!1;return}new Rt().dashboard(t,e,null).then(i=>{this.chartData=i.data,window.store.set(n,i.data),console.log(i.data),this.drawChart(this.generateOptions(this.chartData)),this.loading=!1})},generateOptions(t){A=[];let e=N("line");for(let n=0;n<t.length;n++)if(t.hasOwnProperty(n)){let a="y",r=t[n],o={},i=[];n===0&&(e.data.labels=Object.keys(r.entries)),o.label=r.label,this.autoConversion&&(A.push(r.native_currency_code),o.currency_code=r.native_currency_code,i=Object.values(r.native_entries),a="y"+r.native_currency_code),this.autoConversion||(a="y"+r.currency_code,o.currency_code=r.currency_code,A.push(r.currency_code),i=Object.values(r.entries)),o.yAxisID=a,o.data=i,e.data.datasets.push(o)}for(let n in A)if(A.hasOwnProperty(n)){let a="y"+A[n];e.options.scales.hasOwnProperty(a)||(e.options.scales[a]={id:n,type:"linear",position:parseInt(n)===1?"right":"left",ticks:{callback:function(r,o,i){return f(r,A[n])}}})}return e},loadChart(){if(this.loading!==!0){if(this.loading=!0,H===null){this.getFreshData();return}this.drawChart(this.generateOptions(H)),this.loading=!1}},drawChart(t){if($!==null){$.options=t.options,$.data=t.data,$.update();return}$=new S(document.querySelector("#account-chart"),t)},loadAccounts(){if(this.loadingAccounts===!0)return;if(this.loadingAccounts=!0,this.accountList.length>0){this.loadingAccounts=!1;return}const t=new Date(window.store.get("start")),e=new Date(window.store.get("end")),n=P("dashboard-accounts-data",t,e),a=window.store.get("cacheValid");let r=window.store.get(n);if(a&&typeof r<"u"){this.accountList=r,this.loadingAccounts=!1;return}const o=10;let i=0,l=0,u=[];Promise.all([v("frontpageAccounts")]).then(d=>{i=d[0].length;for(let h in d[0]){let c=d[0];if(c.hasOwnProperty(h)){let _=c[h];new st().get(_,new Date(window.store.get("end"))).then(w=>{let C=w.data.data;const yt={page:1,start:new Date(window.store.get("start")),end:new Date(window.store.get("end"))};new st().transactions(C.id,yt).then(at=>{let nt=[];for(let B=0;B<at.data.data.length&&!(B>=o);B++){let M=at.data.data[B],rt={title:M.attributes.group_title===null?"":M.attributes.group_title,id:M.id,transactions:[]};for(let Y=0;Y<M.attributes.transactions.length;Y++){let k=M.attributes.transactions[Y];const ot=k.type==="withdrawal"?parseFloat(k.native_amount)*-1:parseFloat(k.native_amount),it=k.type==="withdrawal"?parseFloat(k.amount)*-1:parseFloat(k.amount);rt.transactions.push({description:k.description,id:M.id,type:k.type,amount_raw:it,amount:f(it,k.currency_code),native_amount_raw:ot,native_amount:f(ot,k.native_currency_code)})}nt.push(rt)}u.push({name:C.attributes.name,order:C.attributes.order,id:C.id,balance_raw:parseFloat(C.attributes.current_balance),balance:f(C.attributes.current_balance,C.attributes.currency_code),native_balance_raw:parseFloat(C.attributes.native_current_balance),native_balance:f(C.attributes.native_current_balance,C.attributes.native_currency_code),groups:nt}),l++,l===i&&(u.sort((B,M)=>B.order-M.order),this.accountList=u,this.loadingAccounts=!1,window.store.set(n,u))})})}}})},init(){Promise.all([v("viewRange","1M"),v("autoConversion",!1),v("language","en_US")]).then(t=>{this.autoConversion=t[1],J=!0,this.loadChart(),this.loadAccounts()}),window.store.observe("end",()=>{J&&(H=null,this.accountList=[],this.loadChart(),this.loadAccounts())}),window.store.observe("autoConversion",()=>{J&&(this.loadChart(),this.loadAccounts())})}});let zt=class{dashboard(e,n){let a=g(e,"y-MM-dd"),r=g(n,"y-MM-dd");return O.get("/api/v2/chart/budget/dashboard",{params:{start:a,end:r}})}},V=[],T=null,F=null,Z=!1;const Ht=()=>({loading:!1,autoConversion:!1,loadChart(){if(this.loading!==!0){if(this.loading=!0,F!==null){this.drawChart(this.generateOptions(F)),this.loading=!1;return}this.getFreshData()}},drawChart(t){if(T!==null){T.data.datasets=t.data.datasets,T.update();return}T=new S(document.querySelector("#budget-chart"),t)},getFreshData(){const t=new Date(window.store.get("start")),e=new Date(window.store.get("end")),n=P("dashboard-budgets-chart",t,e),a=window.store.get("cacheValid");let r=window.store.get(n);if(a&&typeof r<"u"){F=r,this.drawChart(this.generateOptions(F)),this.loading=!1;return}new zt().dashboard(t,e,null).then(i=>{F=i.data,this.drawChart(this.generateOptions(F)),window.store.set(n,F),this.loading=!1})},generateOptions(t){V=[];let e=N("column");e.options.locale=window.store.get("locale").replace("_","-"),e.options.plugins={tooltip:{callbacks:{title:function(n){return n.label},label:function(n){let a=n.dataset.label||"";return a&&(a+=": "),a+" "+f(n.parsed.y,V[n.parsed.x]??"EUR")}}}},e.data={labels:[],datasets:[{label:p.t("firefly.spent"),data:[],borderWidth:1,stack:1,backgroundColor:j("spent","background"),borderColor:j("spent","border")},{label:p.t("firefly.left"),data:[],borderWidth:1,stack:1,backgroundColor:j("left","background"),borderColor:j("left","border")},{label:p.t("firefly.overspent"),data:[],borderWidth:1,stack:1,backgroundColor:j("overspent","background"),borderColor:j("overspent","border")}]};for(const n in t)if(t.hasOwnProperty(n)){let a=t[n],r=a.label+" ("+a.currency_code+")";e.data.labels.push(r),this.autoConversion&&(V.push(a.native_currency_code),e.data.datasets[0].data.push(parseFloat(a.native_entries.spent)*-1),e.data.datasets[1].data.push(parseFloat(a.native_entries.left)),e.data.datasets[2].data.push(parseFloat(a.native_entries.overspent))),this.autoConversion||(V.push(a.currency_code),e.data.datasets[0].data.push(parseFloat(a.entries.spent)*-1),e.data.datasets[1].data.push(parseFloat(a.entries.left)),e.data.datasets[2].data.push(parseFloat(a.entries.overspent)))}return e.options.scales={y:{ticks:{callback:function(n){return f(n,V[0]??"EUR")}}}},e},init(){Promise.all([v("autoConversion",!1)]).then(t=>{this.autoConversion=t[0],Z=!0,this.loading===!1&&this.loadChart()}),window.store.observe("end",()=>{Z&&this.loading===!1&&(F=null,this.loadChart())}),window.store.observe("autoConversion",t=>{Z&&(this.autoConversion=t,this.loading===!1&&this.loadChart())})}});class Jt{dashboard(e,n){let a=g(e,"y-MM-dd"),r=g(n,"y-MM-dd");return O.get("/api/v2/chart/category/dashboard",{params:{start:a,end:r}})}}let ut=[],K=null,W=null,Q=!1;const Zt=()=>({loading:!1,autoConversion:!1,generateOptions(t){ut=[];let e=N("column"),n={};for(const r in t)if(t.hasOwnProperty(r)){let o=t[r],i=o.currency_code;this.autoConversion&&(i=o.native_currency_code),n.hasOwnProperty(i)||(n[i]={name:i,yAxisID:"",data:{}},ut.push(i))}for(const r in t)if(t.hasOwnProperty(r)){let o=t[r],i=o.currency_code;this.autoConversion&&(i=o.native_currency_code);for(const l in n)if(n.hasOwnProperty(l)){let u=0;i===l&&(u=parseFloat(o.amount),""+o.currency_code,this.autoConversion&&(u=parseFloat(o.native_amount),""+o.native_currency_code)),n[l].data.hasOwnProperty(o.label)&&(n[l].data[o.label]=n[l].data[o.label]+u),n[l].data.hasOwnProperty(o.label)||(n[l].data[o.label]=u)}e.data.labels.includes(o.label)||e.data.labels.push(o.label)}let a=0;for(const r in n){let o="y"+r,i={label:r,currency_code:r,yAxisID:o,data:[]};for(const l in n[r].data)i.data.push(n[r].data[l]);e.data.datasets.push(i),e.options.scales.hasOwnProperty(o)||(e.options.scales[o]={beginAtZero:!0,type:"linear",position:a===1?"right":"left",ticks:{callback:function(l,u,d){return f(l,r)}}},a++)}return e},drawChart(t){if(K!==null){K.options=t.options,K.data=t.data,K.update();return}K=new S(document.querySelector("#category-chart"),t)},getFreshData(){const t=new Date(window.store.get("start")),e=new Date(window.store.get("end")),n=P("dashboard-categories-chart",t,e),a=window.store.get("cacheValid");let r=window.store.get(n);if(a&&typeof r<"u"){W=r,this.drawChart(this.generateOptions(W)),this.loading=!1;return}new Jt().dashboard(t,e,null).then(i=>{W=i.data,this.drawChart(this.generateOptions(i.data)),window.store.set(n,W),this.loading=!1})},loadChart(){if(this.loading!==!0){if(this.loading=!0,W!==null){this.drawChart(this.generateOptions(W)),this.loading=!1;return}this.getFreshData()}},init(){Promise.all([v("autoConversion",!1)]).then(t=>{this.autoConversion=t[0],Q=!0,this.loadChart()}),window.store.observe("end",()=>{Q&&(this.chartData=null,this.loadChart())}),window.store.observe("autoConversion",t=>{Q&&(this.autoConversion=t,this.loadChart())})}});S.register({SankeyController:vt,Flow:mt});const ct="dashboard-sankey-data";let X=!1,R=null,D=[],y=!1,s={category:null,unknown_category:null,in:null,out:null,unknown_source:null,unknown_dest:null,unknown_account:null,expense_account:null,revenue_account:null,budget:null,unknown_budget:null,all_money:null};const dt=function(t){return t.includes(s.revenue_account)?"forestgreen":t.includes("("+s.in+",")?"green":t.includes(s.budget)||t.includes(s.unknown_budget)?"Orchid":t.includes("("+s.out+",")?"MediumOrchid":t.includes(s.all_money)?"blue":"red"};function L(t,e,n,a){if(t==="category"&&e!==null&&n==="in")return s.category+' "'+e+'" ('+s.in+(y?", "+a+")":")");if(t==="category"&&e===null&&n==="in")return s.unknown_category+" ("+s.in+(y?", "+a+")":")");if(t==="category"&&e!==null&&n==="out")return s.category+' "'+e+'" ('+s.out+(y?", "+a+")":")");if(t==="category"&&e===null&&n==="out")return s.unknown_category+" ("+s.out+(y?", "+a+")":")");if(t==="account"&&e===null&&n==="in")return s.unknown_source+(y?" ("+a+")":"");if(t==="account"&&e!==null&&n==="in")return s.revenue_account+'"'+e+'"'+(y?" ("+a+")":"");if(t==="account"&&e===null&&n==="out")return s.unknown_dest+(y?" ("+a+")":"");if(t==="account"&&e!==null&&n==="out")return s.expense_account+' "'+e+'"'+(y?" ("+a+")":"");if(t==="budget"&&e!==null)return s.budget+' "'+e+'"'+(y?" ("+a+")":"");if(t==="budget"&&e===null)return s.unknown_budget+(y?" ("+a+")":"");console.error('Cannot handle: type:"'+t+'", dir: "'+n+'"')}function E(t,e,n){if(t==="category"&&e!==null)return s.category+' "'+e+'"'+(y?" ("+n+")":"");if(t==="category"&&e===null)return s.unknown_category+(y?" ("+n+")":"");if(t==="account"&&e===null)return s.unknown_account+(y?" ("+n+")":"");if(t==="account"&&e!==null)return e+(y?" ("+n+")":"");if(t==="budget"&&e!==null)return s.budget+' "'+e+'"'+(y?" ("+n+")":"");if(t==="budget"&&e===null)return s.unknown_budget+(y?" ("+n+")":"");console.error('Cannot handle: type:"'+t+'"')}const Qt=()=>({loading:!1,autoConversion:!1,generateOptions(){let t=N("sankey"),e={},n={};for(let r in D)if(D.hasOwnProperty(r)){let o=D[r];for(let i in o.attributes.transactions)if(o.attributes.transactions.hasOwnProperty(i)){let l=o.attributes.transactions[i],u=this.autoConversion?l.native_currency_code:l.currency_code,d=this.autoConversion?parseFloat(l.native_amount):parseFloat(l.amount),h;if(l.type==="deposit"){let c=L("category",l.category_name,"in",u),_=L("account",l.source_name,"in",u);n[c]=E("category",l.category_name,u),n[_]=E("account",l.source_name,u),h=_+"-"+c+"-"+u,e.hasOwnProperty(h)||(e[h]={from:_,to:c,amount:0}),e[h].amount+=d,h=c+"-"+s.all_money+"-"+u,e.hasOwnProperty(h)||(e[h]={from:c,to:s.all_money+(this.autoConversion?" ("+u+")":""),amount:0}),e[h].amount+=d}if(l.type==="withdrawal"){let c=L("budget",l.budget_name,"out",u);n[c]=E("budget",l.budget_name,u),h=s.all_money+"-"+c+"-"+u,e.hasOwnProperty(h)||(e[h]={from:s.all_money+(this.autoConversion?" ("+u+")":""),to:c,amount:0}),e[h].amount+=d;let _=L("category",l.category_name,"out",u);n[_]=E("category",l.category_name,u),h=c+"-"+_+"-"+u,e.hasOwnProperty(h)||(e[h]={from:c,to:_,amount:0}),e[h].amount+=d;let w=L("account",l.destination_name,"out",u);n[w]=E("account",l.destination_name,u),h=_+"-"+w+"-"+u,e.hasOwnProperty(h)||(e[h]={from:_,to:w,amount:0}),e[h].amount+=d}}}let a={label:"Firefly III dashboard sankey chart",data:[],colorFrom:r=>dt(r.dataset.data[r.dataIndex]?r.dataset.data[r.dataIndex].from:""),colorTo:r=>dt(r.dataset.data[r.dataIndex]?r.dataset.data[r.dataIndex].to:""),colorMode:"gradient",labels:n,size:"min"};for(let r in e)if(e.hasOwnProperty(r)){let o=e[r];a.data.push({from:o.from,to:o.to,flow:o.amount})}return t.data.datasets.push(a),t},drawChart(t){if(R!==null){R.data.datasets=t.data.datasets,R.update();return}R=new S(document.querySelector("#sankey-chart"),t)},getFreshData(){const t=new Date(window.store.get("start")),e=new Date(window.store.get("end")),n=P(ct,t,e),a=window.store.get("cacheValid");let r=window.store.get(n);if(a&&typeof r<"u"){D=r,this.drawChart(this.generateOptions()),this.loading=!1;return}let o={start:g(t,"y-MM-dd"),end:g(e,"y-MM-dd"),type:"withdrawal,deposit",page:1};this.downloadTransactions(o)},downloadTransactions(t){const e=new Date(window.store.get("start")),n=new Date(window.store.get("end")),a=P(ct,e,n);new $t().list(t).then(o=>{if(D=[...D,...o.data.data],parseInt(o.data.meta.pagination.total_pages)>t.page){t.page++,this.downloadTransactions(t);return}window.store.set(a,D),this.drawChart(this.generateOptions()),this.loading=!1})},loadChart(){if(this.loading!==!0){if(this.loading=!0,D.length!==0){this.drawChart(this.generateOptions()),this.loading=!1;return}this.getFreshData()}},init(){D=[],Promise.all([v("autoConversion",!1)]).then(t=>{this.autoConversion=t[0],y=t[0],s.all_money=p.t("firefly.all_money"),s.category=p.t("firefly.category"),s.in=p.t("firefly.money_flowing_in"),s.out=p.t("firefly.money_flowing_out"),s.unknown_category=p.t("firefly.unknown_category_plain"),s.unknown_source=p.t("firefly.unknown_source_plain"),s.unknown_dest=p.t("firefly.unknown_dest_plain"),s.unknown_account=p.t("firefly.unknown_any_plain"),s.unknown_budget=p.t("firefly.unknown_budget_plain"),s.expense_account=p.t("firefly.expense_account"),s.revenue_account=p.t("firefly.revenue_account"),s.budget=p.t("firefly.budget"),X=!0,this.loadChart()}),window.store.observe("end",()=>{X&&(this.transactions=[],this.loadChart())}),window.store.observe("autoConversion",t=>{X&&(this.autoConversion=t,this.loadChart())})}});let tt=!1,b={};function gt(t){return new Vt().list(t).then(n=>{let a=n.data.data;for(let r in a)if(a.hasOwnProperty(r)){let o=a[r];if(o.attributes.active&&o.attributes.pay_dates.length>0){let i=o.attributes.object_group_id===null?0:o.attributes.object_group_id,l=o.attributes.object_group_title===null?p.t("firefly.default_group_title_name_plain"):o.attributes.object_group_title,u=o.attributes.object_group_order===null?0:o.attributes.object_group_order;b.hasOwnProperty(i)||(b[i]={id:i,title:l,order:u,payment_info:{},bills:[]});let d={id:o.id,name:o.attributes.name,amount_min:o.attributes.amount_min,amount_max:o.attributes.amount_max,amount:(parseFloat(o.attributes.amount_max)+parseFloat(o.attributes.amount_min))/2,currency_code:o.attributes.currency_code,native_amount_min:o.attributes.native_amount_min,native_amount_max:o.attributes.native_amount_max,native_amount:(parseFloat(o.attributes.native_amount_max)+parseFloat(o.attributes.native_amount_min))/2,native_currency_code:o.attributes.native_currency_code,transactions:[],pay_dates:o.attributes.pay_dates,paid:o.attributes.paid_dates.length>0};d.expected_amount=t.autoConversion?f(d.native_amount,d.native_currency_code):f(d.amount,d.currency_code),d.expected_times=p.t("firefly.subscr_expected_x_times",{times:o.attributes.pay_dates.length,amount:d.expected_amount});for(let h in o.attributes.paid_dates)if(o.attributes.paid_dates.hasOwnProperty(h)){const c=o.attributes.paid_dates[h];let _=100;t.autoConversion&&(_=Math.round(-100+parseFloat(c.native_amount)*-1/parseFloat(d.native_amount)*100)),t.autoConversion||(_=Math.round(-100+parseFloat(c.amount)*-1/parseFloat(d.amount)*100));let w={amount:t.autoConversion?f(c.native_amount,c.native_currency_code):f(c.amount,c.currency_code),percentage:_,date:g(new Date(c.date),"PP"),foreign_amount:null};c.foreign_currency_code!==null&&(w.foreign_amount=t.autoConversion?c.foreign_native_amount:c.foreign_amount,w.foreign_currency_code=t.autoConversion?c.native_currency_code:c.foreign_currency_code),d.transactions.push(w)}if(b[i].bills.push(d),o.attributes.paid_dates.length===0){const h=o.attributes.pay_dates.length*d.amount,c=o.attributes.pay_dates.length*d.native_amount;b[i].payment_info.hasOwnProperty(d.currency_code)||(b[i].payment_info[d.currency_code]={currency_code:d.currency_code,paid:0,unpaid:0,native_currency_code:d.native_currency_code,native_paid:0,native_unpaid:0}),b[i].payment_info[d.currency_code].unpaid+=h,b[i].payment_info[d.currency_code].native_unpaid+=c}if(o.attributes.paid_dates.length>0){for(let h in o.attributes.paid_dates)if(o.attributes.paid_dates.hasOwnProperty(h)){let c=o.attributes.paid_dates[h];b[i].payment_info.hasOwnProperty(c.currency_code)||(b[i].payment_info[c.currency_code]={currency_code:d.currency_code,paid:0,unpaid:0,native_currency_code:d.native_currency_code,native_paid:0,native_unpaid:0});const _=parseFloat(c.amount)*-1,w=parseFloat(c.native_amount)*-1;b[i].payment_info[c.currency_code].paid+=_,b[i].payment_info[c.currency_code].native_paid+=w}}}}return parseInt(n.data.meta.pagination.total_pages)>t.page?(t.page++,gt(t)):Promise.resolve()})}const Xt=()=>({loading:!1,autoConversion:!1,subscriptions:[],startSubscriptions(){this.loading=!0;let t=new Date(window.store.get("start")),e=new Date(window.store.get("end"));const n=window.store.get("cacheValid");let a=window.store.get(P("subscriptions-data-dashboard",t,e));n&&typeof a<"u",b={},this.subscriptions=[];let r={start:g(t,"y-MM-dd"),end:g(e,"y-MM-dd"),autoConversion:this.autoConversion,page:1};gt(r).then(()=>{let o=Object.values(b);for(let i in o)if(o.hasOwnProperty(i)){let l=o[i];const u=Object.keys(l.payment_info);l.col_size=u.length===1?"col-6 offset-3":"col-6",l.chart_width=u.length===1?"50%":"100%",l.payment_length=u.length,this.subscriptions.push(l)}this.loading=!1})},drawPieChart(t,e,n){let a="#pie_"+t+"_"+n.currency_code;const r=this.autoConversion?n.native_unpaid:n.unpaid,o=this.autoConversion?n.native_paid:n.paid,i=this.autoConversion?n.native_currency_code:n.currency_code,u={type:"doughnut",data:{labels:[p.t("firefly.paid"),p.t("firefly.unpaid")],datasets:[{label:p.t("firefly.subscriptions_in_group",{title:e}),data:[o,r],backgroundColor:["rgb(54, 162, 235)","rgb(255, 99, 132)"],hoverOffset:4}]},options:{plugins:{tooltip:{callbacks:{label:function(h){return h.dataset.label+": "+f(h.raw,i)}}}}}};var d=S.getChart(document.querySelector(a));typeof d<"u"&&d.destroy(),new S(document.querySelector(a),u)},init(){Promise.all([v("autoConversion",!1)]).then(t=>{this.autoConversion=t[0],tt=!0,this.loading===!1&&this.startSubscriptions()}),window.store.observe("end",()=>{tt&&this.loading===!1&&this.startSubscriptions()}),window.store.observe("autoConversion",t=>{tt&&(this.autoConversion=t,this.loading===!1&&this.startSubscriptions())})}});let x={},et=!1;const ht="dashboard-piggies-data",te=()=>({loading:!1,autoConversion:!1,sankeyGrouping:"account",piggies:[],getFreshData(){const t=new Date(window.store.get("start")),e=new Date(window.store.get("end")),n=P(ht,t,e),a=window.store.get("cacheValid");let r=window.store.get(n);if(a&&typeof r<"u"){x=r,this.parsePiggies(),this.loading=!1;return}let o={start:g(t,"y-MM-dd"),end:g(e,"y-MM-dd"),page:1};this.downloadPiggyBanks(o)},downloadPiggyBanks(t){const e=new Date(window.store.get("start")),n=new Date(window.store.get("end")),a=P(ht,e,n);new Kt().list(t).then(o=>{if(x=[...x,...o.data.data],parseInt(o.data.meta.pagination.total_pages)>t.page){t.page++,this.downloadPiggyBanks(t);return}window.store.set(a,x),this.parsePiggies(),this.loading=!1})},parsePiggies(){let t=[];for(let e in x)if(x.hasOwnProperty(e)){let n=x[e];if(n.attributes.percentage>=100||n.attributes.percentage===0)continue;let a=n.object_group_title??p.t("firefly.default_group_title_name_plain");t.hasOwnProperty(a)||(t[a]={id:n.object_group_id??0,title:a,order:n.object_group_order??0,piggies:[]});let r={id:n.id,name:n.attributes.name,percentage:parseInt(n.attributes.percentage),amount:this.autoConversion?n.attributes.native_current_amount:n.attributes.current_amount,left_to_save:this.autoConversion?n.attributes.native_left_to_save:n.attributes.left_to_save,target_amount:this.autoConversion?n.attributes.native_target_amount:n.attributes.target_amount,save_per_month:this.autoConversion?n.attributes.native_save_per_month:n.attributes.save_per_month,currency_code:this.autoConversion?n.attributes.native_currency_code:n.attributes.currency_code};t[a].piggies.push(r)}this.piggies=Object.values(t)},loadPiggyBanks(){if(this.loading!==!0){if(this.loading=!0,this.piggies.length!==0){this.parsePiggies(),this.loading=!1;return}this.getFreshData()}},init(){x=[],Promise.all([v("autoConversion",!1)]).then(t=>{et=!0,this.autoConversion=t[0],this.loadPiggyBanks()}),window.store.observe("end",()=>{et&&(x=[],this.loadPiggyBanks())}),window.store.observe("autoConversion",t=>{et&&(this.autoConversion=t,this.loadPiggyBanks())})}});S.register({LineController:Ct,LineElement:kt,ArcElement:Pt,BarController:Dt,TimeScale:xt,PieController:Ot,BarElement:Mt,Filler:Ft,Colors:St,LinearScale:At,CategoryScale:Bt,PointElement:jt,Tooltip:Wt,Legend:It});const pt={dates:wt,boxes:Et,accounts:Ut,budgets:Ht,categories:Zt,sankey:Qt,subscriptions:Xt,piggies:te};function _t(t){Object.keys(t).forEach(e=>{let n=t[e]();Alpine.data(e,()=>n)}),Alpine.start()}document.addEventListener("firefly-iii-bootstrapped",()=>{console.log("Loaded through event listener."),_t(pt)});window.bootstrapped&&(console.log("Loaded through window variable."),_t(pt));diff --git a/public/build/assets/edit-a939c15a.js b/public/build/assets/edit-a6845b23.jssimilarity index 94%rename from public/build/assets/edit-a939c15a.jsrename to public/build/assets/edit-a6845b23.jsindex ea2f06a58f..aa5994e12e 100644--- a/public/build/assets/edit-a939c15a.js+++ b/public/build/assets/edit-a6845b23.js@@ -1 +1 @@-import{d as p,f as l}from"./format-money-03f73825.js";import{G as f}from"./get-10f1237b.js";import{p as g}from"./parse-downloaded-splits-fb2d62df.js";import{p as m,d as w,e as a,f as y,g as b,h as P,i as S,l as v,a as C,b as A,c as _,s as E,j as D,k as c,m as u}from"./splice-errors-into-transactions-e53c1920.js";import{i as o,m as T}from"./vendor-cc723e37.js";import{d as x}from"./create-empty-split-d82bb341.js";import{P as B}from"./put-d747f13c.js";import"./get-7f8692a5.js";const n=D();let L=function(){return{entries:[],originals:[],formStates:{loadingCurrencies:!0,loadingBudgets:!0,loadingPiggyBanks:!0,loadingSubscriptions:!0,isSubmitting:!1,returnHereButton:!1,saveAsNewButton:!1,resetButton:!0,rulesButton:!0,webhooksButton:!0},formBehaviour:{formType:"edit",foreignCurrencyEnabled:!0},formData:{defaultCurrency:null,enabledCurrencies:[],nativeCurrencies:[],foreignCurrencies:[],budgets:[],piggyBanks:[],subscriptions:[]},groupProperties:{transactionType:"unknown",title:null,editTitle:null,id:null,totalAmount:0},notifications:{error:{show:!1,text:"",url:""},success:{show:!1,text:"",url:""},wait:{show:!1,text:""}},submitTransaction(){this.notifications.error.show=!1,this.notifications.success.show=!1,this.notifications.wait.show=!1;for(let e in this.entries)this.entries.hasOwnProperty(e)&&(this.entries[e].errors=x());this.formStates.isSubmitting=!0;let t=m(this.entries,this.originals,this.groupProperties.transactionType),s={group_title:this.groupProperties.editTitle,fire_webhooks:this.formStates.webhooksButton,apply_rules:this.formStates.rulesButton,transactions:t};this.groupProperties.title===null&&t.length>1&&(s.group_title=t[0].description);let r=new B;console.log(s),r.put(s,{id:this.groupProperties.id}).then(e=>{const i=e.data.data;if(this.groupProperties.id=parseInt(i.id),this.groupProperties.title=i.attributes.group_title??i.attributes.transactions[0].description,w(this.groupProperties.id,i.attributes.transactions)>0){this.notifications.wait.show=!0,this.notifications.wait.text=o.t("firefly.wait_attachments");return}this.showMessageOrRedirectUser()}).catch(e=>{this.submitting=!1,console.log(e),typeof e.response<"u"&&this.parseErrors(e.response.data)})},filters:{source:[],destination:[]},addedSplit(){setTimeout(()=>{const t=function(s,r,e){return s.name_with_balance+'<br><small class="text-muted">'+o.t("firefly.account_type_"+s.type)+"</small>"};a({selector:"input.ac-source",serverUrl:n.account,filters:this.filters.source,onRenderItem:t,onChange:y,onSelectItem:b}),a({selector:"input.ac-dest",serverUrl:n.account,filters:this.filters.destination,onRenderItem:t,onChange:P,onSelectItem:S}),a({selector:"input.ac-category",serverUrl:n.category,valueField:"id",labelField:"name",onChange:c,onSelectItem:c}),a({selector:"input.ac-description",serverUrl:n.description,valueField:"id",labelField:"description",onChange:u,onSelectItem:u})},250)},changedDateTime(t){console.warn("changedDateTime, event is not used")},changedDescription(t){console.warn("changedDescription, event is not used")},changedDestinationAccount(t){console.warn("changedDestinationAccount, event is not used")},changedSourceAccount(t){console.warn("changedSourceAccount, event is not used")},formattedTotalAmount(){return this.entries.length===0?l(this.groupProperties.totalAmount,"EUR"):l(this.groupProperties.totalAmount,this.entries[0].currency_code??"EUR")},getTags(t){return console.log("at get tags "+t),console.log(this.entries[t].tags),this.entries[t].tags??[]},getTransactionGroup(){this.entries=[];const t=window.location.href.split("/"),s=parseInt(t[t.length-1]);new f().show(s,{}).then(e=>{const i=e.data.data;this.groupProperties.id=parseInt(i.id),this.groupProperties.transactionType=i.attributes.transactions[0].type.toLowerCase(),this.groupProperties.title=i.attributes.title??i.attributes.transactions[0].description,this.entries=g(i.attributes.transactions,parseInt(i.id)),this.notifications.wait.show=!1}).then(()=>{this.groupProperties.totalAmount=0;for(let e in this.entries)this.entries.hasOwnProperty(e)&&(this.groupProperties.totalAmount=this.groupProperties.totalAmount+parseFloat(this.entries[e].amount),this.filters.source.push(this.entries[e].source_account.type),this.filters.destination.push(this.entries[e].destination_account.type));console.log(this.filters),setTimeout(()=>{T.init("select.ac-tags",{allowClear:!0,server:n.tag,liveServer:!0,clearEnd:!0,allowNew:!0,notFoundMessage:o.t("firefly.nothing_found"),noCache:!0,fetchOptions:{headers:{"X-CSRF-TOKEN":document.head.querySelector('meta[name="csrf-token"]').content}}})},150)})},init(){this.notifications.wait.show=!0,this.notifications.wait.text=o.t("firefly.wait_loading_transaction"),this.getTransactionGroup(),v().then(t=>{this.formStates.loadingCurrencies=!1,this.formData.defaultCurrency=t.defaultCurrency,this.formData.enabledCurrencies=t.enabledCurrencies,this.formData.nativeCurrencies=t.nativeCurrencies,this.formData.foreignCurrencies=t.foreignCurrencies}),C().then(t=>{this.formData.budgets=t,this.formStates.loadingBudgets=!1}),A().then(t=>{this.formData.piggyBanks=t,this.formStates.loadingPiggyBanks=!1}),_().then(t=>{this.formData.subscriptions=t,this.formStates.loadingSubscriptions=!1}),document.addEventListener("upload-success",t=>{this.processUpload(t),document.querySelectorAll("input[type=file]").value=""}),document.addEventListener("upload-error",t=>{this.processUploadError(t)}),document.addEventListener("location-move",t=>{this.entries[t.detail.index].latitude=t.detail.latitude,this.entries[t.detail.index].longitude=t.detail.longitude}),document.addEventListener("location-set",t=>{this.entries[t.detail.index].hasLocation=!0,this.entries[t.detail.index].latitude=t.detail.latitude,this.entries[t.detail.index].longitude=t.detail.longitude,this.entries[t.detail.index].zoomLevel=t.detail.zoomLevel}),document.addEventListener("location-zoom",t=>{this.entries[t.detail.index].hasLocation=!0,this.entries[t.detail.index].zoomLevel=t.detail.zoomLevel})},changedAmount(t){const s=parseInt(t.target.dataset.index);this.entries[s].amount=parseFloat(t.target.value),this.groupProperties.totalAmount=0;for(let r in this.entries)this.entries.hasOwnProperty(r)&&(this.groupProperties.totalAmount=this.groupProperties.totalAmount+parseFloat(this.entries[r].amount))},showMessageOrRedirectUser(){if(this.notifications.error.show=!1,this.notifications.success.show=!1,this.notifications.wait.show=!1,this.formStates.returnHereButton){this.notifications.success.show=!0,this.notifications.success.url="transactions/show/"+this.groupProperties.id,this.notifications.success.text=o.t("firefly.updated_journal_js",{description:this.groupProperties.title});return}window.location="transactions/show/"+this.groupProperties.id+"?transaction_group_id="+this.groupProperties.id+"&message=updated"},parseErrors(t){this.notifications.error.show=!0,this.notifications.success.show=!1,this.notifications.wait.show=!1,this.formStates.isSubmitting=!1,this.notifications.error.text=o.t("firefly.errors_submission_v2",{errorMessage:t.message}),t.hasOwnProperty("errors")&&(this.entries=E(t.errors,this.entries))},processUpload(t){this.showMessageOrRedirectUser()},processUploadError(t){this.notifications.success.show=!1,this.notifications.wait.show=!1,this.notifications.error.show=!0,this.formStates.isSubmitting=!1,this.notifications.error.text=o.t("firefly.errors_upload"),console.error(t)}}},h={transactions:L,dates:p};function d(){Object.keys(h).forEach(t=>{console.log(`Loading page component "${t}"`);let s=h[t]();Alpine.data(t,()=>s)}),Alpine.start()}document.addEventListener("firefly-iii-bootstrapped",()=>{console.log("Loaded through event listener."),d()});window.bootstrapped&&(console.log("Loaded through window variable."),d());+import{d as p,f as l}from"./format-money-62afb78b.js";import{G as f}from"./get-ea675e30.js";import{p as g}from"./parse-downloaded-splits-6b9adc20.js";import{p as m,d as w,e as a,f as y,g as b,h as P,i as S,l as v,a as C,b as A,c as _,s as E,j as D,k as c,m as u}from"./splice-errors-into-transactions-528a3749.js";import{i as o,m as T}from"./vendor-2609b2c9.js";import{d as x}from"./create-empty-split-aae839d5.js";import{P as B}from"./put-c9d3942f.js";import"./get-5b4283ca.js";const n=D();let L=function(){return{entries:[],originals:[],formStates:{loadingCurrencies:!0,loadingBudgets:!0,loadingPiggyBanks:!0,loadingSubscriptions:!0,isSubmitting:!1,returnHereButton:!1,saveAsNewButton:!1,resetButton:!0,rulesButton:!0,webhooksButton:!0},formBehaviour:{formType:"edit",foreignCurrencyEnabled:!0},formData:{defaultCurrency:null,enabledCurrencies:[],nativeCurrencies:[],foreignCurrencies:[],budgets:[],piggyBanks:[],subscriptions:[]},groupProperties:{transactionType:"unknown",title:null,editTitle:null,id:null,totalAmount:0},notifications:{error:{show:!1,text:"",url:""},success:{show:!1,text:"",url:""},wait:{show:!1,text:""}},submitTransaction(){this.notifications.error.show=!1,this.notifications.success.show=!1,this.notifications.wait.show=!1;for(let e in this.entries)this.entries.hasOwnProperty(e)&&(this.entries[e].errors=x());this.formStates.isSubmitting=!0;let t=m(this.entries,this.originals,this.groupProperties.transactionType),s={group_title:this.groupProperties.editTitle,fire_webhooks:this.formStates.webhooksButton,apply_rules:this.formStates.rulesButton,transactions:t};this.groupProperties.title===null&&t.length>1&&(s.group_title=t[0].description);let r=new B;console.log(s),r.put(s,{id:this.groupProperties.id}).then(e=>{const i=e.data.data;if(this.groupProperties.id=parseInt(i.id),this.groupProperties.title=i.attributes.group_title??i.attributes.transactions[0].description,w(this.groupProperties.id,i.attributes.transactions)>0){this.notifications.wait.show=!0,this.notifications.wait.text=o.t("firefly.wait_attachments");return}this.showMessageOrRedirectUser()}).catch(e=>{this.submitting=!1,console.log(e),typeof e.response<"u"&&this.parseErrors(e.response.data)})},filters:{source:[],destination:[]},addedSplit(){setTimeout(()=>{const t=function(s,r,e){return s.name_with_balance+'<br><small class="text-muted">'+o.t("firefly.account_type_"+s.type)+"</small>"};a({selector:"input.ac-source",serverUrl:n.account,filters:this.filters.source,onRenderItem:t,onChange:y,onSelectItem:b}),a({selector:"input.ac-dest",serverUrl:n.account,filters:this.filters.destination,onRenderItem:t,onChange:P,onSelectItem:S}),a({selector:"input.ac-category",serverUrl:n.category,valueField:"id",labelField:"name",onChange:c,onSelectItem:c}),a({selector:"input.ac-description",serverUrl:n.description,valueField:"id",labelField:"description",onChange:u,onSelectItem:u})},250)},changedDateTime(t){console.warn("changedDateTime, event is not used")},changedDescription(t){console.warn("changedDescription, event is not used")},changedDestinationAccount(t){console.warn("changedDestinationAccount, event is not used")},changedSourceAccount(t){console.warn("changedSourceAccount, event is not used")},formattedTotalAmount(){return this.entries.length===0?l(this.groupProperties.totalAmount,"EUR"):l(this.groupProperties.totalAmount,this.entries[0].currency_code??"EUR")},getTags(t){return console.log("at get tags "+t),console.log(this.entries[t].tags),this.entries[t].tags??[]},getTransactionGroup(){this.entries=[];const t=window.location.href.split("/"),s=parseInt(t[t.length-1]);new f().show(s,{}).then(e=>{const i=e.data.data;this.groupProperties.id=parseInt(i.id),this.groupProperties.transactionType=i.attributes.transactions[0].type.toLowerCase(),this.groupProperties.title=i.attributes.title??i.attributes.transactions[0].description,this.entries=g(i.attributes.transactions,parseInt(i.id)),this.notifications.wait.show=!1}).then(()=>{this.groupProperties.totalAmount=0;for(let e in this.entries)this.entries.hasOwnProperty(e)&&(this.groupProperties.totalAmount=this.groupProperties.totalAmount+parseFloat(this.entries[e].amount),this.filters.source.push(this.entries[e].source_account.type),this.filters.destination.push(this.entries[e].destination_account.type));console.log(this.filters),setTimeout(()=>{T.init("select.ac-tags",{allowClear:!0,server:n.tag,liveServer:!0,clearEnd:!0,allowNew:!0,notFoundMessage:o.t("firefly.nothing_found"),noCache:!0,fetchOptions:{headers:{"X-CSRF-TOKEN":document.head.querySelector('meta[name="csrf-token"]').content}}})},150)})},init(){this.notifications.wait.show=!0,this.notifications.wait.text=o.t("firefly.wait_loading_transaction"),this.getTransactionGroup(),v().then(t=>{this.formStates.loadingCurrencies=!1,this.formData.defaultCurrency=t.defaultCurrency,this.formData.enabledCurrencies=t.enabledCurrencies,this.formData.nativeCurrencies=t.nativeCurrencies,this.formData.foreignCurrencies=t.foreignCurrencies}),C().then(t=>{this.formData.budgets=t,this.formStates.loadingBudgets=!1}),A().then(t=>{this.formData.piggyBanks=t,this.formStates.loadingPiggyBanks=!1}),_().then(t=>{this.formData.subscriptions=t,this.formStates.loadingSubscriptions=!1}),document.addEventListener("upload-success",t=>{this.processUpload(t),document.querySelectorAll("input[type=file]").value=""}),document.addEventListener("upload-error",t=>{this.processUploadError(t)}),document.addEventListener("location-move",t=>{this.entries[t.detail.index].latitude=t.detail.latitude,this.entries[t.detail.index].longitude=t.detail.longitude}),document.addEventListener("location-set",t=>{this.entries[t.detail.index].hasLocation=!0,this.entries[t.detail.index].latitude=t.detail.latitude,this.entries[t.detail.index].longitude=t.detail.longitude,this.entries[t.detail.index].zoomLevel=t.detail.zoomLevel}),document.addEventListener("location-zoom",t=>{this.entries[t.detail.index].hasLocation=!0,this.entries[t.detail.index].zoomLevel=t.detail.zoomLevel})},changedAmount(t){const s=parseInt(t.target.dataset.index);this.entries[s].amount=parseFloat(t.target.value),this.groupProperties.totalAmount=0;for(let r in this.entries)this.entries.hasOwnProperty(r)&&(this.groupProperties.totalAmount=this.groupProperties.totalAmount+parseFloat(this.entries[r].amount))},showMessageOrRedirectUser(){if(this.notifications.error.show=!1,this.notifications.success.show=!1,this.notifications.wait.show=!1,this.formStates.returnHereButton){this.notifications.success.show=!0,this.notifications.success.url="transactions/show/"+this.groupProperties.id,this.notifications.success.text=o.t("firefly.updated_journal_js",{description:this.groupProperties.title});return}window.location="transactions/show/"+this.groupProperties.id+"?transaction_group_id="+this.groupProperties.id+"&message=updated"},parseErrors(t){this.notifications.error.show=!0,this.notifications.success.show=!1,this.notifications.wait.show=!1,this.formStates.isSubmitting=!1,this.notifications.error.text=o.t("firefly.errors_submission_v2",{errorMessage:t.message}),t.hasOwnProperty("errors")&&(this.entries=E(t.errors,this.entries))},processUpload(t){this.showMessageOrRedirectUser()},processUploadError(t){this.notifications.success.show=!1,this.notifications.wait.show=!1,this.notifications.error.show=!0,this.formStates.isSubmitting=!1,this.notifications.error.text=o.t("firefly.errors_upload"),console.error(t)}}},h={transactions:L,dates:p};function d(){Object.keys(h).forEach(t=>{console.log(`Loading page component "${t}"`);let s=h[t]();Alpine.data(t,()=>s)}),Alpine.start()}document.addEventListener("firefly-iii-bootstrapped",()=>{console.log("Loaded through event listener."),d()});window.bootstrapped&&(console.log("Loaded through window variable."),d());diff --git a/public/build/assets/format-money-03f73825.js b/public/build/assets/format-money-62afb78b.jssimilarity index 99%rename from public/build/assets/format-money-03f73825.jsrename to public/build/assets/format-money-62afb78b.jsindex aee7425a0d..b262f51d4a 100644--- a/public/build/assets/format-money-03f73825.js+++ b/public/build/assets/format-money-62afb78b.js@@ -1 +1 @@-import{q as y,s as d,r as l,t as p,u as _,v as c,w as b,x as N,y as P,z as v,D as g,i as C,E as B,G as x,H as O,J as o,K as E,N as T,f as L,O as S,Q as W,R as U,U as I,V as q,W as Q,X as V,Y,Z as $,_ as j,$ as z,a0 as X,a1 as F,a2 as G,a3 as H,a4 as J,a5 as K,a6 as Z,a7 as ee,a8 as te,a9 as ae,aa as se,ab as ne,ac as re,ad as le,ae as de,af as oe,ag as ie,ah as ue,ai as ge,aj as ce,ak as we,al as he,am as ye}from"./vendor-cc723e37.js";const k="/",h=y.create({baseURL:k,withCredentials:!0});y.defaults.withCredentials=!0;y.defaults.baseURL=k;class R{getByName(e){return h.get("/api/v1/preferences/"+e)}getByNameNow(e){return h.get("/api/v1/preferences/"+e)}postByName(e,a){return h.post("/api/v1/preferences",{name:e,data:a})}}class A{post(e,a){let s="/api/v1/preferences";return h.post(s,{name:e,data:a})}}function fe(t,e=null){return new R().getByName(t).then(s=>Promise.resolve(m(t,s))).catch(()=>{new A().post(t,e).then(i=>Promise.resolve(m(t,i)))})}function m(t,e){return e.data.data.attributes.data}function w(t,e=null){const a=window.store.get("cacheValid");if(a&&window.hasOwnProperty(t))return Promise.resolve(window[t]);const s=window.store.get(t);return a&&typeof s<"u"?Promise.resolve(s):new R().getByName(t).then(u=>Promise.resolve(M(t,u))).catch(()=>{new A().post(t,e).then(n=>Promise.resolve(M(t,n)))})}function M(t,e){let a=e.data.data.attributes.data;return window.store.set(t,a),a}function be(t,e){let a,s;switch(t){case"last365":a=d(g(e,365)),s=l(e);break;case"last90":a=d(g(e,90)),s=l(e);break;case"last30":a=d(g(e,30)),s=l(e);break;case"last7":a=d(g(e,7)),s=l(e);break;case"YTD":a=v(e),s=l(e);break;case"QTD":a=p(e),s=l(e);break;case"MTD":a=c(e),s=l(e);break;case"1D":a=d(e),s=l(e);break;case"1W":a=d(N(e,{weekStartsOn:1})),s=l(P(e,{weekStartsOn:1}));break;case"1M":a=d(c(e)),s=l(b(e));break;case"3M":a=d(p(e)),s=l(_(e));break;case"6M":e.getMonth()<=5&&(a=new Date(e),a.setMonth(0),a.setDate(1),a=d(a),s=new Date(e),s.setMonth(5),s.setDate(30),s=l(a)),e.getMonth()>5&&(a=new Date(e),a.setMonth(6),a.setDate(1),a=d(a),s=new Date(e),s.setMonth(11),s.setDate(31),s=l(a));break;case"1Y":a=new Date(e),a.setMonth(0),a.setDate(1),a=d(a),s=new Date(e),s.setMonth(11),s.setDate(31),s=l(s);break}return{start:a,end:s}}let D=!1;function pe(t){if(D===!1){const e=t.replace("-","_");D=!0;const a=7*24*60*60*1e3;return console.log('Will load language "'+e+'"'),C.use(B).init({load:"languageOnly",fallbackLng:"en",lng:e,debug:!1,backend:{backends:[x,O],backendOptions:[{load:"languageOnly",expirationTime:a},{loadPath:"./v2/i18n/{{lng}}.json"}]}})}return console.warn("Loading translations skipped."),Promise.resolve()}o.addPlugin(E);window.bootstrapped=!1;window.store=o;fe("lastActivity").then(t=>{const e=o.get("lastActivity");o.set("cacheValid",e===t),o.set("lastActivity",t),console.log("Server value: "+t),console.log("Local value: "+e),console.log("Cache valid: "+(e===t))}).then(()=>{Promise.all([w("viewRange"),w("darkMode"),w("locale"),w("language")]).then(t=>{if(!o.get("start")||!o.get("end")){const e=be(t[0],new Date);o.set("start",e.start),o.set("end",e.end)}window.__localeId__=t[2],o.set("language",t[3]),o.set("locale",t[3]),pe(t[3]).then(()=>{const e=new Event("firefly-iii-bootstrapped");document.dispatchEvent(e),window.bootstrapped=!0})})});window.axios=y;window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";window.Alpine=T;const f={bg:S,cs:W,da:U,de:I,el:q,enGB:Q,enUS:V,es:Y,ca:$,fi:j,fr:z,hu:X,id:F,it:G,ja:H,ko:J,nb:K,nn:Z,nl:ee,pl:te,ptBR:ae,pt:se,ro:ne,ru:re,sk:le,sl:de,sv:oe,tr:ie,uk:ue,vi:ge,zhTW:ce,zhCN:we};function r(t,e="PP"){let a=window.__localeId__.replace("_","");return L(t,e,{locale:f[a]??f[a.slice(0,2)]??f.enUS})}const Me=()=>({range:{start:null,end:null},defaultRange:{start:null,end:null},language:"en_US",init(){this.range={start:new Date(window.store.get("start")),end:new Date(window.store.get("end"))},this.defaultRange={start:new Date(window.store.get("start")),end:new Date(window.store.get("end"))},this.language=window.store.get("language"),this.locale=window.store.get("locale"),this.locale=this.locale==="equal"?this.language:this.locale,window.__localeId__=this.language,this.buildDateRange(),window.store.observe("start",t=>{this.range.start=new Date(t)}),window.store.observe("end",t=>{this.range.end=new Date(t),this.buildDateRange()})},buildDateRange(){let t=this.getNextRange(),e=this.getPrevRange(),a=this.lastDays(7),s=this.lastDays(30),i=this.mtd(),u=this.ytd(),n=document.getElementsByClassName("daterange-holder")[0];n.textContent=r(this.range.start)+" - "+r(this.range.end),n.setAttribute("data-start",r(this.range.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(this.range.end,"yyyy-MM-dd")),n=document.getElementsByClassName("daterange-current")[0],n.textContent=r(this.defaultRange.start)+" - "+r(this.defaultRange.end),n.setAttribute("data-start",r(this.defaultRange.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(this.defaultRange.end,"yyyy-MM-dd")),n=document.getElementsByClassName("daterange-next")[0],n.textContent=r(t.start)+" - "+r(t.end),n.setAttribute("data-start",r(t.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(t.end,"yyyy-MM-dd")),n=document.getElementsByClassName("daterange-prev")[0],n.textContent=r(e.start)+" - "+r(e.end),n.setAttribute("data-start",r(e.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(e.end,"yyyy-MM-dd")),n=document.getElementsByClassName("daterange-7d")[0],n.setAttribute("data-start",r(a.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(a.end,"yyyy-MM-dd")),n=document.getElementsByClassName("daterange-90d")[0],n.setAttribute("data-start",r(s.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(s.end,"yyyy-MM-dd")),n=document.getElementsByClassName("daterange-mtd")[0],n.setAttribute("data-start",r(i.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(i.end,"yyyy-MM-dd")),n=document.getElementsByClassName("daterange-ytd")[0],n.setAttribute("data-start",r(u.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(u.end,"yyyy-MM-dd"))},getNextRange(){let t=c(this.range.start),e=he(t,1),a=b(e);return{start:e,end:a}},getPrevRange(){let t=c(this.range.start),e=ye(t,1),a=b(e);return{start:e,end:a}},ytd(){let t=new Date;return{start:v(this.range.start),end:t}},mtd(){let t=new Date;return{start:c(this.range.start),end:t}},lastDays(t){let e=new Date;return{start:g(e,t),end:e}},changeDateRange(t){t.preventDefault();let e=t.currentTarget,a=new Date(e.getAttribute("data-start")),s=new Date(e.getAttribute("data-end"));return window.store.set("start",a),window.store.set("end",s),!1}});function De(t,e){let a=window.__localeId__.replace("_","-");return Intl.NumberFormat(a,{style:"currency",currency:e}).format(t)}export{A as P,h as a,r as b,Me as d,De as f,w as g};+import{q as y,s as d,r as l,t as p,u as _,v as c,w as b,x as N,y as P,z as v,D as g,i as C,E as B,G as x,H as O,J as o,K as E,N as T,f as L,O as S,Q as W,R as U,U as I,V as q,W as Q,X as V,Y,Z as $,_ as j,$ as z,a0 as X,a1 as F,a2 as G,a3 as H,a4 as J,a5 as K,a6 as Z,a7 as ee,a8 as te,a9 as ae,aa as se,ab as ne,ac as re,ad as le,ae as de,af as oe,ag as ie,ah as ue,ai as ge,aj as ce,ak as we,al as he,am as ye}from"./vendor-2609b2c9.js";const k="/",h=y.create({baseURL:k,withCredentials:!0});y.defaults.withCredentials=!0;y.defaults.baseURL=k;class R{getByName(e){return h.get("/api/v1/preferences/"+e)}getByNameNow(e){return h.get("/api/v1/preferences/"+e)}postByName(e,a){return h.post("/api/v1/preferences",{name:e,data:a})}}class A{post(e,a){let s="/api/v1/preferences";return h.post(s,{name:e,data:a})}}function fe(t,e=null){return new R().getByName(t).then(s=>Promise.resolve(m(t,s))).catch(()=>{new A().post(t,e).then(i=>Promise.resolve(m(t,i)))})}function m(t,e){return e.data.data.attributes.data}function w(t,e=null){const a=window.store.get("cacheValid");if(a&&window.hasOwnProperty(t))return Promise.resolve(window[t]);const s=window.store.get(t);return a&&typeof s<"u"?Promise.resolve(s):new R().getByName(t).then(u=>Promise.resolve(M(t,u))).catch(()=>{new A().post(t,e).then(n=>Promise.resolve(M(t,n)))})}function M(t,e){let a=e.data.data.attributes.data;return window.store.set(t,a),a}function be(t,e){let a,s;switch(t){case"last365":a=d(g(e,365)),s=l(e);break;case"last90":a=d(g(e,90)),s=l(e);break;case"last30":a=d(g(e,30)),s=l(e);break;case"last7":a=d(g(e,7)),s=l(e);break;case"YTD":a=v(e),s=l(e);break;case"QTD":a=p(e),s=l(e);break;case"MTD":a=c(e),s=l(e);break;case"1D":a=d(e),s=l(e);break;case"1W":a=d(N(e,{weekStartsOn:1})),s=l(P(e,{weekStartsOn:1}));break;case"1M":a=d(c(e)),s=l(b(e));break;case"3M":a=d(p(e)),s=l(_(e));break;case"6M":e.getMonth()<=5&&(a=new Date(e),a.setMonth(0),a.setDate(1),a=d(a),s=new Date(e),s.setMonth(5),s.setDate(30),s=l(a)),e.getMonth()>5&&(a=new Date(e),a.setMonth(6),a.setDate(1),a=d(a),s=new Date(e),s.setMonth(11),s.setDate(31),s=l(a));break;case"1Y":a=new Date(e),a.setMonth(0),a.setDate(1),a=d(a),s=new Date(e),s.setMonth(11),s.setDate(31),s=l(s);break}return{start:a,end:s}}let D=!1;function pe(t){if(D===!1){const e=t.replace("-","_");D=!0;const a=7*24*60*60*1e3;return console.log('Will load language "'+e+'"'),C.use(B).init({load:"languageOnly",fallbackLng:"en",lng:e,debug:!1,backend:{backends:[x,O],backendOptions:[{load:"languageOnly",expirationTime:a},{loadPath:"./v2/i18n/{{lng}}.json"}]}})}return console.warn("Loading translations skipped."),Promise.resolve()}o.addPlugin(E);window.bootstrapped=!1;window.store=o;fe("lastActivity").then(t=>{const e=o.get("lastActivity");o.set("cacheValid",e===t),o.set("lastActivity",t),console.log("Server value: "+t),console.log("Local value: "+e),console.log("Cache valid: "+(e===t))}).then(()=>{Promise.all([w("viewRange"),w("darkMode"),w("locale"),w("language")]).then(t=>{if(!o.get("start")||!o.get("end")){const e=be(t[0],new Date);o.set("start",e.start),o.set("end",e.end)}window.__localeId__=t[2],o.set("language",t[3]),o.set("locale",t[3]),pe(t[3]).then(()=>{const e=new Event("firefly-iii-bootstrapped");document.dispatchEvent(e),window.bootstrapped=!0})})});window.axios=y;window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";window.Alpine=T;const f={bg:S,cs:W,da:U,de:I,el:q,enGB:Q,enUS:V,es:Y,ca:$,fi:j,fr:z,hu:X,id:F,it:G,ja:H,ko:J,nb:K,nn:Z,nl:ee,pl:te,ptBR:ae,pt:se,ro:ne,ru:re,sk:le,sl:de,sv:oe,tr:ie,uk:ue,vi:ge,zhTW:ce,zhCN:we};function r(t,e="PP"){let a=window.__localeId__.replace("_","");return L(t,e,{locale:f[a]??f[a.slice(0,2)]??f.enUS})}const Me=()=>({range:{start:null,end:null},defaultRange:{start:null,end:null},language:"en_US",init(){this.range={start:new Date(window.store.get("start")),end:new Date(window.store.get("end"))},this.defaultRange={start:new Date(window.store.get("start")),end:new Date(window.store.get("end"))},this.language=window.store.get("language"),this.locale=window.store.get("locale"),this.locale=this.locale==="equal"?this.language:this.locale,window.__localeId__=this.language,this.buildDateRange(),window.store.observe("start",t=>{this.range.start=new Date(t)}),window.store.observe("end",t=>{this.range.end=new Date(t),this.buildDateRange()})},buildDateRange(){let t=this.getNextRange(),e=this.getPrevRange(),a=this.lastDays(7),s=this.lastDays(30),i=this.mtd(),u=this.ytd(),n=document.getElementsByClassName("daterange-holder")[0];n.textContent=r(this.range.start)+" - "+r(this.range.end),n.setAttribute("data-start",r(this.range.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(this.range.end,"yyyy-MM-dd")),n=document.getElementsByClassName("daterange-current")[0],n.textContent=r(this.defaultRange.start)+" - "+r(this.defaultRange.end),n.setAttribute("data-start",r(this.defaultRange.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(this.defaultRange.end,"yyyy-MM-dd")),n=document.getElementsByClassName("daterange-next")[0],n.textContent=r(t.start)+" - "+r(t.end),n.setAttribute("data-start",r(t.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(t.end,"yyyy-MM-dd")),n=document.getElementsByClassName("daterange-prev")[0],n.textContent=r(e.start)+" - "+r(e.end),n.setAttribute("data-start",r(e.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(e.end,"yyyy-MM-dd")),n=document.getElementsByClassName("daterange-7d")[0],n.setAttribute("data-start",r(a.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(a.end,"yyyy-MM-dd")),n=document.getElementsByClassName("daterange-90d")[0],n.setAttribute("data-start",r(s.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(s.end,"yyyy-MM-dd")),n=document.getElementsByClassName("daterange-mtd")[0],n.setAttribute("data-start",r(i.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(i.end,"yyyy-MM-dd")),n=document.getElementsByClassName("daterange-ytd")[0],n.setAttribute("data-start",r(u.start,"yyyy-MM-dd")),n.setAttribute("data-end",r(u.end,"yyyy-MM-dd"))},getNextRange(){let t=c(this.range.start),e=he(t,1),a=b(e);return{start:e,end:a}},getPrevRange(){let t=c(this.range.start),e=ye(t,1),a=b(e);return{start:e,end:a}},ytd(){let t=new Date;return{start:v(this.range.start),end:t}},mtd(){let t=new Date;return{start:c(this.range.start),end:t}},lastDays(t){let e=new Date;return{start:g(e,t),end:e}},changeDateRange(t){t.preventDefault();let e=t.currentTarget,a=new Date(e.getAttribute("data-start")),s=new Date(e.getAttribute("data-end"));return window.store.set("start",a),window.store.set("end",s),!1}});function De(t,e){let a=window.__localeId__.replace("_","-");return Intl.NumberFormat(a,{style:"currency",currency:e}).format(t)}export{A as P,h as a,r as b,Me as d,De as f,w as g};diff --git a/public/build/assets/get-7f8692a5.js b/public/build/assets/get-5b4283ca.jssimilarity index 81%rename from public/build/assets/get-7f8692a5.jsrename to public/build/assets/get-5b4283ca.jsindex 128753a053..63de7ff1ab 100644--- a/public/build/assets/get-7f8692a5.js+++ b/public/build/assets/get-5b4283ca.js@@ -1 +1 @@-import{a as s}from"./format-money-03f73825.js";let t=class{list(a){return s.get("/api/v2/subscriptions",{params:a})}paid(a){return s.get("/api/v2/subscriptions/sum/paid",{params:a})}unpaid(a){return s.get("/api/v2/subscriptions/sum/unpaid",{params:a})}};class e{list(a){return s.get("/api/v2/piggy-banks",{params:a})}}export{t as G,e as a};+import{a as s}from"./format-money-62afb78b.js";let t=class{list(a){return s.get("/api/v2/subscriptions",{params:a})}paid(a){return s.get("/api/v2/subscriptions/sum/paid",{params:a})}unpaid(a){return s.get("/api/v2/subscriptions/sum/unpaid",{params:a})}};class e{list(a){return s.get("/api/v2/piggy-banks",{params:a})}}export{t as G,e as a};diff --git a/public/build/assets/get-10f1237b.js b/public/build/assets/get-ea675e30.jssimilarity index 75%rename from public/build/assets/get-10f1237b.jsrename to public/build/assets/get-ea675e30.jsindex 1204e20820..fe38611d0b 100644--- a/public/build/assets/get-10f1237b.js+++ b/public/build/assets/get-ea675e30.js@@ -1 +1 @@-import{a as t}from"./format-money-03f73825.js";class n{list(a){return t.get("/api/v2/transactions",{params:a})}listByCount(a){return t.get("/api/v2/transactions-inf",{params:a})}show(a,s){return t.get("/api/v2/transactions/"+a,{params:s})}}export{n as G};+import{a as t}from"./format-money-62afb78b.js";class n{list(a){return t.get("/api/v2/transactions",{params:a})}listByCount(a){return t.get("/api/v2/transactions-inf",{params:a})}show(a,s){return t.get("/api/v2/transactions/"+a,{params:s})}}export{n as G};diff --git a/public/build/assets/index-089e7bf2.js b/public/build/assets/index-78b5f723.jssimilarity index 97%rename from public/build/assets/index-089e7bf2.jsrename to public/build/assets/index-78b5f723.jsindex 1d225bcc38..f01d626c40 100644--- a/public/build/assets/index-089e7bf2.js+++ b/public/build/assets/index-78b5f723.js@@ -1 +1 @@-import{b,d as V,f as u}from"./format-money-03f73825.js";import{M as E,I as j,f as h,i as d,o as C}from"./vendor-cc723e37.js";import{G as m}from"./get-10f1237b.js";import{P as c}from"./put-d747f13c.js";class T{init(t){document.addEventListener("cellValueChanged",()=>{console.log("I just realized a cell value has changed.")}),console.log("AmountEditor.init"),this.params=t,this.originalValue=t.value,this.eGui=document.createElement("div"),this.input=document.createElement("input"),this.input.type="number",this.input.min="0",this.input.step="any",this.input.style.overflow="hidden",this.input.style.textOverflow="ellipsis",this.input.autofocus=!0,this.input.value=parseFloat(t.value.amount).toFixed(t.value.decimal_places)}onChange(t){console.log("AmountEditor.onChange"),this.params.onValueChange(t),this.params.stopEditing(t)}afterGuiAttached(){this.input.focus(),this.input.select()}getGui(){return console.log("AmountEditor.getGui"),this.eGui.appendChild(this.input),this.eGui}getValue(){return console.log("AmountEditor.getValue"),this.originalValue.amount=parseFloat(this.input.value),this.submitAmount(this.originalValue),this.originalValue}submitAmount(t){console.log("AmountEditor.submitAmount"),console.log(t);const i=t.amount;console.log('New value for field "amount" in transaction journal #'+t.transaction_journal_id+" of group #"+t.id+' is "'+i+'"');let n={transactions:[{transaction_journal_id:t.transaction_journal_id,amount:i}]};new c().put(n,{id:t.id})}}class v{constructor(){this.type="all",this.rowCount=null}rowCount(){return this.rowCount}getRows(t){new m().listByCount({start_row:t.startRow,end_row:t.endRow,type:this.type}).then(n=>{this.parseTransactions(n.data.data,t.successCallback),this.rowCount=n.data.meta.pagination.total}).catch(n=>{console.log(n)})}parseTransactions(t,i){let n=[];for(let r in t)if(t.hasOwnProperty(r)){let a=t[r],l=a.attributes.transactions.length>1,g=!0;for(let p in a.attributes.transactions)if(a.attributes.transactions.hasOwnProperty(p)){let o=a.attributes.transactions[p],s={};s.split=l,s.firstSplit=g,s.group_title=a.attributes.group_title,s.created_at=a.attributes.created_at,s.updated_at=a.attributes.updated_at,s.user=a.attributes.user,s.user_group=a.attributes.user_group,s.id=parseInt(a.id),s.transaction_journal_id=parseInt(o.transaction_journal_id),s.description=o.description,s.date=new Date(o.date),s.from={name:o.source_name,id:o.source_id,type:o.source_type},s.to={name:o.destination_name,id:o.destination_id,type:o.destination_type},s.category={name:o.category_name,id:o.category_id},s.budget={name:o.budget_name,id:o.budget_id},s.amount={id:parseInt(a.id),transaction_journal_id:parseInt(o.transaction_journal_id),type:o.type,amount:o.amount,currency_code:o.currency_code,decimal_places:o.currency_decimal_places,foreign_amount:o.foreign_amount,foreign_currency_code:o.foreign_currency_code,foreign_decimal_places:o.foreign_currency_decimal_places},s.icon={classes:"fa fa-solid fa-arrow-left",id:s.id},g=!1,n.push(s)}}return i(n,!1),n}setType(t){this.type=t}}class x{init(t){console.log("DateTimeEditor.init"),this.params=t,this.originalValue=t.value,this.eGui=document.createElement("div"),this.input=document.createElement("input"),this.input.type="datetime-local",this.input.style.overflow="hidden",this.input.style.textOverflow="ellipsis",this.input.value=b(t.value,"yyyy-MM-dd HH:mm")}onChange(t){console.log("DateTimeEditor.onChange"),this.params.onValueChange(t),this.params.stopEditing(t)}afterGuiAttached(){this.input.focus()}getGui(){return console.log("DateTimeEditor.getGui"),this.eGui.appendChild(this.input),this.eGui}getValue(){return console.log("DateTimeEditor.getValue"),this.originalValue=this.input.value,this.originalValue}submitAmount(t){console.log("AmountEditor.submitAmount"),console.log(t);const i=t.amount;console.log('New value for field "amount" in transaction journal #'+t.transaction_journal_id+" of group #"+t.id+' is "'+i+'"');let n={transactions:[{transaction_journal_id:t.transaction_journal_id,amount:i}]};new c().put(n,{id:t.id})}}const _=new v;_.setType("withdrawal");document.addEventListener("cellEditRequest",()=>{console.log("Loaded through event listener.")});let w;const A=["description","amount","date"],R=e=>{console.log("onCellEditRequestMethod");const t=e.data,i=e.colDef.field;let n=e.newValue;if(!A.includes(i)){console.log("Field "+i+" is not editable.");return}i==="amount"&&(n=e.newValue.amount,console.log("New value is now"+n)),console.log('New value for field "'+i+'" in transaction journal #'+t.transaction_journal_id+" of group #"+t.id+' is "'+n+'"'),t[i]=n,w.getRowNode(String(e.rowIndex)).updateData(t);let a={transactions:[{transaction_journal_id:t.transaction_journal_id}]};a.transactions[0][i]=n,new c().put(a,{id:t.id})};document.addEventListener("cellValueChanged",()=>{console.log("I just realized a cell value has changed.")});document.addEventListener("onCellValueChanged",()=>{console.log("I just realized a cell value has changed.")});const D={rowModelType:"infinite",datasource:_,onCellEditRequest:R,readOnlyEdit:!0,columnDefs:[{field:"icon",editable:!1,headerName:"",sortable:!1,width:40,cellRenderer:function(e){return e.getValue()?'<a href="./transactions/show/'+parseInt(e.value.id)+'"><em class="'+e.value.classes+'"></em></a>':""}},{field:"description",cellDataType:"text",editable:!0},{field:"amount",editable:function(e){return e.data.amount.foreign_amount===null&&e.data.amount.foreign_currency_code===null},cellEditor:T,cellRenderer(e){if(e.getValue()){let t="",i=parseFloat(e.getValue().amount),n=e.getValue(),r="text-danger";if(n.type==="withdrawal"&&(i=i*-1),n.type==="deposit"&&(r="text-success"),n.type==="transfer"&&(r="text-info"),t+='<span class="'+r+'">'+u(i,e.getValue().currency_code)+"</span>",n.foreign_amount){let a=parseFloat(e.getValue().foreign_amount);n.type==="withdrawal"&&(a=a*-1),t+=' (<span class="'+r+'">'+u(a,n.foreign_currency_code)+"</span>)"}return t}return""}},{field:"date",editable:!0,cellDataType:"date",cellEditor:x,cellEditorPopup:!0,cellEditorPopupPosition:"under",cellRenderer(e){return e.getValue()?h(e.getValue(),d.t("config.date_time_fns_short")):""}},{field:"from",cellDataType:"text",cellRenderer:function(e){if(e.getValue()){let t=e.getValue();return'<a href="./accounts/show/'+t.id+'">'+t.name+"</a>"}return""}},{field:"to",cellDataType:"text",cellRenderer:function(e){if(e.getValue()){let t=e.getValue();return'<a href="./accounts/show/'+t.id+'">'+t.name+"</a>"}return""}},{field:"category",cellDataType:"text",cellRenderer:function(e){if(e.getValue()){let t=e.getValue();if(t.id!==null)return'<a href="./categories/show/'+t.id+'">'+t.name+"</a>"}return""}},{field:"budget",cellDataType:"text",cellRenderer:function(e){if(e.getValue()){let t=e.getValue();if(t.id!==null)return'<a href="./budgets/show/'+t.id+'">'+t.name+"</a>"}return""}}]};E.registerModules([j]);let G=function(){return{notifications:{error:{show:!1,text:"",url:""},success:{show:!1,text:"",url:""},wait:{show:!1,text:""}},transactions:[],totalPages:1,perPage:50,page:1,tableColumns:{description:{enabled:!0},source:{enabled:!0},destination:{enabled:!0},amount:{enabled:!0}},table:null,formatMoney(e,t){return u(e,t)},format(e){return h(e,d.t("config.date_time_fns"))},init(){this.notifications.wait.show=!0,this.notifications.wait.text=d.t("firefly.wait_loading_data"),w=C(document.querySelector("#grid"),D)},getTransactions(e){const t=window.location.href.split("/"),i=t[t.length-1];new m().list({page:e,type:i}).then(r=>{this.parseTransactions(r.data.data),this.totalPages=r.data.meta.pagination.total_pages,this.perPage=r.data.meta.pagination.per_page,this.page=r.data.meta.pagination.current_page}).catch(r=>{this.notifications.wait.show=!1,this.notifications.error.show=!0,this.notifications.error.text=r.response.data.message})},parseTransactions(e){for(let t in e)if(e.hasOwnProperty(t)){let i=e[t],n=i.attributes.transactions.length>1,r=!0;for(let a in i.attributes.transactions)if(i.attributes.transactions.hasOwnProperty(a)){let l=i.attributes.transactions[a];l.split=n,tranaction.icon="fa fa-solid fa-arrow-left",l.firstSplit=r,l.group_title=i.attributes.group_title,l.id=i.id,l.created_at=i.attributes.created_at,l.updated_at=i.attributes.updated_at,l.user=i.attributes.user,l.user_group=i.attributes.user_group,r=!1,this.transactions.push(l)}}this.notifications.wait.show=!1,console.log("refresh!")}}},f={index:G,dates:V};function y(){Object.keys(f).forEach(e=>{console.log(`Loading page component "${e}"`);let t=f[e]();Alpine.data(e,()=>t)}),Alpine.start()}document.addEventListener("firefly-iii-bootstrapped",()=>{console.log("Loaded through event listener."),y()});window.bootstrapped&&(console.log("Loaded through window variable."),y());+import{b,d as V,f as u}from"./format-money-62afb78b.js";import{M as E,I as j,f as h,i as d,o as C}from"./vendor-2609b2c9.js";import{G as m}from"./get-ea675e30.js";import{P as c}from"./put-c9d3942f.js";class T{init(t){document.addEventListener("cellValueChanged",()=>{console.log("I just realized a cell value has changed.")}),console.log("AmountEditor.init"),this.params=t,this.originalValue=t.value,this.eGui=document.createElement("div"),this.input=document.createElement("input"),this.input.type="number",this.input.min="0",this.input.step="any",this.input.style.overflow="hidden",this.input.style.textOverflow="ellipsis",this.input.autofocus=!0,this.input.value=parseFloat(t.value.amount).toFixed(t.value.decimal_places)}onChange(t){console.log("AmountEditor.onChange"),this.params.onValueChange(t),this.params.stopEditing(t)}afterGuiAttached(){this.input.focus(),this.input.select()}getGui(){return console.log("AmountEditor.getGui"),this.eGui.appendChild(this.input),this.eGui}getValue(){return console.log("AmountEditor.getValue"),this.originalValue.amount=parseFloat(this.input.value),this.submitAmount(this.originalValue),this.originalValue}submitAmount(t){console.log("AmountEditor.submitAmount"),console.log(t);const i=t.amount;console.log('New value for field "amount" in transaction journal #'+t.transaction_journal_id+" of group #"+t.id+' is "'+i+'"');let n={transactions:[{transaction_journal_id:t.transaction_journal_id,amount:i}]};new c().put(n,{id:t.id})}}class v{constructor(){this.type="all",this.rowCount=null}rowCount(){return this.rowCount}getRows(t){new m().listByCount({start_row:t.startRow,end_row:t.endRow,type:this.type}).then(n=>{this.parseTransactions(n.data.data,t.successCallback),this.rowCount=n.data.meta.pagination.total}).catch(n=>{console.log(n)})}parseTransactions(t,i){let n=[];for(let r in t)if(t.hasOwnProperty(r)){let a=t[r],l=a.attributes.transactions.length>1,g=!0;for(let p in a.attributes.transactions)if(a.attributes.transactions.hasOwnProperty(p)){let o=a.attributes.transactions[p],s={};s.split=l,s.firstSplit=g,s.group_title=a.attributes.group_title,s.created_at=a.attributes.created_at,s.updated_at=a.attributes.updated_at,s.user=a.attributes.user,s.user_group=a.attributes.user_group,s.id=parseInt(a.id),s.transaction_journal_id=parseInt(o.transaction_journal_id),s.description=o.description,s.date=new Date(o.date),s.from={name:o.source_name,id:o.source_id,type:o.source_type},s.to={name:o.destination_name,id:o.destination_id,type:o.destination_type},s.category={name:o.category_name,id:o.category_id},s.budget={name:o.budget_name,id:o.budget_id},s.amount={id:parseInt(a.id),transaction_journal_id:parseInt(o.transaction_journal_id),type:o.type,amount:o.amount,currency_code:o.currency_code,decimal_places:o.currency_decimal_places,foreign_amount:o.foreign_amount,foreign_currency_code:o.foreign_currency_code,foreign_decimal_places:o.foreign_currency_decimal_places},s.icon={classes:"fa fa-solid fa-arrow-left",id:s.id},g=!1,n.push(s)}}return i(n,!1),n}setType(t){this.type=t}}class x{init(t){console.log("DateTimeEditor.init"),this.params=t,this.originalValue=t.value,this.eGui=document.createElement("div"),this.input=document.createElement("input"),this.input.type="datetime-local",this.input.style.overflow="hidden",this.input.style.textOverflow="ellipsis",this.input.value=b(t.value,"yyyy-MM-dd HH:mm")}onChange(t){console.log("DateTimeEditor.onChange"),this.params.onValueChange(t),this.params.stopEditing(t)}afterGuiAttached(){this.input.focus()}getGui(){return console.log("DateTimeEditor.getGui"),this.eGui.appendChild(this.input),this.eGui}getValue(){return console.log("DateTimeEditor.getValue"),this.originalValue=this.input.value,this.originalValue}submitAmount(t){console.log("AmountEditor.submitAmount"),console.log(t);const i=t.amount;console.log('New value for field "amount" in transaction journal #'+t.transaction_journal_id+" of group #"+t.id+' is "'+i+'"');let n={transactions:[{transaction_journal_id:t.transaction_journal_id,amount:i}]};new c().put(n,{id:t.id})}}const _=new v;_.setType("withdrawal");document.addEventListener("cellEditRequest",()=>{console.log("Loaded through event listener.")});let w;const A=["description","amount","date"],R=e=>{console.log("onCellEditRequestMethod");const t=e.data,i=e.colDef.field;let n=e.newValue;if(!A.includes(i)){console.log("Field "+i+" is not editable.");return}i==="amount"&&(n=e.newValue.amount,console.log("New value is now"+n)),console.log('New value for field "'+i+'" in transaction journal #'+t.transaction_journal_id+" of group #"+t.id+' is "'+n+'"'),t[i]=n,w.getRowNode(String(e.rowIndex)).updateData(t);let a={transactions:[{transaction_journal_id:t.transaction_journal_id}]};a.transactions[0][i]=n,new c().put(a,{id:t.id})};document.addEventListener("cellValueChanged",()=>{console.log("I just realized a cell value has changed.")});document.addEventListener("onCellValueChanged",()=>{console.log("I just realized a cell value has changed.")});const D={rowModelType:"infinite",datasource:_,onCellEditRequest:R,readOnlyEdit:!0,columnDefs:[{field:"icon",editable:!1,headerName:"",sortable:!1,width:40,cellRenderer:function(e){return e.getValue()?'<a href="./transactions/show/'+parseInt(e.value.id)+'"><em class="'+e.value.classes+'"></em></a>':""}},{field:"description",cellDataType:"text",editable:!0},{field:"amount",editable:function(e){return e.data.amount.foreign_amount===null&&e.data.amount.foreign_currency_code===null},cellEditor:T,cellRenderer(e){if(e.getValue()){let t="",i=parseFloat(e.getValue().amount),n=e.getValue(),r="text-danger";if(n.type==="withdrawal"&&(i=i*-1),n.type==="deposit"&&(r="text-success"),n.type==="transfer"&&(r="text-info"),t+='<span class="'+r+'">'+u(i,e.getValue().currency_code)+"</span>",n.foreign_amount){let a=parseFloat(e.getValue().foreign_amount);n.type==="withdrawal"&&(a=a*-1),t+=' (<span class="'+r+'">'+u(a,n.foreign_currency_code)+"</span>)"}return t}return""}},{field:"date",editable:!0,cellDataType:"date",cellEditor:x,cellEditorPopup:!0,cellEditorPopupPosition:"under",cellRenderer(e){return e.getValue()?h(e.getValue(),d.t("config.date_time_fns_short")):""}},{field:"from",cellDataType:"text",cellRenderer:function(e){if(e.getValue()){let t=e.getValue();return'<a href="./accounts/show/'+t.id+'">'+t.name+"</a>"}return""}},{field:"to",cellDataType:"text",cellRenderer:function(e){if(e.getValue()){let t=e.getValue();return'<a href="./accounts/show/'+t.id+'">'+t.name+"</a>"}return""}},{field:"category",cellDataType:"text",cellRenderer:function(e){if(e.getValue()){let t=e.getValue();if(t.id!==null)return'<a href="./categories/show/'+t.id+'">'+t.name+"</a>"}return""}},{field:"budget",cellDataType:"text",cellRenderer:function(e){if(e.getValue()){let t=e.getValue();if(t.id!==null)return'<a href="./budgets/show/'+t.id+'">'+t.name+"</a>"}return""}}]};E.registerModules([j]);let G=function(){return{notifications:{error:{show:!1,text:"",url:""},success:{show:!1,text:"",url:""},wait:{show:!1,text:""}},transactions:[],totalPages:1,perPage:50,page:1,tableColumns:{description:{enabled:!0},source:{enabled:!0},destination:{enabled:!0},amount:{enabled:!0}},table:null,formatMoney(e,t){return u(e,t)},format(e){return h(e,d.t("config.date_time_fns"))},init(){this.notifications.wait.show=!0,this.notifications.wait.text=d.t("firefly.wait_loading_data"),w=C(document.querySelector("#grid"),D)},getTransactions(e){const t=window.location.href.split("/"),i=t[t.length-1];new m().list({page:e,type:i}).then(r=>{this.parseTransactions(r.data.data),this.totalPages=r.data.meta.pagination.total_pages,this.perPage=r.data.meta.pagination.per_page,this.page=r.data.meta.pagination.current_page}).catch(r=>{this.notifications.wait.show=!1,this.notifications.error.show=!0,this.notifications.error.text=r.response.data.message})},parseTransactions(e){for(let t in e)if(e.hasOwnProperty(t)){let i=e[t],n=i.attributes.transactions.length>1,r=!0;for(let a in i.attributes.transactions)if(i.attributes.transactions.hasOwnProperty(a)){let l=i.attributes.transactions[a];l.split=n,tranaction.icon="fa fa-solid fa-arrow-left",l.firstSplit=r,l.group_title=i.attributes.group_title,l.id=i.id,l.created_at=i.attributes.created_at,l.updated_at=i.attributes.updated_at,l.user=i.attributes.user,l.user_group=i.attributes.user_group,r=!1,this.transactions.push(l)}}this.notifications.wait.show=!1,console.log("refresh!")}}},f={index:G,dates:V};function y(){Object.keys(f).forEach(e=>{console.log(`Loading page component "${e}"`);let t=f[e]();Alpine.data(e,()=>t)}),Alpine.start()}document.addEventListener("firefly-iii-bootstrapped",()=>{console.log("Loaded through event listener."),y()});window.bootstrapped&&(console.log("Loaded through window variable."),y());diff --git a/public/build/assets/parse-downloaded-splits-fb2d62df.js b/public/build/assets/parse-downloaded-splits-6b9adc20.jssimilarity index 91%rename from public/build/assets/parse-downloaded-splits-fb2d62df.jsrename to public/build/assets/parse-downloaded-splits-6b9adc20.jsindex 2d36356d3b..e9784de594 100644--- a/public/build/assets/parse-downloaded-splits-fb2d62df.js+++ b/public/build/assets/parse-downloaded-splits-6b9adc20.js@@ -1 +1 @@-import{c as o}from"./create-empty-split-d82bb341.js";import{f as _}from"./vendor-cc723e37.js";function l(a,r){let n=[];for(let i in a)if(a.hasOwnProperty(i)){let e=a[i],t=o();t.transaction_journal_id=e.transaction_journal_id,t.transaction_group_id=r,t.bill_id=e.bill_id,t.bill_name=e.bill_name,t.budget_id=e.budget_id,t.budget_name=e.budget_name,t.category_name=e.category_name,t.category_id=e.category_id,t.piggy_bank_id=e.piggy_bank_id,t.piggy_bank_name=e.piggy_bank_name,t.book_date=e.book_date,t.due_date=e.due_date,t.interest_date=e.interest_date,t.invoice_date=e.invoice_date,t.payment_date=e.payment_date,t.process_date=e.process_date,t.external_url=e.external_url,t.internal_reference=e.internal_reference,t.notes=e.notes,t.tags=e.tags,t.amount=parseFloat(e.amount).toFixed(e.currency_decimal_places),t.currency_code=e.currency_code,e.foreign_amount!==null&&(t.forein_currency_code=e.foreign_currency_code,t.foreign_amount=parseFloat(e.foreign_amount).toFixed(e.foreign_currency_decimal_places)),t.date=_(new Date(e.date),"yyyy-MM-dd HH:mm"),t.description=e.description,t.destination_account={id:e.destination_id,name:e.destination_name,type:e.destination_type,alpine_name:e.destination_name},t.source_account={id:e.source_id,name:e.source_name,type:e.source_type,alpine_name:e.source_name},e.latitude!==null&&(t.hasLocation=!0,t.latitude=e.latitude,t.longitude=e.longitude,t.zoomLevel=e.zoom_level),n.push(t)}return n}export{l as p};+import{c as o}from"./create-empty-split-aae839d5.js";import{f as _}from"./vendor-2609b2c9.js";function l(a,r){let n=[];for(let i in a)if(a.hasOwnProperty(i)){let e=a[i],t=o();t.transaction_journal_id=e.transaction_journal_id,t.transaction_group_id=r,t.bill_id=e.bill_id,t.bill_name=e.bill_name,t.budget_id=e.budget_id,t.budget_name=e.budget_name,t.category_name=e.category_name,t.category_id=e.category_id,t.piggy_bank_id=e.piggy_bank_id,t.piggy_bank_name=e.piggy_bank_name,t.book_date=e.book_date,t.due_date=e.due_date,t.interest_date=e.interest_date,t.invoice_date=e.invoice_date,t.payment_date=e.payment_date,t.process_date=e.process_date,t.external_url=e.external_url,t.internal_reference=e.internal_reference,t.notes=e.notes,t.tags=e.tags,t.amount=parseFloat(e.amount).toFixed(e.currency_decimal_places),t.currency_code=e.currency_code,e.foreign_amount!==null&&(t.forein_currency_code=e.foreign_currency_code,t.foreign_amount=parseFloat(e.foreign_amount).toFixed(e.foreign_currency_decimal_places)),t.date=_(new Date(e.date),"yyyy-MM-dd HH:mm"),t.description=e.description,t.destination_account={id:e.destination_id,name:e.destination_name,type:e.destination_type,alpine_name:e.destination_name},t.source_account={id:e.source_id,name:e.source_name,type:e.source_type,alpine_name:e.source_name},e.latitude!==null&&(t.hasLocation=!0,t.latitude=e.latitude,t.longitude=e.longitude,t.zoomLevel=e.zoom_level),n.push(t)}return n}export{l as p};diff --git a/public/build/assets/put-d747f13c.js b/public/build/assets/put-c9d3942f.jssimilarity index 55%rename from public/build/assets/put-d747f13c.jsrename to public/build/assets/put-c9d3942f.jsindex 5ab46a4c2c..b7259b3ef3 100644--- a/public/build/assets/put-d747f13c.js+++ b/public/build/assets/put-c9d3942f.js@@ -1 +1 @@-import{a as p}from"./format-money-03f73825.js";class u{put(t,a){let r="/api/v2/transactions/"+parseInt(a.id);return p.put(r,t)}}export{u as P};+import{a as p}from"./format-money-62afb78b.js";class u{put(t,a){let r="/api/v2/transactions/"+parseInt(a.id);return p.put(r,t)}}export{u as P};diff --git a/public/build/assets/show-7827ee8e.js b/public/build/assets/show-c2b3bd03.jssimilarity index 98%rename from public/build/assets/show-7827ee8e.jsrename to public/build/assets/show-c2b3bd03.jsindex 3898374c50..408cd95d8b 100644--- a/public/build/assets/show-7827ee8e.js+++ b/public/build/assets/show-c2b3bd03.js@@ -1 +1 @@-var y=Object.defineProperty;var w=(i,t,e)=>t in i?y(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var r=(i,t,e)=>(w(i,typeof t!="symbol"?t+"":t,e),e);import{d as v,f as b}from"./format-money-03f73825.js";import{f as g,i as h}from"./vendor-cc723e37.js";import{G as E}from"./get-10f1237b.js";import{p as _}from"./parse-downloaded-splits-fb2d62df.js";import"./create-empty-split-d82bb341.js";class l{constructor(t){if(this.constructor===l)throw new Error("It's abstract class");this.context=t}event_show(){this.context.typeElement.hideError(),this.context.typeElement.element.value=this.context.value,this.context.element.dispatchEvent(new CustomEvent("show"))}event_shown(){this.context.element.dispatchEvent(new CustomEvent("shown"))}event_hide(){this.context.element.dispatchEvent(new CustomEvent("hide"))}event_hidden(){this.context.element.dispatchEvent(new CustomEvent("hidden"))}init(){throw new Error("Method `init` not define!")}enable(){throw new Error("Method `enable` not define!")}disable(){throw new Error("Method `disable` not define!")}hide(){throw new Error("Method `hide` not define!")}}class L extends l{init(){this.popover=new bootstrap.Popover(this.context.element,{container:"body",content:this.context.typeElement.create(),html:!0,customClass:"dark-editable",title:this.context.title}),this.context.element.addEventListener("show.bs.popover",()=>{this.event_show()}),this.context.element.addEventListener("shown.bs.popover",()=>{this.event_shown()}),this.context.element.addEventListener("hide.bs.popover",()=>{this.event_hide()}),this.context.element.addEventListener("hidden.bs.popover",()=>{this.event_hidden()}),document.addEventListener("click",t=>{const e=t.target;if(e===this.popover.tip||e===this.context.element)return;let n=e;for(;n=n.parentNode;)if(n===this.popover.tip)return;this.hide()})}enable(){this.popover.enable()}disable(){this.popover.disable()}hide(){this.popover.hide()}}class T extends l{init(){const t=()=>{if(!this.context.disabled){const e=this.context.typeElement.create();this.event_show(),this.context.element.removeEventListener("click",t),this.context.element.innerHTML="",this.context.element.append(e),this.event_shown()}};this.context.element.addEventListener("click",t)}enable(){}disable(){}hide(){this.event_hide(),this.context.element.innerHTML=this.context.value,setTimeout(()=>{this.init(),this.event_hidden()},100)}}class c{constructor(t){r(this,"context",null);r(this,"element",null);r(this,"error",null);r(this,"form",null);r(this,"load",null);r(this,"buttonGroup",null);r(this,"buttons",{success:null,cancel:null});if(this.constructor===c)throw new Error("It's abstract class");this.context=t}create(){throw new Error("Method `create` not define!")}createContainer(t){const e=document.createElement("div");this.element=t,this.error=this.createContainerError(),this.form=this.createContainerForm(),this.load=this.createContainerLoad(),this.buttons.success=this.createButtonSuccess(),this.buttons.cancel=this.createButtonCancel();const n=document.createElement("div");n.classList.add("col-12");const s=document.createElement("label");s.classList.add("visually-hidden"),s.for=t.id,n.append(s,t);const o=document.createElement("div");return o.classList.add("col-12"),this.buttonGroup=this.createButtonGroup(),this.buttonGroup.append(this.buttons.success,this.buttons.cancel),o.append(this.buttonGroup),this.form.append(n,o),e.append(this.error,this.form),e}createButtonGroup(){const t=document.createElement("div");return t.classList.add("btn-group","btn-group-sm"),t}createContainerError(){const t=document.createElement("div");return t.classList.add("text-danger","fst-italic","mb-2","fw-bold"),t.style.display="none",t}createContainerForm(){const t=document.createElement("form");return t.classList.add("row","row-cols-lg-auto","g-3","align-items-center"),t.addEventListener("submit",async e=>{e.preventDefault();const n=this.getValue();if(this.context.send&&this.context.pk&&this.context.url&&this.context.value!==n){this.showLoad();let s;try{const o=await this.ajax(n);o.ok?s=await this.context.success(o,n):s=await this.context.error(o,n)||`${o.status} ${o.statusText}`}catch(o){console.error(o),s=o}s?(this.setError(s),this.showError()):(this.setError(null),this.hideError(),this.context.value=this.getValue(),this.context.modeElement.hide(),this.initText()),this.hideLoad()}else this.context.value=this.getValue(),this.context.modeElement.hide(),this.initText();this.context.element.dispatchEvent(new CustomEvent("save"))}),t}createContainerLoad(){const t=document.createElement("div");t.style.display="none",t.style.position="absolute",t.style.background="white",t.style.width="100%",t.style.height="100%",t.style.top=0,t.style.left=0;const e=document.createElement("div");return e.classList.add("dark-editable-loader"),t.append(e),t}createButton(){const t=document.createElement("button");return t.type="button",t.classList.add("btn","btn-sm"),t.style.color="transparent",t.style.textShadow="0 0 0 white",t}createButtonSuccess(){const t=this.createButton();return t.type="submit",t.classList.add("btn-success"),t.innerHTML="✔",t}createButtonCancel(){const t=this.createButton();t.classList.add("btn-danger");const e=document.createElement("div");return e.innerHTML="✖",t.append(e),t.addEventListener("click",()=>{this.context.modeElement.hide()}),t}hideLoad(){this.load.style.display="none"}showLoad(){this.load.style.display="block"}ajax(t){let e=this.context.url,n,s=!1;console.log(this.context),this.context.options.formType==="journal_description"&&(s=!0,n={transactions:[{transaction_journal_id:this.context.options.journalId,description:t}]}),s===!1&&console.error('Cannot deal with form type "'+this.context.formType+'"');const o={headers:{"Content-Type":"application/json","X-CSRF-TOKEN":document.head.querySelector('meta[name="csrf-token"]').content}};return o.method=this.context.ajaxOptions.method,this.context.options.method&&(o.method=this.context.options.method),o.method==="POST"||this.context.options.method==="PUT"?o.body=JSON.stringify(n):e+="?"+new URLSearchParams(form).toString(),fetch(e,o)}async successResponse(t,e){}async errorResponse(t,e){}setError(t){this.error.innerHTML=t}showError(){this.error.style.display="block"}hideError(){this.error&&(this.error.style.display="none")}createElement(t){const e=document.createElement(t);return console.log(e),e.classList.add("form-control"),this.context.required&&(e.required=this.context.required),this.add_focus(e),e}add_focus(t){this.context.element.addEventListener("shown",function(){t.focus()})}initText(){return this.context.value===""?(this.context.element.innerHTML=this.context.emptytext,!0):(this.context.element.innerHTML=this.context.value,!1)}initOptions(){}getValue(){return this.element.value}}class M extends c{create(){const t=this.createElement("input"),e=this.context.element.id+"_input";return t.type=this.context.type,t.id=e,t.autocomplete="off",t.placeholder=this.context.element.innerText,t.classList.add("form-control","form-control-md"),this.createContainer(t)}}class C extends c{create(){const t=this.createElement("textarea");return this.createContainer(t)}}class k extends c{create(){const t=this.createElement("select");return this.context.source.forEach(e=>{const n=document.createElement("option");n.value=e.value,n.innerHTML=e.text,t.append(n)}),this.createContainer(t)}initText(){if(this.context.element.innerHTML=this.context.emptytext,this.context.value!==""&&this.context.source.length>0)for(const t in this.context.source){const e=this.context.source[t];if(e.value==this.context.value)return this.context.element.innerHTML=e.text,!1}return!0}initOptions(){this.context.get_opt("source",[]),typeof this.context.source=="string"&&this.context.source!==""&&(this.context.source=JSON.parse(this.context.source))}}class f extends c{create(){const t=this.createElement("input");return t.type="date",this.createContainer(t)}initText(){return this.value===""?(this.context.element.innerHTML=this.context.emptytext,!0):(this.context.element.innerHTML=moment(this.context.value).format(this.context.viewformat),!1)}initOptions(){this.context.get_opt("format","YYYY-MM-DD"),this.context.get_opt("viewformat","YYYY-MM-DD")}}class D extends f{create(){const t=this.createElement("input");return t.type="datetime-local",this.createContainer(t)}initOptions(){this.context.get_opt("format","YYYY-MM-DD HH:mm"),this.context.get_opt("viewformat","YYYY-MM-DD HH:mm"),this.context.value=moment(this.context.value).format("YYYY-MM-DDTHH:mm")}}class Y{constructor(t,e={}){r(this,"modeElement",null);r(this,"typeElement",null);r(this,"mode",null);r(this,"type",null);r(this,"emptytext",null);r(this,"viewformat",null);r(this,"pk",null);r(this,"name",null);this.element=t,this.options=e,this.init_options(),this.typeElement=this.route_type(),this.typeElement.initOptions(),this.modeElement=this.route_mode(),this.modeElement.init(),this.init_text(),this.init_style(),this.disabled&&this.disable(),this.element.dispatchEvent(new CustomEvent("init"))}get_opt(t,e){var n,s;return this[t]=((n=this.element.dataset)==null?void 0:n[t])??((s=this.options)==null?void 0:s[t])??e}get_opt_bool(t,e){return this.get_opt(t,e),typeof this[t]!="boolean"&&(this[t]==="true"?this[t]=!0:this[t]==="false"?this[t]=!1:this[t]=e),this[t]}init_options(){var t,e,n,s;this.get_opt("value",this.element.innerHTML),this.get_opt("name",this.element.id),this.get_opt("pk",null),this.get_opt("title",""),this.get_opt("type","text"),this.get_opt("emptytext","Empty"),this.get_opt("mode","popup"),this.get_opt("url",null),this.get_opt("ajaxOptions",{}),this.ajaxOptions=Object.assign({method:"POST",dataType:"text"},this.ajaxOptions),this.get_opt_bool("send",!0),this.get_opt_bool("disabled",!1),this.get_opt_bool("required",!1),(t=this.options)!=null&&t.success&&typeof((e=this.options)==null?void 0:e.success)=="function"&&(this.success=this.options.success),(n=this.options)!=null&&n.error&&typeof((s=this.options)==null?void 0:s.error)=="function"&&(this.error=this.options.error)}init_text(){const t="dark-editable-element-empty";this.element.classList.remove(t),this.typeElement.initText()&&this.element.classList.add(t)}init_style(){this.element.classList.add("dark-editable-element")}route_mode(){switch(this.mode){default:throw new Error(`Mode ${this.mode} not found!`);case"popup":return new L(this);case"inline":return new T(this)}}route_type(){if(this.type.prototype instanceof c)return new this.type(this);if(typeof this.type=="string")switch(this.type){case"text":case"password":case"email":case"url":case"tel":case"number":case"range":case"time":return new M(this);case"textarea":return new C(this);case"select":return new k(this);case"date":return new f(this);case"datetime":return new D(this)}throw new Error("Undefined type")}async success(t,e){return await this.typeElement.successResponse(t,e)}async error(t,e){return await this.typeElement.errorResponse(t,e)}enable(){this.disabled=!1,this.element.classList.remove("dark-editable-element-disabled"),this.modeElement.enable()}disable(){this.disabled=!0,this.element.classList.add("dark-editable-element-disabled"),this.modeElement.enable()}setValue(t){this.value=t,this.init_text()}getValue(){return this.value}}function H(i){const t=parseInt(i.dataset.id),e=parseInt(i.dataset.group),n={pk:e,mode:"inline",url:"./api/v2/transactions/"+e,formType:"journal_description",journalId:t,method:"PUT"};new Y(i,n)}let I=function(){return{notifications:{error:{show:!1,text:"",url:""},success:{show:!1,text:"",url:""},wait:{show:!1,text:""}},groupProperties:{id:0,transactionType:"",transactionTypeTranslated:"",title:"",date:new Date},dateFields:["book_date","due_date","interest_date","invoice_date","payment_date","process_date"],metaFields:["external_id","internal_reference","sepa_batch_id","sepa_ct_id","sepa_ct_op","sepa_db","sepa_country","sepa_cc","sepa_ep","sepa_ci","external_url"],amounts:{},entries:[],pageProperties:{},formatMoney(i,t){return console.log("formatting",i,t),t===""&&(t="EUR"),b(i,t)},format(i){return g(i,h.t("config.date_time_fns"))},init(){this.notifications.wait.show=!0,this.notifications.wait.text=h.t("firefly.wait_loading_data");const i=window.location.href.split("/"),t=parseInt(i[i.length-1]);new E().show(t,{}).then(n=>{const s=n.data.data;this.groupProperties.id=parseInt(s.id),this.groupProperties.transactionType=s.attributes.transactions[0].type,this.groupProperties.transactionTypeTranslated=h.t("firefly."+s.attributes.transactions[0].type),this.groupProperties.title=s.attributes.title??s.attributes.transactions[0].description,this.entries=_(s.attributes.transactions,parseInt(s.id)),this.notifications.wait.show=!1}).then(()=>{for(let s in this.entries)if(this.entries.hasOwnProperty(s)){const o=this.entries[s].currency_code,a=this.entries[s].foreign_currency_code;this.amounts[o]===void 0&&(this.amounts[o]=0,this.amounts[o]+=parseFloat(this.entries[s].amount)),a!==null&&a!==""&&this.amounts[a]===void 0&&(this.amounts[a]=0,this.amounts[a]+=parseFloat(this.entries[s].foreign_amount)),parseInt(s)===0&&(this.groupProperties.date=this.entries[s].date)}const n=document.querySelectorAll(".journal_description");for(const s in n)if(n.hasOwnProperty(s)){const o=n[s];o.addEventListener("save",function(a){parseInt(a.currentTarget.dataset.id);const d=parseInt(a.currentTarget.dataset.group),u=parseInt(a.currentTarget.dataset.length),p=a.currentTarget.textContent;console.log(u),u===1&&(document.querySelector('.group_title[data-group="'+d+'"]').textContent=p,document.querySelector('.group_title_title[data-group="'+d+'"]').textContent=p)}),H(o)}}).catch(n=>{this.notifications.error.show=!0,this.notifications.error.text=n.message})}}},m={show:I,dates:v};function x(){Object.keys(m).forEach(i=>{console.log(`Loading page component "${i}"`);let t=m[i]();Alpine.data(i,()=>t)}),Alpine.start()}document.addEventListener("firefly-iii-bootstrapped",()=>{console.log("Loaded through event listener."),x()});window.bootstrapped&&(console.log("Loaded through window variable."),x());+var y=Object.defineProperty;var w=(i,t,e)=>t in i?y(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var r=(i,t,e)=>(w(i,typeof t!="symbol"?t+"":t,e),e);import{d as v,f as b}from"./format-money-62afb78b.js";import{f as g,i as h}from"./vendor-2609b2c9.js";import{G as E}from"./get-ea675e30.js";import{p as _}from"./parse-downloaded-splits-6b9adc20.js";import"./create-empty-split-aae839d5.js";class l{constructor(t){if(this.constructor===l)throw new Error("It's abstract class");this.context=t}event_show(){this.context.typeElement.hideError(),this.context.typeElement.element.value=this.context.value,this.context.element.dispatchEvent(new CustomEvent("show"))}event_shown(){this.context.element.dispatchEvent(new CustomEvent("shown"))}event_hide(){this.context.element.dispatchEvent(new CustomEvent("hide"))}event_hidden(){this.context.element.dispatchEvent(new CustomEvent("hidden"))}init(){throw new Error("Method `init` not define!")}enable(){throw new Error("Method `enable` not define!")}disable(){throw new Error("Method `disable` not define!")}hide(){throw new Error("Method `hide` not define!")}}class L extends l{init(){this.popover=new bootstrap.Popover(this.context.element,{container:"body",content:this.context.typeElement.create(),html:!0,customClass:"dark-editable",title:this.context.title}),this.context.element.addEventListener("show.bs.popover",()=>{this.event_show()}),this.context.element.addEventListener("shown.bs.popover",()=>{this.event_shown()}),this.context.element.addEventListener("hide.bs.popover",()=>{this.event_hide()}),this.context.element.addEventListener("hidden.bs.popover",()=>{this.event_hidden()}),document.addEventListener("click",t=>{const e=t.target;if(e===this.popover.tip||e===this.context.element)return;let n=e;for(;n=n.parentNode;)if(n===this.popover.tip)return;this.hide()})}enable(){this.popover.enable()}disable(){this.popover.disable()}hide(){this.popover.hide()}}class T extends l{init(){const t=()=>{if(!this.context.disabled){const e=this.context.typeElement.create();this.event_show(),this.context.element.removeEventListener("click",t),this.context.element.innerHTML="",this.context.element.append(e),this.event_shown()}};this.context.element.addEventListener("click",t)}enable(){}disable(){}hide(){this.event_hide(),this.context.element.innerHTML=this.context.value,setTimeout(()=>{this.init(),this.event_hidden()},100)}}class c{constructor(t){r(this,"context",null);r(this,"element",null);r(this,"error",null);r(this,"form",null);r(this,"load",null);r(this,"buttonGroup",null);r(this,"buttons",{success:null,cancel:null});if(this.constructor===c)throw new Error("It's abstract class");this.context=t}create(){throw new Error("Method `create` not define!")}createContainer(t){const e=document.createElement("div");this.element=t,this.error=this.createContainerError(),this.form=this.createContainerForm(),this.load=this.createContainerLoad(),this.buttons.success=this.createButtonSuccess(),this.buttons.cancel=this.createButtonCancel();const n=document.createElement("div");n.classList.add("col-12");const s=document.createElement("label");s.classList.add("visually-hidden"),s.for=t.id,n.append(s,t);const o=document.createElement("div");return o.classList.add("col-12"),this.buttonGroup=this.createButtonGroup(),this.buttonGroup.append(this.buttons.success,this.buttons.cancel),o.append(this.buttonGroup),this.form.append(n,o),e.append(this.error,this.form),e}createButtonGroup(){const t=document.createElement("div");return t.classList.add("btn-group","btn-group-sm"),t}createContainerError(){const t=document.createElement("div");return t.classList.add("text-danger","fst-italic","mb-2","fw-bold"),t.style.display="none",t}createContainerForm(){const t=document.createElement("form");return t.classList.add("row","row-cols-lg-auto","g-3","align-items-center"),t.addEventListener("submit",async e=>{e.preventDefault();const n=this.getValue();if(this.context.send&&this.context.pk&&this.context.url&&this.context.value!==n){this.showLoad();let s;try{const o=await this.ajax(n);o.ok?s=await this.context.success(o,n):s=await this.context.error(o,n)||`${o.status} ${o.statusText}`}catch(o){console.error(o),s=o}s?(this.setError(s),this.showError()):(this.setError(null),this.hideError(),this.context.value=this.getValue(),this.context.modeElement.hide(),this.initText()),this.hideLoad()}else this.context.value=this.getValue(),this.context.modeElement.hide(),this.initText();this.context.element.dispatchEvent(new CustomEvent("save"))}),t}createContainerLoad(){const t=document.createElement("div");t.style.display="none",t.style.position="absolute",t.style.background="white",t.style.width="100%",t.style.height="100%",t.style.top=0,t.style.left=0;const e=document.createElement("div");return e.classList.add("dark-editable-loader"),t.append(e),t}createButton(){const t=document.createElement("button");return t.type="button",t.classList.add("btn","btn-sm"),t.style.color="transparent",t.style.textShadow="0 0 0 white",t}createButtonSuccess(){const t=this.createButton();return t.type="submit",t.classList.add("btn-success"),t.innerHTML="✔",t}createButtonCancel(){const t=this.createButton();t.classList.add("btn-danger");const e=document.createElement("div");return e.innerHTML="✖",t.append(e),t.addEventListener("click",()=>{this.context.modeElement.hide()}),t}hideLoad(){this.load.style.display="none"}showLoad(){this.load.style.display="block"}ajax(t){let e=this.context.url,n,s=!1;console.log(this.context),this.context.options.formType==="journal_description"&&(s=!0,n={transactions:[{transaction_journal_id:this.context.options.journalId,description:t}]}),s===!1&&console.error('Cannot deal with form type "'+this.context.formType+'"');const o={headers:{"Content-Type":"application/json","X-CSRF-TOKEN":document.head.querySelector('meta[name="csrf-token"]').content}};return o.method=this.context.ajaxOptions.method,this.context.options.method&&(o.method=this.context.options.method),o.method==="POST"||this.context.options.method==="PUT"?o.body=JSON.stringify(n):e+="?"+new URLSearchParams(form).toString(),fetch(e,o)}async successResponse(t,e){}async errorResponse(t,e){}setError(t){this.error.innerHTML=t}showError(){this.error.style.display="block"}hideError(){this.error&&(this.error.style.display="none")}createElement(t){const e=document.createElement(t);return console.log(e),e.classList.add("form-control"),this.context.required&&(e.required=this.context.required),this.add_focus(e),e}add_focus(t){this.context.element.addEventListener("shown",function(){t.focus()})}initText(){return this.context.value===""?(this.context.element.innerHTML=this.context.emptytext,!0):(this.context.element.innerHTML=this.context.value,!1)}initOptions(){}getValue(){return this.element.value}}class M extends c{create(){const t=this.createElement("input"),e=this.context.element.id+"_input";return t.type=this.context.type,t.id=e,t.autocomplete="off",t.placeholder=this.context.element.innerText,t.classList.add("form-control","form-control-md"),this.createContainer(t)}}class C extends c{create(){const t=this.createElement("textarea");return this.createContainer(t)}}class k extends c{create(){const t=this.createElement("select");return this.context.source.forEach(e=>{const n=document.createElement("option");n.value=e.value,n.innerHTML=e.text,t.append(n)}),this.createContainer(t)}initText(){if(this.context.element.innerHTML=this.context.emptytext,this.context.value!==""&&this.context.source.length>0)for(const t in this.context.source){const e=this.context.source[t];if(e.value==this.context.value)return this.context.element.innerHTML=e.text,!1}return!0}initOptions(){this.context.get_opt("source",[]),typeof this.context.source=="string"&&this.context.source!==""&&(this.context.source=JSON.parse(this.context.source))}}class f extends c{create(){const t=this.createElement("input");return t.type="date",this.createContainer(t)}initText(){return this.value===""?(this.context.element.innerHTML=this.context.emptytext,!0):(this.context.element.innerHTML=moment(this.context.value).format(this.context.viewformat),!1)}initOptions(){this.context.get_opt("format","YYYY-MM-DD"),this.context.get_opt("viewformat","YYYY-MM-DD")}}class D extends f{create(){const t=this.createElement("input");return t.type="datetime-local",this.createContainer(t)}initOptions(){this.context.get_opt("format","YYYY-MM-DD HH:mm"),this.context.get_opt("viewformat","YYYY-MM-DD HH:mm"),this.context.value=moment(this.context.value).format("YYYY-MM-DDTHH:mm")}}class Y{constructor(t,e={}){r(this,"modeElement",null);r(this,"typeElement",null);r(this,"mode",null);r(this,"type",null);r(this,"emptytext",null);r(this,"viewformat",null);r(this,"pk",null);r(this,"name",null);this.element=t,this.options=e,this.init_options(),this.typeElement=this.route_type(),this.typeElement.initOptions(),this.modeElement=this.route_mode(),this.modeElement.init(),this.init_text(),this.init_style(),this.disabled&&this.disable(),this.element.dispatchEvent(new CustomEvent("init"))}get_opt(t,e){var n,s;return this[t]=((n=this.element.dataset)==null?void 0:n[t])??((s=this.options)==null?void 0:s[t])??e}get_opt_bool(t,e){return this.get_opt(t,e),typeof this[t]!="boolean"&&(this[t]==="true"?this[t]=!0:this[t]==="false"?this[t]=!1:this[t]=e),this[t]}init_options(){var t,e,n,s;this.get_opt("value",this.element.innerHTML),this.get_opt("name",this.element.id),this.get_opt("pk",null),this.get_opt("title",""),this.get_opt("type","text"),this.get_opt("emptytext","Empty"),this.get_opt("mode","popup"),this.get_opt("url",null),this.get_opt("ajaxOptions",{}),this.ajaxOptions=Object.assign({method:"POST",dataType:"text"},this.ajaxOptions),this.get_opt_bool("send",!0),this.get_opt_bool("disabled",!1),this.get_opt_bool("required",!1),(t=this.options)!=null&&t.success&&typeof((e=this.options)==null?void 0:e.success)=="function"&&(this.success=this.options.success),(n=this.options)!=null&&n.error&&typeof((s=this.options)==null?void 0:s.error)=="function"&&(this.error=this.options.error)}init_text(){const t="dark-editable-element-empty";this.element.classList.remove(t),this.typeElement.initText()&&this.element.classList.add(t)}init_style(){this.element.classList.add("dark-editable-element")}route_mode(){switch(this.mode){default:throw new Error(`Mode ${this.mode} not found!`);case"popup":return new L(this);case"inline":return new T(this)}}route_type(){if(this.type.prototype instanceof c)return new this.type(this);if(typeof this.type=="string")switch(this.type){case"text":case"password":case"email":case"url":case"tel":case"number":case"range":case"time":return new M(this);case"textarea":return new C(this);case"select":return new k(this);case"date":return new f(this);case"datetime":return new D(this)}throw new Error("Undefined type")}async success(t,e){return await this.typeElement.successResponse(t,e)}async error(t,e){return await this.typeElement.errorResponse(t,e)}enable(){this.disabled=!1,this.element.classList.remove("dark-editable-element-disabled"),this.modeElement.enable()}disable(){this.disabled=!0,this.element.classList.add("dark-editable-element-disabled"),this.modeElement.enable()}setValue(t){this.value=t,this.init_text()}getValue(){return this.value}}function H(i){const t=parseInt(i.dataset.id),e=parseInt(i.dataset.group),n={pk:e,mode:"inline",url:"./api/v2/transactions/"+e,formType:"journal_description",journalId:t,method:"PUT"};new Y(i,n)}let I=function(){return{notifications:{error:{show:!1,text:"",url:""},success:{show:!1,text:"",url:""},wait:{show:!1,text:""}},groupProperties:{id:0,transactionType:"",transactionTypeTranslated:"",title:"",date:new Date},dateFields:["book_date","due_date","interest_date","invoice_date","payment_date","process_date"],metaFields:["external_id","internal_reference","sepa_batch_id","sepa_ct_id","sepa_ct_op","sepa_db","sepa_country","sepa_cc","sepa_ep","sepa_ci","external_url"],amounts:{},entries:[],pageProperties:{},formatMoney(i,t){return console.log("formatting",i,t),t===""&&(t="EUR"),b(i,t)},format(i){return g(i,h.t("config.date_time_fns"))},init(){this.notifications.wait.show=!0,this.notifications.wait.text=h.t("firefly.wait_loading_data");const i=window.location.href.split("/"),t=parseInt(i[i.length-1]);new E().show(t,{}).then(n=>{const s=n.data.data;this.groupProperties.id=parseInt(s.id),this.groupProperties.transactionType=s.attributes.transactions[0].type,this.groupProperties.transactionTypeTranslated=h.t("firefly."+s.attributes.transactions[0].type),this.groupProperties.title=s.attributes.title??s.attributes.transactions[0].description,this.entries=_(s.attributes.transactions,parseInt(s.id)),this.notifications.wait.show=!1}).then(()=>{for(let s in this.entries)if(this.entries.hasOwnProperty(s)){const o=this.entries[s].currency_code,a=this.entries[s].foreign_currency_code;this.amounts[o]===void 0&&(this.amounts[o]=0,this.amounts[o]+=parseFloat(this.entries[s].amount)),a!==null&&a!==""&&this.amounts[a]===void 0&&(this.amounts[a]=0,this.amounts[a]+=parseFloat(this.entries[s].foreign_amount)),parseInt(s)===0&&(this.groupProperties.date=this.entries[s].date)}const n=document.querySelectorAll(".journal_description");for(const s in n)if(n.hasOwnProperty(s)){const o=n[s];o.addEventListener("save",function(a){parseInt(a.currentTarget.dataset.id);const d=parseInt(a.currentTarget.dataset.group),u=parseInt(a.currentTarget.dataset.length),p=a.currentTarget.textContent;console.log(u),u===1&&(document.querySelector('.group_title[data-group="'+d+'"]').textContent=p,document.querySelector('.group_title_title[data-group="'+d+'"]').textContent=p)}),H(o)}}).catch(n=>{this.notifications.error.show=!0,this.notifications.error.text=n.message})}}},m={show:I,dates:v};function x(){Object.keys(m).forEach(i=>{console.log(`Loading page component "${i}"`);let t=m[i]();Alpine.data(i,()=>t)}),Alpine.start()}document.addEventListener("firefly-iii-bootstrapped",()=>{console.log("Loaded through event listener."),x()});window.bootstrapped&&(console.log("Loaded through window variable."),x());diff --git a/public/build/assets/splice-errors-into-transactions-e53c1920.js b/public/build/assets/splice-errors-into-transactions-528a3749.jssimilarity index 98%rename from public/build/assets/splice-errors-into-transactions-e53c1920.jsrename to public/build/assets/splice-errors-into-transactions-528a3749.jsindex e20840e0e8..1161184eb9 100644--- a/public/build/assets/splice-errors-into-transactions-e53c1920.js+++ b/public/build/assets/splice-errors-into-transactions-528a3749.js@@ -1 +1 @@-import{a as l}from"./format-money-03f73825.js";import{a as p,G as f}from"./get-7f8692a5.js";import{n as m,i as _}from"./vendor-cc723e37.js";function x(r,t,a){let n=[];for(let o in r)if(r.hasOwnProperty(o)){const e=r[o];let i=!1,u={};t!==null&&t.hasOwnProperty(o)&&(i=!0,t[o]);let c={};(i&&u.description!==e.description||!i)&&(c.description=e.description),c.source_name=e.source_account.name,c.destination_name=e.destination_account.name,c.amount=e.amount,c.currency_code=e.currency_code,c.date=e.date,c.interest_date=e.interest_date,c.book_date=e.book_date,c.process_date=e.process_date,c.due_date=e.due_date,c.payment_date=e.payment_date,c.invoice_date=e.invoice_date,c.budget_id=e.budget_id,c.category_name=e.category_name,c.piggy_bank_id=e.piggy_bank_id,c.bill_id=e.bill_id,c.tags=e.tags,c.notes=e.notes,c.internal_reference=e.internal_reference,c.external_url=e.external_url,c.store_location=!1,e.hasLocation&&(c.store_location=!0,c.longitude=e.longitude.toString(),c.latitude=e.latitude.toString(),c.zoom_level=e.zoomLevel),typeof e.foreign_currency_code<"u"&&e.foreign_currency_code.toString()!==""&&(c.foreign_currency_code=e.foreign_currency_code,typeof e.foreign_amount<"u"&&e.foreign_amount.toString()!==""&&(c.foreign_amount=e.foreign_amount),(typeof e.foreign_amount>"u"||e.foreign_amount.toString()==="")&&(delete c.foreign_amount,delete c.foreign_currency_code)),typeof e.source_account.id<"u"&&e.source_account.id.toString()!==""&&(c.source_id=e.source_account.id),typeof e.destination_account.id<"u"&&e.destination_account.id.toString()!==""&&(c.destination_id=e.destination_account.id),c.type=a,n.push(c)}return n}let g=class{list(t){return l.get("/api/v2/currencies",{params:t})}};function C(){let r={page:1,limit:1337};return new g().list(r).then(a=>{let n={defaultCurrency:{},nativeCurrencies:[],foreignCurrencies:[],enabledCurrencies:[]};n.foreignCurrencies.push({id:0,name:"(no foreign currency)",code:"",default:!1,symbol:"",decimal_places:2});for(let o in a.data.data)if(a.data.data.hasOwnProperty(o)){let e=a.data.data[o];if(e.attributes.enabled){let i={id:e.id,name:e.attributes.name,code:e.attributes.code,default:e.attributes.default,symbol:e.attributes.symbol,decimal_places:e.attributes.decimal_places};i.default&&(n.defaultCurrency=i),n.enabledCurrencies.push(i),n.nativeCurrencies.push(i),n.foreignCurrencies.push(i)}}return n})}class y{list(t){return l.get("/api/v2/budgets",{params:t})}}function $(){let r={page:1,limit:1337};return new y().list(r).then(a=>{let n=[{id:0,name:"(no budget)"}];for(let o in a.data.data)if(a.data.data.hasOwnProperty(o)){let e=a.data.data[o],i={id:e.id,name:e.attributes.name};n.push(i)}return n})}function O(){let r={page:1,limit:1337};return new p().list(r).then(a=>{let n={0:{id:0,name:"(no group)",order:0,piggyBanks:[{id:0,name:"(no piggy bank)",order:0}]}};for(let o in a.data.data)if(a.data.data.hasOwnProperty(o)){let e=a.data.data[o],i=e.attributes.object_group_id??"0",u=e.attributes.object_group_title??"(no group)",c={id:e.id,name:e.attributes.name,order:e.attributes.order};n.hasOwnProperty(i)||(n[i]={id:i,name:u,order:e.attributes.object_group_order??0,piggyBanks:[]}),n[i].piggyBanks.push(c),n[i].piggyBanks.sort((d,s)=>d.order-s.order)}return Object.keys(n).sort().reduce((o,e)=>(o[e]=n[e],o),{})})}function P(){let r={page:1,limit:1337};return new f().list(r).then(a=>{let n={0:{id:0,name:"(no group)",order:0,subscriptions:[{id:0,name:"(no subscription)",order:0}]}};for(let o in a.data.data)if(a.data.data.hasOwnProperty(o)){let e=a.data.data[o],i=e.attributes.object_group_id??"0",u=e.attributes.object_group_title??"(no group)",c={id:e.id,name:e.attributes.name,order:e.attributes.order};n.hasOwnProperty(i)||(n[i]={id:i,name:u,order:e.attributes.object_group_order??0,subscriptions:[]}),n[i].subscriptions.push(c),n[i].subscriptions.sort((d,s)=>d.order-s.order)}return Object.keys(n).sort().reduce((o,e)=>(o[e]=n[e],o),{})})}function j(){return{description:"/api/v2/autocomplete/transaction-descriptions",account:"/api/v2/autocomplete/accounts",category:"/api/v2/autocomplete/categories",tag:"/api/v2/autocomplete/tags"}}function A(r){const t={server:r.serverUrl,serverParams:{},fetchOptions:{headers:{"X-CSRF-TOKEN":document.head.querySelector('meta[name="csrf-token"]').content}},hiddenInput:!0,highlightTyped:!0,liveServer:!0};typeof r.filters<"u"&&r.filters.length>0&&(t.serverParams.types=r.filters),typeof r.onRenderItem<"u"&&r.onRenderItem!==null&&(t.onRenderItem=r.onRenderItem),r.valueField&&(t.valueField=r.valueField),r.labelField&&(t.labelField=r.labelField),r.onSelectItem&&(t.onSelectItem=r.onSelectItem),r.onChange&&(t.onChange=r.onChange),r.hiddenValue&&(t.hiddenValue=r.hiddenValue),m.init(r.selector,t)}function q(r,t){const a=parseInt(t._searchInput.attributes["data-index"].value);if(typeof r<"u"&&r.name){document.querySelector("#form")._x_dataStack[0].$data.entries[a].category_name=r.name;return}document.querySelector("#form")._x_dataStack[0].$data.entries[a].category_name=t._searchInput.value}function E(r,t){const a=parseInt(t._searchInput.attributes["data-index"].value);if(typeof r<"u"&&r.description){document.querySelector("#form")._x_dataStack[0].$data.entries[a].description=r.description;return}document.querySelector("#form")._x_dataStack[0].$data.entries[a].description=t._searchInput.value}function B(r,t){if(typeof r>"u"){const a=parseInt(t._searchInput.attributes["data-index"].value);if(document.querySelector("#form")._x_dataStack[0].$data.entries[a].destination_account.name===t._searchInput.value){console.warn('Ignore hallucinated destination account name change to "'+t._searchInput.value+'"');return}document.querySelector("#form")._x_dataStack[0].$data.entries[a].destination_account={name:t._searchInput.value,alpine_name:t._searchInput.value},document.querySelector("#form")._x_dataStack[0].changedDestinationAccount()}}function F(r,t){const a=parseInt(t._searchInput.attributes["data-index"].value);document.querySelector("#form")._x_dataStack[0].$data.entries[a].destination_account={id:r.id,name:r.name,alpine_name:r.name,type:r.type,currency_code:r.currency_code},document.querySelector("#form")._x_dataStack[0].changedDestinationAccount()}function G(r,t){if(typeof r>"u"){const a=parseInt(t._searchInput.attributes["data-index"].value);if(document.querySelector("#form")._x_dataStack[0].$data.entries[a].source_account.name===t._searchInput.value)return;document.querySelector("#form")._x_dataStack[0].$data.entries[a].source_account={name:t._searchInput.value,alpine_name:t._searchInput.value},document.querySelector("#form")._x_dataStack[0].changedSourceAccount()}}function R(r,t){const a=parseInt(t._searchInput.attributes["data-index"].value);document.querySelector("#form")._x_dataStack[0].$data.entries[a].source_account={id:r.id,name:r.name,alpine_name:r.name,type:r.type,currency_code:r.currency_code},document.querySelector("#form")._x_dataStack[0].changedSourceAccount()}class h{post(t,a,n){let o="/api/v1/attachments";return l.post(o,{filename:t,attachable_type:a,attachable_id:n})}upload(t,a){let n="./api/v1/attachments/"+t+"/upload";return axios.post(n,a)}}let b=function(r){let t=r.length,a=0,n=!1;for(const o in r)if(r.hasOwnProperty(o)&&/^0$|^[1-9]\d*$/.test(o)&&o<=4294967294&&n===!1){let e=new h;e.post(r[o].name,"TransactionJournal",r[o].journal).then(i=>{let u=parseInt(i.data.data.id);e.upload(u,r[o].content).then(c=>{if(a++,a===t){const d=new CustomEvent("upload-success",{some:"details"});document.dispatchEvent(d)}}).catch(c=>{console.error("Could not upload"),console.error(c),a++;const d=new CustomEvent("upload-failed",{error:c});document.dispatchEvent(d),n=!0})}).catch(i=>{console.error("Could not create upload."),console.error(i),a++;const u=new CustomEvent("upload-failed",{error:i});document.dispatchEvent(u),n=!0})}};function T(r,t){t=t.reverse();let a=[],n=0,o=[],e=document.querySelectorAll('input[name="attachments[]"]');for(const i in e)if(e.hasOwnProperty(i)&&/^0$|^[1-9]\d*$/.test(i)&&i<=4294967294)for(const u in e[i].files)e[i].files.hasOwnProperty(u)&&/^0$|^[1-9]\d*$/.test(u)&&u<=4294967294&&(a.push({journal:t[i].transaction_journal_id,file:e[i].files[u]}),n++);for(const i in a)a.hasOwnProperty(i)&&/^0$|^[1-9]\d*$/.test(i)&&i<=4294967294&&function(u,c){let d=new FileReader;d.onloadend=function(s){s.target.readyState===FileReader.DONE&&(o.push({name:a[c].file.name,journal:a[c].journal,content:new Blob([s.target.result])}),o.length===n&&b(o))},d.readAsArrayBuffer(u.file)}(a[i],i);return n}function v(r,t,a){let n=[];for(let o in a)a.hasOwnProperty(o)&&n.push(a[o].replace(r,t));return n}function D(r,t){let a,n,o;for(const e in r)if(r.hasOwnProperty(e)){if(e==="group_title"){console.error("Cannot handle error in group title.");continue}if(a=parseInt(e.split(".")[1]),n=e.split(".")[2],o=v(e,n,r[e]),!t.hasOwnProperty(a)){console.error("Cannot handle errors in index #"+a);continue}switch(n){case"currency_code":case"foreign_currency_code":case"category_name":case"piggy_bank_id":case"notes":case"internal_reference":case"external_url":case"latitude":case"longitude":case"zoom_level":case"interest_date":case"book_date":case"process_date":case"due_date":case"payment_date":case"invoice_date":case"amount":case"date":case"budget_id":case"bill_id":case"description":case"tags":t[a].errors[n]=o;break;case"source_name":case"source_id":t[a].errors.source_account=t[a].errors.source_account.concat(o);break;case"type":t[a].errors.source_account=t[a].errors.source_account.concat([_.t("validation.bad_type_source")]),t[a].errors.destination_account=t[a].errors.destination_account.concat([_.t("validation.bad_type_destination")]);break;case"destination_name":case"destination_id":t[a].errors.destination_account=t[a].errors.destination_account.concat(o);break;case"foreign_amount":case"foreign_currency_id":t[a].errors.foreign_amount=t[a].errors.foreign_amount.concat(o);break}typeof t[a]<"u"&&(t[a].errors.source_account=Array.from(new Set(t[a].errors.source_account)),t[a].errors.destination_account=Array.from(new Set(t[a].errors.destination_account)))}return console.log(t[0].errors),t}export{$ as a,O as b,P as c,T as d,A as e,G as f,R as g,B as h,F as i,j,q as k,C as l,E as m,x as p,D as s};+import{a as l}from"./format-money-62afb78b.js";import{a as p,G as f}from"./get-5b4283ca.js";import{n as m,i as _}from"./vendor-2609b2c9.js";function x(r,t,a){let n=[];for(let o in r)if(r.hasOwnProperty(o)){const e=r[o];let i=!1,u={};t!==null&&t.hasOwnProperty(o)&&(i=!0,t[o]);let c={};(i&&u.description!==e.description||!i)&&(c.description=e.description),c.source_name=e.source_account.name,c.destination_name=e.destination_account.name,c.amount=e.amount,c.currency_code=e.currency_code,c.date=e.date,c.interest_date=e.interest_date,c.book_date=e.book_date,c.process_date=e.process_date,c.due_date=e.due_date,c.payment_date=e.payment_date,c.invoice_date=e.invoice_date,c.budget_id=e.budget_id,c.category_name=e.category_name,c.piggy_bank_id=e.piggy_bank_id,c.bill_id=e.bill_id,c.tags=e.tags,c.notes=e.notes,c.internal_reference=e.internal_reference,c.external_url=e.external_url,c.store_location=!1,e.hasLocation&&(c.store_location=!0,c.longitude=e.longitude.toString(),c.latitude=e.latitude.toString(),c.zoom_level=e.zoomLevel),typeof e.foreign_currency_code<"u"&&e.foreign_currency_code.toString()!==""&&(c.foreign_currency_code=e.foreign_currency_code,typeof e.foreign_amount<"u"&&e.foreign_amount.toString()!==""&&(c.foreign_amount=e.foreign_amount),(typeof e.foreign_amount>"u"||e.foreign_amount.toString()==="")&&(delete c.foreign_amount,delete c.foreign_currency_code)),typeof e.source_account.id<"u"&&e.source_account.id.toString()!==""&&(c.source_id=e.source_account.id),typeof e.destination_account.id<"u"&&e.destination_account.id.toString()!==""&&(c.destination_id=e.destination_account.id),c.type=a,n.push(c)}return n}let g=class{list(t){return l.get("/api/v2/currencies",{params:t})}};function C(){let r={page:1,limit:1337};return new g().list(r).then(a=>{let n={defaultCurrency:{},nativeCurrencies:[],foreignCurrencies:[],enabledCurrencies:[]};n.foreignCurrencies.push({id:0,name:"(no foreign currency)",code:"",default:!1,symbol:"",decimal_places:2});for(let o in a.data.data)if(a.data.data.hasOwnProperty(o)){let e=a.data.data[o];if(e.attributes.enabled){let i={id:e.id,name:e.attributes.name,code:e.attributes.code,default:e.attributes.default,symbol:e.attributes.symbol,decimal_places:e.attributes.decimal_places};i.default&&(n.defaultCurrency=i),n.enabledCurrencies.push(i),n.nativeCurrencies.push(i),n.foreignCurrencies.push(i)}}return n})}class y{list(t){return l.get("/api/v2/budgets",{params:t})}}function $(){let r={page:1,limit:1337};return new y().list(r).then(a=>{let n=[{id:0,name:"(no budget)"}];for(let o in a.data.data)if(a.data.data.hasOwnProperty(o)){let e=a.data.data[o],i={id:e.id,name:e.attributes.name};n.push(i)}return n})}function O(){let r={page:1,limit:1337};return new p().list(r).then(a=>{let n={0:{id:0,name:"(no group)",order:0,piggyBanks:[{id:0,name:"(no piggy bank)",order:0}]}};for(let o in a.data.data)if(a.data.data.hasOwnProperty(o)){let e=a.data.data[o],i=e.attributes.object_group_id??"0",u=e.attributes.object_group_title??"(no group)",c={id:e.id,name:e.attributes.name,order:e.attributes.order};n.hasOwnProperty(i)||(n[i]={id:i,name:u,order:e.attributes.object_group_order??0,piggyBanks:[]}),n[i].piggyBanks.push(c),n[i].piggyBanks.sort((d,s)=>d.order-s.order)}return Object.keys(n).sort().reduce((o,e)=>(o[e]=n[e],o),{})})}function P(){let r={page:1,limit:1337};return new f().list(r).then(a=>{let n={0:{id:0,name:"(no group)",order:0,subscriptions:[{id:0,name:"(no subscription)",order:0}]}};for(let o in a.data.data)if(a.data.data.hasOwnProperty(o)){let e=a.data.data[o],i=e.attributes.object_group_id??"0",u=e.attributes.object_group_title??"(no group)",c={id:e.id,name:e.attributes.name,order:e.attributes.order};n.hasOwnProperty(i)||(n[i]={id:i,name:u,order:e.attributes.object_group_order??0,subscriptions:[]}),n[i].subscriptions.push(c),n[i].subscriptions.sort((d,s)=>d.order-s.order)}return Object.keys(n).sort().reduce((o,e)=>(o[e]=n[e],o),{})})}function j(){return{description:"/api/v2/autocomplete/transaction-descriptions",account:"/api/v2/autocomplete/accounts",category:"/api/v2/autocomplete/categories",tag:"/api/v2/autocomplete/tags"}}function A(r){const t={server:r.serverUrl,serverParams:{},fetchOptions:{headers:{"X-CSRF-TOKEN":document.head.querySelector('meta[name="csrf-token"]').content}},hiddenInput:!0,highlightTyped:!0,liveServer:!0};typeof r.filters<"u"&&r.filters.length>0&&(t.serverParams.types=r.filters),typeof r.onRenderItem<"u"&&r.onRenderItem!==null&&(t.onRenderItem=r.onRenderItem),r.valueField&&(t.valueField=r.valueField),r.labelField&&(t.labelField=r.labelField),r.onSelectItem&&(t.onSelectItem=r.onSelectItem),r.onChange&&(t.onChange=r.onChange),r.hiddenValue&&(t.hiddenValue=r.hiddenValue),m.init(r.selector,t)}function q(r,t){const a=parseInt(t._searchInput.attributes["data-index"].value);if(typeof r<"u"&&r.name){document.querySelector("#form")._x_dataStack[0].$data.entries[a].category_name=r.name;return}document.querySelector("#form")._x_dataStack[0].$data.entries[a].category_name=t._searchInput.value}function E(r,t){const a=parseInt(t._searchInput.attributes["data-index"].value);if(typeof r<"u"&&r.description){document.querySelector("#form")._x_dataStack[0].$data.entries[a].description=r.description;return}document.querySelector("#form")._x_dataStack[0].$data.entries[a].description=t._searchInput.value}function B(r,t){if(typeof r>"u"){const a=parseInt(t._searchInput.attributes["data-index"].value);if(document.querySelector("#form")._x_dataStack[0].$data.entries[a].destination_account.name===t._searchInput.value){console.warn('Ignore hallucinated destination account name change to "'+t._searchInput.value+'"');return}document.querySelector("#form")._x_dataStack[0].$data.entries[a].destination_account={name:t._searchInput.value,alpine_name:t._searchInput.value},document.querySelector("#form")._x_dataStack[0].changedDestinationAccount()}}function F(r,t){const a=parseInt(t._searchInput.attributes["data-index"].value);document.querySelector("#form")._x_dataStack[0].$data.entries[a].destination_account={id:r.id,name:r.name,alpine_name:r.name,type:r.type,currency_code:r.currency_code},document.querySelector("#form")._x_dataStack[0].changedDestinationAccount()}function G(r,t){if(typeof r>"u"){const a=parseInt(t._searchInput.attributes["data-index"].value);if(document.querySelector("#form")._x_dataStack[0].$data.entries[a].source_account.name===t._searchInput.value)return;document.querySelector("#form")._x_dataStack[0].$data.entries[a].source_account={name:t._searchInput.value,alpine_name:t._searchInput.value},document.querySelector("#form")._x_dataStack[0].changedSourceAccount()}}function R(r,t){const a=parseInt(t._searchInput.attributes["data-index"].value);document.querySelector("#form")._x_dataStack[0].$data.entries[a].source_account={id:r.id,name:r.name,alpine_name:r.name,type:r.type,currency_code:r.currency_code},document.querySelector("#form")._x_dataStack[0].changedSourceAccount()}class h{post(t,a,n){let o="/api/v1/attachments";return l.post(o,{filename:t,attachable_type:a,attachable_id:n})}upload(t,a){let n="./api/v1/attachments/"+t+"/upload";return axios.post(n,a)}}let b=function(r){let t=r.length,a=0,n=!1;for(const o in r)if(r.hasOwnProperty(o)&&/^0$|^[1-9]\d*$/.test(o)&&o<=4294967294&&n===!1){let e=new h;e.post(r[o].name,"TransactionJournal",r[o].journal).then(i=>{let u=parseInt(i.data.data.id);e.upload(u,r[o].content).then(c=>{if(a++,a===t){const d=new CustomEvent("upload-success",{some:"details"});document.dispatchEvent(d)}}).catch(c=>{console.error("Could not upload"),console.error(c),a++;const d=new CustomEvent("upload-failed",{error:c});document.dispatchEvent(d),n=!0})}).catch(i=>{console.error("Could not create upload."),console.error(i),a++;const u=new CustomEvent("upload-failed",{error:i});document.dispatchEvent(u),n=!0})}};function T(r,t){t=t.reverse();let a=[],n=0,o=[],e=document.querySelectorAll('input[name="attachments[]"]');for(const i in e)if(e.hasOwnProperty(i)&&/^0$|^[1-9]\d*$/.test(i)&&i<=4294967294)for(const u in e[i].files)e[i].files.hasOwnProperty(u)&&/^0$|^[1-9]\d*$/.test(u)&&u<=4294967294&&(a.push({journal:t[i].transaction_journal_id,file:e[i].files[u]}),n++);for(const i in a)a.hasOwnProperty(i)&&/^0$|^[1-9]\d*$/.test(i)&&i<=4294967294&&function(u,c){let d=new FileReader;d.onloadend=function(s){s.target.readyState===FileReader.DONE&&(o.push({name:a[c].file.name,journal:a[c].journal,content:new Blob([s.target.result])}),o.length===n&&b(o))},d.readAsArrayBuffer(u.file)}(a[i],i);return n}function v(r,t,a){let n=[];for(let o in a)a.hasOwnProperty(o)&&n.push(a[o].replace(r,t));return n}function D(r,t){let a,n,o;for(const e in r)if(r.hasOwnProperty(e)){if(e==="group_title"){console.error("Cannot handle error in group title.");continue}if(a=parseInt(e.split(".")[1]),n=e.split(".")[2],o=v(e,n,r[e]),!t.hasOwnProperty(a)){console.error("Cannot handle errors in index #"+a);continue}switch(n){case"currency_code":case"foreign_currency_code":case"category_name":case"piggy_bank_id":case"notes":case"internal_reference":case"external_url":case"latitude":case"longitude":case"zoom_level":case"interest_date":case"book_date":case"process_date":case"due_date":case"payment_date":case"invoice_date":case"amount":case"date":case"budget_id":case"bill_id":case"description":case"tags":t[a].errors[n]=o;break;case"source_name":case"source_id":t[a].errors.source_account=t[a].errors.source_account.concat(o);break;case"type":t[a].errors.source_account=t[a].errors.source_account.concat([_.t("validation.bad_type_source")]),t[a].errors.destination_account=t[a].errors.destination_account.concat([_.t("validation.bad_type_destination")]);break;case"destination_name":case"destination_id":t[a].errors.destination_account=t[a].errors.destination_account.concat(o);break;case"foreign_amount":case"foreign_currency_id":t[a].errors.foreign_amount=t[a].errors.foreign_amount.concat(o);break}typeof t[a]<"u"&&(t[a].errors.source_account=Array.from(new Set(t[a].errors.source_account)),t[a].errors.destination_account=Array.from(new Set(t[a].errors.destination_account)))}return console.log(t[0].errors),t}export{$ as a,O as b,P as c,T as d,A as e,G as f,R as g,B as h,F as i,j,q as k,C as l,E as m,x as p,D as s};diff --git a/public/build/assets/vendor-cc723e37.js b/public/build/assets/vendor-2609b2c9.jssimilarity index 98%rename from public/build/assets/vendor-cc723e37.jsrename to public/build/assets/vendor-2609b2c9.jsindex 2441ba7466..52c57bc2d0 100644--- a/public/build/assets/vendor-cc723e37.js+++ b/public/build/assets/vendor-2609b2c9.js@@ -48,7 +48,7 @@ ${t?'Expression: "'+t+`"* Released under the MIT license*/const FORMATS={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};adapters._date.override({_id:"date-fns",formats:function(){return FORMATS},parse:function(n,e){if(n===null||typeof n>"u")return null;const t=typeof n;return t==="number"||n instanceof Date?n=toDate(n):t==="string"&&(typeof e=="string"?n=parse$1(n,e,new Date,this.options):n=parseISO(n,this.options)),isValid(n)?n.getTime():null},format:function(n,e){return format(n,e,this.options)},add:function(n,e,t){switch(t){case"millisecond":return addMilliseconds(n,e);case"second":return addSeconds(n,e);case"minute":return addMinutes(n,e);case"hour":return addHours(n,e);case"day":return addDays(n,e);case"week":return addWeeks(n,e);case"month":return addMonths(n,e);case"quarter":return addQuarters(n,e);case"year":return addYears(n,e);default:return n}},diff:function(n,e,t){switch(t){case"millisecond":return differenceInMilliseconds(n,e);case"second":return differenceInSeconds(n,e);case"minute":return differenceInMinutes(n,e);case"hour":return differenceInHours(n,e);case"day":return differenceInDays(n,e);case"week":return differenceInWeeks(n,e);case"month":return differenceInMonths(n,e);case"quarter":return differenceInQuarters(n,e);case"year":return differenceInYears(n,e);default:return 0}},startOf:function(n,e,t){switch(e){case"second":return startOfSecond(n);case"minute":return startOfMinute(n);case"hour":return startOfHour(n);case"day":return startOfDay(n);case"week":return startOfWeek(n);case"isoWeek":return startOfWeek(n,{weekStartsOn:+t});case"month":return startOfMonth(n);case"quarter":return startOfQuarter(n);case"year":return startOfYear(n);default:return n}},endOf:function(n,e){switch(e){case"second":return endOfSecond(n);case"minute":return endOfMinute(n);case"hour":return endOfHour(n);case"day":return endOfDay(n);case"week":return endOfWeek(n);case"month":return endOfMonth(n);case"quarter":return endOfQuarter(n);case"year":return endOfYear(n);default:return n}}});const leaflet="",DEFAULTS$1={showAllSuggestions:!1,suggestionsThreshold:1,maximumItems:0,autoselectFirst:!0,ignoreEnter:!1,updateOnSelect:!1,highlightTyped:!1,highlightClass:"",fullWidth:!1,fixed:!1,fuzzy:!1,startsWith:!1,fillIn:!1,preventBrowserAutocomplete:!1,itemClass:"",activeClasses:["bg-primary","text-white"],labelField:"label",valueField:"value",searchFields:["label"],queryParam:"query",items:[],source:null,hiddenInput:!1,hiddenValue:"",clearControl:"",datalist:"",server:"",serverMethod:"GET",serverParams:{},serverDataKey:"data",fetchOptions:{},liveServer:!1,noCache:!0,debounceTime:300,notFoundMessage:"",onRenderItem:(n,e,t)=>e,onSelectItem:(n,e)=>{},onServerResponse:(n,e)=>n.json(),onChange:(n,e)=>{},onBeforeFetch:n=>{},onAfterFetch:n=>{}},LOADING_CLASS$1="is-loading",ACTIVE_CLASS$1="is-active",SHOW_CLASS$1="show",NEXT$1="next",PREV$1="prev",INSTANCE_MAP$1=new WeakMap;let counter$1=0,activeCounter=0;function debounce$2(n,e=300){let t;return(...i)=>{clearTimeout(t),t=setTimeout(()=>{n.apply(this,i)},e)}}function removeDiacritics$1(n){return n.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function normalize$1(n){return n?removeDiacritics$1(n.toString()).toLowerCase():""}function fuzzyMatch$1(n,e){if(n.indexOf(e)>=0)return!0;let t=0;for(let i=0;i<e.length;i++){const s=e[i];if(s!=" "&&(t=n.indexOf(s,t)+1,t<=0))return!1}return!0}function insertAfter(n,e){return n.parentNode.insertBefore(e,n.nextSibling)}function decodeHtml(n){var e=document.createElement("textarea");return e.innerHTML=n,e.value}function attrs$1(n,e){for(const[t,i]of Object.entries(e))n.setAttribute(t,i)}function zwijit(n){n.ariaLabel=n.innerText,n.innerHTML=n.innerText.split("").map(e=>e+"‍").join("")}function nested$1(n,e="window"){return n.split(".").reduce((t,i)=>t[i],e)}class Autocomplete{constructor(e,t={}){G(this,"handleEvent",e=>{["scroll","resize"].includes(e.type)?(this._timer&&window.cancelAnimationFrame(this._timer),this._timer=window.requestAnimationFrame(()=>{this[`on${e.type}`](e)})):this[`on${e.type}`](e)});if(!(e instanceof HTMLElement)){console.error("Invalid element",e);return}INSTANCE_MAP$1.set(e,this),counter$1++,activeCounter++,this._searchInput=e,this._configure(t),this._preventInput=!1,this._keyboardNavigation=!1,this._searchFunc=debounce$2(()=>{this._loadFromServer(!0)},this._config.debounceTime),this._configureSearchInput(),this._configureDropElement(),this._config.fixed&&(document.addEventListener("scroll",this,!0),window.addEventListener("resize",this));const i=this._getClearControl();i&&i.addEventListener("click",this),["focus","change","blur","input","keydown"].forEach(s=>{this._searchInput.addEventListener(s,this)}),["mousemove","mouseleave"].forEach(s=>{this._dropElement.addEventListener(s,this)}),this._fetchData()}static init(e="input.autocomplete",t={}){document.querySelectorAll(e).forEach(s=>{this.getOrCreateInstance(s,t)})}static getInstance(e){return INSTANCE_MAP$1.has(e)?INSTANCE_MAP$1.get(e):null}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,t)}dispose(){activeCounter--,["focus","change","blur","input","keydown"].forEach(t=>{this._searchInput.removeEventListener(t,this)}),["mousemove","mouseleave"].forEach(t=>{this._dropElement.removeEventListener(t,this)});const e=this._getClearControl();e&&e.removeEventListener("click",this),this._config.fixed&&activeCounter<=0&&(document.removeEventListener("scroll",this,!0),window.removeEventListener("resize",this)),this._dropElement.parentElement.removeChild(this._dropElement),INSTANCE_MAP$1.delete(this._searchInput)}_getClearControl(){if(this._config.clearControl)return document.querySelector(this._config.clearControl)}_configure(e={}){this._config=Object.assign({},DEFAULTS$1);const t={...e,...this._searchInput.dataset},i=s=>["true","false","1","0",!0,!1].includes(s)&&!!JSON.parse(s);for(const[s,o]of Object.entries(DEFAULTS$1)){if(t[s]===void 0)continue;const r=t[s];switch(typeof o){case"number":this._config[s]=parseInt(r);break;case"boolean":this._config[s]=i(r);break;case"string":this._config[s]=r.toString();break;case"object":if(Array.isArray(o))if(typeof r=="string"){const a=r.includes("|")?"|":",";this._config[s]=r.split(a)}else this._config[s]=r;else this._config[s]=typeof r=="string"?JSON.parse(r):r;break;case"function":this._config[s]=typeof r=="string"?window[r]:r;break;default:this._config[s]=r;break}}}_configureSearchInput(){if(this._searchInput.autocomplete="off",this._searchInput.spellcheck=!1,attrs$1(this._searchInput,{"aria-autocomplete":"list","aria-haspopup":"menu","aria-expanded":"false",role:"combobox"}),this._searchInput.id&&this._config.preventBrowserAutocomplete){const e=document.querySelector(`[for="${this._searchInput.id}"]`);e&&zwijit(e)}this._hiddenInput=null,this._config.hiddenInput&&(this._hiddenInput=document.createElement("input"),this._hiddenInput.type="hidden",this._hiddenInput.value=this._config.hiddenValue,this._hiddenInput.name=this._searchInput.name,this._searchInput.name="_"+this._searchInput.name,insertAfter(this._searchInput,this._hiddenInput))}_configureDropElement(){this._dropElement=document.createElement("ul"),this._dropElement.id="ac-menu-"+counter$1,this._dropElement.classList.add("dropdown-menu","autocomplete-menu","p-0"),this._dropElement.style.maxHeight="280px",this._config.fullWidth||(this._dropElement.style.maxWidth="360px"),this._config.fixed&&(this._dropElement.style.position="fixed"),this._dropElement.style.overflowY="auto",this._dropElement.style.overscrollBehavior="contain",this._dropElement.style.textAlign="unset",insertAfter(this._searchInput,this._dropElement),this._searchInput.setAttribute("aria-controls",this._dropElement.id)}onclick(e){e.target.matches(this._config.clearControl)&&this.clear()}oninput(e){this._preventInput||(this._hiddenInput&&(this._hiddenInput.value=null),this.showOrSearch())}onchange(e){const t=this._searchInput.value,i=Object.values(this._items).find(s=>s.label===t);this._config.onChange(i,this)}onblur(e){if(e.relatedTarget&&e.relatedTarget.classList.contains("modal")){this._searchInput.focus();return}setTimeout(()=>{this.hideSuggestions()},100)}onfocus(e){this.showOrSearch()}onkeydown(e){switch(e.keyCode||e.key){case 13:case"Enter":if(this.isDropdownVisible()){const i=this.getSelection();i&&i.click(),(i||!this._config.ignoreEnter)&&e.preventDefault()}break;case 38:case"ArrowUp":e.preventDefault(),this._keyboardNavigation=!0,this._moveSelection(PREV$1);break;case 40:case"ArrowDown":e.preventDefault(),this._keyboardNavigation=!0,this.isDropdownVisible()?this._moveSelection(NEXT$1):this.showOrSearch(!1);break;case 27:case"Escape":this.isDropdownVisible()&&(this._searchInput.focus(),this.hideSuggestions());break}}onmousemove(e){this._keyboardNavigation=!1}onmouseleave(e){this.removeSelection()}onscroll(e){this._positionMenu()}onresize(e){this._positionMenu()}getConfig(e=null){return e!==null?this._config[e]:this._config}setConfig(e,t){this._config[e]=t}setData(e){this._items={},this._addItems(e)}enable(){this._searchInput.setAttribute("disabled","")}disable(){this._searchInput.removeAttribute("disabled")}isDisabled(){return this._searchInput.hasAttribute("disabled")||this._searchInput.disabled||this._searchInput.hasAttribute("readonly")}isDropdownVisible(){return this._dropElement.classList.contains(SHOW_CLASS$1)}clear(){this._searchInput.value="",this._hiddenInput&&(this._hiddenInput.value="")}getSelection(){return this._dropElement.querySelector("a."+ACTIVE_CLASS$1)}removeSelection(){const e=this.getSelection();e&&e.classList.remove(...this._activeClasses())}_activeClasses(){return[...this._config.activeClasses,ACTIVE_CLASS$1]}_isItemEnabled(e){if(e.style.display==="none")return!1;const t=e.firstElementChild;return t.tagName==="A"&&!t.classList.contains("disabled")}_moveSelection(e=NEXT$1,t=null){const i=this.getSelection();if(i){const s=e===NEXT$1?"nextSibling":"previousSibling";t=i.parentNode;do t=t[s];while(t&&!this._isItemEnabled(t));t?(i.classList.remove(...this._activeClasses()),e===PREV$1?t.parentNode.scrollTop=t.offsetTop-t.parentNode.offsetTop:t.offsetTop>t.parentNode.offsetHeight-t.offsetHeight&&(t.parentNode.scrollTop+=t.offsetHeight)):i&&(t=i.parentElement)}else{if(e===PREV$1)return t;if(!t)for(t=this._dropElement.firstChild;t&&!this._isItemEnabled(t);)t=t.nextSibling}if(t){const s=t.querySelector("a");s.classList.add(...this._activeClasses()),this._searchInput.setAttribute("aria-activedescendant",s.id),this._config.updateOnSelect&&(this._searchInput.value=s.dataset.label)}else this._searchInput.setAttribute("aria-activedescendant","");return t}_shouldShow(){return this.isDisabled()?!1:this._searchInput.value.length>=this._config.suggestionsThreshold}showOrSearch(e=!0){if(e&&!this._shouldShow()){this.hideSuggestions();return}this._config.liveServer?this._searchFunc():this._config.source?this._config.source(this._searchInput.value,t=>{this.setData(t),this._showSuggestions()}):this._showSuggestions()}_createGroup(e){const t=this._createLi(),i=document.createElement("span");return t.append(i),i.classList.add("dropdown-header","text-truncate"),i.innerHTML=e,t}_createItem(e,t){let i=t.label;if(this._config.highlightTyped){const r=normalize$1(i).indexOf(e);r!==-1&&(i=i.substring(0,r)+`<mark class="${this._config.highlightClass}">${i.substring(r,r+e.length)}</mark>`+i.substring(r+e.length,i.length))}i=this._config.onRenderItem(t,i,this);const s=this._createLi(),o=document.createElement("a");if(s.append(o),o.id=this._dropElement.id+"-"+this._dropElement.children.length,o.classList.add("dropdown-item","text-truncate"),this._config.itemClass&&o.classList.add(...this._config.itemClass.split(" ")),o.setAttribute("data-value",t.value),o.setAttribute("data-label",t.label),o.setAttribute("tabindex","-1"),o.setAttribute("role","menuitem"),o.setAttribute("href","#"),o.innerHTML=i,t.data)for(const[r,a]of Object.entries(t.data))o.dataset[r]=a;if(this._config.fillIn){const r=document.createElement("button");r.type="button",r.classList.add("btn","btn-link","border-0"),r.innerHTML=`<svg width="16" height="16" fill="currentColor" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2 2.5a.5.5 0 0 1 .5-.5h6a.5.5 0 0 1 0 1H3.707l10.147 10.146a.5.5 0 0 1-.708.708L3 3.707V8.5a.5.5 0 0 1-1 0z"/>- </svg>`,s.append(r),s.classList.add("d-flex","justify-content-between"),r.addEventListener("click",a=>{this._searchInput.value=t.label,this._searchInput.focus()})}return o.addEventListener("mouseenter",r=>{this._keyboardNavigation||(this.removeSelection(),s.querySelector("a").classList.add(...this._activeClasses()))}),o.addEventListener("mousedown",r=>{r.preventDefault()}),o.addEventListener("click",r=>{r.preventDefault(),this._preventInput=!0,this._searchInput.value=decodeHtml(t.label),this._hiddenInput&&(this._hiddenInput.value=t.value),this._config.onSelectItem(t,this),this.hideSuggestions(),this._preventInput=!1}),s}_showSuggestions(){if(document.activeElement!=this._searchInput)return;const e=normalize$1(this._searchInput.value);this._dropElement.innerHTML="";const t=Object.keys(this._items);let i=0,s=null;const o=[];for(let r=0;r<t.length;r++){const a=t[r],l=this._items[a],d=this._config.showAllSuggestions||e.length===0;let h=e.length==0&&this._config.suggestionsThreshold===0;!d&&e.length>0&&this._config.searchFields.forEach(m=>{const v=normalize$1(l[m]);let y=!1;if(this._config.fuzzy)y=fuzzyMatch$1(v,e);else{const b=v.indexOf(e);y=this._config.startsWith?b===0:b>=0}y&&(h=!0)});const p=h||e.length===0;if(d||h){if(i++,l.group&&!o.includes(l.group)){const v=this._createGroup(l.group);this._dropElement.appendChild(v),o.push(l.group)}const m=this._createItem(e,l);if(!s&&p&&(s=m),this._dropElement.appendChild(m),this._config.maximumItems>0&&i>=this._config.maximumItems)break}}if(s&&this._config.autoselectFirst&&(this.removeSelection(),this._moveSelection(NEXT$1,s)),i===0)if(this._config.notFoundMessage){const r=this._createLi();r.innerHTML=`<span class="dropdown-item">${this._config.notFoundMessage}</span>`,this._dropElement.appendChild(r),this._showDropdown()}else this.hideSuggestions();else this._showDropdown()}_createLi(){const e=document.createElement("li");return e.setAttribute("role","presentation"),e}_showDropdown(){this._dropElement.classList.add(SHOW_CLASS$1),this._dropElement.setAttribute("role","menu"),attrs$1(this._searchInput,{"aria-expanded":"true"}),this._positionMenu()}toggleSuggestions(e=!0){this._dropElement.classList.contains(SHOW_CLASS$1)?this.hideSuggestions():this.showOrSearch(e)}hideSuggestions(){this._dropElement.classList.remove(SHOW_CLASS$1),attrs$1(this._searchInput,{"aria-expanded":"false"}),this.removeSelection()}getInput(){return this._searchInput}getDropMenu(){return this._dropElement}_positionMenu(){const e=window.getComputedStyle(this._searchInput),t=this._searchInput.getBoundingClientRect(),i=e.direction==="rtl",s=this._config.fullWidth,o=this._config.fixed;let r=null,a=null;o&&(r=t.x,a=t.y+t.height,i&&!s&&(r-=this._dropElement.offsetWidth-t.width)),this._dropElement.style.transform="unset",s&&(this._dropElement.style.width=this._searchInput.offsetWidth+"px"),r!==null&&(this._dropElement.style.left=r+"px"),a!==null&&(this._dropElement.style.top=a+"px");const l=this._dropElement.getBoundingClientRect(),d=window.innerHeight;if(l.y+l.height>d){const h=s?t.height+4:t.height;this._dropElement.style.transform="translateY(calc(-100.1% - "+h+"px))"}}_fetchData(){this._items={},this._addItems(this._config.items);const e=this._config.datalist;if(e){const t=document.querySelector(`#${e}`);if(t){const i=Array.from(t.children).map(s=>{const o=s.getAttribute("value")??s.innerHTML.toLowerCase(),r=s.innerHTML;return{value:o,label:r}});this._addItems(i)}else console.error(`Datalist not found ${e}`)}this._setHiddenVal(),this._config.server&&!this._config.liveServer&&this._loadFromServer()}_setHiddenVal(){if(this._config.hiddenInput&&!this._config.hiddenValue)for(const[e,t]of Object.entries(this._items))t.label==this._searchInput.value&&(this._hiddenInput.value=e)}_addItems(e){const t=Object.keys(e);for(let i=0;i<t.length;i++){const s=t[i],o=e[s];if(o.group&&o.items){o.items.forEach(l=>l.group=o.group),this._addItems(o.items);continue}const r=typeof o=="string"?o:o.label,a=typeof o!="object"?{}:o;a.label=o[this._config.labelField]??r,a.value=o[this._config.valueField]??s,a.label&&(this._items[a.value]=a)}}_loadFromServer(e=!1){this._abortController&&this._abortController.abort(),this._abortController=new AbortController;let t=this._searchInput.dataset.serverParams||{};typeof t=="string"&&(t=JSON.parse(t));const i=Object.assign({},this._config.serverParams,t);if(i[this._config.queryParam]=this._searchInput.value,this._config.noCache&&(i.t=Date.now()),i.related){const a=document.getElementById(i.related);if(a){i.related=a.value;const l=a.getAttribute("name");l&&(i[l]=a.value)}}const s=new URLSearchParams(i);let o=this._config.server,r=Object.assign(this._config.fetchOptions,{method:this._config.serverMethod||"GET",signal:this._abortController.signal});r.method==="POST"?r.body=s:o+="?"+s.toString(),this._searchInput.classList.add(LOADING_CLASS$1),this._config.onBeforeFetch(this),fetch(o,r).then(a=>this._config.onServerResponse(a,this)).then(a=>{const l=nested$1(this._config.serverDataKey,a)||a;this.setData(l),this._setHiddenVal(),this._abortController=null,e&&this._showSuggestions()}).catch(a=>{a.name==="AbortError"||this._abortController.signal.aborted||console.error(a)}).finally(a=>{this._searchInput.classList.remove(LOADING_CLASS$1),this._config.onAfterFetch(this)})}}const DEFAULTS={items:[],allowNew:!1,showAllSuggestions:!1,badgeStyle:"primary",allowClear:!1,clearEnd:!1,selected:[],regex:"",separator:[],max:0,clearLabel:"Clear",searchLabel:"Type a value",showDropIcon:!0,keepOpen:!1,allowSame:!1,baseClass:"",placeholder:"",addOnBlur:!1,showDisabled:!1,hideNativeValidation:!1,suggestionsThreshold:-1,maximumItems:0,autoselectFirst:!0,updateOnSelect:!1,highlightTyped:!1,highlightClass:"",fullWidth:!0,fixed:!1,fuzzy:!1,startsWith:!1,singleBadge:!1,activeClasses:["bg-primary","text-white"],labelField:"label",valueField:"value",searchFields:["label"],queryParam:"query",server:"",serverMethod:"GET",serverParams:{},serverDataKey:"data",fetchOptions:{},liveServer:!1,noCache:!0,allowHtml:!1,debounceTime:300,notFoundMessage:"",onRenderItem:(n,e,t)=>t.config("allowHtml")?e:sanitize(e),onSelectItem:(n,e)=>{},onClearItem:(n,e)=>{},onCreateItem:(n,e)=>{},onBlur:(n,e)=>{},onFocus:(n,e)=>{},onCanAdd:(n,e,t)=>{},confirmClear:(n,e)=>Promise.resolve(),confirmAdd:(n,e)=>Promise.resolve(),onServerResponse:(n,e)=>n.json()},CLASS_PREFIX="tags-",LOADING_CLASS="is-loading",ACTIVE_CLASS="is-active",INVALID_CLASS="is-invalid",MAX_REACHED_CLASS="is-max-reached",SHOW_CLASS="show",VALUE_ATTRIBUTE="data-value",NEXT="next",PREV="prev",FOCUS_CLASS="form-control-focus",PLACEHOLDER_CLASS="form-placeholder-shown",DISABLED_CLASS="form-control-disabled",INSTANCE_MAP=new WeakMap;let counter=0,tooltip=window.bootstrap&&window.bootstrap.Tooltip;function debounce$1(n,e=300){let t;return(...i)=>{clearTimeout(t),t=setTimeout(()=>{n.apply(this,i)},e)}}function calcTextWidth(n,e=null){const t=ce("span");document.body.appendChild(t),t.style.fontSize=e||"inherit",t.style.height="auto",t.style.width="auto",t.style.position="absolute",t.style.whiteSpace="no-wrap",t.innerHTML=sanitize(n);const i=Math.ceil(t.clientWidth);return document.body.removeChild(t),i}function sanitize(n){return new Option(n).innerHTML}function removeDiacritics(n){return n.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function normalize(n){return n?removeDiacritics(n.toString()).toLowerCase():""}function fuzzyMatch(n,e){if(n.indexOf(e)>=0)return!0;let t=0;for(let i=0;i<e.length;i++){const s=e[i];if(s!=" "&&(t=n.indexOf(s,t)+1,t<=0))return!1}return!0}function hideItem(n){n.style.display="none",attrs(n,{"aria-hidden":"true"})}function showItem(n){n.style.display="list-item",attrs(n,{"aria-hidden":"false"})}function attrs(n,e){for(const[t,i]of Object.entries(e))n.setAttribute(t,i)}function rmAttr(n,e){n.hasAttribute(e)&&n.removeAttribute(e)}function parseBool(n){return["true","false","1","0",!0,!1].includes(n)&&!!JSON.parse(n)}function ce(n){return document.createElement(n)}function splitMulti(n,e){let t=e[0];for(let i=1;i<e.length;i++)n=n.split(e[i]).join(t);return n.split(t)}function nested(n,e="window"){return n.split(".").reduce((t,i)=>t[i],e)}class Tags{constructor(e,t={}){if(!(e instanceof HTMLElement)){console.error("Invalid element",e);return}INSTANCE_MAP.set(e,this),counter++,this._selectElement=e,this._configure(t),this._keyboardNavigation=!1,this._searchFunc=debounce$1(()=>{this._loadFromServer(!0)},this._config.debounceTime),this._fireEvents=!0,this._configureParent(),this._holderElement=ce("div"),this._containerElement=ce("div"),this._dropElement=ce("ul"),this._searchInput=ce("input"),this._holderElement.appendChild(this._containerElement),this._selectElement.parentElement.insertBefore(this._holderElement,this._selectElement),this._configureHolderElement(),this._configureContainerElement(),this._configureSelectElement(),this._configureSearchInput(),this._configureDropElement(),this.resetState(),this.handleEvent=i=>{this._handleEvent(i)},this._config.fixed&&(document.addEventListener("scroll",this,!0),window.addEventListener("resize",this)),["focus","blur","input","keydown","paste"].forEach(i=>{this._searchInput.addEventListener(i,this)}),["mousemove","mouseleave"].forEach(i=>{this._dropElement.addEventListener(i,this)}),this.loadData(!0)}static init(e="select[multiple]",t={},i=!1){let s=document.querySelectorAll(e);for(let o=0;o<s.length;o++){const r=Tags.getInstance(s[o]);r&&!i||(r&&r.dispose(),new Tags(s[o],t))}}static getInstance(e){if(INSTANCE_MAP.has(e))return INSTANCE_MAP.get(e)}dispose(){["focus","blur","input","keydown","paste"].forEach(e=>{this._searchInput.removeEventListener(e,this)}),["mousemove","mouseleave"].forEach(e=>{this._dropElement.removeEventListener(e,this)}),this._config.fixed&&(document.removeEventListener("scroll",this,!0),window.removeEventListener("resize",this)),this._selectElement.style.display="block",this._holderElement.parentElement.removeChild(this._holderElement),this.parentForm&&this.parentForm.removeEventListener("reset",this),INSTANCE_MAP.delete(this._selectElement)}handleEvent(e){this._handleEvent(e)}_handleEvent(e){["scroll","resize"].includes(e.type)?(this._timer&&window.cancelAnimationFrame(this._timer),this._timer=window.requestAnimationFrame(()=>{this[`on${e.type}`](e)})):this[`on${e.type}`](e)}_configure(e={}){this._config=Object.assign({},DEFAULTS,{showDropIcon:!!this._findOption()});const t=this._selectElement.dataset.config?JSON.parse(this._selectElement.dataset.config):{},i={...e,...t,...this._selectElement.dataset};for(const[s,o]of Object.entries(DEFAULTS)){if(s=="config"||i[s]===void 0)continue;const r=i[s];switch(typeof o){case"number":this._config[s]=parseInt(r);break;case"boolean":this._config[s]=parseBool(r);break;case"string":this._config[s]=r.toString();break;case"object":this._config[s]=r,typeof r=="string"&&(["{","["].includes(r[0])?this._config[s]=JSON.parse(r):this._config[s]=r.split(r.includes("|")?"|":","));break;case"function":this._config[s]=typeof r=="string"?r.split(".").reduce((a,l)=>a[l],window):r,this._config[s]||console.error("Invalid function",r);break;default:this._config[s]=r;break}}this._config.placeholder||(this._config.placeholder=this._getPlaceholder()),this._config.suggestionsThreshold==-1&&(this._config.suggestionsThreshold=this._config.liveServer?1:0)}config(e=null){return e?this._config[e]:this._config}setConfig(e,t){this._config[e]=t}_configureParent(){for(this.overflowParent=null,this.parentForm=this._selectElement.parentElement;this.parentForm&&(this.parentForm.style.overflow==="hidden"&&(this.overflowParent=this.parentForm),this.parentForm=this.parentForm.parentElement,!(this.parentForm&&this.parentForm.nodeName=="FORM")););this.parentForm&&this.parentForm.addEventListener("reset",this)}_getPlaceholder(){if(this._selectElement.hasAttribute("placeholder"))return this._selectElement.getAttribute("placeholder");if(this._selectElement.dataset.placeholder)return this._selectElement.dataset.placeholder;let e=this._selectElement.querySelector("option");return!e||!this._config.autoselectFirst?"":(rmAttr(e,"selected"),e.selected=!1,e.value?"":e.textContent)}_configureSelectElement(){const e=this._selectElement;this._config.hideNativeValidation?(e.style.position="absolute",e.style.left="-9999px"):e.style.cssText="height:1px;width:1px;opacity:0;padding:0;margin:0;border:0;float:left;flex-basis:100%;min-height:unset;",e.tabIndex=-1,e.addEventListener("focus",t=>{this.onclick(t)}),e.addEventListener("invalid",t=>{this._holderElement.classList.add(INVALID_CLASS)})}_configureDropElement(){const e=this._dropElement;e.classList.add("dropdown-menu",CLASS_PREFIX+"menu"),e.id=CLASS_PREFIX+"menu-"+counter,e.setAttribute("role","menu");const t=e.style;t.padding="0",t.maxHeight="280px",this._config.fullWidth||(t.maxWidth="360px"),this._config.fixed&&(t.position="fixed"),t.overflowY="auto",t.overscrollBehavior="contain",t.textAlign="unset",e.addEventListener("mouseenter",i=>{this._keyboardNavigation=!1}),this._holderElement.appendChild(e),this._searchInput.setAttribute("aria-controls",e.id)}_configureHolderElement(){const e=this._holderElement;e.classList.add("form-control","dropdown"),["form-select-lg","form-select-sm","is-invalid","is-valid"].forEach(t=>{this._selectElement.classList.contains(t)&&e.classList.add(t)}),this._config.suggestionsThreshold==0&&this._config.showDropIcon&&e.classList.add("form-select"),this.overflowParent&&(e.style.position="inherit"),e.style.height="auto",e.addEventListener("click",this)}_configureContainerElement(){this._containerElement.addEventListener("click",t=>{this.isDisabled()||this._searchInput.style.visibility!="hidden"&&this._searchInput.focus()});const e=this._containerElement.style;e.display="flex",e.alignItems="center",e.flexWrap="wrap"}_configureSearchInput(){const e=this._searchInput;e.type="text",e.autocomplete="off",e.spellcheck=!1,attrs(e,{"aria-autocomplete":"list","aria-haspopup":"menu","aria-expanded":"false","aria-label":this._config.searchLabel,role:"combobox"}),e.style.cssText="background-color:transparent;color:currentColor;border:0;padding:0;outline:0;max-width:100%",this.resetSearchInput(!0),this._containerElement.appendChild(e),this._rtl=window.getComputedStyle(e).direction==="rtl"}onfocus(e){this._holderElement.classList.add(FOCUS_CLASS),this.showOrSearch(),this._config.onFocus(e,this)}onblur(e){if(e.relatedTarget&&e.relatedTarget.classList.contains("modal")){this._searchInput.focus();return}this.afteronblur(e)}afteronblur(e){this._abortController&&this._abortController.abort();let t=!0;if(this._config.addOnBlur&&this._searchInput.value&&(t=this._enterValue()),this._holderElement.classList.remove(FOCUS_CLASS),this.hideSuggestions(t),this._fireEvents){const i=this.getSelection(),s={selection:i?i.dataset.value:null,input:this._searchInput.value};this._config.onBlur(e,this),this._selectElement.dispatchEvent(new CustomEvent("tags.blur",{bubbles:!0,detail:s}))}}onpaste(e){const i=(e.clipboardData||window.clipboardData).getData("text/plain").replace(/\r\n|\n/g," ");if(i.length>2&&this._config.separator.length){const s=splitMulti(i,this._config.separator).filter(o=>o);s.length>1&&(e.preventDefault(),s.forEach(o=>{this._addPastedValue(o)}))}}_addPastedValue(e){let t=e,i={};if(this._config.allowNew)i.new=1;else{const s=this.getSelection();if(!s)return;e=s.getAttribute(VALUE_ATTRIBUTE),t=s.dataset.label}this._config.confirmAdd(e,this).then(()=>{this._add(t,e,i)}).catch(()=>{})}oninput(e){const t=this._searchInput.value;if(t){const i=t.slice(-1);if(this._config.separator.length&&this._config.separator.includes(i)){this._searchInput.value=this._searchInput.value.slice(0,-1);let s=this._searchInput.value;this._addPastedValue(s);return}}setTimeout(()=>{this._adjustWidth()}),this.showOrSearch()}onkeydown(e){let t=e.keyCode||e.key;const i=e.target;switch(e.keyCode==229&&(t=i.value.charAt(i.selectionStart-1).charCodeAt(0)),t){case 13:case"Enter":e.preventDefault(),this._enterValue();break;case 38:case"ArrowUp":e.preventDefault(),this._keyboardNavigation=!0,this._moveSelection(PREV);break;case 40:case"ArrowDown":e.preventDefault(),this._keyboardNavigation=!0,this.isDropdownVisible()?this._moveSelection(NEXT):this.showOrSearch(!1);break;case 8:case"Backspace":const s=this.getLastItem();this._searchInput.value.length==0&&s&&this._config.confirmClear(s,this).then(()=>{this.removeLastItem(),this._adjustWidth(),this.showOrSearch()}).catch(()=>{});break;case 27:case"Escape":this._searchInput.focus(),this.hideSuggestions();break}}onmousemove(e){this._keyboardNavigation=!1}onmouseleave(e){this.removeSelection()}onscroll(e){this._positionMenu()}onresize(e){this._positionMenu()}onclick(e=null){!this.isSingle()&&this.isMaxReached()||this._searchInput.focus()}onreset(e){this.reset()}loadData(e=!1){Object.keys(this._config.items).length>0?this.setData(this._config.items,!0):this.resetSuggestions(!0),this._config.server&&(this._config.liveServer||this._loadFromServer(!e))}_setSelectedAttributes(){const e=this._selectElement.selectedOptions||[];for(let t=0;t<e.length;t++)e[t].value&&!e[t].hasAttribute("selected")&&e[t].setAttribute("selected","selected")}resetState(){this.isDisabled()?(this._holderElement.setAttribute("readonly",""),this._searchInput.setAttribute("disabled",""),this._holderElement.classList.add(DISABLED_CLASS)):(rmAttr(this._holderElement,"readonly"),rmAttr(this._searchInput,"disabled"),this._holderElement.classList.remove(DISABLED_CLASS))}resetSuggestions(e=!1){this._setSelectedAttributes();const t=s=>({value:s.getAttribute("value"),label:s.textContent,disabled:s.disabled,selected:s.selected,data:Object.assign({disabled:s.disabled},s.dataset)});let i=Array.from(this._selectElement.children).filter(s=>s.hasAttribute("label")||!s.disabled||this._config.showDisabled).map(s=>s.hasAttribute("label")?{group:s.getAttribute("label"),items:Array.from(s.children).map(o=>t(o))}:t(s));this.setData(i,e)}_enterValue(){let e=this.getSelection();if(e)return e.click(),!0;if(this._config.allowNew&&this._searchInput.value){let t=this._searchInput.value;return this._config.confirmAdd(t,this).then(()=>{this._add(t,t,{new:1})}).catch(()=>{}),!0}return!1}_loadFromServer(e=!1){this._abortController&&this._abortController.abort(),this._abortController=new AbortController;let t=this._selectElement.dataset.serverParams||{};typeof t=="string"&&(t=JSON.parse(t));const i=Object.assign({},this._config.serverParams,t);if(i[this._config.queryParam]=this._searchInput.value,this._config.noCache&&(i.t=Date.now()),i.related){const a=document.getElementById(i.related);if(a){i.related=a.value;const l=a.getAttribute("name");l&&(i[l]=a.value)}}const s=new URLSearchParams(i);let o=this._config.server,r=Object.assign(this._config.fetchOptions,{method:this._config.serverMethod||"GET",signal:this._abortController.signal});r.method==="POST"?r.body=s:o+="?"+s.toString(),this._holderElement.classList.add(LOADING_CLASS),fetch(o,r).then(a=>this._config.onServerResponse(a,this)).then(a=>{const l=nested(this._config.serverDataKey,a)||a;this.setData(l,!e),this._abortController=null,e&&this._showSuggestions()}).catch(a=>{a.name==="AbortError"||this._abortController.signal.aborted||console.error(a)}).finally(a=>{this._holderElement.classList.remove(LOADING_CLASS)})}_add(e,t=null,i={}){if(!this.canAdd(e,i))return null;const s=this.addItem(e,t,i);return this._resetHtmlState(),this._config.keepOpen?this._showSuggestions():this.resetSearchInput(),s}_isItemEnabled(e){if(e.style.display==="none")return!1;const t=e.firstElementChild;return t.tagName==="A"&&!t.classList.contains("disabled")}_moveSelection(e=NEXT,t=null){const i=this.getSelection();if(i){const s=e===NEXT?"nextSibling":"previousSibling";t=i.parentNode;do t=t[s];while(t&&!this._isItemEnabled(t));t?i.classList.remove(...this._activeClasses()):i&&(t=i.parentElement)}else{if(e===PREV)return t;if(!t)for(t=this._dropElement.firstChild;t&&!this._isItemEnabled(t);)t=t.nextSibling}if(t){const s=t.offsetHeight,o=t.offsetTop,r=t.parentNode,a=r.offsetHeight,l=r.scrollHeight,d=r.offsetTop;if(s===0&&setTimeout(()=>{r.scrollTop=0}),e===PREV){const p=o-d>10?o-d:0;r.scrollTop=p}else o+s-(a+r.scrollTop)>0&&s>0&&(r.scrollTop=o+s-a+1,r.scrollTop+a>=l-10&&(r.scrollTop=o-d));const h=t.querySelector("a");h.classList.add(...this._activeClasses()),this._searchInput.setAttribute("aria-activedescendant",h.id),this._config.updateOnSelect&&(this._searchInput.value=h.dataset.label,this._adjustWidth())}else this._searchInput.setAttribute("aria-activedescendant","");return t}_adjustWidth(){this._holderElement.classList.remove(PLACEHOLDER_CLASS),this._searchInput.value?this._searchInput.size=this._searchInput.value.length:this.getSelectedValues().length?(this._searchInput.placeholder="",this._searchInput.size=1):(this._searchInput.size=this._config.placeholder.length>0?this._config.placeholder.length:1,this._searchInput.placeholder=this._config.placeholder,this._holderElement.classList.add(PLACEHOLDER_CLASS));const e=this._searchInput.value||this._searchInput.placeholder,t=window.getComputedStyle(this._holderElement).fontSize,i=calcTextWidth(e,t)+16;this._searchInput.style.width=i+"px"}_buildSuggestions(e){for(;this._dropElement.lastChild;)this._dropElement.removeChild(this._dropElement.lastChild);let t=0,i=1;for(let s=0;s<e.length;s++){const o=e[s];if(o){if(o.group&&o.items){const r=ce("li");r.setAttribute("role","presentation"),r.dataset.id=""+i;const a=ce("span");if(r.append(a),a.classList.add("dropdown-header","text-truncate"),a.innerHTML=sanitize(o.group),this._dropElement.appendChild(r),o.items)for(let l=0;l<o.items.length;l++){const d=o.items[l];d.group_id=i,this._buildSuggestionsItem(o.items[l],t),t++}i++}this._buildSuggestionsItem(o,t),t++}}if(this._config.notFoundMessage){const s=ce("li");s.setAttribute("role","presentation"),s.classList.add(CLASS_PREFIX+"not-found"),s.innerHTML='<span class="dropdown-item"></span>',this._dropElement.appendChild(s)}}_buildSuggestionsItem(e,t){if(!e[this._config.valueField])return;const i=e[this._config.valueField],s=e[this._config.labelField];let o=this._config.onRenderItem(e,s,this);const r=ce("li");r.setAttribute("role","presentation"),e.group_id&&r.setAttribute("data-group-id",""+e.group_id);const a=ce("a");r.append(a),a.id=this._dropElement.id+"-"+t,a.classList.add("dropdown-item","text-truncate"),e.disabled&&a.classList.add("disabled"),a.setAttribute(VALUE_ATTRIBUTE,i),a.dataset.label=s;const l={};this._config.searchFields.forEach(d=>{l[d]=e[d]}),a.dataset.searchData=JSON.stringify(l),a.setAttribute("href","#"),a.innerHTML=o,this._dropElement.appendChild(r),a.addEventListener("mouseenter",d=>{this._keyboardNavigation||(this.removeSelection(),r.querySelector("a").classList.add(...this._activeClasses()))}),a.addEventListener("mousedown",d=>{d.preventDefault()}),a.addEventListener("click",d=>{d.preventDefault(),d.stopPropagation(),this._config.confirmAdd(i,this).then(()=>{this._add(s,i,e.data),this._config.onSelectItem(e,this)}).catch(()=>{})})}initialOptions(){return this._selectElement.querySelectorAll("option[data-init]")}_removeSelectedAttrs(){this._selectElement.querySelectorAll("option").forEach(e=>{rmAttr(e,"selected")})}reset(){this.removeAll(),this._fireEvents=!1;const e=this.initialOptions();this._removeSelectedAttrs();for(let t=0;t<e.length;t++){const i=e[t],s=Object.assign({},{disabled:i.hasAttribute("disabled")},i.dataset);this.addItem(i.textContent,i.value,s)}this._resetHtmlState(),this._fireEvents=!0}resetSearchInput(e=!1){if(this._searchInput.value="",this._adjustWidth(),this._checkMax(),this.isSingle()&&!e){document.activeElement.blur(),this.hideSuggestions();return}e||(this._shouldShow()||this.hideSuggestions(),this._searchInput===document.activeElement&&this._searchInput.dispatchEvent(new Event("input")))}_checkMax(){this.isMaxReached()?(this._holderElement.classList.add(MAX_REACHED_CLASS),this._searchInput.style.visibility="hidden"):this._searchInput.style.visibility=="hidden"&&(this._searchInput.style.visibility="visible")}getSelectedValues(){const e=this._selectElement.querySelectorAll("option[selected]");return Array.from(e).map(t=>t.value)}getAvailableValues(){const e=this._selectElement.querySelectorAll("option");return Array.from(e).map(t=>t.value)}showOrSearch(e=!0){if(e&&!this._shouldShow()){this.hideSuggestions(!1);return}this._config.liveServer?this._searchFunc():this._showSuggestions()}hideSuggestions(e=!0){this._dropElement.classList.remove(SHOW_CLASS),attrs(this._searchInput,{"aria-expanded":"false"}),this.removeSelection(),e&&this._holderElement.classList.remove(INVALID_CLASS)}toggleSuggestions(e=!0,t=!0){this._dropElement.classList.contains(SHOW_CLASS)?this.hideSuggestions(t):this.showOrSearch(e)}_shouldShow(){return this.isDisabled()||this.isMaxReached()?!1:this._searchInput.value.length>=this._config.suggestionsThreshold}_showSuggestions(){if(this._searchInput.style.visibility=="hidden")return;const e=normalize(this._searchInput.value),t={},i=this._dropElement.querySelectorAll("li");let s=0,o=null,r=!1,a={};for(let l=0;l<i.length;l++){let d=i[l],h=d.firstElementChild;if(h instanceof HTMLSpanElement){d.dataset.id&&(a[d.dataset.id]=!1),hideItem(d);continue}if(h.classList.remove(...this._activeClasses()),!this._config.allowSame){const y=h.getAttribute(VALUE_ATTRIBUTE);if(t[y]=t[y]||0,this._findOption(h.getAttribute(VALUE_ATTRIBUTE),"[selected]",t[y]++)){hideItem(d);continue}}const p=this._config.showAllSuggestions||e.length===0;let m=e.length==0&&this._config.suggestionsThreshold===0;if(!p&&e.length>0){const y=JSON.parse(h.dataset.searchData);this._config.searchFields.forEach(b=>{const S=normalize(y[b]);let E=!1;if(this._config.fuzzy)E=fuzzyMatch(S,e);else{const T=S.indexOf(e);E=this._config.startsWith?T===0:T>=0}E&&(m=!0)})}const v=m||e.length===0;if(p||m?(s++,showItem(d),d.dataset.groupId&&(a[d.dataset.groupId]=!0),!o&&this._isItemEnabled(d)&&v&&(o=d),this._config.maximumItems>0&&s>this._config.maximumItems&&hideItem(d)):hideItem(d),this._config.highlightTyped){const y=h.textContent,b=normalize(y).indexOf(e),S=y.substring(0,b)+`<mark class="${this._config.highlightClass}">${y.substring(b,b+e.length)}</mark>`+y.substring(b+e.length,y.length);h.innerHTML=S}this._isItemEnabled(d)&&(r=!0)}if(!this._config.allowNew&&!(e.length===0&&!r)&&this._holderElement.classList.add(INVALID_CLASS),this._config.allowNew&&this._config.regex&&this.isInvalid()&&this._holderElement.classList.remove(INVALID_CLASS),Array.from(i).filter(l=>l.dataset.id).forEach(l=>{a[l.dataset.id]===!0&&showItem(l)}),r&&(this._holderElement.classList.remove(INVALID_CLASS),o&&this._config.autoselectFirst&&(this.removeSelection(),this._moveSelection(NEXT,o))),s===0)if(this._config.notFoundMessage){const l=this._dropElement.querySelector("."+CLASS_PREFIX+"not-found");l.style.display="block";const d=this._config.notFoundMessage.replace("{{tag}}",this._searchInput.value);l.innerHTML=`<span class="dropdown-item">${d}</span>`,this._showDropdown()}else this.hideSuggestions(!1);else this._showDropdown()}_showDropdown(){const e=this._dropElement.classList.contains(SHOW_CLASS);e||(this._dropElement.classList.add(SHOW_CLASS),attrs(this._searchInput,{"aria-expanded":"true"})),this._positionMenu(e)}_positionMenu(e=!1){const t=this._rtl,i=this._config.fixed,s=this._config.fullWidth,o=this._searchInput.getBoundingClientRect(),r=this._holderElement.getBoundingClientRect();let a=0,l=0;if(i?s?(a=r.x,l=r.y+r.height+2):(a=o.x,l=o.y+o.height):s?(a=0,l=r.height+2):(a=this._searchInput.offsetLeft,l=this._searchInput.offsetHeight+this._searchInput.offsetTop),t&&!s&&(a-=this._dropElement.offsetWidth-o.width),!s){const p=Math.min(window.innerWidth,document.body.offsetWidth),m=t?o.x+o.width-this._dropElement.offsetWidth-1:p-1-(o.x+this._dropElement.offsetWidth);m<0&&(a=t?a-m:a+m)}s&&(this._dropElement.style.width=this._holderElement.offsetWidth+"px"),e||(this._dropElement.style.transform="unset"),Object.assign(this._dropElement.style,{left:a+"px",top:l+"px"});const d=this._dropElement.getBoundingClientRect(),h=window.innerHeight;if(d.y+d.height>h||this._dropElement.style.transform.includes("translateY")){const p=s?r.height+4:o.height;this._dropElement.style.transform="translateY(calc(-100.1% - "+p+"px))"}}_getBootstrapVersion(){let e=5,t=window.jQuery;return t&&t.fn.tooltip&&t.fn.tooltip.Constructor&&(e=parseInt(t.fn.tooltip.Constructor.VERSION.charAt(0))),e}_isSelected(e){return!!Array.from(this._selectElement.querySelectorAll("option")).find(s=>s.textContent==e&&s.getAttribute("selected"))}_isSelectable(e){const i=Array.from(this._selectElement.querySelectorAll("option")).filter(s=>s.textContent==e);return!(i.length>0&&!i.find(o=>!o.getAttribute("selected")))}hasItem(e){for(let t of this._config.items){const i=t.items||[t];for(let s of i)if(s[this._config.labelField]==e)return!0}return!1}getItem(e){for(let t of this._config.items){const i=t.items||[t];for(let s of i)if(s[this._config.valueField]==e)return s}return null}_validateRegex(e){return new RegExp(this._config.regex.trim()).test(e)}getSelection(){return this._dropElement.querySelector("a."+ACTIVE_CLASS)}removeSelection(){const e=this.getSelection();e&&e.classList.remove(...this._activeClasses())}_activeClasses(){return[...this._config.activeClasses,ACTIVE_CLASS]}getActiveSelection(){return this.getSelection()}removeActiveSelection(){return this.removeSelection()}removeAll(){this.getSelectedValues().forEach(t=>{this.removeItem(t,!0)}),this._adjustWidth()}removeLastItem(e=!1){let t=this.getLastItem();t&&this.removeItem(t,e)}getLastItem(){let e=this._containerElement.querySelectorAll("span."+CLASS_PREFIX+"badge");return e.length?e[e.length-1].getAttribute(VALUE_ATTRIBUTE):void 0}enable(){this._selectElement.setAttribute("disabled",""),this.resetState()}disable(){rmAttr(this._selectElement,"disabled"),this.resetState()}isDisabled(){return this._selectElement.hasAttribute("disabled")||this._selectElement.disabled||this._selectElement.hasAttribute("readonly")}isDropdownVisible(){return this._dropElement.classList.contains(SHOW_CLASS)}isInvalid(){return this._holderElement.classList.contains(INVALID_CLASS)}isSingle(){return!this._selectElement.hasAttribute("multiple")}isMaxReached(){return this._config.max&&this.getSelectedValues().length>=this._config.max}canAdd(e,t={}){if(!e||t.new&&!this._config.allowNew||!t.new&&!this.hasItem(e)||this.isDisabled())return!1;if(!this.isSingle()&&!this._config.allowSame){if(t.new){if(this._isSelected(e))return!1}else if(!this._isSelectable(e))return!1}return this.isMaxReached()?!1:this._config.regex&&t.new&&!this._validateRegex(e)?(this._holderElement.classList.add(INVALID_CLASS),!1):this._config.onCanAdd&&this._config.onCanAdd(e,t,this)===!1?(this._holderElement.classList.add(INVALID_CLASS),!1):!0}getData(){return this._config.items}setData(e,t=!1){Array.isArray(e)||(e=Object.entries(e).map(([i,s])=>({value:i,label:s}))),this._config.items!=e&&(this._config.items=e),t&&(this._removeSelectedAttrs(),e.reduce((s,o)=>s.concat(o.group?o.items:[o]),[]).forEach(s=>{const o=s[this._config.valueField],r=s[this._config.labelField];if(o&&(s.selected||this._config.selected.includes(o))){const a=this.addItem(r,o,s.data);a&&a.setAttribute("data-init","true")}})),this._buildSuggestions(e),this._resetHtmlState()}_findOption(e=null,t="",i=0){const o="option"+(e===null?"":'[value="'+CSS.escape(e)+'"]')+t;return this._selectElement.querySelectorAll(o)[i]||null}setItem(e,t={}){let i=null,s=this._findOption(e,":not([selected])");s&&(i=this.addItem(s.textContent,s.value,t));let o=this.getItem(e);if(o){const r=o[this._config.valueField],a=o[this._config.labelField];i=this.addItem(a,r,t)}return this._adjustWidth(),this._checkMax(),i}addItem(e,t=null,i={}){t||(t=e),this.isSingle()&&this.getSelectedValues().length&&this.removeLastItem(!0);let s=this._findOption(t,":not([selected])");if(!s){s=ce("option"),s.value=t,s.innerText=e;for(const[o,r]of Object.entries(i))s.dataset[o]=r;this._selectElement.appendChild(s),this._config.onCreateItem(s,this)}return s&&(i=Object.assign({title:s.getAttribute("title")},i,s.dataset)),s.setAttribute("selected","selected"),s.selected=!0,this._createBadge(e,t,i),this._fireEvents&&this._selectElement.dispatchEvent(new Event("change",{bubbles:!0})),s}_resetHtmlState(){const e=this._selectElement.innerHTML;this._selectElement.innerHTML="",this._selectElement.innerHTML=e,this._adjustWidth()}_createBadge(e,t=null,i={}){const s=this._getBootstrapVersion()===5,o=i.disabled&&parseBool(i.disabled),r=this._config.allowClear&&!o;let a=this._config.allowHtml?e:sanitize(e),l=ce("span"),d=[CLASS_PREFIX+"badge"];const h=this.isSingle()&&!this._config.singleBadge;if(!h){d.push("badge");let m=this._config.badgeStyle;i.badgeStyle&&(m=i.badgeStyle),i.badgeClass&&d.push(...i.badgeClass.split(" ")),this._config.baseClass?d.push(...this._config.baseClass.split(" ")):s?d=[...d,"bg-"+m,"text-truncate"]:d=[...d,"badge-"+m],l.style.maxWidth="100%"}o&&d.push("disabled","opacity-50");const p=h?0:2;if(l.style.margin=p+"px 6px "+p+"px 0px",l.style.marginBlock=p+"px",l.style.marginInline="0px 6px",l.style.display="flex",l.style.alignItems="center",l.classList.add(...d),l.setAttribute(VALUE_ATTRIBUTE,t),i.title&&l.setAttribute("title",i.title),r){const m=d.includes("text-dark")||h?"btn-close":"btn-close btn-close-white";let v="margin-inline: 0px 6px;",y="left";this._config.clearEnd&&(y="right"),y=="right"&&(v="margin-inline: 6px 0px;");const b=s?'<button type="button" style="font-size:0.65em;'+v+'" class="'+m+'" aria-label="'+this._config.clearLabel+'"></button>':'<button type="button" style="font-size:1em;'+v+'text-shadow:none;color:currentColor;transform:scale(1.2);float:none" class="close" aria-label="'+this._config.clearLabel+'"><span aria-hidden="true">×</span></button>';a=y=="left"?b+a:a+b}l.innerHTML=a,this._containerElement.insertBefore(l,this._searchInput),i.title&&tooltip&&s&&tooltip.getOrCreateInstance(l),r&&l.querySelector("button").addEventListener("click",m=>{m.preventDefault(),m.stopPropagation(),this.isDisabled()||this._config.confirmClear(t,this).then(()=>{this.removeItem(t),document.activeElement.blur(),this._adjustWidth()}).catch(()=>{})})}getHolder(){return this._holderElement}clear(){this.hideSuggestions(),this.reset()}updateData(e){this.setData(e,!1),this.reset()}removeItem(e,t=!1){const i=CSS.escape(e);let s=this._containerElement.querySelectorAll("span["+VALUE_ATTRIBUTE+'="'+i+'"]');if(!s.length)return;const o=s.length-1,r=s[o];r&&(r.dataset.bsOriginalTitle&&tooltip.getOrCreateInstance(r).dispose(),r.remove());let a=this._findOption(e,"[selected]",o);a&&(rmAttr(a,"selected"),a.selected=!1,this._fireEvents&&!t&&this._selectElement.dispatchEvent(new Event("change",{bubbles:!0}))),this._searchInput.style.visibility=="hidden"&&!this.isMaxReached()&&(this._searchInput.style.visibility="visible",this._holderElement.classList.remove(MAX_REACHED_CLASS)),t||this._config.onClearItem(e,this)}}var leafletSrc={exports:{}};/* @preserve+ </svg>`,s.append(r),s.classList.add("d-flex","justify-content-between"),r.addEventListener("click",a=>{this._searchInput.value=t.label,this._searchInput.focus()})}return o.addEventListener("mouseenter",r=>{this._keyboardNavigation||(this.removeSelection(),s.querySelector("a").classList.add(...this._activeClasses()))}),o.addEventListener("mousedown",r=>{r.preventDefault()}),o.addEventListener("click",r=>{r.preventDefault(),this._preventInput=!0,this._searchInput.value=decodeHtml(t.label),this._hiddenInput&&(this._hiddenInput.value=t.value),this._config.onSelectItem(t,this),this.hideSuggestions(),this._preventInput=!1}),s}_showSuggestions(){if(document.activeElement!=this._searchInput)return;const e=normalize$1(this._searchInput.value);this._dropElement.innerHTML="";const t=Object.keys(this._items);let i=0,s=null;const o=[];for(let r=0;r<t.length;r++){const a=t[r],l=this._items[a],d=this._config.showAllSuggestions||e.length===0;let h=e.length==0&&this._config.suggestionsThreshold===0;!d&&e.length>0&&this._config.searchFields.forEach(m=>{const v=normalize$1(l[m]);let y=!1;if(this._config.fuzzy)y=fuzzyMatch$1(v,e);else{const b=v.indexOf(e);y=this._config.startsWith?b===0:b>=0}y&&(h=!0)});const p=h||e.length===0;if(d||h){if(i++,l.group&&!o.includes(l.group)){const v=this._createGroup(l.group);this._dropElement.appendChild(v),o.push(l.group)}const m=this._createItem(e,l);if(!s&&p&&(s=m),this._dropElement.appendChild(m),this._config.maximumItems>0&&i>=this._config.maximumItems)break}}if(s&&this._config.autoselectFirst&&(this.removeSelection(),this._moveSelection(NEXT$1,s)),i===0)if(this._config.notFoundMessage){const r=this._createLi();r.innerHTML=`<span class="dropdown-item">${this._config.notFoundMessage}</span>`,this._dropElement.appendChild(r),this._showDropdown()}else this.hideSuggestions();else this._showDropdown()}_createLi(){const e=document.createElement("li");return e.setAttribute("role","presentation"),e}_showDropdown(){this._dropElement.classList.add(SHOW_CLASS$1),this._dropElement.setAttribute("role","menu"),attrs$1(this._searchInput,{"aria-expanded":"true"}),this._positionMenu()}toggleSuggestions(e=!0){this._dropElement.classList.contains(SHOW_CLASS$1)?this.hideSuggestions():this.showOrSearch(e)}hideSuggestions(){this._dropElement.classList.remove(SHOW_CLASS$1),attrs$1(this._searchInput,{"aria-expanded":"false"}),this.removeSelection()}getInput(){return this._searchInput}getDropMenu(){return this._dropElement}_positionMenu(){const e=window.getComputedStyle(this._searchInput),t=this._searchInput.getBoundingClientRect(),i=e.direction==="rtl",s=this._config.fullWidth,o=this._config.fixed;let r=null,a=null;o&&(r=t.x,a=t.y+t.height,i&&!s&&(r-=this._dropElement.offsetWidth-t.width)),this._dropElement.style.transform="unset",s&&(this._dropElement.style.width=this._searchInput.offsetWidth+"px"),r!==null&&(this._dropElement.style.left=r+"px"),a!==null&&(this._dropElement.style.top=a+"px");const l=this._dropElement.getBoundingClientRect(),d=window.innerHeight;if(l.y+l.height>d){const h=s?t.height+4:t.height;this._dropElement.style.transform="translateY(calc(-100.1% - "+h+"px))"}}_fetchData(){this._items={},this._addItems(this._config.items);const e=this._config.datalist;if(e){const t=document.querySelector(`#${e}`);if(t){const i=Array.from(t.children).map(s=>{const o=s.getAttribute("value")??s.innerHTML.toLowerCase(),r=s.innerHTML;return{value:o,label:r}});this._addItems(i)}else console.error(`Datalist not found ${e}`)}this._setHiddenVal(),this._config.server&&!this._config.liveServer&&this._loadFromServer()}_setHiddenVal(){if(this._config.hiddenInput&&!this._config.hiddenValue)for(const[e,t]of Object.entries(this._items))t.label==this._searchInput.value&&(this._hiddenInput.value=e)}_addItems(e){const t=Object.keys(e);for(let i=0;i<t.length;i++){const s=t[i],o=e[s];if(o.group&&o.items){o.items.forEach(l=>l.group=o.group),this._addItems(o.items);continue}const r=typeof o=="string"?o:o.label,a=typeof o!="object"?{}:o;a.label=o[this._config.labelField]??r,a.value=o[this._config.valueField]??s,a.label&&(this._items[a.value]=a)}}_loadFromServer(e=!1){this._abortController&&this._abortController.abort(),this._abortController=new AbortController;let t=this._searchInput.dataset.serverParams||{};typeof t=="string"&&(t=JSON.parse(t));const i=Object.assign({},this._config.serverParams,t);if(i[this._config.queryParam]=this._searchInput.value,this._config.noCache&&(i.t=Date.now()),i.related){const a=document.getElementById(i.related);if(a){i.related=a.value;const l=a.getAttribute("name");l&&(i[l]=a.value)}}const s=new URLSearchParams(i);let o=this._config.server,r=Object.assign(this._config.fetchOptions,{method:this._config.serverMethod||"GET",signal:this._abortController.signal});r.method==="POST"?r.body=s:o+="?"+s.toString(),this._searchInput.classList.add(LOADING_CLASS$1),this._config.onBeforeFetch(this),fetch(o,r).then(a=>this._config.onServerResponse(a,this)).then(a=>{const l=nested$1(this._config.serverDataKey,a)||a;this.setData(l),this._setHiddenVal(),this._abortController=null,e&&this._showSuggestions()}).catch(a=>{a.name==="AbortError"||this._abortController.signal.aborted||console.error(a)}).finally(a=>{this._searchInput.classList.remove(LOADING_CLASS$1),this._config.onAfterFetch(this)})}}const DEFAULTS={items:[],allowNew:!1,showAllSuggestions:!1,badgeStyle:"primary",allowClear:!1,clearEnd:!1,selected:[],regex:"",separator:[],max:0,clearLabel:"Clear",searchLabel:"Type a value",showDropIcon:!0,keepOpen:!1,allowSame:!1,baseClass:"",placeholder:"",addOnBlur:!1,showDisabled:!1,hideNativeValidation:!1,suggestionsThreshold:-1,maximumItems:0,autoselectFirst:!0,updateOnSelect:!1,highlightTyped:!1,highlightClass:"",fullWidth:!0,fixed:!1,fuzzy:!1,startsWith:!1,singleBadge:!1,activeClasses:["bg-primary","text-white"],labelField:"label",valueField:"value",searchFields:["label"],queryParam:"query",server:"",serverMethod:"GET",serverParams:{},serverDataKey:"data",fetchOptions:{},liveServer:!1,noCache:!0,allowHtml:!1,debounceTime:300,notFoundMessage:"",inputFilter:n=>n,sanitizer:n=>sanitize(n),onRenderItem:(n,e,t)=>t.config("allowHtml")?e:t.config("sanitizer")(e),onSelectItem:(n,e)=>{},onClearItem:(n,e)=>{},onCreateItem:(n,e)=>{},onBlur:(n,e)=>{},onFocus:(n,e)=>{},onCanAdd:(n,e,t)=>{},confirmClear:(n,e)=>Promise.resolve(),confirmAdd:(n,e)=>Promise.resolve(),onServerResponse:(n,e)=>n.json()},CLASS_PREFIX="tags-",LOADING_CLASS="is-loading",ACTIVE_CLASS="is-active",INVALID_CLASS="is-invalid",MAX_REACHED_CLASS="is-max-reached",SHOW_CLASS="show",VALUE_ATTRIBUTE="data-value",NEXT="next",PREV="prev",FOCUS_CLASS="form-control-focus",PLACEHOLDER_CLASS="form-placeholder-shown",DISABLED_CLASS="form-control-disabled",INSTANCE_MAP=new WeakMap;let counter=0,tooltip=window.bootstrap&&window.bootstrap.Tooltip;function debounce$1(n,e=300){let t;return(...i)=>{clearTimeout(t),t=setTimeout(()=>{n.apply(this,i)},e)}}function calcTextWidth(n,e=null){const t=ce("span");document.body.appendChild(t),t.style.fontSize=e||"inherit",t.style.height="auto",t.style.width="auto",t.style.position="absolute",t.style.whiteSpace="no-wrap",t.innerHTML=sanitize(n);const i=Math.ceil(t.clientWidth);return document.body.removeChild(t),i}function sanitize(n){return n.replace(/[\x26\x0A\<>'"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})}function removeDiacritics(n){return n.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function normalize(n){return n?removeDiacritics(n.toString()).toLowerCase():""}function fuzzyMatch(n,e){if(n.indexOf(e)>=0)return!0;let t=0;for(let i=0;i<e.length;i++){const s=e[i];if(s!=" "&&(t=n.indexOf(s,t)+1,t<=0))return!1}return!0}function hideItem(n){n.style.display="none",attrs(n,{"aria-hidden":"true"})}function showItem(n){n.style.display="list-item",attrs(n,{"aria-hidden":"false"})}function attrs(n,e){for(const[t,i]of Object.entries(e))n.setAttribute(t,i)}function rmAttr(n,e){n.hasAttribute(e)&&n.removeAttribute(e)}function parseBool(n){return["true","false","1","0",!0,!1].includes(n)&&!!JSON.parse(n)}function ce(n){return document.createElement(n)}function splitMulti(n,e){let t=e[0];for(let i=1;i<e.length;i++)n=n.split(e[i]).join(t);return n.split(t)}function nested(n,e="window"){return n.split(".").reduce((t,i)=>t[i],e)}class Tags{constructor(e,t={}){if(!(e instanceof HTMLElement)){console.error("Invalid element",e);return}INSTANCE_MAP.set(e,this),counter++,this._selectElement=e,this._configure(t),this._keyboardNavigation=!1,this._searchFunc=debounce$1(()=>{this._loadFromServer(!0)},this._config.debounceTime),this._fireEvents=!0,this._configureParent(),this._holderElement=ce("div"),this._containerElement=ce("div"),this._dropElement=ce("ul"),this._searchInput=ce("input"),this._holderElement.appendChild(this._containerElement),this._selectElement.parentElement.insertBefore(this._holderElement,this._selectElement),this._configureHolderElement(),this._configureContainerElement(),this._configureSelectElement(),this._configureSearchInput(),this._configureDropElement(),this.resetState(),this.handleEvent=i=>{this._handleEvent(i)},this._config.fixed&&(document.addEventListener("scroll",this,!0),window.addEventListener("resize",this)),["focus","blur","input","keydown","paste"].forEach(i=>{this._searchInput.addEventListener(i,this)}),["mousemove","mouseleave"].forEach(i=>{this._dropElement.addEventListener(i,this)}),this.loadData(!0)}static init(e="select[multiple]",t={},i=!1){let s=document.querySelectorAll(e);for(let o=0;o<s.length;o++){const r=Tags.getInstance(s[o]);r&&!i||(r&&r.dispose(),new Tags(s[o],t))}}static getInstance(e){if(INSTANCE_MAP.has(e))return INSTANCE_MAP.get(e)}dispose(){["focus","blur","input","keydown","paste"].forEach(e=>{this._searchInput.removeEventListener(e,this)}),["mousemove","mouseleave"].forEach(e=>{this._dropElement.removeEventListener(e,this)}),this._config.fixed&&(document.removeEventListener("scroll",this,!0),window.removeEventListener("resize",this)),this._selectElement.style.display="block",this._holderElement.parentElement.removeChild(this._holderElement),this.parentForm&&this.parentForm.removeEventListener("reset",this),INSTANCE_MAP.delete(this._selectElement)}handleEvent(e){this._handleEvent(e)}_handleEvent(e){["scroll","resize"].includes(e.type)?(this._timer&&window.cancelAnimationFrame(this._timer),this._timer=window.requestAnimationFrame(()=>{this[`on${e.type}`](e)})):this[`on${e.type}`](e)}_configure(e={}){this._config=Object.assign({},DEFAULTS,{showDropIcon:!!this._findOption()});const t=this._selectElement.dataset.config?JSON.parse(this._selectElement.dataset.config):{},i={...e,...t,...this._selectElement.dataset};for(const[s,o]of Object.entries(DEFAULTS)){if(s=="config"||i[s]===void 0)continue;const r=i[s];switch(typeof o){case"number":this._config[s]=parseInt(r);break;case"boolean":this._config[s]=parseBool(r);break;case"string":this._config[s]=r.toString();break;case"object":this._config[s]=r,typeof r=="string"&&(["{","["].includes(r[0])?this._config[s]=JSON.parse(r):this._config[s]=r.split(r.includes("|")?"|":","));break;case"function":this._config[s]=typeof r=="string"?r.split(".").reduce((a,l)=>a[l],window):r,this._config[s]||console.error("Invalid function",r);break;default:this._config[s]=r;break}}this._config.placeholder||(this._config.placeholder=this._getPlaceholder()),this._config.suggestionsThreshold==-1&&(this._config.suggestionsThreshold=this._config.liveServer?1:0)}config(e=null){return e?this._config[e]:this._config}setConfig(e,t){this._config[e]=t}_configureParent(){for(this.overflowParent=null,this.parentForm=this._selectElement.parentElement;this.parentForm&&(this.parentForm.style.overflow==="hidden"&&(this.overflowParent=this.parentForm),this.parentForm=this.parentForm.parentElement,!(this.parentForm&&this.parentForm.nodeName=="FORM")););this.parentForm&&this.parentForm.addEventListener("reset",this)}_getPlaceholder(){if(this._selectElement.hasAttribute("placeholder"))return this._selectElement.getAttribute("placeholder");if(this._selectElement.dataset.placeholder)return this._selectElement.dataset.placeholder;let e=this._selectElement.querySelector("option");return!e||!this._config.autoselectFirst?"":(rmAttr(e,"selected"),e.selected=!1,e.value?"":e.textContent)}_configureSelectElement(){const e=this._selectElement;this._config.hideNativeValidation?(e.style.position="absolute",e.style.left="-9999px"):e.style.cssText="height:1px;width:1px;opacity:0;padding:0;margin:0;border:0;float:left;flex-basis:100%;min-height:unset;",e.tabIndex=-1,e.addEventListener("focus",t=>{this.onclick(t)}),e.addEventListener("invalid",t=>{this._holderElement.classList.add(INVALID_CLASS)})}_configureDropElement(){const e=this._dropElement;e.classList.add("dropdown-menu",CLASS_PREFIX+"menu"),e.id=CLASS_PREFIX+"menu-"+counter,e.setAttribute("role","menu");const t=e.style;t.padding="0",t.maxHeight="280px",this._config.fullWidth||(t.maxWidth="360px"),this._config.fixed&&(t.position="fixed"),t.overflowY="auto",t.overscrollBehavior="contain",t.textAlign="unset",e.addEventListener("mouseenter",i=>{this._keyboardNavigation=!1}),this._holderElement.appendChild(e),this._searchInput.setAttribute("aria-controls",e.id)}_configureHolderElement(){const e=this._holderElement;e.classList.add("form-control","dropdown"),["form-select-lg","form-select-sm","is-invalid","is-valid"].forEach(t=>{this._selectElement.classList.contains(t)&&e.classList.add(t)}),this._config.suggestionsThreshold==0&&this._config.showDropIcon&&e.classList.add("form-select"),this.overflowParent&&(e.style.position="inherit"),e.style.height="auto",e.addEventListener("click",this)}_configureContainerElement(){this._containerElement.addEventListener("click",t=>{this.isDisabled()||this._searchInput.style.visibility!="hidden"&&this._searchInput.focus()});const e=this._containerElement.style;e.display="flex",e.alignItems="center",e.flexWrap="wrap"}_configureSearchInput(){const e=this._searchInput;e.type="text",e.autocomplete="off",e.spellcheck=!1,attrs(e,{"aria-autocomplete":"list","aria-haspopup":"menu","aria-expanded":"false","aria-label":this._config.searchLabel,role:"combobox"}),e.style.cssText="background-color:transparent;color:currentColor;border:0;padding:0;outline:0;max-width:100%",this.resetSearchInput(!0),this._containerElement.appendChild(e),this._rtl=window.getComputedStyle(e).direction==="rtl"}onfocus(e){this._holderElement.classList.add(FOCUS_CLASS),this.showOrSearch(),this._config.onFocus(e,this)}onblur(e){if(e.relatedTarget&&e.relatedTarget.classList.contains("modal")){this._searchInput.focus();return}this.afteronblur(e)}afteronblur(e){this._abortController&&this._abortController.abort();let t=!0;if(this._config.addOnBlur&&this._searchInput.value&&(t=this._enterValue()),this._holderElement.classList.remove(FOCUS_CLASS),this.hideSuggestions(t),this._fireEvents){const i=this.getSelection(),s={selection:i?i.dataset.value:null,input:this._searchInput.value};this._config.onBlur(e,this),this._selectElement.dispatchEvent(new CustomEvent("tags.blur",{bubbles:!0,detail:s}))}}onpaste(e){const i=(e.clipboardData||window.clipboardData).getData("text/plain").replace(/\r\n|\n/g," ");if(i.length>2&&this._config.separator.length){const s=splitMulti(i,this._config.separator).filter(o=>o);s.length>1&&(e.preventDefault(),s.forEach(o=>{this._addPastedValue(o)}))}}_addPastedValue(e){let t=e,i={};if(this._config.allowNew)i.new=1;else{const s=this.getSelection();if(!s)return;e=s.getAttribute(VALUE_ATTRIBUTE),t=s.dataset.label}this._config.confirmAdd(e,this).then(()=>{this._add(t,e,i)}).catch(()=>{})}oninput(e){const t=this._config.inputFilter(this._searchInput.value);if(t!=this._searchInput.value&&(this._searchInput.value=t),t){const i=t.slice(-1);if(this._config.separator.length&&this._config.separator.includes(i)){this._searchInput.value=this._searchInput.value.slice(0,-1);let s=this._searchInput.value;this._addPastedValue(s);return}}setTimeout(()=>{this._adjustWidth()}),this.showOrSearch()}onkeydown(e){let t=e.keyCode||e.key;const i=e.target;switch(e.keyCode==229&&(t=i.value.charAt(i.selectionStart-1).charCodeAt(0)),t){case 13:case"Enter":e.preventDefault(),this._enterValue();break;case 38:case"ArrowUp":e.preventDefault(),this._keyboardNavigation=!0,this._moveSelection(PREV);break;case 40:case"ArrowDown":e.preventDefault(),this._keyboardNavigation=!0,this.isDropdownVisible()?this._moveSelection(NEXT):this.showOrSearch(!1);break;case 8:case"Backspace":const s=this.getLastItem();this._searchInput.value.length==0&&s&&this._config.confirmClear(s,this).then(()=>{this.removeLastItem(),this._adjustWidth(),this.showOrSearch()}).catch(()=>{});break;case 27:case"Escape":this._searchInput.focus(),this.hideSuggestions();break}}onmousemove(e){this._keyboardNavigation=!1}onmouseleave(e){this.removeSelection()}onscroll(e){this._positionMenu()}onresize(e){this._positionMenu()}onclick(e=null){!this.isSingle()&&this.isMaxReached()||this._searchInput.focus()}onreset(e){this.reset()}loadData(e=!1){Object.keys(this._config.items).length>0?this.setData(this._config.items,!0):this.resetSuggestions(!0),this._config.server&&(this._config.liveServer||this._loadFromServer(!e))}_setSelectedAttributes(){const e=this._selectElement.selectedOptions||[];for(let t=0;t<e.length;t++)e[t].value&&!e[t].hasAttribute("selected")&&e[t].setAttribute("selected","selected")}resetState(){this.isDisabled()?(this._holderElement.setAttribute("readonly",""),this._searchInput.setAttribute("disabled",""),this._holderElement.classList.add(DISABLED_CLASS)):(rmAttr(this._holderElement,"readonly"),rmAttr(this._searchInput,"disabled"),this._holderElement.classList.remove(DISABLED_CLASS))}resetSuggestions(e=!1){this._setSelectedAttributes();const t=s=>({value:s.getAttribute("value"),label:s.textContent,disabled:s.disabled,selected:s.selected,data:Object.assign({disabled:s.disabled},s.dataset)});let i=Array.from(this._selectElement.children).filter(s=>s.hasAttribute("label")||!s.disabled||this._config.showDisabled).map(s=>s.hasAttribute("label")?{group:s.getAttribute("label"),items:Array.from(s.children).map(o=>t(o))}:t(s));this.setData(i,e)}_enterValue(){let e=this.getSelection();if(e)return e.click(),!0;if(this._config.allowNew&&this._searchInput.value){let t=this._searchInput.value;return this._config.confirmAdd(t,this).then(()=>{this._add(t,t,{new:1})}).catch(()=>{}),!0}return!1}_loadFromServer(e=!1){this._abortController&&this._abortController.abort(),this._abortController=new AbortController;let t=this._selectElement.dataset.serverParams||{};typeof t=="string"&&(t=JSON.parse(t));const i=Object.assign({},this._config.serverParams,t);if(i[this._config.queryParam]=this._searchInput.value,this._config.noCache&&(i.t=Date.now()),i.related){const a=document.getElementById(i.related);if(a){i.related=a.value;const l=a.getAttribute("name");l&&(i[l]=a.value)}}const s=new URLSearchParams(i);let o=this._config.server,r=Object.assign(this._config.fetchOptions,{method:this._config.serverMethod||"GET",signal:this._abortController.signal});r.method==="POST"?r.body=s:o+="?"+s.toString(),this._holderElement.classList.add(LOADING_CLASS),fetch(o,r).then(a=>this._config.onServerResponse(a,this)).then(a=>{const l=nested(this._config.serverDataKey,a)||a;this.setData(l,!e),this._abortController=null,e&&this._showSuggestions()}).catch(a=>{a.name==="AbortError"||this._abortController.signal.aborted||console.error(a)}).finally(a=>{this._holderElement.classList.remove(LOADING_CLASS)})}_add(e,t=null,i={}){if(!this.canAdd(e,i))return null;const s=this.addItem(e,t,i);return this._resetHtmlState(),this._config.keepOpen?this._showSuggestions():this.resetSearchInput(),s}_isItemEnabled(e){if(e.style.display==="none")return!1;const t=e.firstElementChild;return t.tagName==="A"&&!t.classList.contains("disabled")}_moveSelection(e=NEXT,t=null){const i=this.getSelection();if(i){const s=e===NEXT?"nextSibling":"previousSibling";t=i.parentNode;do t=t[s];while(t&&!this._isItemEnabled(t));t?i.classList.remove(...this._activeClasses()):i&&(t=i.parentElement)}else{if(e===PREV)return t;if(!t)for(t=this._dropElement.firstChild;t&&!this._isItemEnabled(t);)t=t.nextSibling}if(t){const s=t.offsetHeight,o=t.offsetTop,r=t.parentNode,a=r.offsetHeight,l=r.scrollHeight,d=r.offsetTop;if(s===0&&setTimeout(()=>{r.scrollTop=0}),e===PREV){const p=o-d>10?o-d:0;r.scrollTop=p}else o+s-(a+r.scrollTop)>0&&s>0&&(r.scrollTop=o+s-a+1,r.scrollTop+a>=l-10&&(r.scrollTop=o-d));const h=t.querySelector("a");h.classList.add(...this._activeClasses()),this._searchInput.setAttribute("aria-activedescendant",h.id),this._config.updateOnSelect&&(this._searchInput.value=h.dataset.label,this._adjustWidth())}else this._searchInput.setAttribute("aria-activedescendant","");return t}_adjustWidth(){this._holderElement.classList.remove(PLACEHOLDER_CLASS),this._searchInput.value?this._searchInput.size=this._searchInput.value.length:this.getSelectedValues().length?(this._searchInput.placeholder="",this._searchInput.size=1):(this._searchInput.size=this._config.placeholder.length>0?this._config.placeholder.length:1,this._searchInput.placeholder=this._config.placeholder,this._holderElement.classList.add(PLACEHOLDER_CLASS));const e=this._searchInput.value||this._searchInput.placeholder,t=window.getComputedStyle(this._holderElement).fontSize,i=calcTextWidth(e,t)+16;this._searchInput.style.width=i+"px"}_buildSuggestions(e){for(;this._dropElement.lastChild;)this._dropElement.removeChild(this._dropElement.lastChild);let t=0,i=1;for(let s=0;s<e.length;s++){const o=e[s];if(o){if(o.group&&o.items){const r=ce("li");r.setAttribute("role","presentation"),r.dataset.id=""+i;const a=ce("span");if(r.append(a),a.classList.add("dropdown-header","text-truncate"),a.innerHTML=this._config.sanitizer(o.group),this._dropElement.appendChild(r),o.items)for(let l=0;l<o.items.length;l++){const d=o.items[l];d.group_id=i,this._buildSuggestionsItem(o.items[l],t),t++}i++}this._buildSuggestionsItem(o,t),t++}}if(this._config.notFoundMessage){const s=ce("li");s.setAttribute("role","presentation"),s.classList.add(CLASS_PREFIX+"not-found"),s.innerHTML='<span class="dropdown-item"></span>',this._dropElement.appendChild(s)}}_buildSuggestionsItem(e,t){if(!e[this._config.valueField])return;const i=e[this._config.valueField],s=e[this._config.labelField];let o=this._config.onRenderItem(e,s,this);const r=ce("li");r.setAttribute("role","presentation"),e.group_id&&r.setAttribute("data-group-id",""+e.group_id);const a=ce("a");r.append(a),a.id=this._dropElement.id+"-"+t,a.classList.add("dropdown-item","text-truncate"),e.disabled&&a.classList.add("disabled"),a.setAttribute(VALUE_ATTRIBUTE,i),a.dataset.label=s;const l={};this._config.searchFields.forEach(d=>{l[d]=e[d]}),a.dataset.searchData=JSON.stringify(l),a.setAttribute("href","#"),a.innerHTML=o,this._dropElement.appendChild(r),a.addEventListener("mouseenter",d=>{this._keyboardNavigation||(this.removeSelection(),r.querySelector("a").classList.add(...this._activeClasses()))}),a.addEventListener("mousedown",d=>{d.preventDefault()}),a.addEventListener("click",d=>{d.preventDefault(),d.stopPropagation(),this._config.confirmAdd(i,this).then(()=>{this._add(s,i,e.data),this._config.onSelectItem(e,this)}).catch(()=>{})})}initialOptions(){return this._selectElement.querySelectorAll("option[data-init]")}_removeSelectedAttrs(){this._selectElement.querySelectorAll("option").forEach(e=>{rmAttr(e,"selected")})}reset(){this.removeAll(),this._fireEvents=!1;const e=this.initialOptions();this._removeSelectedAttrs();for(let t=0;t<e.length;t++){const i=e[t],s=Object.assign({},{disabled:i.hasAttribute("disabled")},i.dataset);this.addItem(i.textContent,i.value,s)}this._resetHtmlState(),this._fireEvents=!0}resetSearchInput(e=!1){if(this._searchInput.value="",this._adjustWidth(),this._checkMax(),this.isSingle()&&!e){document.activeElement.blur(),this.hideSuggestions();return}e||(this._shouldShow()||this.hideSuggestions(),this._searchInput===document.activeElement&&this._searchInput.dispatchEvent(new Event("input")))}_checkMax(){this.isMaxReached()?(this._holderElement.classList.add(MAX_REACHED_CLASS),this._searchInput.style.visibility="hidden"):this._searchInput.style.visibility=="hidden"&&(this._searchInput.style.visibility="visible")}getSelectedValues(){const e=this._selectElement.querySelectorAll("option[selected]");return Array.from(e).map(t=>t.value)}getAvailableValues(){const e=this._selectElement.querySelectorAll("option");return Array.from(e).map(t=>t.value)}showOrSearch(e=!0){if(e&&!this._shouldShow()){this.hideSuggestions(!1);return}this._config.liveServer?this._searchFunc():this._showSuggestions()}hideSuggestions(e=!0){this._dropElement.classList.remove(SHOW_CLASS),attrs(this._searchInput,{"aria-expanded":"false"}),this.removeSelection(),e&&this._holderElement.classList.remove(INVALID_CLASS)}toggleSuggestions(e=!0,t=!0){this._dropElement.classList.contains(SHOW_CLASS)?this.hideSuggestions(t):this.showOrSearch(e)}_shouldShow(){return this.isDisabled()||this.isMaxReached()?!1:this._searchInput.value.length>=this._config.suggestionsThreshold}_showSuggestions(){if(this._searchInput.style.visibility=="hidden")return;const e=normalize(this._searchInput.value),t={},i=this._dropElement.querySelectorAll("li");let s=0,o=null,r=!1,a={};for(let l=0;l<i.length;l++){let d=i[l],h=d.firstElementChild;if(h instanceof HTMLSpanElement){d.dataset.id&&(a[d.dataset.id]=!1),hideItem(d);continue}if(h.classList.remove(...this._activeClasses()),!this._config.allowSame){const y=h.getAttribute(VALUE_ATTRIBUTE);if(t[y]=t[y]||0,this._findOption(h.getAttribute(VALUE_ATTRIBUTE),"[selected]",t[y]++)){hideItem(d);continue}}const p=this._config.showAllSuggestions||e.length===0;let m=e.length==0&&this._config.suggestionsThreshold===0;if(!p&&e.length>0){const y=JSON.parse(h.dataset.searchData);this._config.searchFields.forEach(b=>{const S=normalize(y[b]);let E=!1;if(this._config.fuzzy)E=fuzzyMatch(S,e);else{const T=S.indexOf(e);E=this._config.startsWith?T===0:T>=0}E&&(m=!0)})}const v=m||e.length===0;if(p||m?(s++,showItem(d),d.dataset.groupId&&(a[d.dataset.groupId]=!0),!o&&this._isItemEnabled(d)&&v&&(o=d),this._config.maximumItems>0&&s>this._config.maximumItems&&hideItem(d)):hideItem(d),this._config.highlightTyped){const y=h.textContent,b=normalize(y).indexOf(e),S=y.substring(0,b)+`<mark class="${this._config.highlightClass}">${y.substring(b,b+e.length)}</mark>`+y.substring(b+e.length,y.length);h.innerHTML=S}this._isItemEnabled(d)&&(r=!0)}if(!this._config.allowNew&&!(e.length===0&&!r)&&this._holderElement.classList.add(INVALID_CLASS),this._config.allowNew&&this._config.regex&&this.isInvalid()&&this._holderElement.classList.remove(INVALID_CLASS),Array.from(i).filter(l=>l.dataset.id).forEach(l=>{a[l.dataset.id]===!0&&showItem(l)}),r&&(this._holderElement.classList.remove(INVALID_CLASS),o&&this._config.autoselectFirst&&(this.removeSelection(),this._moveSelection(NEXT,o))),s===0)if(this._config.notFoundMessage){const l=this._dropElement.querySelector("."+CLASS_PREFIX+"not-found");l.style.display="block";const d=this._config.notFoundMessage.replace("{{tag}}",this._searchInput.value);l.innerHTML=`<span class="dropdown-item">${d}</span>`,this._showDropdown()}else this.hideSuggestions(!1);else this._showDropdown()}_showDropdown(){const e=this._dropElement.classList.contains(SHOW_CLASS);e||(this._dropElement.classList.add(SHOW_CLASS),attrs(this._searchInput,{"aria-expanded":"true"})),this._positionMenu(e)}_positionMenu(e=!1){const t=this._rtl,i=this._config.fixed,s=this._config.fullWidth,o=this._searchInput.getBoundingClientRect(),r=this._holderElement.getBoundingClientRect();let a=0,l=0;if(i?s?(a=r.x,l=r.y+r.height+2):(a=o.x,l=o.y+o.height):s?(a=0,l=r.height+2):(a=this._searchInput.offsetLeft,l=this._searchInput.offsetHeight+this._searchInput.offsetTop),t&&!s&&(a-=this._dropElement.offsetWidth-o.width),!s){const p=Math.min(window.innerWidth,document.body.offsetWidth),m=t?o.x+o.width-this._dropElement.offsetWidth-1:p-1-(o.x+this._dropElement.offsetWidth);m<0&&(a=t?a-m:a+m)}s&&(this._dropElement.style.width=this._holderElement.offsetWidth+"px"),e||(this._dropElement.style.transform="unset"),Object.assign(this._dropElement.style,{left:a+"px",top:l+"px"});const d=this._dropElement.getBoundingClientRect(),h=window.innerHeight;if(d.y+d.height>h||this._dropElement.style.transform.includes("translateY")){const p=s?r.height+4:o.height;this._dropElement.style.transform="translateY(calc(-100.1% - "+p+"px))"}}_getBootstrapVersion(){let e=5,t=window.jQuery;return t&&t.fn.tooltip&&t.fn.tooltip.Constructor&&(e=parseInt(t.fn.tooltip.Constructor.VERSION.charAt(0))),e}_isSelected(e){return!!Array.from(this._selectElement.querySelectorAll("option")).find(s=>s.textContent==e&&s.getAttribute("selected"))}_isSelectable(e){const i=Array.from(this._selectElement.querySelectorAll("option")).filter(s=>s.textContent==e);return!(i.length>0&&!i.find(o=>!o.getAttribute("selected")))}hasItem(e){for(let t of this._config.items){const i=t.items||[t];for(let s of i)if(s[this._config.labelField]==e)return!0}return!1}getItem(e){for(let t of this._config.items){const i=t.items||[t];for(let s of i)if(s[this._config.valueField]==e)return s}return null}_validateRegex(e){return new RegExp(this._config.regex.trim()).test(e)}getSelection(){return this._dropElement.querySelector("a."+ACTIVE_CLASS)}removeSelection(){const e=this.getSelection();e&&e.classList.remove(...this._activeClasses())}_activeClasses(){return[...this._config.activeClasses,ACTIVE_CLASS]}getActiveSelection(){return this.getSelection()}removeActiveSelection(){return this.removeSelection()}removeAll(){this.getSelectedValues().forEach(t=>{this.removeItem(t,!0)}),this._adjustWidth()}removeLastItem(e=!1){let t=this.getLastItem();t&&this.removeItem(t,e)}getLastItem(){let e=this._containerElement.querySelectorAll("span."+CLASS_PREFIX+"badge");return e.length?e[e.length-1].getAttribute(VALUE_ATTRIBUTE):void 0}enable(){this._selectElement.setAttribute("disabled",""),this.resetState()}disable(){rmAttr(this._selectElement,"disabled"),this.resetState()}isDisabled(){return this._selectElement.hasAttribute("disabled")||this._selectElement.disabled||this._selectElement.hasAttribute("readonly")}isDropdownVisible(){return this._dropElement.classList.contains(SHOW_CLASS)}isInvalid(){return this._holderElement.classList.contains(INVALID_CLASS)}isSingle(){return!this._selectElement.hasAttribute("multiple")}isMaxReached(){return this._config.max&&this.getSelectedValues().length>=this._config.max}canAdd(e,t={}){if(!e||t.new&&!this._config.allowNew||!t.new&&!this.hasItem(e)||this.isDisabled())return!1;if(!this.isSingle()&&!this._config.allowSame){if(t.new){if(this._isSelected(e))return!1}else if(!this._isSelectable(e))return!1}return this.isMaxReached()?!1:this._config.regex&&t.new&&!this._validateRegex(e)?(this._holderElement.classList.add(INVALID_CLASS),!1):this._config.onCanAdd&&this._config.onCanAdd(e,t,this)===!1?(this._holderElement.classList.add(INVALID_CLASS),!1):!0}getData(){return this._config.items}setData(e,t=!1){Array.isArray(e)||(e=Object.entries(e).map(([i,s])=>({value:i,label:s}))),this._config.items!=e&&(this._config.items=e),t&&(this._removeSelectedAttrs(),e.reduce((s,o)=>s.concat(o.group?o.items:[o]),[]).forEach(s=>{const o=s[this._config.valueField],r=s[this._config.labelField];if(o&&(s.selected||this._config.selected.includes(o))){const a=this.addItem(r,o,s.data);a&&a.setAttribute("data-init","true")}})),this._buildSuggestions(e),this._resetHtmlState()}_findOption(e=null,t="",i=0){const o="option"+(e===null?"":'[value="'+CSS.escape(e)+'"]')+t;return this._selectElement.querySelectorAll(o)[i]||null}setItem(e,t={}){let i=null,s=this._findOption(e,":not([selected])");s&&(i=this.addItem(s.textContent,s.value,t));let o=this.getItem(e);if(o){const r=o[this._config.valueField],a=o[this._config.labelField];i=this.addItem(a,r,t)}return this._adjustWidth(),this._checkMax(),i}addItem(e,t=null,i={}){t||(t=e),this.isSingle()&&this.getSelectedValues().length&&this.removeLastItem(!0);let s=this._findOption(t,":not([selected])");if(!s){s=ce("option"),s.value=t,s.innerText=e;for(const[o,r]of Object.entries(i))s.dataset[o]=r;this._selectElement.appendChild(s),this._config.onCreateItem(s,this)}return s&&(i=Object.assign({title:s.getAttribute("title")},i,s.dataset)),s.setAttribute("selected","selected"),s.selected=!0,this._createBadge(e,t,i),this._fireEvents&&this._selectElement.dispatchEvent(new Event("change",{bubbles:!0})),s}_resetHtmlState(){const e=this._selectElement.innerHTML;this._selectElement.innerHTML="",this._selectElement.innerHTML=e,this._adjustWidth()}_createBadge(e,t=null,i={}){const s=this._getBootstrapVersion()===5,o=i.disabled&&parseBool(i.disabled),r=this._config.allowClear&&!o;let a=this._config.allowHtml?e:this._config.sanitizer(e),l=ce("span"),d=[CLASS_PREFIX+"badge"];const h=this.isSingle()&&!this._config.singleBadge;if(!h){d.push("badge");let m=this._config.badgeStyle;i.badgeStyle&&(m=i.badgeStyle),i.badgeClass&&d.push(...i.badgeClass.split(" ")),this._config.baseClass?d.push(...this._config.baseClass.split(" ")):s?d=[...d,"bg-"+m,"text-truncate"]:d=[...d,"badge-"+m],l.style.maxWidth="100%"}o&&d.push("disabled","opacity-50");const p=h?0:2;if(l.style.margin=p+"px 6px "+p+"px 0px",l.style.marginBlock=p+"px",l.style.marginInline="0px 6px",l.style.display="flex",l.style.alignItems="center",l.classList.add(...d),l.setAttribute(VALUE_ATTRIBUTE,t),i.title&&l.setAttribute("title",i.title),r){const m=d.includes("text-dark")||h?"btn-close":"btn-close btn-close-white";let v="margin-inline: 0px 6px;",y="left";this._config.clearEnd&&(y="right"),y=="right"&&(v="margin-inline: 6px 0px;");const b=s?'<button type="button" style="font-size:0.65em;'+v+'" class="'+m+'" aria-label="'+this._config.clearLabel+'"></button>':'<button type="button" style="font-size:1em;'+v+'text-shadow:none;color:currentColor;transform:scale(1.2);float:none" class="close" aria-label="'+this._config.clearLabel+'"><span aria-hidden="true">×</span></button>';a=y=="left"?b+a:a+b}l.innerHTML=a,this._containerElement.insertBefore(l,this._searchInput),i.title&&tooltip&&s&&tooltip.getOrCreateInstance(l),r&&l.querySelector("button").addEventListener("click",m=>{m.preventDefault(),m.stopPropagation(),this.isDisabled()||this._config.confirmClear(t,this).then(()=>{this.removeItem(t),document.activeElement.blur(),this._adjustWidth()}).catch(()=>{})})}getHolder(){return this._holderElement}clear(){this.hideSuggestions(),this.reset()}updateData(e){this.setData(e,!1),this.reset()}removeItem(e,t=!1){const i=CSS.escape(e);let s=this._containerElement.querySelectorAll("span["+VALUE_ATTRIBUTE+'="'+i+'"]');if(!s.length)return;const o=s.length-1,r=s[o];r&&(r.dataset.bsOriginalTitle&&tooltip.getOrCreateInstance(r).dispose(),r.remove());let a=this._findOption(e,"[selected]",o);a&&(rmAttr(a,"selected"),a.selected=!1,this._fireEvents&&!t&&this._selectElement.dispatchEvent(new Event("change",{bubbles:!0}))),this._searchInput.style.visibility=="hidden"&&!this.isMaxReached()&&(this._searchInput.style.visibility="visible",this._holderElement.classList.remove(MAX_REACHED_CLASS)),t||this._config.onClearItem(e,this)}}var leafletSrc={exports:{}};/* @preserve* Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com* (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade*/(function(n,e){(function(t,i){i(e)})(commonjsGlobal,function(t){var i="1.9.4";function s(c){var u,g,C,w;for(g=1,C=arguments.length;g<C;g++){w=arguments[g];for(u in w)c[u]=w[u]}return c}var o=Object.create||function(){function c(){}return function(u){return c.prototype=u,new c}}();function r(c,u){var g=Array.prototype.slice;if(c.bind)return c.bind.apply(c,g.call(arguments,1));var C=g.call(arguments,2);return function(){return c.apply(u,C.length?C.concat(g.call(arguments)):arguments)}}var a=0;function l(c){return"_leaflet_id"in c||(c._leaflet_id=++a),c._leaflet_id}function d(c,u,g){var C,w,P,O;return O=function(){C=!1,w&&(P.apply(g,w),w=!1)},P=function(){C?w=arguments:(c.apply(g,arguments),setTimeout(O,u),C=!0)},P}function h(c,u,g){var C=u[1],w=u[0],P=C-w;return c===C&&g?c:((c-w)%P+P)%P+w}function p(){return!1}function m(c,u){if(u===!1)return c;var g=Math.pow(10,u===void 0?6:u);return Math.round(c*g)/g}function v(c){return c.trim?c.trim():c.replace(/^\s+|\s+$/g,"")}function y(c){return v(c).split(/\s+/)}function b(c,u){Object.prototype.hasOwnProperty.call(c,"options")||(c.options=c.options?o(c.options):{});for(var g in u)c.options[g]=u[g];return c.options}function S(c,u,g){var C=[];for(var w in c)C.push(encodeURIComponent(g?w.toUpperCase():w)+"="+encodeURIComponent(c[w]));return(!u||u.indexOf("?")===-1?"?":"&")+C.join("&")}var E=/\{ *([\w_ -]+) *\}/g;function T(c,u){return c.replace(E,function(g,C){var w=u[C];if(w===void 0)throw new Error("No value provided for variable "+g);return typeof w=="function"&&(w=w(u)),w})}var R=Array.isArray||function(c){return Object.prototype.toString.call(c)==="[object Array]"};function A(c,u){for(var g=0;g<c.length;g++)if(c[g]===u)return g;return-1}var D="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function x(c){return window["webkit"+c]||window["moz"+c]||window["ms"+c]}var M=0;function N(c){var u=+new Date,g=Math.max(0,16-(u-M));return M=u+g,window.setTimeout(c,g)}var V=window.requestAnimationFrame||x("RequestAnimationFrame")||N,z=window.cancelAnimationFrame||x("CancelAnimationFrame")||x("CancelRequestAnimationFrame")||function(c){window.clearTimeout(c)};function B(c,u,g){if(g&&V===N)c.call(u);else return V.call(window,r(c,u))}function K(c){c&&z.call(window,c)}var J={__proto__:null,extend:s,create:o,bind:r,get lastId(){return a},stamp:l,throttle:d,wrapNum:h,falseFn:p,formatNum:m,trim:v,splitWords:y,setOptions:b,getParamString:S,template:T,isArray:R,indexOf:A,emptyImageUrl:D,requestFn:V,cancelFn:z,requestAnimFrame:B,cancelAnimFrame:K};function Z(){}Z.extend=function(c){var u=function(){b(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},g=u.__super__=this.prototype,C=o(g);C.constructor=u,u.prototype=C;for(var w in this)Object.prototype.hasOwnProperty.call(this,w)&&w!=="prototype"&&w!=="__super__"&&(u[w]=this[w]);return c.statics&&s(u,c.statics),c.includes&&(F(c.includes),s.apply(null,[C].concat(c.includes))),s(C,c),delete C.statics,delete C.includes,C.options&&(C.options=g.options?o(g.options):{},s(C.options,c.options)),C._initHooks=[],C.callInitHooks=function(){if(!this._initHooksCalled){g.callInitHooks&&g.callInitHooks.call(this),this._initHooksCalled=!0;for(var P=0,O=C._initHooks.length;P<O;P++)C._initHooks[P].call(this)}},u},Z.include=function(c){var u=this.prototype.options;return s(this.prototype,c),c.options&&(this.prototype.options=u,this.mergeOptions(c.options)),this},Z.mergeOptions=function(c){return s(this.prototype.options,c),this},Z.addInitHook=function(c){var u=Array.prototype.slice.call(arguments,1),g=typeof c=="function"?c:function(){this[c].apply(this,u)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(g),this};function F(c){if(!(typeof L>"u"||!L||!L.Mixin)){c=R(c)?c:[c];for(var u=0;u<c.length;u++)c[u]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var $={on:function(c,u,g){if(typeof c=="object")for(var C in c)this._on(C,c[C],u);else{c=y(c);for(var w=0,P=c.length;w<P;w++)this._on(c[w],u,g)}return this},off:function(c,u,g){if(!arguments.length)delete this._events;else if(typeof c=="object")for(var C in c)this._off(C,c[C],u);else{c=y(c);for(var w=arguments.length===1,P=0,O=c.length;P<O;P++)w?this._off(c[P]):this._off(c[P],u,g)}return this},_on:function(c,u,g,C){if(typeof u!="function"){console.warn("wrong listener type: "+typeof u);return}if(this._listens(c,u,g)===!1){g===this&&(g=void 0);var w={fn:u,ctx:g};C&&(w.once=!0),this._events=this._events||{},this._events[c]=this._events[c]||[],this._events[c].push(w)}},_off:function(c,u,g){var C,w,P;if(this._events&&(C=this._events[c],!!C)){if(arguments.length===1){if(this._firingCount)for(w=0,P=C.length;w<P;w++)C[w].fn=p;delete this._events[c];return}if(typeof u!="function"){console.warn("wrong listener type: "+typeof u);return}var O=this._listens(c,u,g);if(O!==!1){var I=C[O];this._firingCount&&(I.fn=p,this._events[c]=C=C.slice()),C.splice(O,1)}}},fire:function(c,u,g){if(!this.listens(c,g))return this;var C=s({},u,{type:c,target:this,sourceTarget:u&&u.sourceTarget||this});if(this._events){var w=this._events[c];if(w){this._firingCount=this._firingCount+1||1;for(var P=0,O=w.length;P<O;P++){var I=w[P],k=I.fn;I.once&&this.off(c,k,I.ctx),k.call(I.ctx||this,C)}this._firingCount--}}return g&&this._propagateEvent(C),this},listens:function(c,u,g,C){typeof c!="string"&&console.warn('"string" type argument expected');var w=u;typeof u!="function"&&(C=!!u,w=void 0,g=void 0);var P=this._events&&this._events[c];if(P&&P.length&&this._listens(c,w,g)!==!1)return!0;if(C){for(var O in this._eventParents)if(this._eventParents[O].listens(c,u,g,C))return!0}return!1},_listens:function(c,u,g){if(!this._events)return!1;var C=this._events[c]||[];if(!u)return!!C.length;g===this&&(g=void 0);for(var w=0,P=C.length;w<P;w++)if(C[w].fn===u&&C[w].ctx===g)return w;return!1},once:function(c,u,g){if(typeof c=="object")for(var C in c)this._on(C,c[C],u,!0);else{c=y(c);for(var w=0,P=c.length;w<P;w++)this._on(c[w],u,g,!0)}return this},addEventParent:function(c){return this._eventParents=this._eventParents||{},this._eventParents[l(c)]=c,this},removeEventParent:function(c){return this._eventParents&&delete this._eventParents[l(c)],this},_propagateEvent:function(c){for(var u in this._eventParents)this._eventParents[u].fire(c.type,s({layer:c.target,propagatedFrom:c.target},c),!0)}};$.addEventListener=$.on,$.removeEventListener=$.clearAllEventListeners=$.off,$.addOneTimeEventListener=$.once,$.fireEvent=$.fire,$.hasEventListeners=$.listens;var Y=Z.extend($);function W(c,u,g){this.x=g?Math.round(c):c,this.y=g?Math.round(u):u}var X=Math.trunc||function(c){return c>0?Math.floor(c):Math.ceil(c)};W.prototype={clone:function(){return new W(this.x,this.y)},add:function(c){return this.clone()._add(U(c))},_add:function(c){return this.x+=c.x,this.y+=c.y,this},subtract:function(c){return this.clone()._subtract(U(c))},_subtract:function(c){return this.x-=c.x,this.y-=c.y,this},divideBy:function(c){return this.clone()._divideBy(c)},_divideBy:function(c){return this.x/=c,this.y/=c,this},multiplyBy:function(c){return this.clone()._multiplyBy(c)},_multiplyBy:function(c){return this.x*=c,this.y*=c,this},scaleBy:function(c){return new W(this.x*c.x,this.y*c.y)},unscaleBy:function(c){return new W(this.x/c.x,this.y/c.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=X(this.x),this.y=X(this.y),this},distanceTo:function(c){c=U(c);var u=c.x-this.x,g=c.y-this.y;return Math.sqrt(u*u+g*g)},equals:function(c){return c=U(c),c.x===this.x&&c.y===this.y},contains:function(c){return c=U(c),Math.abs(c.x)<=Math.abs(this.x)&&Math.abs(c.y)<=Math.abs(this.y)},toString:function(){return"Point("+m(this.x)+", "+m(this.y)+")"}};function U(c,u,g){return c instanceof W?c:R(c)?new W(c[0],c[1]):c==null?c:typeof c=="object"&&"x"in c&&"y"in c?new W(c.x,c.y):new W(c,u,g)}function se(c,u){if(c)for(var g=u?[c,u]:c,C=0,w=g.length;C<w;C++)this.extend(g[C])}se.prototype={extend:function(c){var u,g;if(!c)return this;if(c instanceof W||typeof c[0]=="number"||"x"in c)u=g=U(c);else if(c=pe(c),u=c.min,g=c.max,!u||!g)return this;return!this.min&&!this.max?(this.min=u.clone(),this.max=g.clone()):(this.min.x=Math.min(u.x,this.min.x),this.max.x=Math.max(g.x,this.max.x),this.min.y=Math.min(u.y,this.min.y),this.max.y=Math.max(g.y,this.max.y)),this},getCenter:function(c){return U((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,c)},getBottomLeft:function(){return U(this.min.x,this.max.y)},getTopRight:function(){return U(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(c){var u,g;return typeof c[0]=="number"||c instanceof W?c=U(c):c=pe(c),c instanceof se?(u=c.min,g=c.max):u=g=c,u.x>=this.min.x&&g.x<=this.max.x&&u.y>=this.min.y&&g.y<=this.max.y},intersects:function(c){c=pe(c);var u=this.min,g=this.max,C=c.min,w=c.max,P=w.x>=u.x&&C.x<=g.x,O=w.y>=u.y&&C.y<=g.y;return P&&O},overlaps:function(c){c=pe(c);var u=this.min,g=this.max,C=c.min,w=c.max,P=w.x>u.x&&C.x<g.x,O=w.y>u.y&&C.y<g.y;return P&&O},isValid:function(){return!!(this.min&&this.max)},pad:function(c){var u=this.min,g=this.max,C=Math.abs(u.x-g.x)*c,w=Math.abs(u.y-g.y)*c;return pe(U(u.x-C,u.y-w),U(g.x+C,g.y+w))},equals:function(c){return c?(c=pe(c),this.min.equals(c.getTopLeft())&&this.max.equals(c.getBottomRight())):!1}};function pe(c,u){return!c||c instanceof se?c:new se(c,u)}function ae(c,u){if(c)for(var g=u?[c,u]:c,C=0,w=g.length;C<w;C++)this.extend(g[C])}ae.prototype={extend:function(c){var u=this._southWest,g=this._northEast,C,w;if(c instanceof ie)C=c,w=c;else if(c instanceof ae){if(C=c._southWest,w=c._northEast,!C||!w)return this}else return c?this.extend(te(c)||oe(c)):this;return!u&&!g?(this._southWest=new ie(C.lat,C.lng),this._northEast=new ie(w.lat,w.lng)):(u.lat=Math.min(C.lat,u.lat),u.lng=Math.min(C.lng,u.lng),g.lat=Math.max(w.lat,g.lat),g.lng=Math.max(w.lng,g.lng)),this},pad:function(c){var u=this._southWest,g=this._northEast,C=Math.abs(u.lat-g.lat)*c,w=Math.abs(u.lng-g.lng)*c;return new ae(new ie(u.lat-C,u.lng-w),new ie(g.lat+C,g.lng+w))},getCenter:function(){return new ie((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new ie(this.getNorth(),this.getWest())},getSouthEast:function(){return new ie(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(c){typeof c[0]=="number"||c instanceof ie||"lat"in c?c=te(c):c=oe(c);var u=this._southWest,g=this._northEast,C,w;return c instanceof ae?(C=c.getSouthWest(),w=c.getNorthEast()):C=w=c,C.lat>=u.lat&&w.lat<=g.lat&&C.lng>=u.lng&&w.lng<=g.lng},intersects:function(c){c=oe(c);var u=this._southWest,g=this._northEast,C=c.getSouthWest(),w=c.getNorthEast(),P=w.lat>=u.lat&&C.lat<=g.lat,O=w.lng>=u.lng&&C.lng<=g.lng;return P&&O},overlaps:function(c){c=oe(c);var u=this._southWest,g=this._northEast,C=c.getSouthWest(),w=c.getNorthEast(),P=w.lat>u.lat&&C.lat<g.lat,O=w.lng>u.lng&&C.lng<g.lng;return P&&O},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(c,u){return c?(c=oe(c),this._southWest.equals(c.getSouthWest(),u)&&this._northEast.equals(c.getNorthEast(),u)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function oe(c,u){return c instanceof ae?c:new ae(c,u)}function ie(c,u,g){if(isNaN(c)||isNaN(u))throw new Error("Invalid LatLng object: ("+c+", "+u+")");this.lat=+c,this.lng=+u,g!==void 0&&(this.alt=+g)}ie.prototype={equals:function(c,u){if(!c)return!1;c=te(c);var g=Math.max(Math.abs(this.lat-c.lat),Math.abs(this.lng-c.lng));return g<=(u===void 0?1e-9:u)},toString:function(c){return"LatLng("+m(this.lat,c)+", "+m(this.lng,c)+")"},distanceTo:function(c){return be.distance(this,te(c))},wrap:function(){return be.wrapLatLng(this)},toBounds:function(c){var u=180*c/40075017,g=u/Math.cos(Math.PI/180*this.lat);return oe([this.lat-u,this.lng-g],[this.lat+u,this.lng+g])},clone:function(){return new ie(this.lat,this.lng,this.alt)}};function te(c,u,g){return c instanceof ie?c:R(c)&&typeof c[0]!="object"?c.length===3?new ie(c[0],c[1],c[2]):c.length===2?new ie(c[0],c[1]):null:c==null?c:typeof c=="object"&&"lat"in c?new ie(c.lat,"lng"in c?c.lng:c.lon,c.alt):u===void 0?null:new ie(c,u,g)}var Se={latLngToPoint:function(c,u){var g=this.projection.project(c),C=this.scale(u);return this.transformation._transform(g,C)},pointToLatLng:function(c,u){var g=this.scale(u),C=this.transformation.untransform(c,g);return this.projection.unproject(C)},project:function(c){return this.projection.project(c)},unproject:function(c){return this.projection.unproject(c)},scale:function(c){return 256*Math.pow(2,c)},zoom:function(c){return Math.log(c/256)/Math.LN2},getProjectedBounds:function(c){if(this.infinite)return null;var u=this.projection.bounds,g=this.scale(c),C=this.transformation.transform(u.min,g),w=this.transformation.transform(u.max,g);return new se(C,w)},infinite:!1,wrapLatLng:function(c){var u=this.wrapLng?h(c.lng,this.wrapLng,!0):c.lng,g=this.wrapLat?h(c.lat,this.wrapLat,!0):c.lat,C=c.alt;return new ie(g,u,C)},wrapLatLngBounds:function(c){var u=c.getCenter(),g=this.wrapLatLng(u),C=u.lat-g.lat,w=u.lng-g.lng;if(C===0&&w===0)return c;var P=c.getSouthWest(),O=c.getNorthEast(),I=new ie(P.lat-C,P.lng-w),k=new ie(O.lat-C,O.lng-w);return new ae(I,k)}},be=s({},Se,{wrapLng:[-180,180],R:6371e3,distance:function(c,u){var g=Math.PI/180,C=c.lat*g,w=u.lat*g,P=Math.sin((u.lat-c.lat)*g/2),O=Math.sin((u.lng-c.lng)*g/2),I=P*P+Math.cos(C)*Math.cos(w)*O*O,k=2*Math.atan2(Math.sqrt(I),Math.sqrt(1-I));return this.R*k}}),qe=6378137,dt={R:qe,MAX_LATITUDE:85.0511287798,project:function(c){var u=Math.PI/180,g=this.MAX_LATITUDE,C=Math.max(Math.min(g,c.lat),-g),w=Math.sin(C*u);return new W(this.R*c.lng*u,this.R*Math.log((1+w)/(1-w))/2)},unproject:function(c){var u=180/Math.PI;return new ie((2*Math.atan(Math.exp(c.y/this.R))-Math.PI/2)*u,c.x*u/this.R)},bounds:function(){var c=qe*Math.PI;return new se([-c,-c],[c,c])}()};function We(c,u,g,C){if(R(c)){this._a=c[0],this._b=c[1],this._c=c[2],this._d=c[3];return}this._a=c,this._b=u,this._c=g,this._d=C}We.prototype={transform:function(c,u){return this._transform(c.clone(),u)},_transform:function(c,u){return u=u||1,c.x=u*(this._a*c.x+this._b),c.y=u*(this._c*c.y+this._d),c},untransform:function(c,u){return u=u||1,new W((c.x/u-this._b)/this._a,(c.y/u-this._d)/this._c)}};function Be(c,u,g,C){return new We(c,u,g,C)}var Xe=s({},be,{code:"EPSG:3857",projection:dt,transformation:function(){var c=.5/(Math.PI*dt.R);return Be(c,.5,-c,.5)}()}),Zt=s({},Xe,{code:"EPSG:900913"});function Mt(c){return document.createElementNS("http://www.w3.org/2000/svg",c)}function ut(c,u){var g="",C,w,P,O,I,k;for(C=0,P=c.length;C<P;C++){for(I=c[C],w=0,O=I.length;w<O;w++)k=I[w],g+=(w?"L":"M")+k.x+" "+k.y;g+=u?Q.svg?"z":"x":""}return g||"M0 0"}var Qe=document.documentElement.style,Ze="ActiveXObject"in window,Jt=Ze&&!document.addEventListener,Oe="msLaunchUri"in navigator&&!("documentMode"in document),Ge=Me("webkit"),ht=Me("android"),ft=Me("android 2")||Me("android 3"),gt=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),Lt=ht&&Me("Google")&><537&&!("AudioNode"in window),Je=!!window.opera,mt=!Oe&&Me("chrome"),vt=Me("gecko")&&!Ge&&!Je&&!Ze,Gn=!mt&&Me("safari"),Mi=Me("phantom"),Li="OTransition"in Qe,Vn=navigator.platform.indexOf("Win")===0,xi=Ze&&"transition"in Qe,ei="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!ft,Fi="MozPerspective"in Qe,Hn=!window.L_DISABLE_3D&&(xi||ei||Fi)&&!Li&&!Mi,Ct=typeof orientation<"u"||Me("mobile"),Wn=Ct&&Ge,Bn=Ct&&ei,Ni=!window.PointerEvent&&window.MSPointerEvent,Ii=!!(window.PointerEvent||Ni),$i="ontouchstart"in window||!!window.TouchEvent,zn=!window.L_NO_TOUCH&&($i||Ii),jn=Ct&&Je,Un=Ct&&vt,Kn=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Yn=function(){var c=!1;try{var u=Object.defineProperty({},"passive",{get:function(){c=!0}});window.addEventListener("testPassiveEventSupport",p,u),window.removeEventListener("testPassiveEventSupport",p,u)}catch{}return c}(),qn=function(){return!!document.createElement("canvas").getContext}(),ti=!!(document.createElementNS&&Mt("svg").createSVGRect),Xn=!!ti&&function(){var c=document.createElement("div");return c.innerHTML="<svg/>",(c.firstChild&&c.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),Qn=!ti&&function(){try{var c=document.createElement("div");c.innerHTML='<v:shape adj="1"/>';var u=c.firstChild;return u.style.behavior="url(#default#VML)",u&&typeof u.adj=="object"}catch{return!1}}(),Zn=navigator.platform.indexOf("Mac")===0,Jn=navigator.platform.indexOf("Linux")===0;function Me(c){return navigator.userAgent.toLowerCase().indexOf(c)>=0}var Q={ie:Ze,ielt9:Jt,edge:Oe,webkit:Ge,android:ht,android23:ft,androidStock:Lt,opera:Je,chrome:mt,gecko:vt,safari:Gn,phantom:Mi,opera12:Li,win:Vn,ie3d:xi,webkit3d:ei,gecko3d:Fi,any3d:Hn,mobile:Ct,mobileWebkit:Wn,mobileWebkit3d:Bn,msPointer:Ni,pointer:Ii,touch:zn,touchNative:$i,mobileOpera:jn,mobileGecko:Un,retina:Kn,passiveEvents:Yn,canvas:qn,svg:ti,vml:Qn,inlineSvg:Xn,mac:Zn,linux:Jn},ki=Q.msPointer?"MSPointerDown":"pointerdown",Gi=Q.msPointer?"MSPointerMove":"pointermove",Vi=Q.msPointer?"MSPointerUp":"pointerup",Hi=Q.msPointer?"MSPointerCancel":"pointercancel",ii={touchstart:ki,touchmove:Gi,touchend:Vi,touchcancel:Hi},Wi={touchstart:rs,touchmove:xt,touchend:xt,touchcancel:xt},et={},Bi=!1;function ts(c,u,g){return u==="touchstart"&&os(),Wi[u]?(g=Wi[u].bind(this,g),c.addEventListener(ii[u],g,!1),g):(console.warn("wrong event specified:",u),p)}function is(c,u,g){if(!ii[u]){console.warn("wrong event specified:",u);return}c.removeEventListener(ii[u],g,!1)}function ns(c){et[c.pointerId]=c}function ss(c){et[c.pointerId]&&(et[c.pointerId]=c)}function zi(c){delete et[c.pointerId]}function os(){Bi||(document.addEventListener(ki,ns,!0),document.addEventListener(Gi,ss,!0),document.addEventListener(Vi,zi,!0),document.addEventListener(Hi,zi,!0),Bi=!0)}function xt(c,u){if(u.pointerType!==(u.MSPOINTER_TYPE_MOUSE||"mouse")){u.touches=[];for(var g in et)u.touches.push(et[g]);u.changedTouches=[u],c(u)}}function rs(c,u){u.MSPOINTER_TYPE_TOUCH&&u.pointerType===u.MSPOINTER_TYPE_TOUCH&&ye(u),xt(c,u)}function as(c){var u={},g,C;for(C in c)g=c[C],u[C]=g&&g.bind?g.bind(c):g;return c=u,u.type="dblclick",u.detail=2,u.isTrusted=!1,u._simulated=!0,u}var ls=200;function ds(c,u){c.addEventListener("dblclick",u);var g=0,C;function w(P){if(P.detail!==1){C=P.detail;return}if(!(P.pointerType==="mouse"||P.sourceCapabilities&&!P.sourceCapabilities.firesTouchEvents)){var O=qi(P);if(!(O.some(function(k){return k instanceof HTMLLabelElement&&k.attributes.for})&&!O.some(function(k){return k instanceof HTMLInputElement||k instanceof HTMLSelectElement}))){var I=Date.now();I-g<=ls?(C++,C===2&&u(as(P))):C=1,g=I}}}return c.addEventListener("click",w),{dblclick:u,simDblclick:w}}function us(c,u){c.removeEventListener("dblclick",u.dblclick),c.removeEventListener("click",u.simDblclick)}var ni=It(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),_t=It(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ji=_t==="webkitTransition"||_t==="OTransition"?_t+"End":"transitionend";function Ui(c){return typeof c=="string"?document.getElementById(c):c}function yt(c,u){var g=c.style[u]||c.currentStyle&&c.currentStyle[u];if((!g||g==="auto")&&document.defaultView){var C=document.defaultView.getComputedStyle(c,null);g=C?C[u]:null}return g==="auto"?null:g}function he(c,u,g){var C=document.createElement(c);return C.className=u||"",g&&g.appendChild(C),C}function ge(c){var u=c.parentNode;u&&u.removeChild(c)}function Ft(c){for(;c.firstChild;)c.removeChild(c.firstChild)}function tt(c){var u=c.parentNode;u&&u.lastChild!==c&&u.appendChild(c)}function nt(c){var u=c.parentNode;u&&u.firstChild!==c&&u.insertBefore(c,u.firstChild)}function si(c,u){if(c.classList!==void 0)return c.classList.contains(u);var g=Nt(c);return g.length>0&&new RegExp("(^|\\s)"+u+"(\\s|$)").test(g)}function re(c,u){if(c.classList!==void 0)for(var g=y(u),C=0,w=g.length;C<w;C++)c.classList.add(g[C]);else if(!si(c,u)){var P=Nt(c);oi(c,(P?P+" ":"")+u)}}function me(c,u){c.classList!==void 0?c.classList.remove(u):oi(c,v((" "+Nt(c)+" ").replace(" "+u+" "," ")))}function oi(c,u){c.className.baseVal===void 0?c.className=u:c.className.baseVal=u}function Nt(c){return c.correspondingElement&&(c=c.correspondingElement),c.className.baseVal===void 0?c.className:c.className.baseVal}function Pe(c,u){"opacity"in c.style?c.style.opacity=u:"filter"in c.style&&hs(c,u)}function hs(c,u){var g=!1,C="DXImageTransform.Microsoft.Alpha";try{g=c.filters.item(C)}catch{if(u===1)return}u=Math.round(u*100),g?(g.Enabled=u!==100,g.Opacity=u):c.style.filter+=" progid:"+C+"(opacity="+u+")"}function It(c){for(var u=document.documentElement.style,g=0;g<c.length;g++)if(c[g]in u)return c[g];return!1}function ze(c,u,g){var C=u||new W(0,0);c.style[ni]=(Q.ie3d?"translate("+C.x+"px,"+C.y+"px)":"translate3d("+C.x+"px,"+C.y+"px,0)")+(g?" scale("+g+")":"")}function ve(c,u){c._leaflet_pos=u,Q.any3d?ze(c,u):(c.style.left=u.x+"px",c.style.top=u.y+"px")}function je(c){return c._leaflet_pos||new W(0,0)}var bt,wt,ri;if("onselectstart"in document)bt=function(){ne(window,"selectstart",ye)},wt=function(){fe(window,"selectstart",ye)};else{var St=It(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);bt=function(){if(St){var c=document.documentElement.style;ri=c[St],c[St]="none"}},wt=function(){St&&(document.documentElement.style[St]=ri,ri=void 0)}}function ai(){ne(window,"dragstart",ye)}function li(){fe(window,"dragstart",ye)}var $t,ci;function di(c){for(;c.tabIndex===-1;)c=c.parentNode;c.style&&(kt(),$t=c,ci=c.style.outlineStyle,c.style.outlineStyle="none",ne(window,"keydown",kt))}function kt(){$t&&($t.style.outlineStyle=ci,$t=void 0,ci=void 0,fe(window,"keydown",kt))}function Ki(c){do c=c.parentNode;while((!c.offsetWidth||!c.offsetHeight)&&c!==document.body);return c}function ui(c){var u=c.getBoundingClientRect();return{x:u.width/c.offsetWidth||1,y:u.height/c.offsetHeight||1,boundingClientRect:u}}var ps={__proto__:null,TRANSFORM:ni,TRANSITION:_t,TRANSITION_END:ji,get:Ui,getStyle:yt,create:he,remove:ge,empty:Ft,toFront:tt,toBack:nt,hasClass:si,addClass:re,removeClass:me,setClass:oi,getClass:Nt,setOpacity:Pe,testProp:It,setTransform:ze,setPosition:ve,getPosition:je,get disableTextSelection(){return bt},get enableTextSelection(){return wt},disableImageDrag:ai,enableImageDrag:li,preventOutline:di,restoreOutline:kt,getSizedParentNode:Ki,getScale:ui};function ne(c,u,g,C){if(u&&typeof u=="object")for(var w in u)pi(c,w,u[w],g);else{u=y(u);for(var P=0,O=u.length;P<O;P++)pi(c,u[P],g,C)}return this}var Le="_leaflet_events";function fe(c,u,g,C){if(arguments.length===1)Yi(c),delete c[Le];else if(u&&typeof u=="object")for(var w in u)gi(c,w,u[w],g);else if(u=y(u),arguments.length===2)Yi(c,function(I){return A(u,I)!==-1});else for(var P=0,O=u.length;P<O;P++)gi(c,u[P],g,C);return this}function Yi(c,u){for(var g in c[Le]){var C=g.split(/\d/)[0];(!u||u(C))&&gi(c,C,null,null,g)}}var hi={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function pi(c,u,g,C){var w=u+l(g)+(C?"_"+l(C):"");if(c[Le]&&c[Le][w])return this;var P=function(I){return g.call(C||c,I||window.event)},O=P;!Q.touchNative&&Q.pointer&&u.indexOf("touch")===0?P=ts(c,u,P):Q.touch&&u==="dblclick"?P=ds(c,P):"addEventListener"in c?u==="touchstart"||u==="touchmove"||u==="wheel"||u==="mousewheel"?c.addEventListener(hi[u]||u,P,Q.passiveEvents?{passive:!1}:!1):u==="mouseenter"||u==="mouseleave"?(P=function(I){I=I||window.event,Ci(c,I)&&O(I)},c.addEventListener(hi[u],P,!1)):c.addEventListener(u,O,!1):c.attachEvent("on"+u,P),c[Le]=c[Le]||{},c[Le][w]=P}function gi(c,u,g,C,w){w=w||u+l(g)+(C?"_"+l(C):"");var P=c[Le]&&c[Le][w];if(!P)return this;!Q.touchNative&&Q.pointer&&u.indexOf("touch")===0?is(c,u,P):Q.touch&&u==="dblclick"?us(c,P):"removeEventListener"in c?c.removeEventListener(hi[u]||u,P,!1):c.detachEvent("on"+u,P),c[Le][w]=null}function Ue(c){return c.stopPropagation?c.stopPropagation():c.originalEvent?c.originalEvent._stopped=!0:c.cancelBubble=!0,this}function mi(c){return pi(c,"wheel",Ue),this}function Et(c){return ne(c,"mousedown touchstart dblclick contextmenu",Ue),c._leaflet_disable_click=!0,this}function ye(c){return c.preventDefault?c.preventDefault():c.returnValue=!1,this}function Ke(c){return ye(c),Ue(c),this}function qi(c){if(c.composedPath)return c.composedPath();for(var u=[],g=c.target;g;)u.push(g),g=g.parentNode;return u}function Xi(c,u){if(!u)return new W(c.clientX,c.clientY);var g=ui(u),C=g.boundingClientRect;return new W((c.clientX-C.left)/g.x-u.clientLeft,(c.clientY-C.top)/g.y-u.clientTop)}var fs=Q.linux&&Q.chrome?window.devicePixelRatio:Q.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function Qi(c){return Q.edge?c.wheelDeltaY/2:c.deltaY&&c.deltaMode===0?-c.deltaY/fs:c.deltaY&&c.deltaMode===1?-c.deltaY*20:c.deltaY&&c.deltaMode===2?-c.deltaY*60:c.deltaX||c.deltaZ?0:c.wheelDelta?(c.wheelDeltaY||c.wheelDelta)/2:c.detail&&Math.abs(c.detail)<32765?-c.detail*20:c.detail?c.detail/-32765*60:0}function Ci(c,u){var g=u.relatedTarget;if(!g)return!0;try{for(;g&&g!==c;)g=g.parentNode}catch{return!1}return g!==c}var gs={__proto__:null,on:ne,off:fe,stopPropagation:Ue,disableScrollPropagation:mi,disableClickPropagation:Et,preventDefault:ye,stop:Ke,getPropagationPath:qi,getMousePosition:Xi,getWheelDelta:Qi,isExternalTarget:Ci,addListener:ne,removeListener:fe},Zi=Y.extend({run:function(c,u,g,C){this.stop(),this._el=c,this._inProgress=!0,this._duration=g||.25,this._easeOutPower=1/Math.max(C||.5,.2),this._startPos=je(c),this._offset=u.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=B(this._animate,this),this._step()},_step:function(c){var u=+new Date-this._startTime,g=this._duration*1e3;u<g?this._runFrame(this._easeOut(u/g),c):(this._runFrame(1),this._complete())},_runFrame:function(c,u){var g=this._startPos.add(this._offset.multiplyBy(c));u&&g._round(),ve(this._el,g),this.fire("step")},_complete:function(){K(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(c){return 1-Math.pow(1-c,this._easeOutPower)}}),ue=Y.extend({options:{crs:Xe,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(c,u){u=b(this,u),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(c),this._initLayout(),this._onResize=r(this._onResize,this),this._initEvents(),u.maxBounds&&this.setMaxBounds(u.maxBounds),u.zoom!==void 0&&(this._zoom=this._limitZoom(u.zoom)),u.center&&u.zoom!==void 0&&this.setView(te(u.center),u.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=_t&&Q.any3d&&!Q.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),ne(this._proxy,ji,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(c,u,g){if(u=u===void 0?this._zoom:this._limitZoom(u),c=this._limitCenter(te(c),u,this.options.maxBounds),g=g||{},this._stop(),this._loaded&&!g.reset&&g!==!0){g.animate!==void 0&&(g.zoom=s({animate:g.animate},g.zoom),g.pan=s({animate:g.animate,duration:g.duration},g.pan));var C=this._zoom!==u?this._tryAnimatedZoom&&this._tryAnimatedZoom(c,u,g.zoom):this._tryAnimatedPan(c,g.pan);if(C)return clearTimeout(this._sizeTimer),this}return this._resetView(c,u,g.pan&&g.pan.noMoveStart),this},setZoom:function(c,u){return this._loaded?this.setView(this.getCenter(),c,{zoom:u}):(this._zoom=c,this)},zoomIn:function(c,u){return c=c||(Q.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+c,u)},zoomOut:function(c,u){return c=c||(Q.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-c,u)},setZoomAround:function(c,u,g){var C=this.getZoomScale(u),w=this.getSize().divideBy(2),P=c instanceof W?c:this.latLngToContainerPoint(c),O=P.subtract(w).multiplyBy(1-1/C),I=this.containerPointToLatLng(w.add(O));return this.setView(I,u,{zoom:g})},_getBoundsCenterZoom:function(c,u){u=u||{},c=c.getBounds?c.getBounds():oe(c);var g=U(u.paddingTopLeft||u.padding||[0,0]),C=U(u.paddingBottomRight||u.padding||[0,0]),w=this.getBoundsZoom(c,!1,g.add(C));if(w=typeof u.maxZoom=="number"?Math.min(u.maxZoom,w):w,w===1/0)return{center:c.getCenter(),zoom:w};var P=C.subtract(g).divideBy(2),O=this.project(c.getSouthWest(),w),I=this.project(c.getNorthEast(),w),k=this.unproject(O.add(I).divideBy(2).add(P),w);return{center:k,zoom:w}},fitBounds:function(c,u){if(c=oe(c),!c.isValid())throw new Error("Bounds are not valid.");var g=this._getBoundsCenterZoom(c,u);return this.setView(g.center,g.zoom,u)},fitWorld:function(c){return this.fitBounds([[-90,-180],[90,180]],c)},panTo:function(c,u){return this.setView(c,this._zoom,{pan:u})},panBy:function(c,u){if(c=U(c).round(),u=u||{},!c.x&&!c.y)return this.fire("moveend");if(u.animate!==!0&&!this.getSize().contains(c))return this._resetView(this.unproject(this.project(this.getCenter()).add(c)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new Zi,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),u.noMoveStart||this.fire("movestart"),u.animate!==!1){re(this._mapPane,"leaflet-pan-anim");var g=this._getMapPanePos().subtract(c).round();this._panAnim.run(this._mapPane,g,u.duration||.25,u.easeLinearity)}else this._rawPanBy(c),this.fire("move").fire("moveend");return this},flyTo:function(c,u,g){if(g=g||{},g.animate===!1||!Q.any3d)return this.setView(c,u,g);this._stop();var C=this.project(this.getCenter()),w=this.project(c),P=this.getSize(),O=this._zoom;c=te(c),u=u===void 0?O:u;var I=Math.max(P.x,P.y),k=I*this.getZoomScale(O,u),H=w.distanceTo(C)||1,q=1.42,ee=q*q;function le(Ce){var Xt=Ce?-1:1,so=Ce?k:I,oo=k*k-I*I+Xt*ee*ee*H*H,ao=2*so*ee*H,Di=oo/ao,Nn=Math.sqrt(Di*Di+1)-Di,lo=Nn<1e-9?-18:Math.log(Nn);return lo}function we(Ce){return(Math.exp(Ce)-Math.exp(-Ce))/2}function _e(Ce){return(Math.exp(Ce)+Math.exp(-Ce))/2}function Re(Ce){return we(Ce)/_e(Ce)}var Ee=le(0);function ct(Ce){return I*(_e(Ee)/_e(Ee+q*Ce))}function Js(Ce){return I*(_e(Ee)*Re(Ee+q*Ce)-we(Ee))/ee}function eo(Ce){return 1-Math.pow(1-Ce,1.5)}var io=Date.now(),xn=(le(1)-Ee)/q,no=g.duration?1e3*g.duration:1e3*xn*.8;function Fn(){var Ce=(Date.now()-io)/no,Xt=eo(Ce)*xn;Ce<=1?(this._flyToFrame=B(Fn,this),this._move(this.unproject(C.add(w.subtract(C).multiplyBy(Js(Xt)/H)),O),this.getScaleZoom(I/ct(Xt),O),{flyTo:!0})):this._move(c,u)._moveEnd(!0)}return this._moveStart(!0,g.noMoveStart),Fn.call(this),this},flyToBounds:function(c,u){var g=this._getBoundsCenterZoom(c,u);return this.flyTo(g.center,g.zoom,u)},setMaxBounds:function(c){return c=oe(c),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),c.isValid()?(this.options.maxBounds=c,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(c){var u=this.options.minZoom;return this.options.minZoom=c,this._loaded&&u!==c&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(c):this},setMaxZoom:function(c){var u=this.options.maxZoom;return this.options.maxZoom=c,this._loaded&&u!==c&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(c):this},panInsideBounds:function(c,u){this._enforcingBounds=!0;var g=this.getCenter(),C=this._limitCenter(g,this._zoom,oe(c));return g.equals(C)||this.panTo(C,u),this._enforcingBounds=!1,this},panInside:function(c,u){u=u||{};var g=U(u.paddingTopLeft||u.padding||[0,0]),C=U(u.paddingBottomRight||u.padding||[0,0]),w=this.project(this.getCenter()),P=this.project(c),O=this.getPixelBounds(),I=pe([O.min.add(g),O.max.subtract(C)]),k=I.getSize();if(!I.contains(P)){this._enforcingBounds=!0;var H=P.subtract(I.getCenter()),q=I.extend(P).getSize().subtract(k);w.x+=H.x<0?-q.x:q.x,w.y+=H.y<0?-q.y:q.y,this.panTo(this.unproject(w),u),this._enforcingBounds=!1}return this},invalidateSize:function(c){if(!this._loaded)return this;c=s({animate:!1,pan:!0},c===!0?{animate:!0}:c);var u=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var g=this.getSize(),C=u.divideBy(2).round(),w=g.divideBy(2).round(),P=C.subtract(w);return!P.x&&!P.y?this:(c.animate&&c.pan?this.panBy(P):(c.pan&&this._rawPanBy(P),this.fire("move"),c.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(r(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:u,newSize:g}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(c){if(c=this._locateOptions=s({timeout:1e4,watch:!1},c),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var u=r(this._handleGeolocationResponse,this),g=r(this._handleGeolocationError,this);return c.watch?this._locationWatchId=navigator.geolocation.watchPosition(u,g,c):navigator.geolocation.getCurrentPosition(u,g,c),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(c){if(this._container._leaflet_id){var u=c.code,g=c.message||(u===1?"permission denied":u===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:u,message:"Geolocation error: "+g+"."})}},_handleGeolocationResponse:function(c){if(this._container._leaflet_id){var u=c.coords.latitude,g=c.coords.longitude,C=new ie(u,g),w=C.toBounds(c.coords.accuracy*2),P=this._locateOptions;if(P.setView){var O=this.getBoundsZoom(w);this.setView(C,P.maxZoom?Math.min(O,P.maxZoom):O)}var I={latlng:C,bounds:w,timestamp:c.timestamp};for(var k in c.coords)typeof c.coords[k]=="number"&&(I[k]=c.coords[k]);this.fire("locationfound",I)}},addHandler:function(c,u){if(!u)return this;var g=this[c]=new u(this);return this._handlers.push(g),this.options[c]&&g.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),ge(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(K(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var c;for(c in this._layers)this._layers[c].remove();for(c in this._panes)ge(this._panes[c]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(c,u){var g="leaflet-pane"+(c?" leaflet-"+c.replace("Pane","")+"-pane":""),C=he("div",g,u||this._mapPane);return c&&(this._panes[c]=C),C},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var c=this.getPixelBounds(),u=this.unproject(c.getBottomLeft()),g=this.unproject(c.getTopRight());return new ae(u,g)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(c,u,g){c=oe(c),g=U(g||[0,0]);var C=this.getZoom()||0,w=this.getMinZoom(),P=this.getMaxZoom(),O=c.getNorthWest(),I=c.getSouthEast(),k=this.getSize().subtract(g),H=pe(this.project(I,C),this.project(O,C)).getSize(),q=Q.any3d?this.options.zoomSnap:1,ee=k.x/H.x,le=k.y/H.y,we=u?Math.max(ee,le):Math.min(ee,le);return C=this.getScaleZoom(we,C),q&&(C=Math.round(C/(q/100))*(q/100),C=u?Math.ceil(C/q)*q:Math.floor(C/q)*q),Math.max(w,Math.min(P,C))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new W(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(c,u){var g=this._getTopLeftPoint(c,u);return new se(g,g.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(c){return this.options.crs.getProjectedBounds(c===void 0?this.getZoom():c)},getPane:function(c){return typeof c=="string"?this._panes[c]:c},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(c,u){var g=this.options.crs;return u=u===void 0?this._zoom:u,g.scale(c)/g.scale(u)},getScaleZoom:function(c,u){var g=this.options.crs;u=u===void 0?this._zoom:u;var C=g.zoom(c*g.scale(u));return isNaN(C)?1/0:C},project:function(c,u){return u=u===void 0?this._zoom:u,this.options.crs.latLngToPoint(te(c),u)},unproject:function(c,u){return u=u===void 0?this._zoom:u,this.options.crs.pointToLatLng(U(c),u)},layerPointToLatLng:function(c){var u=U(c).add(this.getPixelOrigin());return this.unproject(u)},latLngToLayerPoint:function(c){var u=this.project(te(c))._round();return u._subtract(this.getPixelOrigin())},wrapLatLng:function(c){return this.options.crs.wrapLatLng(te(c))},wrapLatLngBounds:function(c){return this.options.crs.wrapLatLngBounds(oe(c))},distance:function(c,u){return this.options.crs.distance(te(c),te(u))},containerPointToLayerPoint:function(c){return U(c).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(c){return U(c).add(this._getMapPanePos())},containerPointToLatLng:function(c){var u=this.containerPointToLayerPoint(U(c));return this.layerPointToLatLng(u)},latLngToContainerPoint:function(c){return this.layerPointToContainerPoint(this.latLngToLayerPoint(te(c)))},mouseEventToContainerPoint:function(c){return Xi(c,this._container)},mouseEventToLayerPoint:function(c){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(c))},mouseEventToLatLng:function(c){return this.layerPointToLatLng(this.mouseEventToLayerPoint(c))},_initContainer:function(c){var u=this._container=Ui(c);if(u){if(u._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");ne(u,"scroll",this._onScroll,this),this._containerId=l(u)},_initLayout:function(){var c=this._container;this._fadeAnimated=this.options.fadeAnimation&&Q.any3d,re(c,"leaflet-container"+(Q.touch?" leaflet-touch":"")+(Q.retina?" leaflet-retina":"")+(Q.ielt9?" leaflet-oldie":"")+(Q.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var u=yt(c,"position");u!=="absolute"&&u!=="relative"&&u!=="fixed"&&u!=="sticky"&&(c.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var c=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),ve(this._mapPane,new W(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(re(c.markerPane,"leaflet-zoom-hide"),re(c.shadowPane,"leaflet-zoom-hide"))},_resetView:function(c,u,g){ve(this._mapPane,new W(0,0));var C=!this._loaded;this._loaded=!0,u=this._limitZoom(u),this.fire("viewprereset");var w=this._zoom!==u;this._moveStart(w,g)._move(c,u)._moveEnd(w),this.fire("viewreset"),C&&this.fire("load")},_moveStart:function(c,u){return c&&this.fire("zoomstart"),u||this.fire("movestart"),this},_move:function(c,u,g,C){u===void 0&&(u=this._zoom);var w=this._zoom!==u;return this._zoom=u,this._lastCenter=c,this._pixelOrigin=this._getNewPixelOrigin(c),C?g&&g.pinch&&this.fire("zoom",g):((w||g&&g.pinch)&&this.fire("zoom",g),this.fire("move",g)),this},_moveEnd:function(c){return c&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return K(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(c){ve(this._mapPane,this._getMapPanePos().subtract(c))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(c){this._targets={},this._targets[l(this._container)]=this;var u=c?fe:ne;u(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&u(window,"resize",this._onResize,this),Q.any3d&&this.options.transform3DLimit&&(c?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){K(this._resizeRequest),this._resizeRequest=B(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var c=this._getMapPanePos();Math.max(Math.abs(c.x),Math.abs(c.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(c,u){for(var g=[],C,w=u==="mouseout"||u==="mouseover",P=c.target||c.srcElement,O=!1;P;){if(C=this._targets[l(P)],C&&(u==="click"||u==="preclick")&&this._draggableMoved(C)){O=!0;break}if(C&&C.listens(u,!0)&&(w&&!Ci(P,c)||(g.push(C),w))||P===this._container)break;P=P.parentNode}return!g.length&&!O&&!w&&this.listens(u,!0)&&(g=[this]),g},_isClickDisabled:function(c){for(;c&&c!==this._container;){if(c._leaflet_disable_click)return!0;c=c.parentNode}},_handleDOMEvent:function(c){var u=c.target||c.srcElement;if(!(!this._loaded||u._leaflet_disable_events||c.type==="click"&&this._isClickDisabled(u))){var g=c.type;g==="mousedown"&&di(u),this._fireDOMEvent(c,g)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(c,u,g){if(c.type==="click"){var C=s({},c);C.type="preclick",this._fireDOMEvent(C,C.type,g)}var w=this._findEventTargets(c,u);if(g){for(var P=[],O=0;O<g.length;O++)g[O].listens(u,!0)&&P.push(g[O]);w=P.concat(w)}if(w.length){u==="contextmenu"&&ye(c);var I=w[0],k={originalEvent:c};if(c.type!=="keypress"&&c.type!=="keydown"&&c.type!=="keyup"){var H=I.getLatLng&&(!I._radius||I._radius<=10);k.containerPoint=H?this.latLngToContainerPoint(I.getLatLng()):this.mouseEventToContainerPoint(c),k.layerPoint=this.containerPointToLayerPoint(k.containerPoint),k.latlng=H?I.getLatLng():this.layerPointToLatLng(k.layerPoint)}for(O=0;O<w.length;O++)if(w[O].fire(u,k,!0),k.originalEvent._stopped||w[O].options.bubblingMouseEvents===!1&&A(this._mouseEvents,u)!==-1)return}},_draggableMoved:function(c){return c=c.dragging&&c.dragging.enabled()?c:this,c.dragging&&c.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var c=0,u=this._handlers.length;c<u;c++)this._handlers[c].disable()},whenReady:function(c,u){return this._loaded?c.call(u||this,{target:this}):this.on("load",c,u),this},_getMapPanePos:function(){return je(this._mapPane)||new W(0,0)},_moved:function(){var c=this._getMapPanePos();return c&&!c.equals([0,0])},_getTopLeftPoint:function(c,u){var g=c&&u!==void 0?this._getNewPixelOrigin(c,u):this.getPixelOrigin();return g.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(c,u){var g=this.getSize()._divideBy(2);return this.project(c,u)._subtract(g)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(c,u,g){var C=this._getNewPixelOrigin(g,u);return this.project(c,u)._subtract(C)},_latLngBoundsToNewLayerBounds:function(c,u,g){var C=this._getNewPixelOrigin(g,u);return pe([this.project(c.getSouthWest(),u)._subtract(C),this.project(c.getNorthWest(),u)._subtract(C),this.project(c.getSouthEast(),u)._subtract(C),this.project(c.getNorthEast(),u)._subtract(C)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(c){return this.latLngToLayerPoint(c).subtract(this._getCenterLayerPoint())},_limitCenter:function(c,u,g){if(!g)return c;var C=this.project(c,u),w=this.getSize().divideBy(2),P=new se(C.subtract(w),C.add(w)),O=this._getBoundsOffset(P,g,u);return Math.abs(O.x)<=1&&Math.abs(O.y)<=1?c:this.unproject(C.add(O),u)},_limitOffset:function(c,u){if(!u)return c;var g=this.getPixelBounds(),C=new se(g.min.add(c),g.max.add(c));return c.add(this._getBoundsOffset(C,u))},_getBoundsOffset:function(c,u,g){var C=pe(this.project(u.getNorthEast(),g),this.project(u.getSouthWest(),g)),w=C.min.subtract(c.min),P=C.max.subtract(c.max),O=this._rebound(w.x,-P.x),I=this._rebound(w.y,-P.y);return new W(O,I)},_rebound:function(c,u){return c+u>0?Math.round(c-u)/2:Math.max(0,Math.ceil(c))-Math.max(0,Math.floor(u))},_limitZoom:function(c){var u=this.getMinZoom(),g=this.getMaxZoom(),C=Q.any3d?this.options.zoomSnap:1;return C&&(c=Math.round(c/C)*C),Math.max(u,Math.min(g,c))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){me(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(c,u){var g=this._getCenterOffset(c)._trunc();return(u&&u.animate)!==!0&&!this.getSize().contains(g)?!1:(this.panBy(g,u),!0)},_createAnimProxy:function(){var c=this._proxy=he("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(c),this.on("zoomanim",function(u){var g=ni,C=this._proxy.style[g];ze(this._proxy,this.project(u.center,u.zoom),this.getZoomScale(u.zoom,1)),C===this._proxy.style[g]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ge(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var c=this.getCenter(),u=this.getZoom();ze(this._proxy,this.project(c,u),this.getZoomScale(u,1))},_catchTransitionEnd:function(c){this._animatingZoom&&c.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(c,u,g){if(this._animatingZoom)return!0;if(g=g||{},!this._zoomAnimated||g.animate===!1||this._nothingToAnimate()||Math.abs(u-this._zoom)>this.options.zoomAnimationThreshold)return!1;var C=this.getZoomScale(u),w=this._getCenterOffset(c)._divideBy(1-1/C);return g.animate!==!0&&!this.getSize().contains(w)?!1:(B(function(){this._moveStart(!0,g.noMoveStart||!1)._animateZoom(c,u,!0)},this),!0)},_animateZoom:function(c,u,g,C){this._mapPane&&(g&&(this._animatingZoom=!0,this._animateToCenter=c,this._animateToZoom=u,re(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:c,zoom:u,noUpdate:C}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(r(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&me(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function ms(c,u){return new ue(c,u)}var Ae=Z.extend({options:{position:"topright"},initialize:function(c){b(this,c)},getPosition:function(){return this.options.position},setPosition:function(c){var u=this._map;return u&&u.removeControl(this),this.options.position=c,u&&u.addControl(this),this},getContainer:function(){return this._container},addTo:function(c){this.remove(),this._map=c;var u=this._container=this.onAdd(c),g=this.getPosition(),C=c._controlCorners[g];return re(u,"leaflet-control"),g.indexOf("bottom")!==-1?C.insertBefore(u,C.firstChild):C.appendChild(u),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ge(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(c){this._map&&c&&c.screenX>0&&c.screenY>0&&this._map.getContainer().focus()}}),Pt=function(c){return new Ae(c)};ue.include({addControl:function(c){return c.addTo(this),this},removeControl:function(c){return c.remove(),this},_initControlPos:function(){var c=this._controlCorners={},u="leaflet-",g=this._controlContainer=he("div",u+"control-container",this._container);function C(w,P){var O=u+w+" "+u+P;c[w+P]=he("div",O,g)}C("top","left"),C("top","right"),C("bottom","left"),C("bottom","right")},_clearControlPos:function(){for(var c in this._controlCorners)ge(this._controlCorners[c]);ge(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Ji=Ae.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(c,u,g,C){return g<C?-1:C<g?1:0}},initialize:function(c,u,g){b(this,g),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var C in c)this._addLayer(c[C],C);for(C in u)this._addLayer(u[C],C,!0)},onAdd:function(c){this._initLayout(),this._update(),this._map=c,c.on("zoomend",this._checkDisabledLayers,this);for(var u=0;u<this._layers.length;u++)this._layers[u].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(c){return Ae.prototype.addTo.call(this,c),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var c=0;c<this._layers.length;c++)this._layers[c].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(c,u){return this._addLayer(c,u),this._map?this._update():this},addOverlay:function(c,u){return this._addLayer(c,u,!0),this._map?this._update():this},removeLayer:function(c){c.off("add remove",this._onLayerChange,this);var u=this._getLayer(l(c));return u&&this._layers.splice(this._layers.indexOf(u),1),this._map?this._update():this},expand:function(){re(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var c=this._map.getSize().y-(this._container.offsetTop+50);return c<this._section.clientHeight?(re(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=c+"px"):me(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return me(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var c="leaflet-control-layers",u=this._container=he("div",c),g=this.options.collapsed;u.setAttribute("aria-haspopup",!0),Et(u),mi(u);var C=this._section=he("section",c+"-list");g&&(this._map.on("click",this.collapse,this),ne(u,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var w=this._layersLink=he("a",c+"-toggle",u);w.href="#",w.title="Layers",w.setAttribute("role","button"),ne(w,{keydown:function(P){P.keyCode===13&&this._expandSafely()},click:function(P){ye(P),this._expandSafely()}},this),g||this.expand(),this._baseLayersList=he("div",c+"-base",C),this._separator=he("div",c+"-separator",C),this._overlaysList=he("div",c+"-overlays",C),u.appendChild(C)},_getLayer:function(c){for(var u=0;u<this._layers.length;u++)if(this._layers[u]&&l(this._layers[u].layer)===c)return this._layers[u]},_addLayer:function(c,u,g){this._map&&c.on("add remove",this._onLayerChange,this),this._layers.push({layer:c,name:u,overlay:g}),this.options.sortLayers&&this._layers.sort(r(function(C,w){return this.options.sortFunction(C.layer,w.layer,C.name,w.name)},this)),this.options.autoZIndex&&c.setZIndex&&(this._lastZIndex++,c.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;Ft(this._baseLayersList),Ft(this._overlaysList),this._layerControlInputs=[];var c,u,g,C,w=0;for(g=0;g<this._layers.length;g++)C=this._layers[g],this._addItem(C),u=u||C.overlay,c=c||!C.overlay,w+=C.overlay?0:1;return this.options.hideSingleBase&&(c=c&&w>1,this._baseLayersList.style.display=c?"":"none"),this._separator.style.display=u&&c?"":"none",this},_onLayerChange:function(c){this._handlingClick||this._update();var u=this._getLayer(l(c.target)),g=u.overlay?c.type==="add"?"overlayadd":"overlayremove":c.type==="add"?"baselayerchange":null;g&&this._map.fire(g,u)},_createRadioElement:function(c,u){var g='<input type="radio" class="leaflet-control-layers-selector" name="'+c+'"'+(u?' checked="checked"':"")+"/>",C=document.createElement("div");return C.innerHTML=g,C.firstChild},_addItem:function(c){var u=document.createElement("label"),g=this._map.hasLayer(c.layer),C;c.overlay?(C=document.createElement("input"),C.type="checkbox",C.className="leaflet-control-layers-selector",C.defaultChecked=g):C=this._createRadioElement("leaflet-base-layers_"+l(this),g),this._layerControlInputs.push(C),C.layerId=l(c.layer),ne(C,"click",this._onInputClick,this);var w=document.createElement("span");w.innerHTML=" "+c.name;var P=document.createElement("span");u.appendChild(P),P.appendChild(C),P.appendChild(w);var O=c.overlay?this._overlaysList:this._baseLayersList;return O.appendChild(u),this._checkDisabledLayers(),u},_onInputClick:function(){if(!this._preventClick){var c=this._layerControlInputs,u,g,C=[],w=[];this._handlingClick=!0;for(var P=c.length-1;P>=0;P--)u=c[P],g=this._getLayer(u.layerId).layer,u.checked?C.push(g):u.checked||w.push(g);for(P=0;P<w.length;P++)this._map.hasLayer(w[P])&&this._map.removeLayer(w[P]);for(P=0;P<C.length;P++)this._map.hasLayer(C[P])||this._map.addLayer(C[P]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var c=this._layerControlInputs,u,g,C=this._map.getZoom(),w=c.length-1;w>=0;w--)u=c[w],g=this._getLayer(u.layerId).layer,u.disabled=g.options.minZoom!==void 0&&C<g.options.minZoom||g.options.maxZoom!==void 0&&C>g.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var c=this._section;this._preventClick=!0,ne(c,"click",ye),this.expand();var u=this;setTimeout(function(){fe(c,"click",ye),u._preventClick=!1})}}),vs=function(c,u,g){return new Ji(c,u,g)},_i=Ae.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">−</span>',zoomOutTitle:"Zoom out"},onAdd:function(c){var u="leaflet-control-zoom",g=he("div",u+" leaflet-bar"),C=this.options;return this._zoomInButton=this._createButton(C.zoomInText,C.zoomInTitle,u+"-in",g,this._zoomIn),this._zoomOutButton=this._createButton(C.zoomOutText,C.zoomOutTitle,u+"-out",g,this._zoomOut),this._updateDisabled(),c.on("zoomend zoomlevelschange",this._updateDisabled,this),g},onRemove:function(c){c.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(c){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(c.shiftKey?3:1))},_zoomOut:function(c){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(c.shiftKey?3:1))},_createButton:function(c,u,g,C,w){var P=he("a",g,C);return P.innerHTML=c,P.href="#",P.title=u,P.setAttribute("role","button"),P.setAttribute("aria-label",u),Et(P),ne(P,"click",Ke),ne(P,"click",w,this),ne(P,"click",this._refocusOnMap,this),P},_updateDisabled:function(){var c=this._map,u="leaflet-disabled";me(this._zoomInButton,u),me(this._zoomOutButton,u),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||c._zoom===c.getMinZoom())&&(re(this._zoomOutButton,u),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||c._zoom===c.getMaxZoom())&&(re(this._zoomInButton,u),this._zoomInButton.setAttribute("aria-disabled","true"))}});ue.mergeOptions({zoomControl:!0}),ue.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new _i,this.addControl(this.zoomControl))});var Cs=function(c){return new _i(c)},en=Ae.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(c){var u="leaflet-control-scale",g=he("div",u),C=this.options;return this._addScales(C,u+"-line",g),c.on(C.updateWhenIdle?"moveend":"move",this._update,this),c.whenReady(this._update,this),g},onRemove:function(c){c.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(c,u,g){c.metric&&(this._mScale=he("div",u,g)),c.imperial&&(this._iScale=he("div",u,g))},_update:function(){var c=this._map,u=c.getSize().y/2,g=c.distance(c.containerPointToLatLng([0,u]),c.containerPointToLatLng([this.options.maxWidth,u]));this._updateScales(g)},_updateScales:function(c){this.options.metric&&c&&this._updateMetric(c),this.options.imperial&&c&&this._updateImperial(c)},_updateMetric:function(c){var u=this._getRoundNum(c),g=u<1e3?u+" m":u/1e3+" km";this._updateScale(this._mScale,g,u/c)},_updateImperial:function(c){var u=c*3.2808399,g,C,w;u>5280?(g=u/5280,C=this._getRoundNum(g),this._updateScale(this._iScale,C+" mi",C/g)):(w=this._getRoundNum(u),this._updateScale(this._iScale,w+" ft",w/u))},_updateScale:function(c,u,g){c.style.width=Math.round(this.options.maxWidth*g)+"px",c.innerHTML=u},_getRoundNum:function(c){var u=Math.pow(10,(Math.floor(c)+"").length-1),g=c/u;return g=g>=10?10:g>=5?5:g>=3?3:g>=2?2:1,u*g}}),_s=function(c){return new en(c)},ys='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',yi=Ae.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(Q.inlineSvg?ys+" ":"")+"Leaflet</a>"},initialize:function(c){b(this,c),this._attributions={}},onAdd:function(c){c.attributionControl=this,this._container=he("div","leaflet-control-attribution"),Et(this._container);for(var u in c._layers)c._layers[u].getAttribution&&this.addAttribution(c._layers[u].getAttribution());return this._update(),c.on("layeradd",this._addAttribution,this),this._container},onRemove:function(c){c.off("layeradd",this._addAttribution,this)},_addAttribution:function(c){c.layer.getAttribution&&(this.addAttribution(c.layer.getAttribution()),c.layer.once("remove",function(){this.removeAttribution(c.layer.getAttribution())},this))},setPrefix:function(c){return this.options.prefix=c,this._update(),this},addAttribution:function(c){return c?(this._attributions[c]||(this._attributions[c]=0),this._attributions[c]++,this._update(),this):this},removeAttribution:function(c){return c?(this._attributions[c]&&(this._attributions[c]--,this._update()),this):this},_update:function(){if(this._map){var c=[];for(var u in this._attributions)this._attributions[u]&&c.push(u);var g=[];this.options.prefix&&g.push(this.options.prefix),c.length&&g.push(c.join(", ")),this._container.innerHTML=g.join(' <span aria-hidden="true">|</span> ')}}});ue.mergeOptions({attributionControl:!0}),ue.addInitHook(function(){this.options.attributionControl&&new yi().addTo(this)});var bs=function(c){return new yi(c)};Ae.Layers=Ji,Ae.Zoom=_i,Ae.Scale=en,Ae.Attribution=yi,Pt.layers=vs,Pt.zoom=Cs,Pt.scale=_s,Pt.attribution=bs;var xe=Z.extend({initialize:function(c){this._map=c},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});xe.addTo=function(c,u){return c.addHandler(u,this),this};var ws={Events:$},tn=Q.touch?"touchstart mousedown":"mousedown",Ve=Y.extend({options:{clickTolerance:3},initialize:function(c,u,g,C){b(this,C),this._element=c,this._dragStartTarget=u||c,this._preventOutline=g},enable:function(){this._enabled||(ne(this._dragStartTarget,tn,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Ve._dragging===this&&this.finishDrag(!0),fe(this._dragStartTarget,tn,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(c){if(this._enabled&&(this._moved=!1,!si(this._element,"leaflet-zoom-anim"))){if(c.touches&&c.touches.length!==1){Ve._dragging===this&&this.finishDrag();return}if(!(Ve._dragging||c.shiftKey||c.which!==1&&c.button!==1&&!c.touches)&&(Ve._dragging=this,this._preventOutline&&di(this._element),ai(),bt(),!this._moving)){this.fire("down");var u=c.touches?c.touches[0]:c,g=Ki(this._element);this._startPoint=new W(u.clientX,u.clientY),this._startPos=je(this._element),this._parentScale=ui(g);var C=c.type==="mousedown";ne(document,C?"mousemove":"touchmove",this._onMove,this),ne(document,C?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(c){if(this._enabled){if(c.touches&&c.touches.length>1){this._moved=!0;return}var u=c.touches&&c.touches.length===1?c.touches[0]:c,g=new W(u.clientX,u.clientY)._subtract(this._startPoint);!g.x&&!g.y||Math.abs(g.x)+Math.abs(g.y)<this.options.clickTolerance||(g.x/=this._parentScale.x,g.y/=this._parentScale.y,ye(c),this._moved||(this.fire("dragstart"),this._moved=!0,re(document.body,"leaflet-dragging"),this._lastTarget=c.target||c.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),re(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(g),this._moving=!0,this._lastEvent=c,this._updatePosition())}},_updatePosition:function(){var c={originalEvent:this._lastEvent};this.fire("predrag",c),ve(this._element,this._newPos),this.fire("drag",c)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(c){me(document.body,"leaflet-dragging"),this._lastTarget&&(me(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),fe(document,"mousemove touchmove",this._onMove,this),fe(document,"mouseup touchend touchcancel",this._onUp,this),li(),wt();var u=this._moved&&this._moving;this._moving=!1,Ve._dragging=!1,u&&this.fire("dragend",{noInertia:c,distance:this._newPos.distanceTo(this._startPos)})}});function sn(c,u,g){var C,w=[1,4,2,8],P,O,I,k,H,q,ee,le;for(P=0,q=c.length;P<q;P++)c[P]._code=Ye(c[P],u);for(I=0;I<4;I++){for(ee=w[I],C=[],P=0,q=c.length,O=q-1;P<q;O=P++)k=c[P],H=c[O],k._code&ee?H._code&ee||(le=Gt(H,k,ee,u,g),le._code=Ye(le,u),C.push(le)):(H._code&ee&&(le=Gt(H,k,ee,u,g),le._code=Ye(le,u),C.push(le)),C.push(k));c=C}return c}function rn(c,u){var g,C,w,P,O,I,k,H,q;if(!c||c.length===0)throw new Error("latlngs not passed");Te(c)||(console.warn("latlngs are not flat! Only the first ring will be used"),c=c[0]);var ee=te([0,0]),le=oe(c),we=le.getNorthWest().distanceTo(le.getSouthWest())*le.getNorthEast().distanceTo(le.getNorthWest());we<1700&&(ee=bi(c));var _e=c.length,Re=[];for(g=0;g<_e;g++){var Ee=te(c[g]);Re.push(u.project(te([Ee.lat-ee.lat,Ee.lng-ee.lng])))}for(I=k=H=0,g=0,C=_e-1;g<_e;C=g++)w=Re[g],P=Re[C],O=w.y*P.x-P.y*w.x,k+=(w.x+P.x)*O,H+=(w.y+P.y)*O,I+=O*3;I===0?q=Re[0]:q=[k/I,H/I];var ct=u.unproject(U(q));return te([ct.lat+ee.lat,ct.lng+ee.lng])}function bi(c){for(var u=0,g=0,C=0,w=0;w<c.length;w++){var P=te(c[w]);u+=P.lat,g+=P.lng,C++}return te([u/C,g/C])}var Ss={__proto__:null,clipPolygon:sn,polygonCenter:rn,centroid:bi};function an(c,u){if(!u||!c.length)return c.slice();var g=u*u;return c=Ts(c,g),c=Ps(c,g),c}function ln(c,u,g){return Math.sqrt(Tt(c,u,g,!0))}function Es(c,u,g){return Tt(c,u,g)}function Ps(c,u){var g=c.length,C=typeof Uint8Array!=void 0+""?Uint8Array:Array,w=new C(g);w[0]=w[g-1]=1,wi(c,w,u,0,g-1);var P,O=[];for(P=0;P<g;P++)w[P]&&O.push(c[P]);return O}function wi(c,u,g,C,w){var P=0,O,I,k;for(I=C+1;I<=w-1;I++)k=Tt(c[I],c[C],c[w],!0),k>P&&(O=I,P=k);P>g&&(u[O]=1,wi(c,u,g,C,O),wi(c,u,g,O,w))}function Ts(c,u){for(var g=[c[0]],C=1,w=0,P=c.length;C<P;C++)Rs(c[C],c[w])>u&&(g.push(c[C]),w=C);return w<P-1&&g.push(c[P-1]),g}var cn;function dn(c,u,g,C,w){var P=C?cn:Ye(c,g),O=Ye(u,g),I,k,H;for(cn=O;;){if(!(P|O))return[c,u];if(P&O)return!1;I=P||O,k=Gt(c,u,I,g,w),H=Ye(k,g),I===P?(c=k,P=H):(u=k,O=H)}}function Gt(c,u,g,C,w){var P=u.x-c.x,O=u.y-c.y,I=C.min,k=C.max,H,q;return g&8?(H=c.x+P*(k.y-c.y)/O,q=k.y):g&4?(H=c.x+P*(I.y-c.y)/O,q=I.y):g&2?(H=k.x,q=c.y+O*(k.x-c.x)/P):g&1&&(H=I.x,q=c.y+O*(I.x-c.x)/P),new W(H,q,w)}function Ye(c,u){var g=0;return c.x<u.min.x?g|=1:c.x>u.max.x&&(g|=2),c.y<u.min.y?g|=4:c.y>u.max.y&&(g|=8),g}function Rs(c,u){var g=u.x-c.x,C=u.y-c.y;return g*g+C*C}function Tt(c,u,g,C){var w=u.x,P=u.y,O=g.x-w,I=g.y-P,k=O*O+I*I,H;return k>0&&(H=((c.x-w)*O+(c.y-P)*I)/k,H>1?(w=g.x,P=g.y):H>0&&(w+=O*H,P+=I*H)),O=c.x-w,I=c.y-P,C?O*O+I*I:new W(w,P)}function Te(c){return!R(c[0])||typeof c[0][0]!="object"&&typeof c[0][0]<"u"}function un(c){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Te(c)}function hn(c,u){var g,C,w,P,O,I,k,H;if(!c||c.length===0)throw new Error("latlngs not passed");Te(c)||(console.warn("latlngs are not flat! Only the first ring will be used"),c=c[0]);var q=te([0,0]),ee=oe(c),le=ee.getNorthWest().distanceTo(ee.getSouthWest())*ee.getNorthEast().distanceTo(ee.getNorthWest());le<1700&&(q=bi(c));var we=c.length,_e=[];for(g=0;g<we;g++){var Re=te(c[g]);_e.push(u.project(te([Re.lat-q.lat,Re.lng-q.lng])))}for(g=0,C=0;g<we-1;g++)C+=_e[g].distanceTo(_e[g+1])/2;if(C===0)H=_e[0];else for(g=0,P=0;g<we-1;g++)if(O=_e[g],I=_e[g+1],w=O.distanceTo(I),P+=w,P>C){k=(P-C)/w,H=[I.x-k*(I.x-O.x),I.y-k*(I.y-O.y)];break}var Ee=u.unproject(U(H));return te([Ee.lat+q.lat,Ee.lng+q.lng])}var As={__proto__:null,simplify:an,pointToSegmentDistance:ln,closestPointOnSegment:Es,clipSegment:dn,_getEdgeIntersection:Gt,_getBitCode:Ye,_sqClosestPointOnSegment:Tt,isFlat:Te,_flat:un,polylineCenter:hn},Si={project:function(c){return new W(c.lng,c.lat)},unproject:function(c){return new ie(c.y,c.x)},bounds:new se([-180,-90],[180,90])},Ei={R:6378137,R_MINOR:6356752314245179e-9,bounds:new se([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(c){var u=Math.PI/180,g=this.R,C=c.lat*u,w=this.R_MINOR/g,P=Math.sqrt(1-w*w),O=P*Math.sin(C),I=Math.tan(Math.PI/4-C/2)/Math.pow((1-O)/(1+O),P/2);return C=-g*Math.log(Math.max(I,1e-10)),new W(c.lng*u*g,C)},unproject:function(c){for(var u=180/Math.PI,g=this.R,C=this.R_MINOR/g,w=Math.sqrt(1-C*C),P=Math.exp(-c.y/g),O=Math.PI/2-2*Math.atan(P),I=0,k=.1,H;I<15&&Math.abs(k)>1e-7;I++)H=w*Math.sin(O),H=Math.pow((1-H)/(1+H),w/2),k=Math.PI/2-2*Math.atan(P*H)-O,O+=k;return new ie(O*u,c.x*u/g)}},Ds={__proto__:null,LonLat:Si,Mercator:Ei,SphericalMercator:dt},Os=s({},be,{code:"EPSG:3395",projection:Ei,transformation:function(){var c=.5/(Math.PI*Ei.R);return Be(c,.5,-c,.5)}()}),pn=s({},be,{code:"EPSG:4326",projection:Si,transformation:Be(1/180,1,-1/180,.5)}),Ms=s({},Se,{projection:Si,transformation:Be(1,0,-1,0),scale:function(c){return Math.pow(2,c)},zoom:function(c){return Math.log(c)/Math.LN2},distance:function(c,u){var g=u.lng-c.lng,C=u.lat-c.lat;return Math.sqrt(g*g+C*C)},infinite:!0});Se.Earth=be,Se.EPSG3395=Os,Se.EPSG3857=Xe,Se.EPSG900913=Zt,Se.EPSG4326=pn,Se.Simple=Ms;var De=Y.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(c){return c.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(c){return c&&c.removeLayer(this),this},getPane:function(c){return this._map.getPane(c?this.options[c]||c:this.options.pane)},addInteractiveTarget:function(c){return this._map._targets[l(c)]=this,this},removeInteractiveTarget:function(c){return delete this._map._targets[l(c)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(c){var u=c.target;if(u.hasLayer(this)){if(this._map=u,this._zoomAnimated=u._zoomAnimated,this.getEvents){var g=this.getEvents();u.on(g,this),this.once("remove",function(){u.off(g,this)},this)}this.onAdd(u),this.fire("add"),u.fire("layeradd",{layer:this})}}});ue.include({addLayer:function(c){if(!c._layerAdd)throw new Error("The provided object is not a Layer.");var u=l(c);return this._layers[u]?this:(this._layers[u]=c,c._mapToAdd=this,c.beforeAdd&&c.beforeAdd(this),this.whenReady(c._layerAdd,c),this)},removeLayer:function(c){var u=l(c);return this._layers[u]?(this._loaded&&c.onRemove(this),delete this._layers[u],this._loaded&&(this.fire("layerremove",{layer:c}),c.fire("remove")),c._map=c._mapToAdd=null,this):this},hasLayer:function(c){return l(c)in this._layers},eachLayer:function(c,u){for(var g in this._layers)c.call(u,this._layers[g]);return this},_addLayers:function(c){c=c?R(c)?c:[c]:[];for(var u=0,g=c.length;u<g;u++)this.addLayer(c[u])},_addZoomLimit:function(c){(!isNaN(c.options.maxZoom)||!isNaN(c.options.minZoom))&&(this._zoomBoundLayers[l(c)]=c,this._updateZoomLevels())},_removeZoomLimit:function(c){var u=l(c);this._zoomBoundLayers[u]&&(delete this._zoomBoundLayers[u],this._updateZoomLevels())},_updateZoomLevels:function(){var c=1/0,u=-1/0,g=this._getZoomSpan();for(var C in this._zoomBoundLayers){var w=this._zoomBoundLayers[C].options;c=w.minZoom===void 0?c:Math.min(c,w.minZoom),u=w.maxZoom===void 0?u:Math.max(u,w.maxZoom)}this._layersMaxZoom=u===-1/0?void 0:u,this._layersMinZoom=c===1/0?void 0:c,g!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var st=De.extend({initialize:function(c,u){b(this,u),this._layers={};var g,C;if(c)for(g=0,C=c.length;g<C;g++)this.addLayer(c[g])},addLayer:function(c){var u=this.getLayerId(c);return this._layers[u]=c,this._map&&this._map.addLayer(c),this},removeLayer:function(c){var u=c in this._layers?c:this.getLayerId(c);return this._map&&this._layers[u]&&this._map.removeLayer(this._layers[u]),delete this._layers[u],this},hasLayer:function(c){var u=typeof c=="number"?c:this.getLayerId(c);return u in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(c){var u=Array.prototype.slice.call(arguments,1),g,C;for(g in this._layers)C=this._layers[g],C[c]&&C[c].apply(C,u);return this},onAdd:function(c){this.eachLayer(c.addLayer,c)},onRemove:function(c){this.eachLayer(c.removeLayer,c)},eachLayer:function(c,u){for(var g in this._layers)c.call(u,this._layers[g]);return this},getLayer:function(c){return this._layers[c]},getLayers:function(){var c=[];return this.eachLayer(c.push,c),c},setZIndex:function(c){return this.invoke("setZIndex",c)},getLayerId:function(c){return l(c)}}),Ls=function(c,u){return new st(c,u)},Ne=st.extend({addLayer:function(c){return this.hasLayer(c)?this:(c.addEventParent(this),st.prototype.addLayer.call(this,c),this.fire("layeradd",{layer:c}))},removeLayer:function(c){return this.hasLayer(c)?(c in this._layers&&(c=this._layers[c]),c.removeEventParent(this),st.prototype.removeLayer.call(this,c),this.fire("layerremove",{layer:c})):this},setStyle:function(c){return this.invoke("setStyle",c)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var c=new ae;for(var u in this._layers){var g=this._layers[u];c.extend(g.getBounds?g.getBounds():g.getLatLng())}return c}}),xs=function(c,u){return new Ne(c,u)},ot=Z.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(c){b(this,c)},createIcon:function(c){return this._createIcon("icon",c)},createShadow:function(c){return this._createIcon("shadow",c)},_createIcon:function(c,u){var g=this._getIconUrl(c);if(!g){if(c==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var C=this._createImg(g,u&&u.tagName==="IMG"?u:null);return this._setIconStyles(C,c),(this.options.crossOrigin||this.options.crossOrigin==="")&&(C.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),C},_setIconStyles:function(c,u){var g=this.options,C=g[u+"Size"];typeof C=="number"&&(C=[C,C]);var w=U(C),P=U(u==="shadow"&&g.shadowAnchor||g.iconAnchor||w&&w.divideBy(2,!0));c.className="leaflet-marker-"+u+" "+(g.className||""),P&&(c.style.marginLeft=-P.x+"px",c.style.marginTop=-P.y+"px"),w&&(c.style.width=w.x+"px",c.style.height=w.y+"px")},_createImg:function(c,u){return u=u||document.createElement("img"),u.src=c,u},_getIconUrl:function(c){return Q.retina&&this.options[c+"RetinaUrl"]||this.options[c+"Url"]}});function Fs(c){return new ot(c)}var Rt=ot.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(c){return typeof Rt.imagePath!="string"&&(Rt.imagePath=this._detectIconPath()),(this.options.imagePath||Rt.imagePath)+ot.prototype._getIconUrl.call(this,c)},_stripUrl:function(c){var u=function(g,C,w){var P=C.exec(g);return P&&P[w]};return c=u(c,/^url\((['"])?(.+)\1\)$/,2),c&&u(c,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var c=he("div","leaflet-default-icon-path",document.body),u=yt(c,"background-image")||yt(c,"backgroundImage");if(document.body.removeChild(c),u=this._stripUrl(u),u)return u;var g=document.querySelector('link[href$="leaflet.css"]');return g?g.href.substring(0,g.href.length-11-1):""}}),fn=xe.extend({initialize:function(c){this._marker=c},addHooks:function(){var c=this._marker._icon;this._draggable||(this._draggable=new Ve(c,c,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),re(c,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&me(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(c){var u=this._marker,g=u._map,C=this._marker.options.autoPanSpeed,w=this._marker.options.autoPanPadding,P=je(u._icon),O=g.getPixelBounds(),I=g.getPixelOrigin(),k=pe(O.min._subtract(I).add(w),O.max._subtract(I).subtract(w));if(!k.contains(P)){var H=U((Math.max(k.max.x,P.x)-k.max.x)/(O.max.x-k.max.x)-(Math.min(k.min.x,P.x)-k.min.x)/(O.min.x-k.min.x),(Math.max(k.max.y,P.y)-k.max.y)/(O.max.y-k.max.y)-(Math.min(k.min.y,P.y)-k.min.y)/(O.min.y-k.min.y)).multiplyBy(C);g.panBy(H,{animate:!1}),this._draggable._newPos._add(H),this._draggable._startPos._add(H),ve(u._icon,this._draggable._newPos),this._onDrag(c),this._panRequest=B(this._adjustPan.bind(this,c))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(c){this._marker.options.autoPan&&(K(this._panRequest),this._panRequest=B(this._adjustPan.bind(this,c)))},_onDrag:function(c){var u=this._marker,g=u._shadow,C=je(u._icon),w=u._map.layerPointToLatLng(C);g&&ve(g,C),u._latlng=w,c.latlng=w,c.oldLatLng=this._oldLatLng,u.fire("move",c).fire("drag",c)},_onDragEnd:function(c){K(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",c)}}),Vt=De.extend({options:{icon:new Rt,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(c,u){b(this,u),this._latlng=te(c)},onAdd:function(c){this._zoomAnimated=this._zoomAnimated&&c.options.markerZoomAnimation,this._zoomAnimated&&c.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(c){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&c.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(c){var u=this._latlng;return this._latlng=te(c),this.update(),this.fire("move",{oldLatLng:u,latlng:this._latlng})},setZIndexOffset:function(c){return this.options.zIndexOffset=c,this.update()},getIcon:function(){return this.options.icon},setIcon:function(c){return this.options.icon=c,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var c=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(c)}return this},_initIcon:function(){var c=this.options,u="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),g=c.icon.createIcon(this._icon),C=!1;g!==this._icon&&(this._icon&&this._removeIcon(),C=!0,c.title&&(g.title=c.title),g.tagName==="IMG"&&(g.alt=c.alt||"")),re(g,u),c.keyboard&&(g.tabIndex="0",g.setAttribute("role","button")),this._icon=g,c.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&ne(g,"focus",this._panOnFocus,this);var w=c.icon.createShadow(this._shadow),P=!1;w!==this._shadow&&(this._removeShadow(),P=!0),w&&(re(w,u),w.alt=""),this._shadow=w,c.opacity<1&&this._updateOpacity(),C&&this.getPane().appendChild(this._icon),this._initInteraction(),w&&P&&this.getPane(c.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&fe(this._icon,"focus",this._panOnFocus,this),ge(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&ge(this._shadow),this._shadow=null},_setPos:function(c){this._icon&&ve(this._icon,c),this._shadow&&ve(this._shadow,c),this._zIndex=c.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(c){this._icon&&(this._icon.style.zIndex=this._zIndex+c)},_animateZoom:function(c){var u=this._map._latLngToNewLayerPoint(this._latlng,c.zoom,c.center).round();this._setPos(u)},_initInteraction:function(){if(this.options.interactive&&(re(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),fn)){var c=this.options.draggable;this.dragging&&(c=this.dragging.enabled(),this.dragging.disable()),this.dragging=new fn(this),c&&this.dragging.enable()}},setOpacity:function(c){return this.options.opacity=c,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var c=this.options.opacity;this._icon&&Pe(this._icon,c),this._shadow&&Pe(this._shadow,c)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var c=this._map;if(c){var u=this.options.icon.options,g=u.iconSize?U(u.iconSize):U(0,0),C=u.iconAnchor?U(u.iconAnchor):U(0,0);c.panInside(this._latlng,{paddingTopLeft:C,paddingBottomRight:g.subtract(C)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function Ns(c,u){return new Vt(c,u)}var He=De.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(c){this._renderer=c.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(c){return b(this,c),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&c&&Object.prototype.hasOwnProperty.call(c,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),Ht=He.extend({options:{fill:!0,radius:10},initialize:function(c,u){b(this,u),this._latlng=te(c),this._radius=this.options.radius},setLatLng:function(c){var u=this._latlng;return this._latlng=te(c),this.redraw(),this.fire("move",{oldLatLng:u,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(c){return this.options.radius=this._radius=c,this.redraw()},getRadius:function(){return this._radius},setStyle:function(c){var u=c&&c.radius||this._radius;return He.prototype.setStyle.call(this,c),this.setRadius(u),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var c=this._radius,u=this._radiusY||c,g=this._clickTolerance(),C=[c+g,u+g];this._pxBounds=new se(this._point.subtract(C),this._point.add(C))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(c){return c.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function Is(c,u){return new Ht(c,u)}var Pi=Ht.extend({initialize:function(c,u,g){if(typeof u=="number"&&(u=s({},g,{radius:u})),b(this,u),this._latlng=te(c),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(c){return this._mRadius=c,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var c=[this._radius,this._radiusY||this._radius];return new ae(this._map.layerPointToLatLng(this._point.subtract(c)),this._map.layerPointToLatLng(this._point.add(c)))},setStyle:He.prototype.setStyle,_project:function(){var c=this._latlng.lng,u=this._latlng.lat,g=this._map,C=g.options.crs;if(C.distance===be.distance){var w=Math.PI/180,P=this._mRadius/be.R/w,O=g.project([u+P,c]),I=g.project([u-P,c]),k=O.add(I).divideBy(2),H=g.unproject(k).lat,q=Math.acos((Math.cos(P*w)-Math.sin(u*w)*Math.sin(H*w))/(Math.cos(u*w)*Math.cos(H*w)))/w;(isNaN(q)||q===0)&&(q=P/Math.cos(Math.PI/180*u)),this._point=k.subtract(g.getPixelOrigin()),this._radius=isNaN(q)?0:k.x-g.project([H,c-q]).x,this._radiusY=k.y-O.y}else{var ee=C.unproject(C.project(this._latlng).subtract([this._mRadius,0]));this._point=g.latLngToLayerPoint(this._latlng),this._radius=this._point.x-g.latLngToLayerPoint(ee).x}this._updateBounds()}});function $s(c,u,g){return new Pi(c,u,g)}var Ie=He.extend({options:{smoothFactor:1,noClip:!1},initialize:function(c,u){b(this,u),this._setLatLngs(c)},getLatLngs:function(){return this._latlngs},setLatLngs:function(c){return this._setLatLngs(c),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(c){for(var u=1/0,g=null,C=Tt,w,P,O=0,I=this._parts.length;O<I;O++)for(var k=this._parts[O],H=1,q=k.length;H<q;H++){w=k[H-1],P=k[H];var ee=C(c,w,P,!0);ee<u&&(u=ee,g=C(c,w,P))}return g&&(g.distance=Math.sqrt(u)),g},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return hn(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(c,u){return u=u||this._defaultShape(),c=te(c),u.push(c),this._bounds.extend(c),this.redraw()},_setLatLngs:function(c){this._bounds=new ae,this._latlngs=this._convertLatLngs(c)},_defaultShape:function(){return Te(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(c){for(var u=[],g=Te(c),C=0,w=c.length;C<w;C++)g?(u[C]=te(c[C]),this._bounds.extend(u[C])):u[C]=this._convertLatLngs(c[C]);return u},_project:function(){var c=new se;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,c),this._bounds.isValid()&&c.isValid()&&(this._rawPxBounds=c,this._updateBounds())},_updateBounds:function(){var c=this._clickTolerance(),u=new W(c,c);this._rawPxBounds&&(this._pxBounds=new se([this._rawPxBounds.min.subtract(u),this._rawPxBounds.max.add(u)]))},_projectLatlngs:function(c,u,g){var C=c[0]instanceof ie,w=c.length,P,O;if(C){for(O=[],P=0;P<w;P++)O[P]=this._map.latLngToLayerPoint(c[P]),g.extend(O[P]);u.push(O)}else for(P=0;P<w;P++)this._projectLatlngs(c[P],u,g)},_clipPoints:function(){var c=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(c))){if(this.options.noClip){this._parts=this._rings;return}var u=this._parts,g,C,w,P,O,I,k;for(g=0,w=0,P=this._rings.length;g<P;g++)for(k=this._rings[g],C=0,O=k.length;C<O-1;C++)I=dn(k[C],k[C+1],c,C,!0),I&&(u[w]=u[w]||[],u[w].push(I[0]),(I[1]!==k[C+1]||C===O-2)&&(u[w].push(I[1]),w++))}},_simplifyPoints:function(){for(var c=this._parts,u=this.options.smoothFactor,g=0,C=c.length;g<C;g++)c[g]=an(c[g],u)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(c,u){var g,C,w,P,O,I,k=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(c))return!1;for(g=0,P=this._parts.length;g<P;g++)for(I=this._parts[g],C=0,O=I.length,w=O-1;C<O;w=C++)if(!(!u&&C===0)&&ln(c,I[w],I[C])<=k)return!0;return!1}});function ks(c,u){return new Ie(c,u)}Ie._flat=un;var rt=Ie.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return rn(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(c){var u=Ie.prototype._convertLatLngs.call(this,c),g=u.length;return g>=2&&u[0]instanceof ie&&u[0].equals(u[g-1])&&u.pop(),u},_setLatLngs:function(c){Ie.prototype._setLatLngs.call(this,c),Te(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Te(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var c=this._renderer._bounds,u=this.options.weight,g=new W(u,u);if(c=new se(c.min.subtract(g),c.max.add(g)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(c))){if(this.options.noClip){this._parts=this._rings;return}for(var C=0,w=this._rings.length,P;C<w;C++)P=sn(this._rings[C],c,!0),P.length&&this._parts.push(P)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(c){var u=!1,g,C,w,P,O,I,k,H;if(!this._pxBounds||!this._pxBounds.contains(c))return!1;for(P=0,k=this._parts.length;P<k;P++)for(g=this._parts[P],O=0,H=g.length,I=H-1;O<H;I=O++)C=g[O],w=g[I],C.y>c.y!=w.y>c.y&&c.x<(w.x-C.x)*(c.y-C.y)/(w.y-C.y)+C.x&&(u=!u);return u||Ie.prototype._containsPoint.call(this,c,!0)}});function Gs(c,u){return new rt(c,u)}var $e=Ne.extend({initialize:function(c,u){b(this,u),this._layers={},c&&this.addData(c)},addData:function(c){var u=R(c)?c:c.features,g,C,w;if(u){for(g=0,C=u.length;g<C;g++)w=u[g],(w.geometries||w.geometry||w.features||w.coordinates)&&this.addData(w);return this}var P=this.options;if(P.filter&&!P.filter(c))return this;var O=Wt(c,P);return O?(O.feature=jt(c),O.defaultOptions=O.options,this.resetStyle(O),P.onEachFeature&&P.onEachFeature(c,O),this.addLayer(O)):this},resetStyle:function(c){return c===void 0?this.eachLayer(this.resetStyle,this):(c.options=s({},c.defaultOptions),this._setLayerStyle(c,this.options.style),this)},setStyle:function(c){return this.eachLayer(function(u){this._setLayerStyle(u,c)},this)},_setLayerStyle:function(c,u){c.setStyle&&(typeof u=="function"&&(u=u(c.feature)),c.setStyle(u))}});function Wt(c,u){var g=c.type==="Feature"?c.geometry:c,C=g?g.coordinates:null,w=[],P=u&&u.pointToLayer,O=u&&u.coordsToLatLng||Ti,I,k,H,q;if(!C&&!g)return null;switch(g.type){case"Point":return I=O(C),gn(P,c,I,u);case"MultiPoint":for(H=0,q=C.length;H<q;H++)I=O(C[H]),w.push(gn(P,c,I,u));return new Ne(w);case"LineString":case"MultiLineString":return k=Bt(C,g.type==="LineString"?0:1,O),new Ie(k,u);case"Polygon":case"MultiPolygon":return k=Bt(C,g.type==="Polygon"?1:2,O),new rt(k,u);case"GeometryCollection":for(H=0,q=g.geometries.length;H<q;H++){var ee=Wt({geometry:g.geometries[H],type:"Feature",properties:c.properties},u);ee&&w.push(ee)}return new Ne(w);case"FeatureCollection":for(H=0,q=g.features.length;H<q;H++){var le=Wt(g.features[H],u);le&&w.push(le)}return new Ne(w);default:throw new Error("Invalid GeoJSON object.")}}function gn(c,u,g,C){return c?c(u,g):new Vt(g,C&&C.markersInheritOptions&&C)}function Ti(c){return new ie(c[1],c[0],c[2])}function Bt(c,u,g){for(var C=[],w=0,P=c.length,O;w<P;w++)O=u?Bt(c[w],u-1,g):(g||Ti)(c[w]),C.push(O);return C}function Ri(c,u){return c=te(c),c.alt!==void 0?[m(c.lng,u),m(c.lat,u),m(c.alt,u)]:[m(c.lng,u),m(c.lat,u)]}function zt(c,u,g,C){for(var w=[],P=0,O=c.length;P<O;P++)w.push(u?zt(c[P],Te(c[P])?0:u-1,g,C):Ri(c[P],C));return!u&&g&&w.length>0&&w.push(w[0].slice()),w}function at(c,u){return c.feature?s({},c.feature,{geometry:u}):jt(u)}function jt(c){return c.type==="Feature"||c.type==="FeatureCollection"?c:{type:"Feature",properties:{},geometry:c}}var Ai={toGeoJSON:function(c){return at(this,{type:"Point",coordinates:Ri(this.getLatLng(),c)})}};Vt.include(Ai),Pi.include(Ai),Ht.include(Ai),Ie.include({toGeoJSON:function(c){var u=!Te(this._latlngs),g=zt(this._latlngs,u?1:0,!1,c);return at(this,{type:(u?"Multi":"")+"LineString",coordinates:g})}}),rt.include({toGeoJSON:function(c){var u=!Te(this._latlngs),g=u&&!Te(this._latlngs[0]),C=zt(this._latlngs,g?2:u?1:0,!0,c);return u||(C=[C]),at(this,{type:(g?"Multi":"")+"Polygon",coordinates:C})}}),st.include({toMultiPoint:function(c){var u=[];return this.eachLayer(function(g){u.push(g.toGeoJSON(c).geometry.coordinates)}),at(this,{type:"MultiPoint",coordinates:u})},toGeoJSON:function(c){var u=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(u==="MultiPoint")return this.toMultiPoint(c);var g=u==="GeometryCollection",C=[];return this.eachLayer(function(w){if(w.toGeoJSON){var P=w.toGeoJSON(c);if(g)C.push(P.geometry);else{var O=jt(P);O.type==="FeatureCollection"?C.push.apply(C,O.features):C.push(O)}}}),g?at(this,{geometries:C,type:"GeometryCollection"}):{type:"FeatureCollection",features:C}}});function mn(c,u){return new $e(c,u)}var Vs=mn,Ut=De.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(c,u,g){this._url=c,this._bounds=oe(u),b(this,g)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(re(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ge(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(c){return this.options.opacity=c,this._image&&this._updateOpacity(),this},setStyle:function(c){return c.opacity&&this.setOpacity(c.opacity),this},bringToFront:function(){return this._map&&tt(this._image),this},bringToBack:function(){return this._map&&nt(this._image),this},setUrl:function(c){return this._url=c,this._image&&(this._image.src=c),this},setBounds:function(c){return this._bounds=oe(c),this._map&&this._reset(),this},getEvents:function(){var c={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(c.zoomanim=this._animateZoom),c},setZIndex:function(c){return this.options.zIndex=c,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var c=this._url.tagName==="IMG",u=this._image=c?this._url:he("img");if(re(u,"leaflet-image-layer"),this._zoomAnimated&&re(u,"leaflet-zoom-animated"),this.options.className&&re(u,this.options.className),u.onselectstart=p,u.onmousemove=p,u.onload=r(this.fire,this,"load"),u.onerror=r(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(u.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),c){this._url=u.src;return}u.src=this._url,u.alt=this.options.alt},_animateZoom:function(c){var u=this._map.getZoomScale(c.zoom),g=this._map._latLngBoundsToNewLayerBounds(this._bounds,c.zoom,c.center).min;ze(this._image,g,u)},_reset:function(){var c=this._image,u=new se(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),g=u.getSize();ve(c,u.min),c.style.width=g.x+"px",c.style.height=g.y+"px"},_updateOpacity:function(){Pe(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var c=this.options.errorOverlayUrl;c&&this._url!==c&&(this._url=c,this._image.src=c)},getCenter:function(){return this._bounds.getCenter()}}),Hs=function(c,u,g){return new Ut(c,u,g)},vn=Ut.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var c=this._url.tagName==="VIDEO",u=this._image=c?this._url:he("video");if(re(u,"leaflet-image-layer"),this._zoomAnimated&&re(u,"leaflet-zoom-animated"),this.options.className&&re(u,this.options.className),u.onselectstart=p,u.onmousemove=p,u.onloadeddata=r(this.fire,this,"load"),c){for(var g=u.getElementsByTagName("source"),C=[],w=0;w<g.length;w++)C.push(g[w].src);this._url=g.length>0?C:[u.src];return}R(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(u.style,"objectFit")&&(u.style.objectFit="fill"),u.autoplay=!!this.options.autoplay,u.loop=!!this.options.loop,u.muted=!!this.options.muted,u.playsInline=!!this.options.playsInline;for(var P=0;P<this._url.length;P++){var O=he("source");O.src=this._url[P],u.appendChild(O)}}});function Ws(c,u,g){return new vn(c,u,g)}var Cn=Ut.extend({_initImage:function(){var c=this._image=this._url;re(c,"leaflet-image-layer"),this._zoomAnimated&&re(c,"leaflet-zoom-animated"),this.options.className&&re(c,this.options.className),c.onselectstart=p,c.onmousemove=p}});function Bs(c,u,g){return new Cn(c,u,g)}var Fe=De.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(c,u){c&&(c instanceof ie||R(c))?(this._latlng=te(c),b(this,u)):(b(this,c),this._source=u),this.options.content&&(this._content=this.options.content)},openOn:function(c){return c=arguments.length?c:this._source._map,c.hasLayer(this)||c.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(c){return this._map?this.close():(arguments.length?this._source=c:c=this._source,this._prepareOpen(),this.openOn(c._map)),this},onAdd:function(c){this._zoomAnimated=c._zoomAnimated,this._container||this._initLayout(),c._fadeAnimated&&Pe(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),c._fadeAnimated&&Pe(this._container,1),this.bringToFront(),this.options.interactive&&(re(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(c){c._fadeAnimated?(Pe(this._container,0),this._removeTimeout=setTimeout(r(ge,void 0,this._container),200)):ge(this._container),this.options.interactive&&(me(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(c){return this._latlng=te(c),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(c){return this._content=c,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var c={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(c.zoomanim=this._animateZoom),c},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&tt(this._container),this},bringToBack:function(){return this._map&&nt(this._container),this},_prepareOpen:function(c){var u=this._source;if(!u._map)return!1;if(u instanceof Ne){u=null;var g=this._source._layers;for(var C in g)if(g[C]._map){u=g[C];break}if(!u)return!1;this._source=u}if(!c)if(u.getCenter)c=u.getCenter();else if(u.getLatLng)c=u.getLatLng();else if(u.getBounds)c=u.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(c),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var c=this._contentNode,u=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof u=="string")c.innerHTML=u;else{for(;c.hasChildNodes();)c.removeChild(c.firstChild);c.appendChild(u)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var c=this._map.latLngToLayerPoint(this._latlng),u=U(this.options.offset),g=this._getAnchor();this._zoomAnimated?ve(this._container,c.add(g)):u=u.add(c).add(g);var C=this._containerBottom=-u.y,w=this._containerLeft=-Math.round(this._containerWidth/2)+u.x;this._container.style.bottom=C+"px",this._container.style.left=w+"px"}},_getAnchor:function(){return[0,0]}});ue.include({_initOverlay:function(c,u,g,C){var w=u;return w instanceof c||(w=new c(C).setContent(u)),g&&w.setLatLng(g),w}}),De.include({_initOverlay:function(c,u,g,C){var w=g;return w instanceof c?(b(w,C),w._source=this):(w=u&&!C?u:new c(C,this),w.setContent(g)),w}});var Kt=Fe.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(c){return c=arguments.length?c:this._source._map,!c.hasLayer(this)&&c._popup&&c._popup.options.autoClose&&c.removeLayer(c._popup),c._popup=this,Fe.prototype.openOn.call(this,c)},onAdd:function(c){Fe.prototype.onAdd.call(this,c),c.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof He||this._source.on("preclick",Ue))},onRemove:function(c){Fe.prototype.onRemove.call(this,c),c.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof He||this._source.off("preclick",Ue))},getEvents:function(){var c=Fe.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(c.preclick=this.close),this.options.keepInView&&(c.moveend=this._adjustPan),c},_initLayout:function(){var c="leaflet-popup",u=this._container=he("div",c+" "+(this.options.className||"")+" leaflet-zoom-animated"),g=this._wrapper=he("div",c+"-content-wrapper",u);if(this._contentNode=he("div",c+"-content",g),Et(u),mi(this._contentNode),ne(u,"contextmenu",Ue),this._tipContainer=he("div",c+"-tip-container",u),this._tip=he("div",c+"-tip",this._tipContainer),this.options.closeButton){var C=this._closeButton=he("a",c+"-close-button",u);C.setAttribute("role","button"),C.setAttribute("aria-label","Close popup"),C.href="#close",C.innerHTML='<span aria-hidden="true">×</span>',ne(C,"click",function(w){ye(w),this.close()},this)}},_updateLayout:function(){var c=this._contentNode,u=c.style;u.width="",u.whiteSpace="nowrap";var g=c.offsetWidth;g=Math.min(g,this.options.maxWidth),g=Math.max(g,this.options.minWidth),u.width=g+1+"px",u.whiteSpace="",u.height="";var C=c.offsetHeight,w=this.options.maxHeight,P="leaflet-popup-scrolled";w&&C>w?(u.height=w+"px",re(c,P)):me(c,P),this._containerWidth=this._container.offsetWidth},_animateZoom:function(c){var u=this._map._latLngToNewLayerPoint(this._latlng,c.zoom,c.center),g=this._getAnchor();ve(this._container,u.add(g))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var c=this._map,u=parseInt(yt(this._container,"marginBottom"),10)||0,g=this._container.offsetHeight+u,C=this._containerWidth,w=new W(this._containerLeft,-g-this._containerBottom);w._add(je(this._container));var P=c.layerPointToContainerPoint(w),O=U(this.options.autoPanPadding),I=U(this.options.autoPanPaddingTopLeft||O),k=U(this.options.autoPanPaddingBottomRight||O),H=c.getSize(),q=0,ee=0;P.x+C+k.x>H.x&&(q=P.x+C-H.x+k.x),P.x-q-I.x<0&&(q=P.x-I.x),P.y+g+k.y>H.y&&(ee=P.y+g-H.y+k.y),P.y-ee-I.y<0&&(ee=P.y-I.y),(q||ee)&&(this.options.keepInView&&(this._autopanning=!0),c.fire("autopanstart").panBy([q,ee]))}},_getAnchor:function(){return U(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),zs=function(c,u){return new Kt(c,u)};ue.mergeOptions({closePopupOnClick:!0}),ue.include({openPopup:function(c,u,g){return this._initOverlay(Kt,c,u,g).openOn(this),this},closePopup:function(c){return c=arguments.length?c:this._popup,c&&c.close(),this}}),De.include({bindPopup:function(c,u){return this._popup=this._initOverlay(Kt,this._popup,c,u),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(c){return this._popup&&(this instanceof Ne||(this._popup._source=this),this._popup._prepareOpen(c||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(c){return this._popup&&this._popup.setContent(c),this},getPopup:function(){return this._popup},_openPopup:function(c){if(!(!this._popup||!this._map)){Ke(c);var u=c.layer||c.target;if(this._popup._source===u&&!(u instanceof He)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(c.latlng);return}this._popup._source=u,this.openPopup(c.latlng)}},_movePopup:function(c){this._popup.setLatLng(c.latlng)},_onKeyPress:function(c){c.originalEvent.keyCode===13&&this._openPopup(c)}});var Yt=Fe.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(c){Fe.prototype.onAdd.call(this,c),this.setOpacity(this.options.opacity),c.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(c){Fe.prototype.onRemove.call(this,c),c.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var c=Fe.prototype.getEvents.call(this);return this.options.permanent||(c.preclick=this.close),c},_initLayout:function(){var c="leaflet-tooltip",u=c+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=he("div",u),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+l(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(c){var u,g,C=this._map,w=this._container,P=C.latLngToContainerPoint(C.getCenter()),O=C.layerPointToContainerPoint(c),I=this.options.direction,k=w.offsetWidth,H=w.offsetHeight,q=U(this.options.offset),ee=this._getAnchor();I==="top"?(u=k/2,g=H):I==="bottom"?(u=k/2,g=0):I==="center"?(u=k/2,g=H/2):I==="right"?(u=0,g=H/2):I==="left"?(u=k,g=H/2):O.x<P.x?(I="right",u=0,g=H/2):(I="left",u=k+(q.x+ee.x)*2,g=H/2),c=c.subtract(U(u,g,!0)).add(q).add(ee),me(w,"leaflet-tooltip-right"),me(w,"leaflet-tooltip-left"),me(w,"leaflet-tooltip-top"),me(w,"leaflet-tooltip-bottom"),re(w,"leaflet-tooltip-"+I),ve(w,c)},_updatePosition:function(){var c=this._map.latLngToLayerPoint(this._latlng);this._setPosition(c)},setOpacity:function(c){this.options.opacity=c,this._container&&Pe(this._container,c)},_animateZoom:function(c){var u=this._map._latLngToNewLayerPoint(this._latlng,c.zoom,c.center);this._setPosition(u)},_getAnchor:function(){return U(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),js=function(c,u){return new Yt(c,u)};ue.include({openTooltip:function(c,u,g){return this._initOverlay(Yt,c,u,g).openOn(this),this},closeTooltip:function(c){return c.close(),this}}),De.include({bindTooltip:function(c,u){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Yt,this._tooltip,c,u),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(c){if(!(!c&&this._tooltipHandlersAdded)){var u=c?"off":"on",g={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?g.add=this._openTooltip:(g.mouseover=this._openTooltip,g.mouseout=this.closeTooltip,g.click=this._openTooltip,this._map?this._addFocusListeners():g.add=this._addFocusListeners),this._tooltip.options.sticky&&(g.mousemove=this._moveTooltip),this[u](g),this._tooltipHandlersAdded=!c}},openTooltip:function(c){return this._tooltip&&(this instanceof Ne||(this._tooltip._source=this),this._tooltip._prepareOpen(c)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(c){return this._tooltip&&this._tooltip.setContent(c),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(c){var u=typeof c.getElement=="function"&&c.getElement();u&&(ne(u,"focus",function(){this._tooltip._source=c,this.openTooltip()},this),ne(u,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(c){var u=typeof c.getElement=="function"&&c.getElement();u&&u.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(c){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var u=this;this._map.once("moveend",function(){u._openOnceFlag=!1,u._openTooltip(c)});return}this._tooltip._source=c.layer||c.target,this.openTooltip(this._tooltip.options.sticky?c.latlng:void 0)}},_moveTooltip:function(c){var u=c.latlng,g,C;this._tooltip.options.sticky&&c.originalEvent&&(g=this._map.mouseEventToContainerPoint(c.originalEvent),C=this._map.containerPointToLayerPoint(g),u=this._map.layerPointToLatLng(C)),this._tooltip.setLatLng(u)}});var _n=ot.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(c){var u=c&&c.tagName==="DIV"?c:document.createElement("div"),g=this.options;if(g.html instanceof Element?(Ft(u),u.appendChild(g.html)):u.innerHTML=g.html!==!1?g.html:"",g.bgPos){var C=U(g.bgPos);u.style.backgroundPosition=-C.x+"px "+-C.y+"px"}return this._setIconStyles(u,"icon"),u},createShadow:function(){return null}});function Us(c){return new _n(c)}ot.Default=Rt;var At=De.extend({options:{tileSize:256,opacity:1,updateWhenIdle:Q.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(c){b(this,c)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(c){c._addZoomLimit(this)},onRemove:function(c){this._removeAllTiles(),ge(this._container),c._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(tt(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(nt(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(c){return this.options.opacity=c,this._updateOpacity(),this},setZIndex:function(c){return this.options.zIndex=c,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var c=this._clampZoom(this._map.getZoom());c!==this._tileZoom&&(this._tileZoom=c,this._updateLevels()),this._update()}return this},getEvents:function(){var c={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=d(this._onMoveEnd,this.options.updateInterval,this)),c.move=this._onMove),this._zoomAnimated&&(c.zoomanim=this._animateZoom),c},createTile:function(){return document.createElement("div")},getTileSize:function(){var c=this.options.tileSize;return c instanceof W?c:new W(c,c)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(c){for(var u=this.getPane().children,g=-c(-1/0,1/0),C=0,w=u.length,P;C<w;C++)P=u[C].style.zIndex,u[C]!==this._container&&P&&(g=c(g,+P));isFinite(g)&&(this.options.zIndex=g+c(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!Q.ielt9){Pe(this._container,this.options.opacity);var c=+new Date,u=!1,g=!1;for(var C in this._tiles){var w=this._tiles[C];if(!(!w.current||!w.loaded)){var P=Math.min(1,(c-w.loaded)/200);Pe(w.el,P),P<1?u=!0:(w.active?g=!0:this._onOpaqueTile(w),w.active=!0)}}g&&!this._noPrune&&this._pruneTiles(),u&&(K(this._fadeFrame),this._fadeFrame=B(this._updateOpacity,this))}},_onOpaqueTile:p,_initContainer:function(){this._container||(this._container=he("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var c=this._tileZoom,u=this.options.maxZoom;if(c!==void 0){for(var g in this._levels)g=Number(g),this._levels[g].el.children.length||g===c?(this._levels[g].el.style.zIndex=u-Math.abs(c-g),this._onUpdateLevel(g)):(ge(this._levels[g].el),this._removeTilesAtZoom(g),this._onRemoveLevel(g),delete this._levels[g]);var C=this._levels[c],w=this._map;return C||(C=this._levels[c]={},C.el=he("div","leaflet-tile-container leaflet-zoom-animated",this._container),C.el.style.zIndex=u,C.origin=w.project(w.unproject(w.getPixelOrigin()),c).round(),C.zoom=c,this._setZoomTransform(C,w.getCenter(),w.getZoom()),p(C.el.offsetWidth),this._onCreateLevel(C)),this._level=C,C}},_onUpdateLevel:p,_onRemoveLevel:p,_onCreateLevel:p,_pruneTiles:function(){if(this._map){var c,u,g=this._map.getZoom();if(g>this.options.maxZoom||g<this.options.minZoom){this._removeAllTiles();return}for(c in this._tiles)u=this._tiles[c],u.retain=u.current;for(c in this._tiles)if(u=this._tiles[c],u.current&&!u.active){var C=u.coords;this._retainParent(C.x,C.y,C.z,C.z-5)||this._retainChildren(C.x,C.y,C.z,C.z+2)}for(c in this._tiles)this._tiles[c].retain||this._removeTile(c)}},_removeTilesAtZoom:function(c){for(var u in this._tiles)this._tiles[u].coords.z===c&&this._removeTile(u)},_removeAllTiles:function(){for(var c in this._tiles)this._removeTile(c)},_invalidateAll:function(){for(var c in this._levels)ge(this._levels[c].el),this._onRemoveLevel(Number(c)),delete this._levels[c];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(c,u,g,C){var w=Math.floor(c/2),P=Math.floor(u/2),O=g-1,I=new W(+w,+P);I.z=+O;var k=this._tileCoordsToKey(I),H=this._tiles[k];return H&&H.active?(H.retain=!0,!0):(H&&H.loaded&&(H.retain=!0),O>C?this._retainParent(w,P,O,C):!1)},_retainChildren:function(c,u,g,C){for(var w=2*c;w<2*c+2;w++)for(var P=2*u;P<2*u+2;P++){var O=new W(w,P);O.z=g+1;var I=this._tileCoordsToKey(O),k=this._tiles[I];if(k&&k.active){k.retain=!0;continue}else k&&k.loaded&&(k.retain=!0);g+1<C&&this._retainChildren(w,P,g+1,C)}},_resetView:function(c){var u=c&&(c.pinch||c.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),u,u)},_animateZoom:function(c){this._setView(c.center,c.zoom,!0,c.noUpdate)},_clampZoom:function(c){var u=this.options;return u.minNativeZoom!==void 0&&c<u.minNativeZoom?u.minNativeZoom:u.maxNativeZoom!==void 0&&u.maxNativeZoom<c?u.maxNativeZoom:c},_setView:function(c,u,g,C){var w=Math.round(u);this.options.maxZoom!==void 0&&w>this.options.maxZoom||this.options.minZoom!==void 0&&w<this.options.minZoom?w=void 0:w=this._clampZoom(w);var P=this.options.updateWhenZooming&&w!==this._tileZoom;(!C||P)&&(this._tileZoom=w,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),w!==void 0&&this._update(c),g||this._pruneTiles(),this._noPrune=!!g),this._setZoomTransforms(c,u)},_setZoomTransforms:function(c,u){for(var g in this._levels)this._setZoomTransform(this._levels[g],c,u)},_setZoomTransform:function(c,u,g){var C=this._map.getZoomScale(g,c.zoom),w=c.origin.multiplyBy(C).subtract(this._map._getNewPixelOrigin(u,g)).round();Q.any3d?ze(c.el,w,C):ve(c.el,w)},_resetGrid:function(){var c=this._map,u=c.options.crs,g=this._tileSize=this.getTileSize(),C=this._tileZoom,w=this._map.getPixelWorldBounds(this._tileZoom);w&&(this._globalTileRange=this._pxBoundsToTileRange(w)),this._wrapX=u.wrapLng&&!this.options.noWrap&&[Math.floor(c.project([0,u.wrapLng[0]],C).x/g.x),Math.ceil(c.project([0,u.wrapLng[1]],C).x/g.y)],this._wrapY=u.wrapLat&&!this.options.noWrap&&[Math.floor(c.project([u.wrapLat[0],0],C).y/g.x),Math.ceil(c.project([u.wrapLat[1],0],C).y/g.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(c){var u=this._map,g=u._animatingZoom?Math.max(u._animateToZoom,u.getZoom()):u.getZoom(),C=u.getZoomScale(g,this._tileZoom),w=u.project(c,this._tileZoom).floor(),P=u.getSize().divideBy(C*2);return new se(w.subtract(P),w.add(P))},_update:function(c){var u=this._map;if(u){var g=this._clampZoom(u.getZoom());if(c===void 0&&(c=u.getCenter()),this._tileZoom!==void 0){var C=this._getTiledPixelBounds(c),w=this._pxBoundsToTileRange(C),P=w.getCenter(),O=[],I=this.options.keepBuffer,k=new se(w.getBottomLeft().subtract([I,-I]),w.getTopRight().add([I,-I]));if(!(isFinite(w.min.x)&&isFinite(w.min.y)&&isFinite(w.max.x)&&isFinite(w.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var H in this._tiles){var q=this._tiles[H].coords;(q.z!==this._tileZoom||!k.contains(new W(q.x,q.y)))&&(this._tiles[H].current=!1)}if(Math.abs(g-this._tileZoom)>1){this._setView(c,g);return}for(var ee=w.min.y;ee<=w.max.y;ee++)for(var le=w.min.x;le<=w.max.x;le++){var we=new W(le,ee);if(we.z=this._tileZoom,!!this._isValidTile(we)){var _e=this._tiles[this._tileCoordsToKey(we)];_e?_e.current=!0:O.push(we)}}if(O.sort(function(Ee,ct){return Ee.distanceTo(P)-ct.distanceTo(P)}),O.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Re=document.createDocumentFragment();for(le=0;le<O.length;le++)this._addTile(O[le],Re);this._level.el.appendChild(Re)}}}},_isValidTile:function(c){var u=this._map.options.crs;if(!u.infinite){var g=this._globalTileRange;if(!u.wrapLng&&(c.x<g.min.x||c.x>g.max.x)||!u.wrapLat&&(c.y<g.min.y||c.y>g.max.y))return!1}if(!this.options.bounds)return!0;var C=this._tileCoordsToBounds(c);return oe(this.options.bounds).overlaps(C)},_keyToBounds:function(c){return this._tileCoordsToBounds(this._keyToTileCoords(c))},_tileCoordsToNwSe:function(c){var u=this._map,g=this.getTileSize(),C=c.scaleBy(g),w=C.add(g),P=u.unproject(C,c.z),O=u.unproject(w,c.z);return[P,O]},_tileCoordsToBounds:function(c){var u=this._tileCoordsToNwSe(c),g=new ae(u[0],u[1]);return this.options.noWrap||(g=this._map.wrapLatLngBounds(g)),g},_tileCoordsToKey:function(c){return c.x+":"+c.y+":"+c.z},_keyToTileCoords:function(c){var u=c.split(":"),g=new W(+u[0],+u[1]);return g.z=+u[2],g},_removeTile:function(c){var u=this._tiles[c];u&&(ge(u.el),delete this._tiles[c],this.fire("tileunload",{tile:u.el,coords:this._keyToTileCoords(c)}))},_initTile:function(c){re(c,"leaflet-tile");var u=this.getTileSize();c.style.width=u.x+"px",c.style.height=u.y+"px",c.onselectstart=p,c.onmousemove=p,Q.ielt9&&this.options.opacity<1&&Pe(c,this.options.opacity)},_addTile:function(c,u){var g=this._getTilePos(c),C=this._tileCoordsToKey(c),w=this.createTile(this._wrapCoords(c),r(this._tileReady,this,c));this._initTile(w),this.createTile.length<2&&B(r(this._tileReady,this,c,null,w)),ve(w,g),this._tiles[C]={el:w,coords:c,current:!0},u.appendChild(w),this.fire("tileloadstart",{tile:w,coords:c})},_tileReady:function(c,u,g){u&&this.fire("tileerror",{error:u,tile:g,coords:c});var C=this._tileCoordsToKey(c);g=this._tiles[C],g&&(g.loaded=+new Date,this._map._fadeAnimated?(Pe(g.el,0),K(this._fadeFrame),this._fadeFrame=B(this._updateOpacity,this)):(g.active=!0,this._pruneTiles()),u||(re(g.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:g.el,coords:c})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Q.ielt9||!this._map._fadeAnimated?B(this._pruneTiles,this):setTimeout(r(this._pruneTiles,this),250)))},_getTilePos:function(c){return c.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(c){var u=new W(this._wrapX?h(c.x,this._wrapX):c.x,this._wrapY?h(c.y,this._wrapY):c.y);return u.z=c.z,u},_pxBoundsToTileRange:function(c){var u=this.getTileSize();return new se(c.min.unscaleBy(u).floor(),c.max.unscaleBy(u).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var c in this._tiles)if(!this._tiles[c].loaded)return!1;return!0}});function Ks(c){return new At(c)}var lt=At.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(c,u){this._url=c,u=b(this,u),u.detectRetina&&Q.retina&&u.maxZoom>0?(u.tileSize=Math.floor(u.tileSize/2),u.zoomReverse?(u.zoomOffset--,u.minZoom=Math.min(u.maxZoom,u.minZoom+1)):(u.zoomOffset++,u.maxZoom=Math.max(u.minZoom,u.maxZoom-1)),u.minZoom=Math.max(0,u.minZoom)):u.zoomReverse?u.minZoom=Math.min(u.maxZoom,u.minZoom):u.maxZoom=Math.max(u.minZoom,u.maxZoom),typeof u.subdomains=="string"&&(u.subdomains=u.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(c,u){return this._url===c&&u===void 0&&(u=!0),this._url=c,u||this.redraw(),this},createTile:function(c,u){var g=document.createElement("img");return ne(g,"load",r(this._tileOnLoad,this,u,g)),ne(g,"error",r(this._tileOnError,this,u,g)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(g.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(g.referrerPolicy=this.options.referrerPolicy),g.alt="",g.src=this.getTileUrl(c),g},getTileUrl:function(c){var u={r:Q.retina?"@2x":"",s:this._getSubdomain(c),x:c.x,y:c.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var g=this._globalTileRange.max.y-c.y;this.options.tms&&(u.y=g),u["-y"]=g}return T(this._url,s(u,this.options))},_tileOnLoad:function(c,u){Q.ielt9?setTimeout(r(c,this,null,u),0):c(null,u)},_tileOnError:function(c,u,g){var C=this.options.errorTileUrl;C&&u.getAttribute("src")!==C&&(u.src=C),c(g,u)},_onTileRemove:function(c){c.tile.onload=null},_getZoomForUrl:function(){var c=this._tileZoom,u=this.options.maxZoom,g=this.options.zoomReverse,C=this.options.zoomOffset;return g&&(c=u-c),c+C},_getSubdomain:function(c){var u=Math.abs(c.x+c.y)%this.options.subdomains.length;return this.options.subdomains[u]},_abortLoading:function(){var c,u;for(c in this._tiles)if(this._tiles[c].coords.z!==this._tileZoom&&(u=this._tiles[c].el,u.onload=p,u.onerror=p,!u.complete)){u.src=D;var g=this._tiles[c].coords;ge(u),delete this._tiles[c],this.fire("tileabort",{tile:u,coords:g})}},_removeTile:function(c){var u=this._tiles[c];if(u)return u.el.setAttribute("src",D),At.prototype._removeTile.call(this,c)},_tileReady:function(c,u,g){if(!(!this._map||g&&g.getAttribute("src")===D))return At.prototype._tileReady.call(this,c,u,g)}});function yn(c,u){return new lt(c,u)}var bn=lt.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(c,u){this._url=c;var g=s({},this.defaultWmsParams);for(var C in u)C in this.options||(g[C]=u[C]);u=b(this,u);var w=u.detectRetina&&Q.retina?2:1,P=this.getTileSize();g.width=P.x*w,g.height=P.y*w,this.wmsParams=g},onAdd:function(c){this._crs=this.options.crs||c.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var u=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[u]=this._crs.code,lt.prototype.onAdd.call(this,c)},getTileUrl:function(c){var u=this._tileCoordsToNwSe(c),g=this._crs,C=pe(g.project(u[0]),g.project(u[1])),w=C.min,P=C.max,O=(this._wmsVersion>=1.3&&this._crs===pn?[w.y,w.x,P.y,P.x]:[w.x,w.y,P.x,P.y]).join(","),I=lt.prototype.getTileUrl.call(this,c);return I+S(this.wmsParams,I,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+O},setParams:function(c,u){return s(this.wmsParams,c),u||this.redraw(),this}});function Ys(c,u){return new bn(c,u)}lt.WMS=bn,yn.wms=Ys;var ke=De.extend({options:{padding:.1},initialize:function(c){b(this,c),l(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),re(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var c={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(c.zoomanim=this._onAnimZoom),c},_onAnimZoom:function(c){this._updateTransform(c.center,c.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(c,u){var g=this._map.getZoomScale(u,this._zoom),C=this._map.getSize().multiplyBy(.5+this.options.padding),w=this._map.project(this._center,u),P=C.multiplyBy(-g).add(w).subtract(this._map._getNewPixelOrigin(c,u));Q.any3d?ze(this._container,P,g):ve(this._container,P)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var c in this._layers)this._layers[c]._reset()},_onZoomEnd:function(){for(var c in this._layers)this._layers[c]._project()},_updatePaths:function(){for(var c in this._layers)this._layers[c]._update()},_update:function(){var c=this.options.padding,u=this._map.getSize(),g=this._map.containerPointToLayerPoint(u.multiplyBy(-c)).round();this._bounds=new se(g,g.add(u.multiplyBy(1+c*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),wn=ke.extend({options:{tolerance:0},getEvents:function(){var c=ke.prototype.getEvents.call(this);return c.viewprereset=this._onViewPreReset,c},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ke.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var c=this._container=document.createElement("canvas");ne(c,"mousemove",this._onMouseMove,this),ne(c,"click dblclick mousedown mouseup contextmenu",this._onClick,this),ne(c,"mouseout",this._handleMouseOut,this),c._leaflet_disable_events=!0,this._ctx=c.getContext("2d")},_destroyContainer:function(){K(this._redrawRequest),delete this._ctx,ge(this._container),fe(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var c;this._redrawBounds=null;for(var u in this._layers)c=this._layers[u],c._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ke.prototype._update.call(this);var c=this._bounds,u=this._container,g=c.getSize(),C=Q.retina?2:1;ve(u,c.min),u.width=C*g.x,u.height=C*g.y,u.style.width=g.x+"px",u.style.height=g.y+"px",Q.retina&&this._ctx.scale(2,2),this._ctx.translate(-c.min.x,-c.min.y),this.fire("update")}},_reset:function(){ke.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(c){this._updateDashArray(c),this._layers[l(c)]=c;var u=c._order={layer:c,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=u),this._drawLast=u,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(c){this._requestRedraw(c)},_removePath:function(c){var u=c._order,g=u.next,C=u.prev;g?g.prev=C:this._drawLast=C,C?C.next=g:this._drawFirst=g,delete c._order,delete this._layers[l(c)],this._requestRedraw(c)},_updatePath:function(c){this._extendRedrawBounds(c),c._project(),c._update(),this._requestRedraw(c)},_updateStyle:function(c){this._updateDashArray(c),this._requestRedraw(c)},_updateDashArray:function(c){if(typeof c.options.dashArray=="string"){var u=c.options.dashArray.split(/[, ]+/),g=[],C,w;for(w=0;w<u.length;w++){if(C=Number(u[w]),isNaN(C))return;g.push(C)}c.options._dashArray=g}else c.options._dashArray=c.options.dashArray},_requestRedraw:function(c){this._map&&(this._extendRedrawBounds(c),this._redrawRequest=this._redrawRequest||B(this._redraw,this))},_extendRedrawBounds:function(c){if(c._pxBounds){var u=(c.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new se,this._redrawBounds.extend(c._pxBounds.min.subtract([u,u])),this._redrawBounds.extend(c._pxBounds.max.add([u,u]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var c=this._redrawBounds;if(c){var u=c.getSize();this._ctx.clearRect(c.min.x,c.min.y,u.x,u.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var c,u=this._redrawBounds;if(this._ctx.save(),u){var g=u.getSize();this._ctx.beginPath(),this._ctx.rect(u.min.x,u.min.y,g.x,g.y),this._ctx.clip()}this._drawing=!0;for(var C=this._drawFirst;C;C=C.next)c=C.layer,(!u||c._pxBounds&&c._pxBounds.intersects(u))&&c._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(c,u){if(this._drawing){var g,C,w,P,O=c._parts,I=O.length,k=this._ctx;if(I){for(k.beginPath(),g=0;g<I;g++){for(C=0,w=O[g].length;C<w;C++)P=O[g][C],k[C?"lineTo":"moveTo"](P.x,P.y);u&&k.closePath()}this._fillStroke(k,c)}}},_updateCircle:function(c){if(!(!this._drawing||c._empty())){var u=c._point,g=this._ctx,C=Math.max(Math.round(c._radius),1),w=(Math.max(Math.round(c._radiusY),1)||C)/C;w!==1&&(g.save(),g.scale(1,w)),g.beginPath(),g.arc(u.x,u.y/w,C,0,Math.PI*2,!1),w!==1&&g.restore(),this._fillStroke(g,c)}},_fillStroke:function(c,u){var g=u.options;g.fill&&(c.globalAlpha=g.fillOpacity,c.fillStyle=g.fillColor||g.color,c.fill(g.fillRule||"evenodd")),g.stroke&&g.weight!==0&&(c.setLineDash&&c.setLineDash(u.options&&u.options._dashArray||[]),c.globalAlpha=g.opacity,c.lineWidth=g.weight,c.strokeStyle=g.color,c.lineCap=g.lineCap,c.lineJoin=g.lineJoin,c.stroke())},_onClick:function(c){for(var u=this._map.mouseEventToLayerPoint(c),g,C,w=this._drawFirst;w;w=w.next)g=w.layer,g.options.interactive&&g._containsPoint(u)&&(!(c.type==="click"||c.type==="preclick")||!this._map._draggableMoved(g))&&(C=g);this._fireEvent(C?[C]:!1,c)},_onMouseMove:function(c){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var u=this._map.mouseEventToLayerPoint(c);this._handleMouseHover(c,u)}},_handleMouseOut:function(c){var u=this._hoveredLayer;u&&(me(this._container,"leaflet-interactive"),this._fireEvent([u],c,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(c,u){if(!this._mouseHoverThrottled){for(var g,C,w=this._drawFirst;w;w=w.next)g=w.layer,g.options.interactive&&g._containsPoint(u)&&(C=g);C!==this._hoveredLayer&&(this._handleMouseOut(c),C&&(re(this._container,"leaflet-interactive"),this._fireEvent([C],c,"mouseover"),this._hoveredLayer=C)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,c),this._mouseHoverThrottled=!0,setTimeout(r(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(c,u,g){this._map._fireDOMEvent(u,g||u.type,c)},_bringToFront:function(c){var u=c._order;if(u){var g=u.next,C=u.prev;if(g)g.prev=C;else return;C?C.next=g:g&&(this._drawFirst=g),u.prev=this._drawLast,this._drawLast.next=u,u.next=null,this._drawLast=u,this._requestRedraw(c)}},_bringToBack:function(c){var u=c._order;if(u){var g=u.next,C=u.prev;if(C)C.next=g;else return;g?g.prev=C:C&&(this._drawLast=C),u.prev=null,u.next=this._drawFirst,this._drawFirst.prev=u,this._drawFirst=u,this._requestRedraw(c)}}});function Sn(c){return Q.canvas?new wn(c):null}var Dt=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(c){return document.createElement("<lvml:"+c+' class="lvml">')}}catch{}return function(c){return document.createElement("<"+c+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),qs={_initContainer:function(){this._container=he("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ke.prototype._update.call(this),this.fire("update"))},_initPath:function(c){var u=c._container=Dt("shape");re(u,"leaflet-vml-shape "+(this.options.className||"")),u.coordsize="1 1",c._path=Dt("path"),u.appendChild(c._path),this._updateStyle(c),this._layers[l(c)]=c},_addPath:function(c){var u=c._container;this._container.appendChild(u),c.options.interactive&&c.addInteractiveTarget(u)},_removePath:function(c){var u=c._container;ge(u),c.removeInteractiveTarget(u),delete this._layers[l(c)]},_updateStyle:function(c){var u=c._stroke,g=c._fill,C=c.options,w=c._container;w.stroked=!!C.stroke,w.filled=!!C.fill,C.stroke?(u||(u=c._stroke=Dt("stroke")),w.appendChild(u),u.weight=C.weight+"px",u.color=C.color,u.opacity=C.opacity,C.dashArray?u.dashStyle=R(C.dashArray)?C.dashArray.join(" "):C.dashArray.replace(/( *, *)/g," "):u.dashStyle="",u.endcap=C.lineCap.replace("butt","flat"),u.joinstyle=C.lineJoin):u&&(w.removeChild(u),c._stroke=null),C.fill?(g||(g=c._fill=Dt("fill")),w.appendChild(g),g.color=C.fillColor||C.color,g.opacity=C.fillOpacity):g&&(w.removeChild(g),c._fill=null)},_updateCircle:function(c){var u=c._point.round(),g=Math.round(c._radius),C=Math.round(c._radiusY||g);this._setPath(c,c._empty()?"M0 0":"AL "+u.x+","+u.y+" "+g+","+C+" 0,"+65535*360)},_setPath:function(c,u){c._path.v=u},_bringToFront:function(c){tt(c._container)},_bringToBack:function(c){nt(c._container)}},qt=Q.vml?Dt:Mt,Ot=ke.extend({_initContainer:function(){this._container=qt("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=qt("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ge(this._container),fe(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ke.prototype._update.call(this);var c=this._bounds,u=c.getSize(),g=this._container;(!this._svgSize||!this._svgSize.equals(u))&&(this._svgSize=u,g.setAttribute("width",u.x),g.setAttribute("height",u.y)),ve(g,c.min),g.setAttribute("viewBox",[c.min.x,c.min.y,u.x,u.y].join(" ")),this.fire("update")}},_initPath:function(c){var u=c._path=qt("path");c.options.className&&re(u,c.options.className),c.options.interactive&&re(u,"leaflet-interactive"),this._updateStyle(c),this._layers[l(c)]=c},_addPath:function(c){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(c._path),c.addInteractiveTarget(c._path)},_removePath:function(c){ge(c._path),c.removeInteractiveTarget(c._path),delete this._layers[l(c)]},_updatePath:function(c){c._project(),c._update()},_updateStyle:function(c){var u=c._path,g=c.options;u&&(g.stroke?(u.setAttribute("stroke",g.color),u.setAttribute("stroke-opacity",g.opacity),u.setAttribute("stroke-width",g.weight),u.setAttribute("stroke-linecap",g.lineCap),u.setAttribute("stroke-linejoin",g.lineJoin),g.dashArray?u.setAttribute("stroke-dasharray",g.dashArray):u.removeAttribute("stroke-dasharray"),g.dashOffset?u.setAttribute("stroke-dashoffset",g.dashOffset):u.removeAttribute("stroke-dashoffset")):u.setAttribute("stroke","none"),g.fill?(u.setAttribute("fill",g.fillColor||g.color),u.setAttribute("fill-opacity",g.fillOpacity),u.setAttribute("fill-rule",g.fillRule||"evenodd")):u.setAttribute("fill","none"))},_updatePoly:function(c,u){this._setPath(c,ut(c._parts,u))},_updateCircle:function(c){var u=c._point,g=Math.max(Math.round(c._radius),1),C=Math.max(Math.round(c._radiusY),1)||g,w="a"+g+","+C+" 0 1,0 ",P=c._empty()?"M0 0":"M"+(u.x-g)+","+u.y+w+g*2+",0 "+w+-g*2+",0 ";this._setPath(c,P)},_setPath:function(c,u){c._path.setAttribute("d",u)},_bringToFront:function(c){tt(c._path)},_bringToBack:function(c){nt(c._path)}});Q.vml&&Ot.include(qs);function En(c){return Q.svg||Q.vml?new Ot(c):null}ue.include({getRenderer:function(c){var u=c.options.renderer||this._getPaneRenderer(c.options.pane)||this.options.renderer||this._renderer;return u||(u=this._renderer=this._createRenderer()),this.hasLayer(u)||this.addLayer(u),u},_getPaneRenderer:function(c){if(c==="overlayPane"||c===void 0)return!1;var u=this._paneRenderers[c];return u===void 0&&(u=this._createRenderer({pane:c}),this._paneRenderers[c]=u),u},_createRenderer:function(c){return this.options.preferCanvas&&Sn(c)||En(c)}});var Pn=rt.extend({initialize:function(c,u){rt.prototype.initialize.call(this,this._boundsToLatLngs(c),u)},setBounds:function(c){return this.setLatLngs(this._boundsToLatLngs(c))},_boundsToLatLngs:function(c){return c=oe(c),[c.getSouthWest(),c.getNorthWest(),c.getNorthEast(),c.getSouthEast()]}});function Xs(c,u){return new Pn(c,u)}Ot.create=qt,Ot.pointsToPath=ut,$e.geometryToLayer=Wt,$e.coordsToLatLng=Ti,$e.coordsToLatLngs=Bt,$e.latLngToCoords=Ri,$e.latLngsToCoords=zt,$e.getFeature=at,$e.asFeature=jt,ue.mergeOptions({boxZoom:!0});var Tn=xe.extend({initialize:function(c){this._map=c,this._container=c._container,this._pane=c._panes.overlayPane,this._resetStateTimeout=0,c.on("unload",this._destroy,this)},addHooks:function(){ne(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){fe(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ge(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(c){if(!c.shiftKey||c.which!==1&&c.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),bt(),ai(),this._startPoint=this._map.mouseEventToContainerPoint(c),ne(document,{contextmenu:Ke,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(c){this._moved||(this._moved=!0,this._box=he("div","leaflet-zoom-box",this._container),re(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(c);var u=new se(this._point,this._startPoint),g=u.getSize();ve(this._box,u.min),this._box.style.width=g.x+"px",this._box.style.height=g.y+"px"},_finish:function(){this._moved&&(ge(this._box),me(this._container,"leaflet-crosshair")),wt(),li(),fe(document,{contextmenu:Ke,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(c){if(!(c.which!==1&&c.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(r(this._resetState,this),0);var u=new ae(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(u).fire("boxzoomend",{boxZoomBounds:u})}},_onKeyDown:function(c){c.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});ue.addInitHook("addHandler","boxZoom",Tn),ue.mergeOptions({doubleClickZoom:!0});var Rn=xe.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(c){var u=this._map,g=u.getZoom(),C=u.options.zoomDelta,w=c.originalEvent.shiftKey?g-C:g+C;u.options.doubleClickZoom==="center"?u.setZoom(w):u.setZoomAround(c.containerPoint,w)}});ue.addInitHook("addHandler","doubleClickZoom",Rn),ue.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var An=xe.extend({addHooks:function(){if(!this._draggable){var c=this._map;this._draggable=new Ve(c._mapPane,c._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),c.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),c.on("zoomend",this._onZoomEnd,this),c.whenReady(this._onZoomEnd,this))}re(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){me(this._map._container,"leaflet-grab"),me(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var c=this._map;if(c._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var u=oe(this._map.options.maxBounds);this._offsetLimit=pe(this._map.latLngToContainerPoint(u.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(u.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;c.fire("movestart").fire("dragstart"),c.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(c){if(this._map.options.inertia){var u=this._lastTime=+new Date,g=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(g),this._times.push(u),this._prunePositions(u)}this._map.fire("move",c).fire("drag",c)},_prunePositions:function(c){for(;this._positions.length>1&&c-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var c=this._map.getSize().divideBy(2),u=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=u.subtract(c).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(c,u){return c-(c-u)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var c=this._draggable._newPos.subtract(this._draggable._startPos),u=this._offsetLimit;c.x<u.min.x&&(c.x=this._viscousLimit(c.x,u.min.x)),c.y<u.min.y&&(c.y=this._viscousLimit(c.y,u.min.y)),c.x>u.max.x&&(c.x=this._viscousLimit(c.x,u.max.x)),c.y>u.max.y&&(c.y=this._viscousLimit(c.y,u.max.y)),this._draggable._newPos=this._draggable._startPos.add(c)}},_onPreDragWrap:function(){var c=this._worldWidth,u=Math.round(c/2),g=this._initialWorldOffset,C=this._draggable._newPos.x,w=(C-u+g)%c+u-g,P=(C+u+g)%c-u-g,O=Math.abs(w+g)<Math.abs(P+g)?w:P;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=O},_onDragEnd:function(c){var u=this._map,g=u.options,C=!g.inertia||c.noInertia||this._times.length<2;if(u.fire("dragend",c),C)u.fire("moveend");else{this._prunePositions(+new Date);var w=this._lastPos.subtract(this._positions[0]),P=(this._lastTime-this._times[0])/1e3,O=g.easeLinearity,I=w.multiplyBy(O/P),k=I.distanceTo([0,0]),H=Math.min(g.inertiaMaxSpeed,k),q=I.multiplyBy(H/k),ee=H/(g.inertiaDeceleration*O),le=q.multiplyBy(-ee/2).round();!le.x&&!le.y?u.fire("moveend"):(le=u._limitOffset(le,u.options.maxBounds),B(function(){u.panBy(le,{duration:ee,easeLinearity:O,noMoveStart:!0,animate:!0})}))}}});ue.addInitHook("addHandler","dragging",An),ue.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Dn=xe.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(c){this._map=c,this._setPanDelta(c.options.keyboardPanDelta),this._setZoomDelta(c.options.zoomDelta)},addHooks:function(){var c=this._map._container;c.tabIndex<=0&&(c.tabIndex="0"),ne(c,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),fe(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var c=document.body,u=document.documentElement,g=c.scrollTop||u.scrollTop,C=c.scrollLeft||u.scrollLeft;this._map._container.focus(),window.scrollTo(C,g)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(c){var u=this._panKeys={},g=this.keyCodes,C,w;for(C=0,w=g.left.length;C<w;C++)u[g.left[C]]=[-1*c,0];for(C=0,w=g.right.length;C<w;C++)u[g.right[C]]=[c,0];for(C=0,w=g.down.length;C<w;C++)u[g.down[C]]=[0,c];for(C=0,w=g.up.length;C<w;C++)u[g.up[C]]=[0,-1*c]},_setZoomDelta:function(c){var u=this._zoomKeys={},g=this.keyCodes,C,w;for(C=0,w=g.zoomIn.length;C<w;C++)u[g.zoomIn[C]]=c;for(C=0,w=g.zoomOut.length;C<w;C++)u[g.zoomOut[C]]=-c},_addHooks:function(){ne(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){fe(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(c){if(!(c.altKey||c.ctrlKey||c.metaKey)){var u=c.keyCode,g=this._map,C;if(u in this._panKeys){if(!g._panAnim||!g._panAnim._inProgress)if(C=this._panKeys[u],c.shiftKey&&(C=U(C).multiplyBy(3)),g.options.maxBounds&&(C=g._limitOffset(U(C),g.options.maxBounds)),g.options.worldCopyJump){var w=g.wrapLatLng(g.unproject(g.project(g.getCenter()).add(C)));g.panTo(w)}else g.panBy(C)}else if(u in this._zoomKeys)g.setZoom(g.getZoom()+(c.shiftKey?3:1)*this._zoomKeys[u]);else if(u===27&&g._popup&&g._popup.options.closeOnEscapeKey)g.closePopup();else return;Ke(c)}}});ue.addInitHook("addHandler","keyboard",Dn),ue.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var On=xe.extend({addHooks:function(){ne(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){fe(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(c){var u=Qi(c),g=this._map.options.wheelDebounceTime;this._delta+=u,this._lastMousePos=this._map.mouseEventToContainerPoint(c),this._startTime||(this._startTime=+new Date);var C=Math.max(g-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(r(this._performZoom,this),C),Ke(c)},_performZoom:function(){var c=this._map,u=c.getZoom(),g=this._map.options.zoomSnap||0;c._stop();var C=this._delta/(this._map.options.wheelPxPerZoomLevel*4),w=4*Math.log(2/(1+Math.exp(-Math.abs(C))))/Math.LN2,P=g?Math.ceil(w/g)*g:w,O=c._limitZoom(u+(this._delta>0?P:-P))-u;this._delta=0,this._startTime=null,O&&(c.options.scrollWheelZoom==="center"?c.setZoom(u+O):c.setZoomAround(this._lastMousePos,u+O))}});ue.addInitHook("addHandler","scrollWheelZoom",On);var Qs=600;ue.mergeOptions({tapHold:Q.touchNative&&Q.safari&&Q.mobile,tapTolerance:15});var Mn=xe.extend({addHooks:function(){ne(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){fe(this._map._container,"touchstart",this._onDown,this)},_onDown:function(c){if(clearTimeout(this._holdTimeout),c.touches.length===1){var u=c.touches[0];this._startPos=this._newPos=new W(u.clientX,u.clientY),this._holdTimeout=setTimeout(r(function(){this._cancel(),this._isTapValid()&&(ne(document,"touchend",ye),ne(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",u))},this),Qs),ne(document,"touchend touchcancel contextmenu",this._cancel,this),ne(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function c(){fe(document,"touchend",ye),fe(document,"touchend touchcancel",c)},_cancel:function(){clearTimeout(this._holdTimeout),fe(document,"touchend touchcancel contextmenu",this._cancel,this),fe(document,"touchmove",this._onMove,this)},_onMove:function(c){var u=c.touches[0];this._newPos=new W(u.clientX,u.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(c,u){var g=new MouseEvent(c,{bubbles:!0,cancelable:!0,view:window,screenX:u.screenX,screenY:u.screenY,clientX:u.clientX,clientY:u.clientY});g._simulated=!0,u.target.dispatchEvent(g)}});ue.addInitHook("addHandler","tapHold",Mn),ue.mergeOptions({touchZoom:Q.touch,bounceAtZoomLimits:!0});var Ln=xe.extend({addHooks:function(){re(this._map._container,"leaflet-touch-zoom"),ne(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){me(this._map._container,"leaflet-touch-zoom"),fe(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(c){var u=this._map;if(!(!c.touches||c.touches.length!==2||u._animatingZoom||this._zooming)){var g=u.mouseEventToContainerPoint(c.touches[0]),C=u.mouseEventToContainerPoint(c.touches[1]);this._centerPoint=u.getSize()._divideBy(2),this._startLatLng=u.containerPointToLatLng(this._centerPoint),u.options.touchZoom!=="center"&&(this._pinchStartLatLng=u.containerPointToLatLng(g.add(C)._divideBy(2))),this._startDist=g.distanceTo(C),this._startZoom=u.getZoom(),this._moved=!1,this._zooming=!0,u._stop(),ne(document,"touchmove",this._onTouchMove,this),ne(document,"touchend touchcancel",this._onTouchEnd,this),ye(c)}},_onTouchMove:function(c){if(!(!c.touches||c.touches.length!==2||!this._zooming)){var u=this._map,g=u.mouseEventToContainerPoint(c.touches[0]),C=u.mouseEventToContainerPoint(c.touches[1]),w=g.distanceTo(C)/this._startDist;if(this._zoom=u.getScaleZoom(w,this._startZoom),!u.options.bounceAtZoomLimits&&(this._zoom<u.getMinZoom()&&w<1||this._zoom>u.getMaxZoom()&&w>1)&&(this._zoom=u._limitZoom(this._zoom)),u.options.touchZoom==="center"){if(this._center=this._startLatLng,w===1)return}else{var P=g._add(C)._divideBy(2)._subtract(this._centerPoint);if(w===1&&P.x===0&&P.y===0)return;this._center=u.unproject(u.project(this._pinchStartLatLng,this._zoom).subtract(P),this._zoom)}this._moved||(u._moveStart(!0,!1),this._moved=!0),K(this._animRequest);var O=r(u._move,u,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=B(O,this,!0),ye(c)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,K(this._animRequest),fe(document,"touchmove",this._onTouchMove,this),fe(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});ue.addInitHook("addHandler","touchZoom",Ln),ue.BoxZoom=Tn,ue.DoubleClickZoom=Rn,ue.Drag=An,ue.Keyboard=Dn,ue.ScrollWheelZoom=On,ue.TapHold=Mn,ue.TouchZoom=Ln,t.Bounds=se,t.Browser=Q,t.CRS=Se,t.Canvas=wn,t.Circle=Pi,t.CircleMarker=Ht,t.Class=Z,t.Control=Ae,t.DivIcon=_n,t.DivOverlay=Fe,t.DomEvent=gs,t.DomUtil=ps,t.Draggable=Ve,t.Evented=Y,t.FeatureGroup=Ne,t.GeoJSON=$e,t.GridLayer=At,t.Handler=xe,t.Icon=ot,t.ImageOverlay=Ut,t.LatLng=ie,t.LatLngBounds=ae,t.Layer=De,t.LayerGroup=st,t.LineUtil=As,t.Map=ue,t.Marker=Vt,t.Mixin=ws,t.Path=He,t.Point=W,t.PolyUtil=Ss,t.Polygon=rt,t.Polyline=Ie,t.Popup=Kt,t.PosAnimation=Zi,t.Projection=Ds,t.Rectangle=Pn,t.Renderer=ke,t.SVG=Ot,t.SVGOverlay=Cn,t.TileLayer=lt,t.Tooltip=Yt,t.Transformation=We,t.Util=J,t.VideoOverlay=vn,t.bind=r,t.bounds=pe,t.canvas=Sn,t.circle=$s,t.circleMarker=Is,t.control=Pt,t.divIcon=Us,t.extend=s,t.featureGroup=xs,t.geoJSON=mn,t.geoJson=Vs,t.gridLayer=Ks,t.icon=Fs,t.imageOverlay=Hs,t.latLng=te,t.latLngBounds=oe,t.layerGroup=Ls,t.map=ms,t.marker=Ns,t.point=U,t.polygon=Gs,t.polyline=ks,t.popup=zs,t.rectangle=Xs,t.setOptions=b,t.stamp=l,t.svg=En,t.svgOverlay=Bs,t.tileLayer=yn,t.tooltip=js,t.transformation=Be,t.version=i,t.videoOverlay=Ws;var Zs=window.L;t.noConflict=function(){return window.L=Zs,this},window.L=t})})(leafletSrc,leafletSrc.exports);var leafletSrcExports=leafletSrc.exports;const L$1=getDefaultExportFromCjs(leafletSrcExports);function makeNull(n){return n==null||n===""?null:n}function exists(n,e=!1){return n!=null&&(n!==""||e)}function missing(n){return!exists(n)}function missingOrEmpty(n){return n==null||n.length===0}function toStringOrNull(n){return n!=null&&typeof n.toString=="function"?n.toString():null}function attrToNumber(n){if(n===void 0)return;if(n===null||n==="")return null;if(typeof n=="number")return isNaN(n)?void 0:n;const e=parseInt(n,10);return isNaN(e)?void 0:e}function attrToBoolean(n){if(n!==void 0)return n===null||n===""?!1:typeof n=="boolean"?n:/true/i.test(n)}function attrToString(n){if(!(n==null||n===""))return n}function jsonEquals(n,e){const t=n?JSON.stringify(n):null,i=e?JSON.stringify(e):null;return t===i}function defaultComparator(n,e,t=!1){const i=n==null,s=e==null;if(n&&n.toNumber&&(n=n.toNumber()),e&&e.toNumber&&(e=e.toNumber()),i&&s)return 0;if(i)return-1;if(s)return 1;function o(r,a){return r>a?1:r<a?-1:0}if(typeof n!="string"||!t)return o(n,e);try{return n.localeCompare(e)}catch{return o(n,e)}}function values(n){if(n instanceof Set||n instanceof Map){const e=[];return n.forEach(t=>e.push(t)),e}return Object.values(n)}const GenericUtils=Object.freeze(Object.defineProperty({__proto__:null,attrToBoolean,attrToNumber,attrToString,defaultComparator,exists,jsonEquals,makeNull,missing,missingOrEmpty,toStringOrNull,values},Symbol.toStringTag,{value:"Module"}));class ColumnKeyCreator{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t<e.length;t++)this.existingKeys[e[t]]=!0}getUniqueKey(e,t){e=toStringOrNull(e);let i=0;for(;;){let s;if(e?(s=e,i!==0&&(s+="_"+i)):t?(s=t,i!==0&&(s+="_"+i)):s=i,!this.existingKeys[s])return this.existingKeys[s]=!0,String(s);i++}}}function iterateObject(n,e){if(n!=null){if(Array.isArray(n)){for(let t=0;t<n.length;t++)e(t.toString(),n[t]);return}for(const[t,i]of Object.entries(n))e(t,i)}}function cloneObject(n){const e={},t=Object.keys(n);for(let i=0;i<t.length;i++){const s=t[i],o=n[s];e[s]=o}return e}function deepCloneObject(n){return JSON.parse(JSON.stringify(n))}function deepCloneDefinition(n,e){if(!n)return;const t=n,i={};return Object.keys(t).forEach(s=>{if(e&&e.indexOf(s)>=0)return;const o=t[s];isNonNullObject(o)&&o.constructor===Object?i[s]=deepCloneDefinition(o):i[s]=o}),i}function getProperty(n,e){return n[e]}function setProperty(n,e,t){n[e]=t}function copyPropertiesIfPresent(n,e,...t){t.forEach(i=>copyPropertyIfPresent(n,e,i))}function copyPropertyIfPresent(n,e,t,i){const s=getProperty(n,t);s!==void 0&&setProperty(e,t,i?i(s):s)}function getAllKeysInObjects(n){const e={};return n.filter(t=>t!=null).forEach(t=>{Object.keys(t).forEach(i=>e[i]=null)}),Object.keys(e)}function getAllValuesInObject(n){if(!n)return[];const e=Object;if(typeof e.values=="function")return e.values(n);const t=[];for(const i in n)n.hasOwnProperty(i)&&n.propertyIsEnumerable(i)&&t.push(n[i]);return t}function mergeDeep(n,e,t=!0,i=!1){exists(e)&&iterateObject(e,(s,o)=>{let r=n[s];r!==o&&(i&&r==null&&o!=null&&typeof o=="object"&&o.constructor===Object&&(r={},n[s]=r),isNonNullObject(o)&&isNonNullObject(r)&&!Array.isArray(r)?mergeDeep(r,o,t,i):(t||o!==void 0)&&(n[s]=o))})}function missingOrEmptyObject(n){return missing(n)||Object.keys(n).length===0}function get(n,e,t){if(n==null)return t;const i=e.split(".");let s=n;for(;i.length>1;)if(s=s[i.shift()],s==null)return t;const o=s[i[0]];return o??t}function set(n,e,t){if(n==null)return;const i=e.split(".");let s=n;i.forEach((o,r)=>{s[o]||(s[o]={}),r<i.length-1&&(s=s[o])}),s[i[i.length-1]]=t}function getValueUsingField(n,e,t){if(!e||!n)return;if(!t)return n[e];const i=e.split(".");let s=n;for(let o=0;o<i.length;o++){if(s==null)return;s=s[i[o]]}return s}function removeAllReferences(n,e=[],t){Object.keys(n).forEach(r=>{typeof n[r]=="object"&&!e.includes(r)&&(n[r]=void 0)});const i=Object.getPrototypeOf(n),s={},o=r=>`AG Grid: Grid API function ${r}() cannot be called as the grid has been destroyed.diff --git a/public/build/manifest.json b/public/build/manifest.jsonindex 1443127241..5857d24240 100644--- a/public/build/manifest.json+++ b/public/build/manifest.json@@ -1,57 +1,57 @@{- "_create-empty-split-d82bb341.js": {- "file": "assets/create-empty-split-d82bb341.js",+ "_create-empty-split-aae839d5.js": {+ "file": "assets/create-empty-split-aae839d5.js","imports": [- "_vendor-cc723e37.js"+ "_vendor-2609b2c9.js"],- "integrity": "sha384-xqyk8VkCuWg3Pyh5tmtlOcjXCNVzHghsQICD/8eqKQqivrhLARahE2sHuw6SiZuK"+ "integrity": "sha384-kUrPjqHkFqVzJQjH9DXySo3O27g0Jh9lAs8AJRf3MPN85968p9Du3UiQIZlTUPGc"},- "_format-money-03f73825.js": {- "file": "assets/format-money-03f73825.js",+ "_format-money-62afb78b.js": {+ "file": "assets/format-money-62afb78b.js","imports": [- "_vendor-cc723e37.js"+ "_vendor-2609b2c9.js"],- "integrity": "sha384-zmpuSCeX+Xvs0IlpZqebAdDNiTGxuNaaFFWWEd6KF6sUQ2So61pu+jjH6RIkB3Pj"+ "integrity": "sha384-TAio40YCcyMAfzXMbgBAmXaAeUHGFYD0n7FRC3hgtUuTUlGLnYrxZtDc0/ulWnPd"},- "_get-10f1237b.js": {- "file": "assets/get-10f1237b.js",+ "_get-5b4283ca.js": {+ "file": "assets/get-5b4283ca.js","imports": [- "_format-money-03f73825.js"+ "_format-money-62afb78b.js"],- "integrity": "sha384-Qp3fLmVM9CLH0wJSAEvAjT1Q/TK7iIbVt4wNo9WCx04cEfMp+aXC49FqNYdUSVS8"+ "integrity": "sha384-8G2j6ux1LVbsCSQQRonc1WDrDqdOxMoRJUeYlN1uMpZ/ui/8my/HGWOxFbLCStf3"},- "_get-7f8692a5.js": {- "file": "assets/get-7f8692a5.js",+ "_get-ea675e30.js": {+ "file": "assets/get-ea675e30.js","imports": [- "_format-money-03f73825.js"+ "_format-money-62afb78b.js"],- "integrity": "sha384-Nu6mFNb909g9ZLzJpntU8cRhbRBwe8tWBcmxRJ5vt88JWYVdqqrPlvxHAwyG/3I+"+ "integrity": "sha384-cdp/pfZrpvE6Rs9OyKGrNAEX4fKIl78uvKtlSQnphz3GkPJzMq01f/5+0sOF4xue"},- "_parse-downloaded-splits-fb2d62df.js": {- "file": "assets/parse-downloaded-splits-fb2d62df.js",+ "_parse-downloaded-splits-6b9adc20.js": {+ "file": "assets/parse-downloaded-splits-6b9adc20.js","imports": [- "_create-empty-split-d82bb341.js",- "_vendor-cc723e37.js"+ "_create-empty-split-aae839d5.js",+ "_vendor-2609b2c9.js"],- "integrity": "sha384-e2TYgrrrNUa1Khx6aS8Ai/mRtmiz8TPFLQZcZYz7OoOipiWHovDKven8sxIJmqkj"+ "integrity": "sha384-5o93Kgc0sXYdoE/lS3IknfCFLno5CseAZ8y6HtDM5mkkg43y6DOTFcxIW3xuOPvb"},- "_put-d747f13c.js": {- "file": "assets/put-d747f13c.js",+ "_put-c9d3942f.js": {+ "file": "assets/put-c9d3942f.js","imports": [- "_format-money-03f73825.js"+ "_format-money-62afb78b.js"],- "integrity": "sha384-m1RzGO6aYwXHYY7GIZAwxkr+70Iqu8hSxaMNWnXpQb2CB31CN5L2QqhSNBzvANc1"+ "integrity": "sha384-jBUmdZ39Tp/GN4Zr3suYFGsrfKw3j3GJDvBo8vh0eRA2Pbwk2PLIE8TWhAXu6zR3"},- "_splice-errors-into-transactions-e53c1920.js": {- "file": "assets/splice-errors-into-transactions-e53c1920.js",+ "_splice-errors-into-transactions-528a3749.js": {+ "file": "assets/splice-errors-into-transactions-528a3749.js","imports": [- "_format-money-03f73825.js",- "_get-7f8692a5.js",- "_vendor-cc723e37.js"+ "_format-money-62afb78b.js",+ "_get-5b4283ca.js",+ "_vendor-2609b2c9.js"],- "integrity": "sha384-SeZHC0EItDDobOAXWQwnZ76014a8Kn/UxN+X8zyf5ESIQ9yEnpH/PJqmt10lR+kh"+ "integrity": "sha384-AuGtawK1GzB4IW0SN1e52QLD+A/tG/LKEDnodKNDU8rRZr9EeYnf6bOIbSemYm5A"},- "_vendor-cc723e37.js": {+ "_vendor-2609b2c9.js": {"assets": ["assets/layers-1dbbe9d0.png","assets/layers-2x-066daca8.png",@@ -60,8 +60,8 @@"css": ["assets/vendor-5c5099b4.css"],- "file": "assets/vendor-cc723e37.js",- "integrity": "sha384-SBcU5qAqCE2yT4967bb7EkNvKlH48c6QqGE9S32LwfGECQA9k4nkyTlopJr0cmgR"+ "file": "assets/vendor-2609b2c9.js",+ "integrity": "sha384-dUB0xSeqzlyxX/anun8b4k38j63OmPyjAdpCLpuxq3A1CHRCnGMJswNn/NKzwhOS"},"node_modules/@fortawesome/fontawesome-free/webfonts/fa-brands-400.ttf": {"file": "assets/fa-brands-400-5656d596.ttf",@@ -109,45 +109,45 @@"integrity": "sha384-wg83fCOXjBtqzFAWhTL9Sd9vmLUNhfEEzfmNUX9zwv2igKlz/YQbdapF4ObdxF+R"},"resources/assets/v2/pages/dashboard/dashboard.js": {- "file": "assets/dashboard-d1d540db.js",+ "file": "assets/dashboard-5ef2eea4.js","imports": [- "_format-money-03f73825.js",- "_vendor-cc723e37.js",- "_get-10f1237b.js",- "_get-7f8692a5.js"+ "_format-money-62afb78b.js",+ "_vendor-2609b2c9.js",+ "_get-ea675e30.js",+ "_get-5b4283ca.js"],"isEntry": true,"src": "resources/assets/v2/pages/dashboard/dashboard.js",- "integrity": "sha384-EG2YFwGswmDXurC8abNfvl04dS8utpeumKrlxYAOd1ZlLc4JUQ1AWG0cRKNCsb7U"+ "integrity": "sha384-U59Ky3Sz6ruwvg1AfP8JjhiN9OMRcG8+Tzhyyu22rSPKTSop1CLyhsUmOCfM8YhT"},"resources/assets/v2/pages/transactions/create.js": {- "file": "assets/create-af0e6c17.js",+ "file": "assets/create-6378bb8a.js","imports": [- "_format-money-03f73825.js",- "_create-empty-split-d82bb341.js",- "_splice-errors-into-transactions-e53c1920.js",- "_vendor-cc723e37.js",- "_get-7f8692a5.js"+ "_format-money-62afb78b.js",+ "_create-empty-split-aae839d5.js",+ "_splice-errors-into-transactions-528a3749.js",+ "_vendor-2609b2c9.js",+ "_get-5b4283ca.js"],"isEntry": true,"src": "resources/assets/v2/pages/transactions/create.js",- "integrity": "sha384-SbUjMpGlNF36W0wZYbTQkpr7nb5fI1JpOtKp/oZB7d+KfcKNmdGIafsyu5hFw+3v"+ "integrity": "sha384-MGu6/JpMYPxpIy/FqXPwlGo4LAGC3MB5dV9PtszBnijuB/3bl4lemzdsmM5NSRDI"},"resources/assets/v2/pages/transactions/edit.js": {- "file": "assets/edit-a939c15a.js",+ "file": "assets/edit-a6845b23.js","imports": [- "_format-money-03f73825.js",- "_get-10f1237b.js",- "_parse-downloaded-splits-fb2d62df.js",- "_splice-errors-into-transactions-e53c1920.js",- "_vendor-cc723e37.js",- "_create-empty-split-d82bb341.js",- "_put-d747f13c.js",- "_get-7f8692a5.js"+ "_format-money-62afb78b.js",+ "_get-ea675e30.js",+ "_parse-downloaded-splits-6b9adc20.js",+ "_splice-errors-into-transactions-528a3749.js",+ "_vendor-2609b2c9.js",+ "_create-empty-split-aae839d5.js",+ "_put-c9d3942f.js",+ "_get-5b4283ca.js"],"isEntry": true,"src": "resources/assets/v2/pages/transactions/edit.js",- "integrity": "sha384-+e/kMTR2lpALsCeYoFbNh1ePnqaC56PrwtNMhbTlCGQmtxYiAMEOTH5jE+gAnqDN"+ "integrity": "sha384-/O7vRaIUH+cd83DZccxnrXf8YYsg2KjC/d5C1q5qNeh+MuFVl4NFShMQvE3n5tZp"},"resources/assets/v2/pages/transactions/index.css": {"file": "assets/index-badb0a41.css",@@ -158,16 +158,16 @@"css": ["assets/index-badb0a41.css"],- "file": "assets/index-089e7bf2.js",+ "file": "assets/index-78b5f723.js","imports": [- "_format-money-03f73825.js",- "_vendor-cc723e37.js",- "_get-10f1237b.js",- "_put-d747f13c.js"+ "_format-money-62afb78b.js",+ "_vendor-2609b2c9.js",+ "_get-ea675e30.js",+ "_put-c9d3942f.js"],"isEntry": true,"src": "resources/assets/v2/pages/transactions/index.js",- "integrity": "sha384-LdFg7W8efK0nAmNDzVzSLaUnZ5JDpfcY7TCE5lYeh8RtvYeklsJZCJcbqbuUHint"+ "integrity": "sha384-A/WqZ8EUl2gLfNfwuyfHiN61ME/6IT+OKaySatMo7qKgQ3mVan6PRkenaANbzYQH"},"resources/assets/v2/pages/transactions/show.css": {"file": "assets/show-8b1429e5.css",@@ -178,17 +178,17 @@"css": ["assets/show-8b1429e5.css"],- "file": "assets/show-7827ee8e.js",+ "file": "assets/show-c2b3bd03.js","imports": [- "_format-money-03f73825.js",- "_vendor-cc723e37.js",- "_get-10f1237b.js",- "_parse-downloaded-splits-fb2d62df.js",- "_create-empty-split-d82bb341.js"+ "_format-money-62afb78b.js",+ "_vendor-2609b2c9.js",+ "_get-ea675e30.js",+ "_parse-downloaded-splits-6b9adc20.js",+ "_create-empty-split-aae839d5.js"],"isEntry": true,"src": "resources/assets/v2/pages/transactions/show.js",- "integrity": "sha384-IgbM4MiKR37X2FSkAG1AzDXGHnZccsdtSXNoDQ/2wVABwhL01ef9V7zCMWhhIJiu"+ "integrity": "sha384-Cwohl3AO2jlS/+sY36BhwAFGmNhpWQZZZXsPVDd+a4a1jeJ0ScZBgxz8vtY+r4k0"},"resources/assets/v2/sass/app.scss": {"file": "assets/app-fb7b26ec.css",diff --git a/resources/lang/bg_BG/firefly.php b/resources/lang/bg_BG/firefly.phpindex acf6a45804..99ae30928f 100644--- a/resources/lang/bg_BG/firefly.php+++ b/resources/lang/bg_BG/firefly.php@@ -308,6 +308,8 @@ return ['update_new_version_alert' => 'Налична е нова версия на Firefly III. Вие изпълнявате :your_version, последната версия е :new_version, която беше пусната на :date.','update_version_beta' => 'Това е BETA версия. Може да се натъкнете на проблеми.','update_version_alpha' => 'Това е ALPHA версия. Може да се натъкнете на проблеми.',+ 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!',+ 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.','update_current_version_alert' => 'Изпълнявате :version, която е най-новата налична версия.','update_newer_version_alert' => 'Изпълнявате: :your_version, която е по-нова от последната налична версия: :new_version.','update_check_error' => 'Възникна грешка при проверка за актуализации: :error',diff --git a/resources/lang/ca_ES/firefly.php b/resources/lang/ca_ES/firefly.phpindex 3e7680ff9e..27fedde31e 100644--- a/resources/lang/ca_ES/firefly.php+++ b/resources/lang/ca_ES/firefly.php@@ -308,6 +308,8 @@ return ['update_new_version_alert' => 'Hi ha una nova versió de Firefly III disponible. Estàs executant la versió :your_version, i l\'última versió és la :new_version que es va publicar el :date.','update_version_beta' => 'Aquesta és una versió BETA. Podries tenir problemes.','update_version_alpha' => 'Aquesta és una versió ALFA. Podries tenir problemes.',+ 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!',+ 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.','update_current_version_alert' => 'Estàs executant :version, que és l\'última versió disponible.','update_newer_version_alert' => 'Estàs executant :your_version, que és més nova que l\'última versió, :new_version.','update_check_error' => 'Ha succeït un error mentre es comprovaven les actualitzacions: :error',diff --git a/resources/lang/cs_CZ/firefly.php b/resources/lang/cs_CZ/firefly.phpindex 55d3271ae7..ef6073ce74 100644--- a/resources/lang/cs_CZ/firefly.php+++ b/resources/lang/cs_CZ/firefly.php@@ -308,6 +308,8 @@ return ['update_new_version_alert' => 'Je k dispozici nová verze Firefly III. Nyní provozujete verzi :your_version, nejnovější verze je :new_version, která byla vydaná :date.','update_version_beta' => 'Tato verze je BETA verze. Můžete narazit na problémy.','update_version_alpha' => 'Tato verze je ALFA verze. Můžete narazit na problémy.',+ 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!',+ 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.','update_current_version_alert' => 'Provozujete verzi :version, která je nejnovější dostupnou verzí.','update_newer_version_alert' => 'Používáte verzi :your_version, která je novější než poslední stabilní verze :new_version.','update_check_error' => 'Došlo k chybě při kontrole aktualizací: :error',diff --git a/resources/lang/da_DK/firefly.php b/resources/lang/da_DK/firefly.phpindex 69fef846dc..737465f339 100644--- a/resources/lang/da_DK/firefly.php+++ b/resources/lang/da_DK/firefly.php@@ -308,6 +308,8 @@ return ['update_new_version_alert' => 'En ny version af Firefly III er tilgængelig. Du bruger :your_version, den nyeste version er :new_version, som blev udgivet den :date.','update_version_beta' => 'Denne version er en BETA version. Du kan løbe ind i problemer.','update_version_alpha' => 'Denne version er en ALPHA version. Du kan løbe ind i problemer.',+ 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!',+ 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.','update_current_version_alert' => 'Du bruger :version, som er den seneste tilgængelige udgivelse.','update_newer_version_alert' => 'Du bruger :your_version, som er nyere end den seneste udgivelse, :new_version.','update_check_error' => 'Der opstod en fejl under søgning efter opdateringer: :error',diff --git a/resources/lang/de_DE/firefly.php b/resources/lang/de_DE/firefly.phpindex 8a46c03e86..f25fcc350c 100644--- a/resources/lang/de_DE/firefly.php+++ b/resources/lang/de_DE/firefly.php@@ -308,6 +308,8 @@ return ['update_new_version_alert' => 'Eine neue Version von Firefly III ist verfügbar. Sie verwenden :your_version, die neueste Version ist :new_version, die am :date veröffentlicht wurde.','update_version_beta' => 'Seien Sie vorsichtig bei der Verwendung dieser BETA-Version. Sie könnte noch Fehler enthaltern.','update_version_alpha' => 'Seien Sie vorsichtig bei der Verwendung dieser APLPHA-Version. Sie kann Fehler enthaltern.',+ 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!',+ 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.','update_current_version_alert' => 'Sie verwenden Version :version. Dies ist die neueste verfügbare Version.','update_newer_version_alert' => 'Sie verwenden :your_version. Ihre Version ist neuer als die neueste Version (:new_version).','update_check_error' => 'Bei der Suche nach Aktualisierungen ist ein Fehler aufgetreten: :error',diff --git a/resources/lang/el_GR/firefly.php b/resources/lang/el_GR/firefly.phpindex 97aaca550d..160e63428a 100644--- a/resources/lang/el_GR/firefly.php+++ b/resources/lang/el_GR/firefly.php@@ -308,6 +308,8 @@ return ['update_new_version_alert' => 'Μία νέα έκδοση του Firefly III είναι διαθέσιμη. Έχετε την v:your_version, ενώ η τελευταία έκδοση είναι η v:new_version που κυκλοφόρησε στις :date.','update_version_beta' => 'Αυτή είναι μια BETA δοκιμαστική έκδοση. Μπορεί να συναντήσετε προβλήματα.','update_version_alpha' => 'Αυτή είναι μια ALPHA δοκιμαστική έκδοση. Μπορεί να συναντήσετε προβλήματα.',+ 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!',+ 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.','update_current_version_alert' => 'Έχετε την έκδοση v:version, που είναι η τελευταία διαθέσιμη.','update_newer_version_alert' => 'Έχετε την έκδοση v:your_version, που είναι νεότερη από την τελευταία έκδοση, v:new_version.','update_check_error' => 'Παρουσιάστηκε σφάλμα κατά τον έλεγχο για ενημερώσεις: :error',diff --git a/resources/lang/en_GB/firefly.php b/resources/lang/en_GB/firefly.phpindex c765a8473e..633e0b0d0a 100644--- a/resources/lang/en_GB/firefly.php+++ b/resources/lang/en_GB/firefly.php@@ -308,6 +308,8 @@ return ['update_new_version_alert' => 'A new version of Firefly III is available. You are running :your_version, the latest version is :new_version which was released on :date.','update_version_beta' => 'This version is a BETA version. You may run into issues.','update_version_alpha' => 'This version is a ALPHA version. You may run into issues.',+ 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!',+ 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.','update_current_version_alert' => 'You are running :version, which is the latest available release.','update_newer_version_alert' => 'You are running :your_version, which is newer than the latest release, :new_version.','update_check_error' => 'An error occurred while checking for updates: :error',diff --git a/resources/lang/es_ES/firefly.php b/resources/lang/es_ES/firefly.phpindex 851e1ea1f3..764fd2a74d 100644--- a/resources/lang/es_ES/firefly.php+++ b/resources/lang/es_ES/firefly.php@@ -308,6 +308,8 @@ return ['update_new_version_alert' => 'Una nueva versión de Firefly III esta disponible. Estás usando :your_version, la ultima versión es :new_version que se lanzó en :date.','update_version_beta' => 'Esta versión es una versión BETA. Puede tener problemas.','update_version_alpha' => 'Esta versión es una versión de ALPHA. Puede tener problemas.',+ 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!',+ 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.','update_current_version_alert' => 'Estás usando :version, que es la última versión disponible.','update_newer_version_alert' => 'Estás usando :your_version, que es más reciente que la última versión, :new_version.','update_check_error' => 'Se ha producido un error al buscar actualizaciones: :error',diff --git a/resources/lang/fi_FI/firefly.php b/resources/lang/fi_FI/firefly.phpindex b62625ea3c..c2b1ba06b1 100644--- a/resources/lang/fi_FI/firefly.php+++ b/resources/lang/fi_FI/firefly.php@@ -308,6 +308,8 @@ return ['update_new_version_alert' => 'Firefly III:sta on julkaistu uusi versio. Käytät versiota :your_version, viimeisin versio :new_version on julkaistu :date.','update_version_beta' => 'Tämä on BETA versio. Saatat törmätä hankaluuksiin.','update_version_alpha' => 'Tämä on ALPHA versio. Saatat törmätä hankaluuksiin.',+ 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!',+ 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.','update_current_version_alert' => 'Käytät versiota :version, se on viimeisin julkaistu versio.','update_newer_version_alert' => 'Käytät versiota :your_version, joka on uudempi kuin viimeisin julkaistu versio, :new_version.','update_check_error' => 'Päivityksiä tarkistettaessa tapahtui virhe: :error',diff --git a/resources/lang/fr_FR/firefly.php b/resources/lang/fr_FR/firefly.phpindex 880f6ee7c9..ea7d20ff0f 100644--- a/resources/lang/fr_FR/firefly.php+++ b/resources/lang/fr_FR/firefly.php@@ -308,6 +308,8 @@ return ['update_new_version_alert' => 'Une nouvelle version de Firefly III est disponible. Vous utilisez v:your_version. La dernière version v:new_version a été publiée le :date.','update_version_beta' => 'Cette version est une version BETA. Vous pouvez rencontrer des problèmes.','update_version_alpha' => 'Cette version est une version ALPHA. Vous pourriez rencontrer des problèmes.',+ 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!',+ 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.','update_current_version_alert' => 'Vous utilisez v:version, la dernière version disponible.','update_newer_version_alert' => 'Vous utilisez v:your_version, qui est plus récente que la dernière version, v:new_version.','update_check_error' => 'Une erreur est survenue lors de la vérification d\'une mise à jour : :error',diff --git a/resources/lang/hu_HU/firefly.php b/resources/lang/hu_HU/firefly.phpindex 16a4a3cea6..7db05ea58c 100644--- a/resources/lang/hu_HU/firefly.php+++ b/resources/lang/hu_HU/firefly.php@@ -308,6 +308,8 @@ return ['update_new_version_alert' => 'A Firefly III új verziója elérhető. A jelenleg használt verzió :your_version, a legújabb verzió pedig :new_version, amely ekkor jelent meg: :date.','update_version_beta' => 'Ez egy BETA verzió. Előfordulhatnak problémák.','update_version_alpha' => 'Ez egy ALPHA verzió. Előfordulhatnak problémák.',+ 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!',+ 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.','update_current_version_alert' => 'A jelenlegi verzió :version, ez egyben a legfrissebb elérhető verzió is.','update_newer_version_alert' => 'A jelenlegi verzió :your_version, amely újabb, mint a legfrissebb kiadott verzió, ami a :new_version.','update_check_error' => 'Hiba történt a frissítések ellenőrzése közben: :error',diff --git a/resources/lang/id_ID/firefly.php b/resources/lang/id_ID/firefly.phpindex 98a62ad8b1..478b488e9b 100644--- a/resources/lang/id_ID/firefly.php+++ b/resources/lang/id_ID/firefly.php@@ -308,6 +308,8 @@ return ['update_new_version_alert' => 'A new version of Firefly III is available. You are running :your_version, the latest version is :new_version which was released on :date.','update_version_beta' => 'This version is a BETA version. You may run into issues.','update_version_alpha' => 'This version is a ALPHA version. You may run into issues.',+ 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!',+ 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.','update_current_version_alert' => 'You are running :version, which is the latest available release.','update_newer_version_alert' => 'You are running :your_version, which is newer than the latest release, :new_version.','update_check_error' => 'An error occurred while checking for updates: :error',diff --git a/resources/lang/it_IT/firefly.php b/resources/lang/it_IT/firefly.phpindex 3f6055bef3..624cce97e6 100644--- a/resources/lang/it_IT/firefly.php+++ b/resources/lang/it_IT/firefly.php@@ -308,6 +308,8 @@ return ['update_new_version_alert' => 'È disponibile una nuova versione di Firefly III. Stai utilizzando :your_version, l\'ultima versione è :new_version che è stata rilasciata il :date.','update_version_beta' => 'Questa versione è una versione BETA. Puoi avere problemi.','update_version_alpha' => 'Questa versione è una versione ALPHA. Puoi avere problemi.',+ 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!',+ 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.','update_current_version_alert' => 'Stai utilizzando :version, che è l\'ultima versione disponibile.','update_newer_version_alert' => 'Stai utilizzando :your_version, che è più recente dell\'ultima versione, :new_version.','update_check_error' => 'Si è verificato un errore durante il controllo degli aggiornamenti: :error',diff --git a/resources/lang/ja_JP/firefly.php b/resources/lang/ja_JP/firefly.phpindex 2156a19270..bcc4d906d3 100644--- a/resources/lang/ja_JP/firefly.php+++ b/resources/lang/ja_JP/firefly.php@@ -308,6 +308,8 @@ return ['update_new_version_alert' => 'Firefly III の新しいバージョンが利用可能です。あなたは現在 :your_version を実行していますが、最新バージョンは :date にリリースされた :new_version です。','update_version_beta' => 'このバージョンはベータ版です。問題が発生する可能性があります。','update_version_alpha' => 'このバージョンはアルファ版です。問題が発生する可能性があります。',+ 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!',+ 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.','update_current_version_alert' => '最新のリリースである :version を利用しています。','update_newer_version_alert' => '最新の :new_version よりも新しい :your_version を利用しています。','update_check_error' => 'アップデートの確認中にエラーが発生しました: :error',diff --git a/resources/lang/ko_KR/firefly.php b/resources/lang/ko_KR/firefly.phpindex 862c40c22d..5d45d62073 100644--- a/resources/lang/ko_KR/firefly.php+++ b/resources/lang/ko_KR/firefly.php@@ -308,6 +308,8 @@ return ['update_new_version_alert' => 'Firefly III의 새 버전을 사용할 수 있습니다. 현재 실행 중인 버전은 :your_version이며, 최신 버전은 :date에 릴리스된 :new_version입니다.','update_version_beta' => '이 버전은 베타 버전입니다. 문제가 발생할 수 있습니다.','update_version_alpha' => '이 버전은 알파 버전입니다. 문제가 발생할 수 있습니다.',+ 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!',+ 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.','update_current_version_alert' => '사용 가능한 최신 릴리스인 :version을 실행 중입니다.','update_newer_version_alert' => '최신 릴리스인 :new_version보다 최신 버전인 :your_version을 실행중입니다.','update_check_error' => '업데이트 확인 중 오류가 발생했습니다: :error',diff --git a/resources/lang/nb_NO/firefly.php b/resources/lang/nb_NO/firefly.phpindex e2e2d9586a..bd9ae4113e 100644--- a/resources/lang/nb_NO/firefly.php+++ b/resources/lang/nb_NO/firefly.php@@ -308,6 +308,8 @@ return ['update_new_version_alert' => 'En ny versjon av Firefly III er tilgjengelig. Du kjører :your_version, den nyeste versjonen er :new_version som ble utgitt den :date.','update_version_beta' => 'Dette er en BETA versjon, du kan oppleve problemer.','update_version_alpha' => 'Dette er en ALPHA versjon, du kan oppleve problemer.',+ 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!',+ 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.','update_current_version_alert' => 'Du kjører :version, som er den nyeste tilgjengelige utgivelsen.','update_newer_version_alert' => 'Du kjører :your_version, som er nyere enn den nyeste versjonen, :new_version.','update_check_error' => 'Det oppstod en feil under søk etter oppdatering: :error',diff --git a/resources/lang/nl_NL/firefly.php b/resources/lang/nl_NL/firefly.phpindex 03c8a68af1..7fece2aa49 100644--- a/resources/lang/nl_NL/firefly.php+++ b/resources/lang/nl_NL/firefly.php@@ -308,6 +308,8 @@ return ['update_new_version_alert' => 'Er is een nieuwe versie van Firefly III beschikbaar. Je gebruikt :your_version, de nieuwste versie is :new_version die werd uitgebracht op :date.','update_version_beta' => 'Dit is een BETA versie. Er kunnen bugs in zitten.','update_version_alpha' => 'Dit is een ALPHA versie. Er kunnen bugs in zitten.',+ 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!',+ 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.','update_current_version_alert' => 'Je gebruikt :version, de nieuwste beschikbare versie.','update_newer_version_alert' => 'Je gebruikt :your_version, wat nieuwer is dan de nieuwste versie, :new_version.','update_check_error' => 'Er is een fout opgetreden bij het controleren op updates: :error',diff --git a/resources/lang/nn_NO/firefly.php b/resources/lang/nn_NO/firefly.phpindex a3d66608af..a791f9572b 100644--- a/resources/lang/nn_NO/firefly.php+++ b/resources/lang/nn_NO/firefly.php@@ -308,6 +308,8 @@ return ['update_new_version_alert' => 'Ein ny versjon av Firefly III er tilgjengeleg. Du køyrer :your_version, den nyaste versjonen er :new_version som vart utgitt den :date.','update_version_beta' => 'Dette er ein BETA versjon, du kan oppleve problemer.','update_version_alpha' => 'Dette er ein ALPHA versjon, du kan oppleve problemer.',+ 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!',+ 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.','update_current_version_alert' => 'Du køyrer :version, som er den nyaste tilgjengelege utgjevinga.','update_newer_version_alert' => 'Du køyrer :your_version, som er nyare enn den nyaste versjonen, :new_version.','update_check_error' => 'Det oppstod ein feil under søk etter oppdatering: :error',diff --git a/resources/lang/pl_PL/firefly.php b/resources/lang/pl_PL/firefly.phpindex e400745cbf..63be886639 100644--- a/resources/lang/pl_PL/firefly.php+++ b/resources/lang/pl_PL/firefly.php@@ -234,7 +234,7 @@ return [// Webhooks'webhooks' => 'Webhooki','webhooks_breadcrumb' => 'Webhooki',- 'webhooks_menu_disabled' => 'disabled',+ 'webhooks_menu_disabled' => 'wyłączone','no_webhook_messages' => 'Brak wiadomości webhook','webhook_trigger_STORE_TRANSACTION' => 'Po utworzeniu transakcji','webhook_trigger_UPDATE_TRANSACTION' => 'Po zmodyfikowaniu transakcji',@@ -308,6 +308,8 @@ return ['update_new_version_alert' => 'Dostępna jest nowa wersja Firefly III. Używasz wersji :your_version, najnowsza wersja to :new_version wydana :date.','update_version_beta' => 'Ta wersja jest wersją BETA. Możesz napotkać błędy.','update_version_alpha' => 'Ta wersja jest wersją ALPHA. Możesz napotkać błędy.',+ 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!',+ 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.','update_current_version_alert' => 'Używasz wersji :version, która jest najnowszą dostępną wersją.','update_newer_version_alert' => 'Używasz wersji :your_version, która jest nowsza niż najnowsza wersja, :new_version.','update_check_error' => 'Wystąpił błąd podczas sprawdzania aktualizacji :error',diff --git a/resources/lang/pt_BR/firefly.php b/resources/lang/pt_BR/firefly.phpindex 86ce276019..6891a18773 100644--- a/resources/lang/pt_BR/firefly.php+++ b/resources/lang/pt_BR/firefly.php@@ -308,6 +308,8 @@ return ['update_new_version_alert' => 'Uma nova versão do Firefly lll está disponível. Você está utilizando a versão :your_version, e a nova é a :new_version, que foi lançada no dia :date.','update_version_beta' => 'Esta versão é uma versão BETA. Você pode encontrar problemas.','update_version_alpha' => 'Esta versão é uma versão ALPHA. Você pode encontrar problemas.',+ 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!',+ 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.','update_current_version_alert' => 'Você está utilizando a versão :version, que é a última disponível.','update_newer_version_alert' => 'Você está utilizando a versão :your_version, que é mais nova do que a mais recente :new_version.','update_check_error' => 'Ocorreu um erro durante a verificação de atualizações: :error',diff --git a/resources/lang/pt_PT/firefly.php b/resources/lang/pt_PT/firefly.phpindex 614af846ee..8a514cbcd2 100644--- a/resources/lang/pt_PT/firefly.php+++ b/resources/lang/pt_PT/firefly.php@@ -308,6 +308,8 @@ return ['update_new_version_alert' => 'Está disponível uma versão nova do Firefly III. Está a usar a versão :your_version, a versão mais recente é :new_version que foi lançada em :date.','update_version_beta' => 'Esta versão é BETA. Pode ter problemas.','update_version_alpha' => 'Esta versão é ALPHA. Pode ter problemas.',+ 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!',+ 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.','update_current_version_alert' => 'Está a executar :version, que é a última versão disponível.','update_newer_version_alert' => 'Está a executar :your_version, que é mais recente que a última versão, :new_version.','update_check_error' => 'Ocorreu um erro durante a verificação de atualizações: :error',diff --git a/resources/lang/ro_RO/firefly.php b/resources/lang/ro_RO/firefly.phpindex fa77f66b22..d2d3c01299 100644--- a/resources/lang/ro_RO/firefly.php+++ b/resources/lang/ro_RO/firefly.php@@ -308,6 +308,8 @@ return ['update_new_version_alert' => 'O nouă versiune de Firefly III este disponibilă. Dvs. aveți :your_version, ultima versiune este :new_version lansată în data de :date.','update_version_beta' => 'Această versiune este o versiune BETA. Este posibil să aveți probleme.','update_version_alpha' => 'Această versiune este o versiune ALFA. Este posibil să aveți probleme.',+ 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!',+ 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.','update_current_version_alert' => 'Aveți versiunea :version, care este ultima disponibilă.','update_newer_version_alert' => 'Aveți versiunea :your_version, care este mai nouă decât cea mai recentă versiune, :new_version.','update_check_error' => 'A apărut o eroare la verificarea actualizărilor: :error',diff --git a/resources/lang/ru_RU/firefly.php b/resources/lang/ru_RU/firefly.phpindex 852514648c..fc23e20d3a 100644--- a/resources/lang/ru_RU/firefly.php+++ b/resources/lang/ru_RU/firefly.php@@ -308,6 +308,8 @@ return ['update_new_version_alert' => 'Доступна новая версия Firefly III. Вы используете версию v:your_version, самая свежая версия - v:new_version (выпущена :date).','update_version_beta' => 'Эта версия является БЕТА-версией. Вы можете столкнуться с проблемами.','update_version_alpha' => 'Эта версия является АЛЬФА-версией. Вы можете столкнуться с проблемами.',+ 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!',+ 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.','update_current_version_alert' => 'Вы используете v:version, которая является последним доступным релизом.','update_newer_version_alert' => 'Вы используете версию v:your_version, которая новее последнего релиза (v:new_version).','update_check_error' => 'Произошла ошибка при проверке обновлений: :error',diff --git a/resources/lang/sk_SK/firefly.php b/resources/lang/sk_SK/firefly.phpindex c0e4a20711..73e119bef0 100644--- a/resources/lang/sk_SK/firefly.php+++ b/resources/lang/sk_SK/firefly.php@@ -308,6 +308,8 @@ return ['update_new_version_alert' => 'Je dostupná nová verzia Firefly III. Pracujete s verziou :your_version, najnovšia verzia je :new_version zverejnená :date.','update_version_beta' => 'Toto je BETA verzia. Môžu sa vyskytnúť chyby.','update_version_alpha' => 'Toto je ALPHA verzia. Môžu sa vyskytnúť chyby.',+ 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!',+ 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.','update_current_version_alert' => 'Pracujete s verziou :version, čo je najnovšie dostupné vydanie.','update_newer_version_alert' => 'Pracujete s verziou :your_version, ktorá je novšia, než posledné vydanie, :new_version.','update_check_error' => 'Pri kontrole aktualizácii nastala chyba: :error',diff --git a/resources/lang/sl_SI/firefly.php b/resources/lang/sl_SI/firefly.phpindex 46c05a4df6..4e332c505c 100644--- a/resources/lang/sl_SI/firefly.php+++ b/resources/lang/sl_SI/firefly.php@@ -308,6 +308,8 @@ return ['update_new_version_alert' => 'Na voljo je nova različica Firefly III. Trenutno uporabljate :your_version, najnovejša različica pa je :new_version, izdana :date.','update_version_beta' => 'To je BETA verzija. Lahko naletite na težave.','update_version_alpha' => 'To je ALFA verzija. Lahko naletite na težave.',+ 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!',+ 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.','update_current_version_alert' => 'Uporabljate :version, ki je zadnja razpoložljiva izdaja.','update_newer_version_alert' => 'Uporabljate :your_version, ki je novejša od zadnje izdaje, :new_version.','update_check_error' => 'Pri preverjanju posodobitev smo naleteli na težavo: :error',diff --git a/resources/lang/sv_SE/firefly.php b/resources/lang/sv_SE/firefly.phpindex 6bd0f13fef..502ebcc24f 100644--- a/resources/lang/sv_SE/firefly.php+++ b/resources/lang/sv_SE/firefly.php@@ -308,6 +308,8 @@ return ['update_new_version_alert' => 'En ny version av Firefly III är tillgänglig. Du har :your_version, den senaste är :new_version vilken släpptes :date.','update_version_beta' => 'Denna version är en BETA version. Det kan förekomma problem.','update_version_alpha' => 'Denna version är en ALPHA version. Det kan förekomma problem.',+ 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!',+ 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.','update_current_version_alert' => 'Du har :version, vilken är den senaste tillgängliga utgåva.','update_newer_version_alert' => 'Du har :your_version, vilken är nyare än senaste utgåva, :new_version.','update_check_error' => 'Ett fel inträffade vid sökning efter uppdateringar: :error',diff --git a/resources/lang/th_TH/firefly.php b/resources/lang/th_TH/firefly.phpindex 5fb28c4264..79bbf9c565 100644--- a/resources/lang/th_TH/firefly.php+++ b/resources/lang/th_TH/firefly.php@@ -308,6 +308,8 @@ return ['update_new_version_alert' => 'A new version of Firefly III is available. You are running :your_version, the latest version is :new_version which was released on :date.','update_version_beta' => 'This version is a BETA version. You may run into issues.','update_version_alpha' => 'This version is a ALPHA version. You may run into issues.',+ 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!',+ 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.','update_current_version_alert' => 'You are running :version, which is the latest available release.','update_newer_version_alert' => 'You are running :your_version, which is newer than the latest release, :new_version.','update_check_error' => 'An error occurred while checking for updates: :error',diff --git a/resources/lang/tr_TR/firefly.php b/resources/lang/tr_TR/firefly.phpindex e053c653f6..054ff4b51d 100644--- a/resources/lang/tr_TR/firefly.php+++ b/resources/lang/tr_TR/firefly.php@@ -309,6 +309,8 @@ return ['update_new_version_alert' => 'Firefly III\'ün yeni versiyonu mevcut. Şuan kullandığınız :your_version, son versiyon ise :date tarihinde yayınlanan :new_version versiyonu.','update_version_beta' => 'Bu bir BETA versiyonudur. Bazı hatalar ile karşılaşabilirsiniz.','update_version_alpha' => 'Bu bir ALPHA versiyonudur. Bazı hatalar ile karşılaşabilirsiniz.',+ 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!',+ 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.','update_current_version_alert' => 'En son mevcut olan :version versiyonunu kullanıyorsunuz.','update_newer_version_alert' => 'Son mevcut olan :new_version versiyonundan daha yeni olan :your_version versiyonu kullanıyorsunuz.','update_check_error' => 'Güncellemeler kontrol edilirken bir hata oluştu: :error',diff --git a/resources/lang/uk_UA/firefly.php b/resources/lang/uk_UA/firefly.phpindex 51fb55d4cb..07c27b6170 100644--- a/resources/lang/uk_UA/firefly.php+++ b/resources/lang/uk_UA/firefly.php@@ -308,6 +308,8 @@ return ['update_new_version_alert' => 'Доступна нова версія Firefly III. Ви працюєте з :your_version, остання версія :new_version яка була випущена на :date.','update_version_beta' => 'Це бета-версія. Ви можете зіткнутися з проблемами.','update_version_alpha' => 'Це альфа-версія. Може містити баги та недоліки.',+ 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!',+ 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.','update_current_version_alert' => 'Ви працюєте в найновішій версії :version.','update_newer_version_alert' => 'Ви працюєте з :your_version версією, яка є новішою за останній реліз, :new_version.','update_check_error' => 'Сталася помилка під час перевірки наявності оновлень: :error',diff --git a/resources/lang/vi_VN/firefly.php b/resources/lang/vi_VN/firefly.phpindex 55d2675610..de7affd846 100644--- a/resources/lang/vi_VN/firefly.php+++ b/resources/lang/vi_VN/firefly.php@@ -308,6 +308,8 @@ return ['update_new_version_alert' => 'Một phiên bản mới của Firefly III có sẵn. Bạn đang chạy :your_version, phiên bản mới nhất là :new_version được phát hành vào :date.','update_version_beta' => 'Phiên bản này là phiên bản BETA. Bạn có thể gặp vấn đề.','update_version_alpha' => 'Phiên bản này là phiên bản ALPHA. Bạn có thể gặp vấn đề.',+ 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!',+ 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.','update_current_version_alert' => 'Bạn đang chạy :version , đây là phiên bản mới nhất có sẵn.','update_newer_version_alert' => 'Bạn đang chạy :your_version, mới hơn bản phát hành mới nhất , :new_version.','update_check_error' => 'Đã xảy ra lỗi trong khi kiểm tra cập nhật: :error',diff --git a/resources/lang/zh_CN/firefly.php b/resources/lang/zh_CN/firefly.phpindex 15ac484e87..80f41cb09f 100644--- a/resources/lang/zh_CN/firefly.php+++ b/resources/lang/zh_CN/firefly.php@@ -308,6 +308,8 @@ return ['update_new_version_alert' => '发现可用的 Firefly III 新版本,您正在运行的版本是 :your_version,最新版本是 :new_version(发布于 :date)。','update_version_beta' => '此版本是 BETA 版本。您可能会遇到问题。','update_version_alpha' => '此版本是 ALPHA 版本。您可能会遇到问题。',+ 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!',+ 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.','update_current_version_alert' => '您正在运行 :version,这是最新的可用版本。','update_newer_version_alert' => '您正在运行 :your_version,它比最新发布的 :new_version 更新。','update_check_error' => '检查更新时发生错误::error',diff --git a/resources/lang/zh_TW/firefly.php b/resources/lang/zh_TW/firefly.phpindex 0645600738..64ab0cc817 100644--- a/resources/lang/zh_TW/firefly.php+++ b/resources/lang/zh_TW/firefly.php@@ -308,6 +308,8 @@ return ['update_new_version_alert' => 'A new version of Firefly III is available. You are running :your_version, the latest version is :new_version which was released on :date.','update_version_beta' => 'This version is a BETA version. You may run into issues.','update_version_alpha' => 'This version is a ALPHA version. You may run into issues.',+ 'update_current_dev_older' => 'You are running development release ":version", which is older than the latest release :new_version. Please update!',+ 'update_current_dev_newer' => 'You are running development release ":version", which is newer than the latest release :new_version.','update_current_version_alert' => 'You are running :version, which is the latest available release.','update_newer_version_alert' => 'You are running :your_version, which is newer than the latest release, :new_version.','update_check_error' => 'An error occurred while checking for updates: :error',